*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Fri, 05 Oct 2007 13:04:00 +0200
changeset 2183 517b70cb2de7
parent 2182 28e8023b2f9f
child 2184 1ffb97ee0a55
*** empty log message ***
Tools__ObjectModuleInformation.st
--- a/Tools__ObjectModuleInformation.st	Fri Oct 05 11:57:47 2007 +0200
+++ b/Tools__ObjectModuleInformation.st	Fri Oct 05 13:04:00 2007 +0200
@@ -3,14 +3,16 @@
 "{ NameSpace: Tools }"
 
 ApplicationModel subclass:#ObjectModuleInformation
-	instanceVariableNames:'listOfModuleNames selectedModuleIndexHolder allModules'
+	instanceVariableNames:'listOfModuleNames selectedModuleIndexHolder allModules
+		objectHandles showOthers showCObjects showBuiltIn showMethods
+		showClassLibs table1VisibleHolder table2VisibleHolder'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Monitors-ST/X'
 !
 
 Object subclass:#InfoRow
-	instanceVariableNames:'name version date'
+	instanceVariableNames:'name version date value'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:ObjectModuleInformation
@@ -40,8 +42,15 @@
 
 !ObjectModuleInformation class methodsFor:'info'!
 
+aboutThisApplicationText
+    ^ super aboutThisApplicationText ,
+      '\\Written by Claus Gittinger, eXept Software AG.' withCRs
+
+    "Created: / 05-10-2007 / 12:39:42 / cg"
+!
+
 defaultLabel
-    ^ 'Process Monitor'
+    ^ 'Object Module Info'
 
     "Created: / 05-10-2007 / 11:56:59 / cg"
 ! !
@@ -56,9 +65,9 @@
      the UIPainter may not be able to read the specification."
 
     "
-     UIPainter new openOnClass:ObjectModuleInformation andSelector:#windowSpec
-     ObjectModuleInformation new openInterface:#windowSpec
-     ObjectModuleInformation open
+     UIPainter new openOnClass:Tools::ObjectModuleInformation andSelector:#windowSpec
+     Tools::ObjectModuleInformation new openInterface:#windowSpec
+     Tools::ObjectModuleInformation open
     "
 
     <resource: #canvas>
@@ -112,13 +121,26 @@
                        (DataSetSpec
                           name: 'Table1'
                           layout: (LayoutFrame 0 0 30 0 0 1 0 1)
+                          visibilityChannel: table1VisibleHolder
                           model: selectedInfoIndexHolder
                           hasHorizontalScrollBar: true
                           hasVerticalScrollBar: true
-                          dataList: infoTableListHolder
+                          dataList: infoTable1ListHolder
                           columnHolder: tableColumns
                           separatorOneDColor: (Color 66.999313344015 66.999313344015 66.999313344015)
                         )
+                       (DataSetSpec
+                          name: 'Table2'
+                          layout: (LayoutFrame 0 0 30 0 0 1 0 1)
+                          initiallyInvisible: true
+                          visibilityChannel: table2VisibleHolder
+                          model: selectedInfoIndexHolder
+                          hasHorizontalScrollBar: true
+                          hasVerticalScrollBar: true
+                          dataList: infoTable2ListHolder
+                          columnHolder: tableColumnsForSingleInfo
+                          separatorOneDColor: (Color 66.999313344015 66.999313344015 66.999313344015)
+                        )
                        )
                      
                     )
@@ -144,8 +166,8 @@
      the MenuEditor may not be able to read the specification."
 
     "
-     MenuEditor new openOnClass:ObjectModuleInformation andSelector:#mainMenu
-     (Menu new fromLiteralArrayEncoding:(ObjectModuleInformation mainMenu)) startUp
+     MenuEditor new openOnClass:Tools::ObjectModuleInformation andSelector:#mainMenu
+     (Menu new fromLiteralArrayEncoding:(Tools::ObjectModuleInformation mainMenu)) startUp
     "
 
     <resource: #menu>
