Skip to content

Commit

Permalink
Method change lost source tab selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Winger authored and Eric Winger committed Nov 16, 2018
1 parent 49b3edb commit 7df782e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
29 changes: 29 additions & 0 deletions sources/JadeiteProjectBrowserTestCase.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,34 @@ test_methodsContainingCaption
[self assert: ('Methods containing ''updateFromSton:'' for *' match: methodListBrowser caption)]
ensure: [methodListBrowser destroy]!

test_methodTabSelected
"when a method is changed the method source tab should be selected"

self selectServiceNamed: 'RowanSample1' in: self projectListPresenter.
self selectServiceNamed: 'RowanSample1-Tests' in: self packageListPresenter.
self selectServiceNamed: 'RowanSample1Test' in: self classListPresenter.
self assert: self projectsPresenter textAreaTabs currentCard name = 'classDefinition'.
self selectMethodNamed: #test1.
self assert: self projectsPresenter textAreaTabs currentCard name = 'methodSource'.
self selectHierarchyTab.
self assert: self projectsPresenter textAreaTabs currentCard name = 'classDefinition'. "presume user is thinking classes so show class def"
self selectMethodNamed: #test2.
self assert: self projectsPresenter textAreaTabs currentCard name = 'methodSource'.
self selectSUnitTab.
self assert: self projectsPresenter textAreaTabs currentCard name = 'sunit'.
self selectMethodNamed: #test1.
self assert: self projectsPresenter textAreaTabs currentCard name = 'methodSource'.
self selectClassTab. "effectively deselect method go back to class def"
self assert: self projectsPresenter textAreaTabs currentCard name = 'classDefinition'.
self selectInstanceTab.
self assert: self projectsPresenter textAreaTabs currentCard name = 'classDefinition'.
self selectMethodNamed: #test1.
self assert: self projectsPresenter textAreaTabs currentCard name = 'methodSource'.



!

test_multipleCompileMethod
self testsIssue: #issue170
withTitle: 'Editing methods to create new method and updating created method gets errors'.
Expand Down Expand Up @@ -1712,6 +1740,7 @@ waitForPresenter: presenter
!JadeiteProjectBrowserTestCase categoriesFor: #test_menusDontAddBreaks!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_methodsContaining!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_methodsContainingCaption!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_methodTabSelected!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_multipleCompileMethod!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_noSelectionHierarchy!public!test class hierarchy! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_openNewProjectBrowser!public!test menus!test projects! !
Expand Down
7 changes: 6 additions & 1 deletion sources/JadeiteProjectsBrowserPresenter.cls
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ createSchematicWiringForMethodList
when: #aboutToDisplayMenu: send: #updateMethodMenu: to: self;
when: #selectionChanging: send: #aboutToChange: to: self;
when: #keyTyped: send: #selectServiceStartingWith: to: methodListPresenter;
when: #selectionChanged send: #updateMethodSource to: self!
when: #selectionChanged send: #methodSelectionChanged to: self!

createSchematicWiringForPackageDictionaryTabs

Expand Down Expand Up @@ -756,6 +756,10 @@ methodMenuBreak: aMenu
selection ifNil: [^self].
selection appendToSourceMenu: aMenu presenter: methodSourcePresenter!

methodSelectionChanged
self updateMethodSource.
methodSourcePresenter ensureVisible!

methodsMenuStrings
false
ifTrue:
Expand Down Expand Up @@ -1895,6 +1899,7 @@ writeProject
!JadeiteProjectsBrowserPresenter categoriesFor: #methodListPresenter!accessing!public! !
!JadeiteProjectsBrowserPresenter categoriesFor: #methodListSelection!accessing!public! !
!JadeiteProjectsBrowserPresenter categoriesFor: #methodMenuBreak:!menus!public! !
!JadeiteProjectsBrowserPresenter categoriesFor: #methodSelectionChanged!event handlers!public!text tabs!updating! !
!JadeiteProjectsBrowserPresenter categoriesFor: #methodsMenuStrings!menus!public! !
!JadeiteProjectsBrowserPresenter categoriesFor: #moveMethods:toCategory:!drag & drop!private! !
!JadeiteProjectsBrowserPresenter categoriesFor: #newBrowser!menu handlers!public! !
Expand Down

0 comments on commit 7df782e

Please sign in to comment.