Fix in Tools::VariableList jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 07 Oct 2013 11:20:25 +0100
branchjv
changeset 13619 4e81091e3699
parent 13618 aa7dd2f6dc46
child 13620 4dc3c71122d0
Fix in Tools::VariableList move code for displaying Java field type to VariableEntry to leave field name intact (so readers/writers menu/highlighting still works)
Tools__VariableList.st
--- a/Tools__VariableList.st	Wed Oct 02 02:48:56 2013 +0100
+++ b/Tools__VariableList.st	Mon Oct 07 11:20:25 2013 +0100
@@ -520,18 +520,6 @@
     | nm entry |
 
     nm := name.
-    "/ Hack for Java classes to display field type
-    cls theNonMetaclass isJavaClass ifTrue:[
-        | field |
-
-        field := cls theNonMetaclass lookupFieldFor:name static: (cls isMetaclass) onlyPublic: false.
-        field notNil ifTrue:[
-            nm := nm asText , 
-                    ' ' , 
-                        (('< ' , (JavaMethod fieldTypeFromStream: (field descriptor readStream) in: cls theNonMetaclass javaPackage) , ' >')
-                                asText colorizeAllWith: Color brown).
-        ].
-    ].
     entry := Tools::VariableList::VariableEntry application: self class: cls name: nm.
     entry sortingByNameHolder:sortVariablesByName.
     classInfo notNil ifTrue:[
@@ -540,7 +528,7 @@
     ^entry
 
     "Created: / 27-11-2011 / 17:17:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 09-09-2013 / 01:44:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-10-2013 / 08:28:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 listOfVariables
@@ -790,14 +778,27 @@
 label
 
     label isNil ifTrue:[
-	label := name.
-	type notNil ifTrue:[
-	    label := (label , ' ' ,  (type displayString colorizeAllWith: Color brown))
-	].
+        label := name.
+        type notNil ifTrue:[
+            label := (label , ' ' ,  (type displayString colorizeAllWith: Color brown))
+        ] ifFalse:[
+            "/ Hack for Java classes to display field type
+            class theNonMetaclass isJavaClass ifTrue:[
+                | field |
+                field := class theNonMetaclass lookupFieldFor:name static: (class isMetaclass) onlyPublic: false.
+                field notNil ifTrue:[
+                    label := label asText , 
+                            ' ' , 
+                                (('< ' , (JavaMethod fieldTypeFromStream: (field descriptor readStream) in: class theNonMetaclass javaPackage) , ' >')
+                                        asText colorizeAllWith: Color brown).
+                ].
+            ].    
+        ].
     ].
     ^label
 
     "Created: / 16-12-2011 / 00:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-10-2013 / 08:29:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 labelWithClass