@@ -178,26 +200,31 @@
                (MenuItem
                   label: 'Builtin'
                   translateLabel: true
+                  hideMenuOnActivated: false
                   indication: showBuiltIn
                 )
                (MenuItem
                   label: 'Class Libraries'
                   translateLabel: true
+                  hideMenuOnActivated: false
                   indication: showClassLibs
                 )
                (MenuItem
                   label: 'Methods'
                   translateLabel: true
+                  hideMenuOnActivated: false
                   indication: showMethods
                 )
                (MenuItem
                   label: 'C-Objects'
                   translateLabel: true
+                  hideMenuOnActivated: false
                   indication: showCObjects
                 )
                (MenuItem
                   label: 'Others'
                   translateLabel: true
+                  hideMenuOnActivated: false
                   indication: showOthers
                 )
                )
@@ -291,14 +318,53 @@
        )
       )
     
+!
+
+tableColumnsForSingleInfo
+    "This resource specification was automatically generated
+     by the DataSetBuilder of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the DataSetBuilder may not be able to read the specification."
+
+    "
+     DataSetBuilder new openOnClass:Tools::ObjectModuleInformation andSelector:#tableColumnsForSingleInfo
+    "
+
+    <resource: #tableColumns>
+
+    ^#(
+      (DataSetColumnSpec
+         label: ''
+         activeHelpKey: ''
+         labelButtonType: None
+         width: 0.3
+         model: name
+         canSelect: false
+       )
+      (DataSetColumnSpec
+         label: ''
+         activeHelpKey: ''
+         labelButtonType: None
+         model: value
+         canSelect: false
+       )
+      )
+    
 ! !
 
 !ObjectModuleInformation methodsFor:'aspects'!
 
-infoTableListHolder
-    ^ builder valueAspectFor:#'infoTableListHolder' initialValue:#()
+infoTable1ListHolder
+    ^ builder valueAspectFor:#'infoTable1ListHolder' initialValue:#()
 
-    "Created: / 05-10-2007 / 11:07:50 / cg"
+    "Created: / 05-10-2007 / 12:48:06 / cg"
+!
+
+infoTable2ListHolder
+    ^ builder valueAspectFor:#'infoTable2ListHolder' initialValue:#()
+
+    "Created: / 05-10-2007 / 12:48:10 / cg"
 !
 
 listOfModuleNames
@@ -327,33 +393,71 @@
 !
 
 showBuiltIn
-    ^ builder valueAspectFor:#'showBuiltIn' initialValue:true
+    showBuiltIn isNil ifTrue:[
+        showBuiltIn := true asValue.
+        showBuiltIn onChangeSend:#filterChanged to:self.
+    ].
+    ^ showBuiltIn
 
-    "Modified: / 05-10-2007 / 10:35:20 / cg"
+    "Modified: / 05-10-2007 / 12:43:23 / cg"
 !
 
 showCObjects
-    ^ builder valueAspectFor:#'showCObjects' initialValue:true
+    showCObjects isNil ifTrue:[
+        showCObjects := true asValue.
+        showCObjects onChangeSend:#filterChanged to:self.
+    ].
+    ^ showCObjects
 
-    "Modified: / 05-10-2007 / 10:35:23 / cg"
+    "Modified: / 05-10-2007 / 12:43:16 / cg"
 !
 
 showClassLibs
-    ^ builder valueAspectFor:#'showClassLibs' initialValue:true
+    showClassLibs isNil ifTrue:[
+        showClassLibs := true asValue.
+        showClassLibs onChangeSend:#filterChanged to:self.
+    ].
+    ^ showClassLibs
 
-    "Modified: / 05-10-2007 / 10:35:27 / cg"
+    "Modified: / 05-10-2007 / 12:43:10 / cg"
 !
 
 showMethods
-    ^ builder valueAspectFor:#'showMethods' initialValue:true
+    showMethods isNil ifTrue:[
+        showMethods := true asValue.
+        showMethods onChangeSend:#filterChanged to:self.
+    ].
+    ^ showMethods
 
