# HG changeset patch # User Jan Vrany # Date 1527242726 -3600 # Node ID ef87e31d3308e4913c0fcea440c589241a687211 # Parent 9cd645552433d4ce12fcdb7b54e0eb919799d35d `Inspector2`: pre-select last selected tab when opening a new inspector diff -r 9cd645552433 -r ef87e31d3308 Tools__Inspector2.st --- a/Tools__Inspector2.st Mon Mar 05 17:45:03 2018 +0000 +++ b/Tools__Inspector2.st Fri May 25 11:05:26 2018 +0100 @@ -25,7 +25,7 @@ Model subclass:#NavigationState instanceVariableNames:'inspector theObject index tabs selectionIndex displayString' - classVariableNames:'' + classVariableNames:'LastSelectionIndexMap' poolDictionaries:'' privateIn:Inspector2 ! @@ -84,7 +84,7 @@ EvaluationLanguageMap := Dictionary new. - "Modified: / 26-10-2013 / 00:42:35 / Jan Vrany " + "Modified: / 25-05-2018 / 10:46:55 / Jan Vrany " ! ! !Inspector2 class methodsFor:'help specs'! @@ -1375,6 +1375,16 @@ ^'$Id$' ! ! +!Inspector2::NavigationState class methodsFor:'initialization'! + +initialize + "Invoked at system start or when the class is dynamically loaded." + + LastSelectionIndexMap := WeakIdentityDictionary new. + + "Modified: / 25-05-2018 / 10:48:08 / Jan Vrany " +! ! + !Inspector2::NavigationState methodsFor:'accessing'! application:anInspectorApp @@ -1415,10 +1425,12 @@ selectionIndex: anInteger selectionIndex := anInteger. + LastSelectionIndexMap at: theObject class put: anInteger. self changed:#selectionIndex "Created: / 16-01-2008 / 17:27:52 / janfrog" "Modified: / 17-02-2008 / 09:46:45 / janfrog" + "Modified: / 25-05-2018 / 10:49:01 / Jan Vrany " ! selectionView @@ -1461,10 +1473,12 @@ theObject:anObject theObject := anObject. + selectionIndex := LastSelectionIndexMap at: theObject class ifAbsent: nil. self changed "Modified: / 17-02-2008 / 08:38:44 / janfrog" "Modified: / 19-08-2011 / 09:16:25 / cg" + "Modified: / 25-05-2018 / 10:50:30 / Jan Vrany " ! ! !Inspector2::NavigationState methodsFor:'comparing'! @@ -1589,3 +1603,4 @@ Inspector2 initialize! +Inspector2::NavigationState initialize!