Tools__ClassList.st
changeset 17516 b7b3597d66f2
parent 17482 e5390555ee86
child 17606 d028acd721db
--- a/Tools__ClassList.st	Tue May 23 03:42:20 2017 +0000
+++ b/Tools__ClassList.st	Tue May 23 13:44:55 2017 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 2004 by eXept Software AG
               All Rights Reserved
@@ -1471,7 +1473,7 @@
                 bucket notNil ifTrue:[
                     bucket do:action.
                 ]
-        ].
+            ].
 
         classesOrdered do:action.
         classesOrdered := stream contents.
@@ -1487,6 +1489,7 @@
     "Modified: / 24-08-2010 / 20:17:07 / Jan Vrany"
     "Created: / 04-07-2011 / 18:27:34 / cg"
     "Modified: / 06-08-2014 / 14:14:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 22-05-2017 / 13:44:50 / stefan"
 !
 
 makeDependent
@@ -1504,7 +1507,7 @@
 nameListForClasses:aClassList
     |orgMode namespaces showNamespaces fullNameList nameList
      filteredPackages filteredNameSpaces classesInRemoteChangeSet
-     classNamesInChangeSet classNamesInRemoteChangeSet javaClassCountsByBname|
+     classNamesInChangeSet classNamesInRemoteChangeSet javaClassCountsByBname widthOfSpace|
 
     showNamespaces := false.
     filteredNameSpaces := nameSpaceFilter value.
@@ -1547,6 +1550,7 @@
                 put:(javaClassCountsByBname at:eachClass ifAbsent:[0]) + 1
         ]
     ].
+    widthOfSpace := ' ' widthOn:self window.
 
     nameList := aClassList 
                     collect:[:eachClass | 
@@ -1662,12 +1666,22 @@
                             ] ifFalse:[
                                 markApplicationsHolder value == true ifTrue:[
                                     icon := self iconForClass:eachClass theNonMetaclass.
-                                    icon isNil ifTrue:[
-                                        "/ icon := SystemBrowser emptyIcon
-                                    ].
+"/                                    icon isNil ifTrue:[
+"/                                        icon := SystemBrowser emptyIcon
+"/                                    ].
                                 ]
                             ].
                             icon notNil ifTrue:[
+                                |indent iconWidth|
+
+                                (nm startsWith:Character space) ifTrue:[
+                                    "make sure, that indent is reduced by icon width (hack)"
+                                    iconWidth := icon width.
+                                    indent := (iconWidth // widthOfSpace)+1 min:nm leftIndent.
+                                    indent ~~ 0 ifTrue:[
+                                        nm := nm copyFrom:indent.
+                                    ].
+                                ].
                                 nm := LabelAndIcon icon:icon string:nm
                             ].
                             nm
@@ -1677,6 +1691,7 @@
 
     "Modified: / 27-10-2012 / 12:32:20 / cg"
     "Modified: / 11-08-2014 / 12:05:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 23-05-2017 / 13:43:06 / stefan"
 !
 
 reconstructNameList
@@ -2000,26 +2015,19 @@
     sortByNameAndInheritanceValue := self sortByNameAndInheritance value.
 
     sortByNameAndInheritanceValue ifTrue:[
-        nm := (self nameListIndentStringFor: aClass withNameSpace: useFullName) , aClass nameInBrowser.
+        nm := (self nameListIndentStringFor:aClass) , aClass nameInBrowser.
     ] ifFalse:[
         nm := aClass nameInBrowser.
     ].
 
-    aClass isLoaded ifFalse:[
+    aClass isLoaded ifTrue:[
+        aClass isAbstract ifTrue:[ nm := nm allItalic ].
+        nm := nm, ((' (%1+%2) ' bindWith:(aClass methodsCount ? '?') with:(aClass class methodsCount ? '?')) 
+                    withColor:self class pseudoEntryForegroundColor).
+    ] ifFalse:[
         unloadedClassesColor notNil ifTrue:[
             nm := nm withColor:unloadedClassesColor
         ]
-    ] ifTrue:[
-        | instMethodCount classMethodCount |   
-
-        aClass isAbstract ifTrue:[ nm := nm allItalic ].
-        instMethodCount := aClass methodsCount.
-        classMethodCount := aClass class methodsCount.
-
-        (instMethodCount notNil or:[ classMethodCount notNil ]) ifTrue:[ 
-            nm := nm, ((' (%1+%2) ' bindWith:(instMethodCount ? '?') with:(classMethodCount ? '?')) 
-                        withColor:self class pseudoEntryForegroundColor).
-        ]
     ].
 
     orgMode := organizerMode value.
@@ -2054,7 +2062,7 @@
     useFullName ifFalse:[
         aClass isPrivate ifFalse:[
             sortByNameAndInheritanceValue ifTrue:[
-                ^ (self nameListIndentStringFor: aClass withNameSpace: useFullName) , aClass nameWithoutNameSpacePrefix 
+                ^ (self nameListIndentStringFor:aClass) , aClass nameWithoutNameSpacePrefix 
             ].
             ^ aClass nameWithoutNameSpacePrefix 
         ]
@@ -2062,15 +2070,15 @@
 
     "/ full name required if owner is not in the list
     owner := aClass owningClass.
-    (owner isNil
-     or:[(self classList value includesIdentical:owner) not]) ifFalse:[
+    (owner notNil
+     and:[self classList value includesIdentical:owner]) ifTrue:[
         "/ namespace
         indent := (nm count:[:char | char == $:]) // 2.
         indent > 0 ifTrue:[
             indent := indent * self indentPerPrivacyLevel.
             indentString := String new:indent withAll:Character space.
             sortByNameAndInheritanceValue ifTrue:[
-                nm := (self nameListIndentStringFor:owner withNameSpace:useFullName)
+                nm := (self nameListIndentStringFor:owner)
                         , indentString , '::' , aClass nameWithoutPrefix.
             ] ifFalse:[
                 nm := indentString , '::' , aClass nameWithoutPrefix
@@ -2082,9 +2090,10 @@
 
     "Modified: / 04-07-2011 / 19:00:45 / cg"
     "Modified: / 27-03-2015 / 16:23:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-05-2017 / 13:32:22 / stefan"
 !
 
-nameListIndentStringFor:aClass withNameSpace:useFullName 
+nameListIndentStringFor:aClass     
     |indent indentString cls|
 
     indent := 0.
@@ -2109,9 +2118,7 @@
     ].
     ^ indentString
 
-    "Modified: / 24-02-2000 / 17:52:28 / cg"
-    "Created: / 21-01-2008 / 19:02:07 / janfrog"
-    "Modified (format): / 04-07-2011 / 18:30:20 / cg"
+    "Created: / 22-05-2017 / 13:28:31 / stefan"
 ! !
 
 !ClassList methodsFor:'queries'!