From 7df782e6144c2b3e53eac14e1bf9dd994b1e8336 Mon Sep 17 00:00:00 2001 From: Eric Winger Date: Fri, 16 Nov 2018 10:54:32 -0800 Subject: [PATCH] Method change lost source tab selection --- sources/JadeiteProjectBrowserTestCase.cls | 29 +++++++++++++++++++++ sources/JadeiteProjectsBrowserPresenter.cls | 7 ++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/sources/JadeiteProjectBrowserTestCase.cls b/sources/JadeiteProjectBrowserTestCase.cls index b415d967..67099201 100644 --- a/sources/JadeiteProjectBrowserTestCase.cls +++ b/sources/JadeiteProjectBrowserTestCase.cls @@ -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'. @@ -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! ! diff --git a/sources/JadeiteProjectsBrowserPresenter.cls b/sources/JadeiteProjectsBrowserPresenter.cls index c7c3a6b8..406d6efd 100644 --- a/sources/JadeiteProjectsBrowserPresenter.cls +++ b/sources/JadeiteProjectsBrowserPresenter.cls @@ -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 @@ -756,6 +756,10 @@ methodMenuBreak: aMenu selection ifNil: [^self]. selection appendToSourceMenu: aMenu presenter: methodSourcePresenter! +methodSelectionChanged + self updateMethodSource. + methodSourcePresenter ensureVisible! + methodsMenuStrings false ifTrue: @@ -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! !