ProjectBrowser.st
changeset 1097 c89241e215a4
parent 1096 7efff9ca044f
child 1098 5f4b4338a68f
--- a/ProjectBrowser.st	Tue Mar 30 19:44:55 1999 +0200
+++ b/ProjectBrowser.st	Tue Mar 30 20:37:28 1999 +0200
@@ -22,6 +22,24 @@
 
 !ProjectBrowser class methodsFor:'image specs'!
 
+classIcon
+    "This resource specification was automatically generated
+     by the ImageEditor of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the ImageEditor may not be able to read the specification."
+
+    "
+     self classIcon inspect
+     ImageEditor openOnClass:self andSelector:#classIcon
+    "
+
+    <resource: #image>
+
+    ^Icon
+        constantNamed:#'ProjectBrowser classIcon'
+        ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'H"H"H"H"H"@"H"H"H"H"HBH@@@@@@@H H H!!DQD"@"@"@@@@@@@BHBHBH"H"H H H HQDQDR@@@@@@@@@@@@@@@BH"H"H @@@@HQDQDR@@@@@"H"H"HBHBHBDQDQD H H H"H"H"@"@"@@@@@@@@@BHBH"H"H"H"H H"H"H"H"Hb') ; colorMapFromArray:#[0 0 0 132 130 132 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@C?8O? ?>C?8O? ?>C?8O? ?>C?8O? ?>@@@@@@b') ; yourself); yourself]!
+
 classesIcon
     "This resource specification was automatically generated
      by the ImageEditor of ST/X."
@@ -1981,7 +1999,7 @@
      propertiesNode docNode classesNode patchesNode subprojectsNode filesNode
      commentNode prerequisitesNode analysisNode designNode codeNode
      userDocNode userOverViewNode userGuideNode userRefManNode
-     deploymentNode|
+     deploymentNode classIcon|
 
     projectName := aProject name.
     pNode := ProjectNode name:projectName.
@@ -2027,6 +2045,8 @@
     prerequisitesNode icon:(self class prerequisitesIcon).
     prerequisitesNode spec:[self class rightCanvasSpecForPrerequisites].
 
+    classIcon := self class classIcon.
+
     classesNode contents:#classes.
     classesNode icon:(self class classesIcon).
     ((aProject classes ? #()) copy sort:[:a :b | 
@@ -2042,6 +2062,7 @@
         cName := aClass isSymbol ifTrue:[aClass] ifFalse:[aClass name].
         cNode := ProjectTreeItem name:cName.
         cNode contents:(#class -> aClass).
+        cNode icon:classIcon.
         classesNode add:cNode.
     ].
 
@@ -2083,7 +2104,9 @@
 
     p := self currentProject.
     p notNil ifTrue:[
-        self rightCanvasTextHolder value:p comment.
+        self selectedTreeNode value contents == #comment ifTrue:[
+            self rightCanvasTextHolder value:p comment.
+        ].
 
         self currentProjectWasNotLoadedFromFile value:p wasLoadedFromFile not.
         self projectType value:(p type).
@@ -2177,6 +2200,10 @@
         self showPatchesListOf:selectedNode.
         ^ self.
     ].
+    self hasClassNodeSelected ifTrue:[
+        self showClassDefinitionOf:selectedNode.
+        ^ self.
+    ].      
 
     self currentCanvasHolder value:(self class emptyRightCanvasSpec).
     self rightCanvasTextHolder value:''.
@@ -2480,6 +2507,25 @@
 
 !
 
+showClassDefinitionOf:anItem
+    |node className cls text|
+
+    self hasClassNodeSelected ifFalse:[^ self].
+
+    self currentCanvasHolder value:(self class rightCanvasSpecForEditableText).
+
+    node := self selectedTreeNode value.
+    className := node contents value.
+    cls := Smalltalk at:className.
+    cls isNil ifTrue:[
+        text := 'The class is not (yet) loaded'.
+    ] ifFalse:[
+        text := cls definition
+    ].
+    self rightCanvasTextHolder value:text.
+
+!
+
 showClassListOf:anItem
     |projectItem project classInfo l|