Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 7 additions & 33 deletions src/NewTools-MethodBrowsers/StMethodBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ StMethodBrowser class >> browseWritersOfVariables: variables [
StMethodBrowser class >> implementorsOf: aSymbol [
"Do not use aSymbol implementors because it is a disguised global"

^ (SystemNavigation new allImplementorsOf: aSymbol) reject: [ :m | m isFromTrait ]
^ (SystemNavigation default allImplementorsOf: aSymbol) reject: [ :m | m isFromTrait ]
]

{ #category : 'instance creation' }
Expand Down Expand Up @@ -243,41 +243,25 @@ StMethodBrowser class >> navigateInPlaceSettingsOn: aBuilder [
parent: #tools
]

{ #category : 'opening - old' }
StMethodBrowser class >> openMessageList: messageList name: aString autoSelect: aSelector refreshingBlockSelector: aRefreshingBlockSelector [

| browser |
browser := self new
methods: messageList;
title: aString;
autoSelect: aSelector;
yourself.

aRefreshingBlockSelector ifNotNil:[(browser perform: aRefreshingBlockSelector with: aSelector)].
^browser open



]

{ #category : 'private' }
StMethodBrowser class >> referencesOf: aSymbol [
"Do not use aSymbol implementors because it is a disguised global"

^ SystemNavigation new allReferencesTo: aSymbol
^ SystemNavigation default allReferencesTo: aSymbol
]

{ #category : 'private' }
StMethodBrowser class >> referencesToClass: aClass [

^ SystemNavigation new allReferencesTo: aClass binding
^ SystemNavigation default allReferencesTo: aClass binding
]

{ #category : 'private' }
StMethodBrowser class >> referencesToLiteral: aLiteral [
"Do not use aSymbol implementors because it is a disguised global"

^ SystemNavigation new allReferencesTo: aLiteral
^ SystemNavigation default allReferencesTo: aLiteral
]

{ #category : 'private' }
Expand Down Expand Up @@ -357,12 +341,6 @@ StMethodBrowser >> allScopes [
^ methodList allScopes
]

{ #category : 'to remove' }
StMethodBrowser >> autoSelect: aString [
"this is just to absorb system navigation for now"
"once we remove the old message browser we should remove this empty method."
]

{ #category : 'announcements' }
StMethodBrowser >> classRenamed: anAnnouncement [
"this method forces the announcement to be handled in the UI process"
Expand Down Expand Up @@ -614,7 +592,9 @@ StMethodBrowser >> initializeWindow: aWindowPresenter [
textPresenter isDirty ifTrue: [
(self application confirm: 'Changes have not been saved.
Is it OK to discard changes?') ifFalse: [ ann denyClose ] ] ].
aWindowPresenter whenClosedDo: [ TestCase historyAnnouncer unsubscribe: methodList ]
aWindowPresenter whenClosedDo: [
TestCase historyAnnouncer unsubscribe: methodList.
self class codeChangeAnnouncer unsubscribe: self ]
]

{ #category : 'private' }
Expand Down Expand Up @@ -1010,12 +990,6 @@ StMethodBrowser >> windowIcon [

]

{ #category : 'private' }
StMethodBrowser >> windowIsClosing [

self class codeChangeAnnouncer unsubscribe: self
]

{ #category : 'private' }
StMethodBrowser >> windowTitle [

Expand Down
14 changes: 13 additions & 1 deletion src/NewTools-MethodBrowsers/StMethodListPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,23 @@ StMethodListPresenter >> doInspectMethod [
StMethodListPresenter >> doRemoveMethod [

self selectedMethod ifNotNil: [ :aMethod |
SystemNavigation new
SystemNavigation default
removeMethod: aMethod
inClass: aMethod methodClass ]
]

{ #category : 'private - actions' }
StMethodListPresenter >> doRunTests [

| testMethods |
testMethods := self methods select: [ :each | each isTestMethod ].

testMethods ifEmpty: [
self application inform: 'No test found in the list.'.
^ self ].
testMethods do: [ :m | self executeTestFor: m ]
]

{ #category : 'execution' }
StMethodListPresenter >> executeTestFor: aMethod [

Expand Down
14 changes: 14 additions & 0 deletions src/NewTools-MethodBrowsers/StMethodToolbarPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Class {
'dropList',
'toolbarPresenter',
'messageList',
'runTestsButton'
'reuseWindowButton'
],
#category : 'NewTools-MethodBrowsers-Base',
Expand Down Expand Up @@ -92,6 +93,12 @@ StMethodToolbarPresenter >> doBrowseVersions [
messageList doBrowseVersions
]

{ #category : 'private - actions' }
StMethodToolbarPresenter >> doRunTests [

messageList doRunTests
]

{ #category : 'accessing' }
StMethodToolbarPresenter >> emptyDropList [

Expand Down Expand Up @@ -134,6 +141,12 @@ StMethodToolbarPresenter >> initializePresenters [
icon: (self iconNamed: #history);
help: 'Browse versions of current selected method';
action: [ self doBrowseVersions ].
(runTestsButton := self newToolbarButton )
label: 'Run Tests';
icon: (self iconNamed: #testGreen);
help: 'Run all test methods in the list';
action: [ self doRunTests ].

reuseWindowButton := self newToolbarToggleButton
label: 'Reuse window';
help: 'If checked, new searches will replace current results.';
Expand All @@ -153,6 +166,7 @@ StMethodToolbarPresenter >> initializePresenters [
add: implementorsButton;
add: versionButton;
add: reuseWindowButton;
add: runTestsButton;
yourself.

dropList := self newDropList
Expand Down
Loading