-    "Modified: / 05-10-2007 / 10:35:30 / cg"
+    "Modified: / 05-10-2007 / 12:43:02 / cg"
 !
 
 showOthers
-    ^ builder valueAspectFor:#'showOthers' initialValue:true
+    showOthers isNil ifTrue:[
+        showOthers := true asValue.
+        showOthers onChangeSend:#filterChanged to:self.
+    ].
+    ^ showOthers
+
+    "Modified: / 05-10-2007 / 12:42:54 / cg"
+!
 
-    "Modified: / 05-10-2007 / 10:35:32 / cg"
+table1VisibleHolder
+    table1VisibleHolder isNil ifTrue:[
+        table1VisibleHolder := true asValue.
+    ].
+    ^ table1VisibleHolder.
+
+    "Modified: / 05-10-2007 / 12:53:05 / cg"
+!
+
+table2VisibleHolder
+    table2VisibleHolder isNil ifTrue:[
+        table2VisibleHolder := false asValue.
+    ].
+    ^ table2VisibleHolder.
+
+    "Modified: / 05-10-2007 / 12:53:14 / cg"
 ! !
 
 !ObjectModuleInformation methodsFor:'change & update'!
@@ -362,10 +466,12 @@
     |sel info|
 
     sel := self selectedModuleIndexHolder value.
+    sel notNil ifTrue:[
+        (self showClassLibs value or:[self showBuiltIn value]) ifTrue:[
+            info := allModules at:sel ifAbsent:nil.
+        ].
+    ].
 
-    (self showClassLibs value or:[self showBuiltIn value]) ifTrue:[
-        info := allModules at:sel ifAbsent:nil.
-    ].
     info isNil ifTrue:[
         "/ selected a method, cObject or unknown
         self showInfoForNonClassLib:sel.
@@ -379,13 +485,13 @@
     "/ selected a class-library package
     self showInfoForClassLib:info.
 
-    "Modified: / 05-10-2007 / 11:02:05 / cg"
+    "Modified: / 05-10-2007 / 12:56:13 / cg"
 !
 
 showInfoForClassLib:info
     "/ selected a package; fill bottom list with class-info
 
-    |classNames|
+    |classNames rows|
 
     self middleLabelHolder value:'Contains Modules:'.
 
@@ -401,7 +507,7 @@
                     ].
                   ].
 
