class: Tools::VariableList
authorClaus Gittinger <cg@exept.de>
Fri, 27 Feb 2015 20:16:27 +0100
changeset 15455 9091f8069ac3
parent 15454 51caa391b185
child 15456 44e323d6539f
class: Tools::VariableList changed: #listOfVariables
Tools__VariableList.st
--- a/Tools__VariableList.st	Fri Feb 27 19:56:01 2015 +0100
+++ b/Tools__VariableList.st	Fri Feb 27 20:16:27 2015 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 2000 by eXept Software AG
 	      All Rights Reserved
@@ -22,7 +24,8 @@
 !
 
 Object subclass:#VariableEntry
-	instanceVariableNames:'label application class name type icon sortingByNameHolder'
+	instanceVariableNames:'label application class name type icon sortingByNameHolder
+		classShown'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:VariableList
@@ -656,14 +659,18 @@
                 "/ in environment?                       
 
                 (environment at: cls theNonMetaclass name ifAbsent:[nil]) notNil ifTrue:[
-                    |varNames|
+                    |varNames classShown|
 
                     (hasSmallSense and:[showingClassVars not]) ifTrue:[
                         info := smallSenseManager infoForClassOrNil: cls.
                     ].                            
                     varNames := showingClassVars ifTrue:[ cls classVarNames ] ifFalse:[ cls instVarNames ].
+                    classShown := (cls ~~ class). "/ only append the class in the shown name, if the var is inherited
+
                     varNames copy reverse do:[:varName|
-                        nameList addFirst: (self listEntryForClass: cls name: varName info: info).
+                        |entry|
+                        nameList addFirst: (entry := self listEntryForClass: cls name: varName info: info).
+                        classShown ifFalse:[ entry classShown:classShown ].
                     ].
                     sortByName ifFalse:[
                         nameList addFirst:(("'----- ' , "cls nameInBrowser" , ' -----'") asText colorizeAllWith: Color gray).
@@ -789,6 +796,10 @@
     class := aClass.
 !
 
+classShown:aBoolean
+    classShown := aBoolean.
+!
+
 icon
     icon isNil ifTrue:[
         icon := application iconInBrowserForVariable: name in: class.
@@ -880,7 +891,7 @@
 
 !VariableList::VariableEntry methodsFor:'displaying'!
 
-displayOn:aGC x:x y:y opaque: opaque
+displayOn:aGC x:x y:y opaque:opaque
     | icn shownLabel |
 
     icn := self icon.
@@ -888,7 +899,7 @@
         icn displayOn:aGC x:x + 1 y:y - icn height.
     ].
 
-    shownLabel := sortingByNameHolder value 
+    shownLabel := ((classShown ? true) and:[sortingByNameHolder value]) 
                     ifTrue:[ self labelWithClass ]
                     ifFalse: [ self label ].
 
@@ -910,6 +921,6 @@
 !VariableList class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__VariableList.st,v 1.36 2014-11-26 17:43:39 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__VariableList.st,v 1.37 2015-02-27 19:16:27 cg Exp $'
 ! !