-    classNames := classNames collect:[:cName |
+    rows := classNames collect:[:cName |
                     |cls entry rev listEntry revisionInfo|
 
                     listEntry := InfoRow new.
@@ -409,7 +515,9 @@
 
                     cls := Smalltalk classNamed:cName.
                     cls isNil ifTrue:[
-                        listEntry version:'(class removed)'.
+                        (cName endsWith:'_extensions') ifFalse:[
+                            listEntry version:'(class removed)'.
+                        ]
                     ] ifFalse:[
                         rev := cls binaryRevision.
                         rev notNil ifTrue:[
@@ -436,15 +544,17 @@
                     listEntry
                   ].
 
-    self infoTableListHolder value:classNames.
+    self infoTable1ListHolder value:rows.
+    self table1VisibleHolder value:true.
+    self table2VisibleHolder value:false.
 
-    "Modified: / 05-10-2007 / 11:26:13 / cg"
+    "Modified: / 05-10-2007 / 13:03:56 / cg"
 !
 
 showInfoForNonClassLib:sel
     "/ selected a method, cObject or unknown
 
-    |objectHandles module fileName list entry|
+    |module fileName list entry|
 
     module := objectHandles at:sel.
     fileName := module pathName.
@@ -452,7 +562,7 @@
     module isMethodHandle ifTrue:[
         |method nm entry1 entry2 entry3|
 
-        self middleLabelHolder value:'Contains Compiled Method:'.
+        self middleLabelHolder value:'Compiled Method:'.
 
         (method := module method) isNil ifTrue:[
             nm := '** removed **'.
@@ -472,21 +582,23 @@
             nm := (method whoString) asText emphasizeAllWith:(#color->Color blue).
         ].
         entry1 := InfoRow new.
-        entry1 name:'compiled method'; version:nm.
+        entry1 name:'Compiled method'; value:nm.
 
         entry2 := InfoRow new.
-        entry2 name:'path'; version:fileName.
+        entry2 name:'Path'; value:fileName.
 
         entry3 := InfoRow new.
-        entry3 name:'address'; version:('(16r) ' , (method code address hexPrintString leftPaddedTo:8 with:$0)).
+        entry3 name:'Address'; value:('(16r) ' , (method code address hexPrintString leftPaddedTo:8 with:$0)).
 
-        self infoTableListHolder value:(Array with:entry1 with:entry2 with:entry3).
+        self infoTable2ListHolder value:(Array with:entry1 with:entry2 with:entry3).
+        self table1VisibleHolder value:false.
+        self table2VisibleHolder value:true.
         ^ self.
     ].
 
     (module isFunctionObjectHandle 
     and:[module functions notEmpty]) ifTrue:[
-        self middleLabelHolder value:'Contains Functions:'.
+        self middleLabelHolder value:'Functions:'.
 
 "/        menu := PopUpMenu
 "/                    labels:#('Inspect')
@@ -498,18 +610,22 @@
                         collect:[:f | |entry|
                                         entry := InfoRow new.
                                         entry name:(f name asText emphasizeAllWith:(#color->Color blue)).
-                                        entry version:('address: (16r) ' , (f code address hexPrintString leftPaddedTo:8 with:$0)).
+                                        entry value:('address: (16r) ' , (f code address hexPrintString leftPaddedTo:8 with:$0)).
                                         entry
                                 ].
-        self infoTableListHolder value:list.
+        self infoTable2ListHolder value:list.
+        self table1VisibleHolder value:false.
+        self table2VisibleHolder value:true.
         ^ self.
     ].
 
     entry := InfoRow new.
     entry name:'Unknown'.
-    self infoTableListHolder value:(Array with:entry).
+    self infoTable2ListHolder value:(Array with:entry).
+    self table1VisibleHolder value:false.
+    self table2VisibleHolder value:true.
 
-    "Modified: / 05-10-2007 / 11:51:38 / cg"
+    "Modified: / 05-10-2007 / 13:01:33 / cg"
 !
 
 showInfoForVM
@@ -547,14 +663,16 @@
         ].
         listEntry.
     ].
-    self infoTableListHolder value:l.
+    self infoTable1ListHolder value:l.
+    self table1VisibleHolder value:true.
+    self table2VisibleHolder value:false.
 
 "/    readOnly ifFalse:[
 "/        unloadButton disable.
 "/        unloadAndRemoveButton disable.
 "/    ]
 
-    "Modified: / 05-10-2007 / 11:15:08 / cg"
+    "Modified: / 05-10-2007 / 12:53:44 / cg"
 ! !
 
 !ObjectModuleInformation methodsFor:'initialization'!
@@ -585,6 +703,12 @@
 
 !ObjectModuleInformation methodsFor:'private'!
 
+filterChanged
+    self updateModuleList
+
+    "Created: / 05-10-2007 / 12:43:36 / cg"
+!
+
 updateModuleList
     |showClassLibs showBuiltIn showMethods showCObjects showOthers
      listOfModuleNames allObjects handles|
@@ -665,13 +789,9 @@
     ].
 
     self listOfModuleNames contents:listOfModuleNames.
+    objectHandles := handles.
 
-"/    readOnly ifFalse:[
-"/        unloadButton disable.
-"/        unloadAndRemoveButton disable.
-"/    ]
-
-    "Created: / 05-10-2007 / 10:46:18 / cg"
+    "Modified: / 05-10-2007 / 12:45:37 / cg"
 ! !
 
 !ObjectModuleInformation::InfoRow methodsFor:'accessing'!
@@ -698,6 +818,14 @@
     date := dateArg.
 !
 
+value
+    ^ value
+!
+
+value:something
+    value := something.
+!
+
 version
     ^ version
 !