Tools__ObjectModuleInformation.st
author Patrik Svestka <patrik.svestka@gmail.com>
Wed, 14 Nov 2018 12:07:51 +0100
branchjv
changeset 3630 5e718e0a754e
parent 3345 681833029ed5
child 3388 b9b7b2fae2f9
permissions -rw-r--r--
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present

- All source *.st files are now Unicode UTF8 without BOM
Files are in two groups (fileOut works this way in Smalltalk/X):
- containing a unicode character have "{ Encoding: utf8 }" at the header
- ASCII only are without the header
     1 "{ Package: 'stx:libtool2' }"
     2 
     3 "{ NameSpace: Tools }"
     4 
     5 ToolApplicationModel subclass:#ObjectModuleInformation
     6 	instanceVariableNames:'readOnly listOfModuleNames selectedModuleIndexHolder allModules
     7 		objectHandles showOthers showCObjects showBuiltIn showMethods
     8 		showClassLibs table1VisibleHolder table2VisibleHolder
     9 		selectedInfoIndexHolder canBrowseSelectedModule
    10 		canUnloadSelectedModule classNamesShown classInfoShown
    11 		vmInfoShown canUnloadSelectedModulesPackage
    12 		canBrowseSelectedModulesExtensions canUnloadSelectedDLL'
    13 	classVariableNames:''
    14 	poolDictionaries:''
    15 	category:'Monitors-ST/X'
    16 !
    17 
    18 Object subclass:#InfoRow
    19 	instanceVariableNames:'name version date value'
    20 	classVariableNames:''
    21 	poolDictionaries:''
    22 	privateIn:ObjectModuleInformation
    23 !
    24 
    25 !ObjectModuleInformation class methodsFor:'documentation'!
    26 
    27 documentation
    28 "
    29     Shows the modules (dll's) of ST/X.
    30     Both builtIn modules, and dynamically loaded modules are listed.
    31 
    32     [author:]
    33         Claus Gittinger
    34 "
    35 !
    36 
    37 examples
    38 "
    39   Starting the application:
    40                                                                 [exBegin]
    41     ObjectModuleInformation open
    42 
    43                                                                 [exEnd]
    44 "
    45 ! !
    46 
    47 !ObjectModuleInformation class methodsFor:'info'!
    48 
    49 defaultLabel
    50     ^ 'Object Module Info'
    51 
    52     "Created: / 05-10-2007 / 11:56:59 / cg"
    53 ! !
    54 
    55 !ObjectModuleInformation class methodsFor:'interface specs'!
    56 
    57 windowSpec
    58     "This resource specification was automatically generated
    59      by the UIPainter of ST/X."
    60 
    61     "Do not manually edit this!! If it is corrupted,
    62      the UIPainter may not be able to read the specification."
    63 
    64     "
    65      UIPainter new openOnClass:Tools::ObjectModuleInformation andSelector:#windowSpec
    66      Tools::ObjectModuleInformation new openInterface:#windowSpec
    67      Tools::ObjectModuleInformation open
    68     "
    69 
    70     <resource: #canvas>
    71 
    72     ^ 
    73     #(FullSpec
    74        name: windowSpec
    75        window: 
    76       (WindowSpec
    77          label: 'ST/X Module & Version Information'
    78          name: 'ST/X Module & Version Information'
    79          min: (Point 0 0)
    80          bounds: (Rectangle 0 0 505 567)
    81          menu: mainMenu
    82        )
    83        component: 
    84       (SpecCollection
    85          collection: (
    86           (MenuPanelSpec
    87              name: 'ToolBar1'
    88              layout: (LayoutFrame 0 0 0 0 0 1 40 0)
    89              menu: toolbarMenu
    90              textDefault: true
    91            )
    92           (VariableVerticalPanelSpec
    93              name: 'VariableVerticalPanel1'
    94              layout: (LayoutFrame 0 0 40 0 0 1 0 1)
    95              component: 
    96             (SpecCollection
    97                collection: (
    98                 (SequenceViewSpec
    99                    name: 'List1'
   100                    model: selectedModuleIndexHolder
   101                    menu: moduleMenu
   102                    hasHorizontalScrollBar: true
   103                    hasVerticalScrollBar: true
   104                    useIndex: true
   105                    sequenceList: listOfModuleNames
   106                  )
   107                 (ViewSpec
   108                    name: 'Box1'
   109                    component: 
   110                   (SpecCollection
   111                      collection: (
   112                       (LabelSpec
   113                          name: 'Label2'
   114                          layout: (LayoutFrame 0 0 0 0 0 1 30 0)
   115                          translateLabel: true
   116                          labelChannel: descriptionLabelHolder
   117                          adjust: left
   118                        )
   119                       (LabelSpec
   120                          name: 'Label1'
   121                          layout: (LayoutFrame 0 0 30 0 0 1 60 0)
   122                          translateLabel: true
   123                          labelChannel: middleLabelHolder
   124                          adjust: left
   125                        )
   126                       (DataSetSpec
   127                          name: 'Table1'
   128                          layout: (LayoutFrame 0 0 60 0 0 1 0 1)
   129                          visibilityChannel: table1VisibleHolder
   130                          model: selectedInfoIndexHolder
   131                          menu: moduleItemMenu
   132                          hasHorizontalScrollBar: true
   133                          hasVerticalScrollBar: true
   134                          dataList: infoTable1ListHolder
   135                          columnHolder: tableColumns
   136                          separatorOneDColor: (Color 66.9993133440147 66.9993133440147 66.9993133440147)
   137                          keepSpaceForOSXResizeHandleV: true
   138                        )
   139                       (DataSetSpec
   140                          name: 'Table2'
   141                          layout: (LayoutFrame 0 0 60 0 0 1 0 1)
   142                          initiallyInvisible: true
   143                          visibilityChannel: table2VisibleHolder
   144                          model: selectedInfoIndexHolder
   145                          hasHorizontalScrollBar: true
   146                          hasVerticalScrollBar: true
   147                          dataList: infoTable2ListHolder
   148                          columnHolder: tableColumnsForSingleInfo
   149                          separatorOneDColor: (Color 66.9993133440147 66.9993133440147 66.9993133440147)
   150                          keepSpaceForOSXResizeHandleV: true
   151                        )
   152                       )
   153                     
   154                    )
   155                  )
   156                 )
   157               
   158              )
   159              handles: (Any 0.35195530726257 1.0)
   160            )
   161           )
   162         
   163        )
   164      )
   165 ! !
   166 
   167 !ObjectModuleInformation class methodsFor:'menu specs'!
   168 
   169 mainMenu
   170     "This resource specification was automatically generated
   171      by the MenuEditor of ST/X."
   172 
   173     "Do not manually edit this!! If it is corrupted,
   174      the MenuEditor may not be able to read the specification."
   175 
   176     "
   177      MenuEditor new openOnClass:Tools::ObjectModuleInformation andSelector:#mainMenu
   178      (Menu new fromLiteralArrayEncoding:(Tools::ObjectModuleInformation mainMenu)) startUp
   179     "
   180 
   181     <resource: #menu>
   182 
   183     ^ 
   184      #(Menu
   185         (
   186          (MenuItem
   187             label: 'File'
   188             translateLabel: true
   189             submenu: 
   190            (Menu
   191               (
   192                (MenuItem
   193                   label: 'Exit'
   194                   itemValue: closeRequest
   195                   translateLabel: true
   196                 )
   197                )
   198               nil
   199               nil
   200             )
   201           )
   202          (MenuItem
   203             label: 'View'
   204             translateLabel: true
   205             submenu: 
   206            (Menu
   207               (
   208                (MenuItem
   209                   label: 'Dynamically Loaded ClassLibraries Only'
   210                   itemValue: showOnlyDynamicallyLoadedClassLibraries
   211                   translateLabel: true
   212                   hideMenuOnActivated: false
   213                 )
   214                (MenuItem
   215                   label: '-'
   216                 )
   217                (MenuItem
   218                   label: 'Builtin'
   219                   translateLabel: true
   220                   hideMenuOnActivated: false
   221                   indication: showBuiltIn
   222                 )
   223                (MenuItem
   224                   label: 'Class Libraries'
   225                   translateLabel: true
   226                   hideMenuOnActivated: false
   227                   indication: showClassLibs
   228                 )
   229                (MenuItem
   230                   label: 'Methods'
   231                   translateLabel: true
   232                   hideMenuOnActivated: false
   233                   indication: showMethods
   234                 )
   235                (MenuItem
   236                   label: 'C-Objects'
   237                   translateLabel: true
   238                   hideMenuOnActivated: false
   239                   indication: showCObjects
   240                 )
   241                (MenuItem
   242                   label: 'Others'
   243                   translateLabel: true
   244                   hideMenuOnActivated: false
   245                   indication: showOthers
   246                 )
   247                (MenuItem
   248                   label: '-'
   249                 )
   250                (MenuItem
   251                   label: 'Update'
   252                   itemValue: menuUpdateModuleList
   253                   translateLabel: true
   254                 )
   255                )
   256               nil
   257               nil
   258             )
   259           )
   260          (MenuItem
   261             label: 'Module'
   262             translateLabel: true
   263             submenu: 
   264            (Menu
   265               (
   266                (MenuItem
   267                   enabled: canBrowseSelectedModule
   268                   label: 'Browse'
   269                   itemValue: browseModule
   270                   translateLabel: true
   271                 )
   272                (MenuItem
   273                   enabled: canBrowseSelectedModulesExtensions
   274                   label: 'Browse Extensions'
   275                   itemValue: browseModuleExtensions
   276                   translateLabel: true
   277                 )
   278                (MenuItem
   279                   enabled: canBrowseSelectedModulesProjectDefinition
   280                   label: 'Browse ProjectDefinition'
   281                   itemValue: browseModulesProjectDefinition
   282                   translateLabel: true
   283                 )
   284                (MenuItem
   285                   label: 'Find a Class...'
   286                   itemValue: findClass
   287                   translateLabel: true
   288                 )
   289                (MenuItem
   290                   label: '-'
   291                 )
   292                (MenuItem
   293                   enabled: canCopyClassNameList
   294                   label: 'Copy Version Info to Clipboard'
   295                   itemValue: copyClassOrVMNameList
   296                   translateLabel: true
   297                 )
   298                (MenuItem
   299                   label: '-'
   300                 )
   301                (MenuItem
   302                   label: 'Load Package...'
   303                   itemValue: loadPackage
   304                   translateLabel: true
   305                 )
   306                (MenuItem
   307                   label: '-'
   308                 )
   309                (MenuItem
   310                   enabled: canUnloadSelectedModulesPackage
   311                   label: 'Unload Package...'
   312                   itemValue: unloadSelectedModulesPackage
   313                   translateLabel: true
   314                 )
   315                (MenuItem
   316                   enabled: canUnloadSelectedModule
   317                   label: 'Remove Classes && Unload DLL...'
   318                   itemValue: unloadSelectedModuleAndRemoveClasses
   319                   translateLabel: true
   320                 )
   321                (MenuItem
   322                   enabled: canUnloadSelectedDLL
   323                   label: 'Unload DLL...'
   324                   itemValue: unloadSelectedModule
   325                   translateLabel: true
   326                 )
   327                (MenuItem
   328                   label: 'Inspect'
   329                   itemValue: inspectSelectedObject
   330                   translateLabel: true
   331                 )
   332                (MenuItem
   333                   label: '-'
   334                 )
   335                (MenuItem
   336                   label: 'Update'
   337                   itemValue: menuUpdateModuleList
   338                   translateLabel: true
   339                 )
   340                )
   341               nil
   342               nil
   343             )
   344           )
   345          (MenuItem
   346             label: 'MENU_Help'
   347             startGroup: conditionalRight
   348             translateLabel: true
   349             submenu: 
   350            (Menu
   351               (
   352                (MenuItem
   353                   label: 'Documentation'
   354                   itemValue: openDocumentation
   355                   translateLabel: true
   356                 )
   357                (MenuItem
   358                   label: '-'
   359                 )
   360                (MenuItem
   361                   label: 'About this Application...'
   362                   itemValue: openAboutThisApplication
   363                   translateLabel: true
   364                 )
   365                )
   366               nil
   367               nil
   368             )
   369           )
   370          )
   371         nil
   372         nil
   373       )
   374 !
   375 
   376 moduleItemMenu
   377     "This resource specification was automatically generated
   378      by the MenuEditor of ST/X."
   379 
   380     "Do not manually edit this!! If it is corrupted,
   381      the MenuEditor may not be able to read the specification."
   382 
   383     "
   384      MenuEditor new openOnClass:Tools::ObjectModuleInformation andSelector:#moduleItemMenu
   385      (Menu new fromLiteralArrayEncoding:(Tools::ObjectModuleInformation moduleItemMenu)) startUp
   386     "
   387 
   388     <resource: #menu>
   389 
   390     ^ 
   391      #(Menu
   392         (
   393          (MenuItem
   394             enabled: canBrowseSelectedClass
   395             label: 'Browse'
   396             itemValue: browseClass
   397             translateLabel: true
   398           )
   399          (MenuItem
   400             label: '-'
   401           )
   402          (MenuItem
   403             enabled: canCopyClassNameList
   404             label: 'Copy Version Info to Clipboard'
   405             itemValue: copyClassOrVMNameList
   406             translateLabel: true
   407           )
   408          )
   409         nil
   410         nil
   411       )
   412 !
   413 
   414 moduleMenu
   415     "This resource specification was automatically generated
   416      by the MenuEditor of ST/X."
   417 
   418     "Do not manually edit this!! If it is corrupted,
   419      the MenuEditor may not be able to read the specification."
   420 
   421     "
   422      MenuEditor new openOnClass:Tools::ObjectModuleInformation andSelector:#moduleMenu
   423      (Menu new fromLiteralArrayEncoding:(Tools::ObjectModuleInformation moduleMenu)) startUp
   424     "
   425 
   426     <resource: #menu>
   427 
   428     ^ 
   429      #(Menu
   430         (
   431          (MenuItem
   432             enabled: canBrowseSelectedModule
   433             label: 'Browse'
   434             itemValue: browseModule
   435             translateLabel: true
   436           )
   437          (MenuItem
   438             enabled: canBrowseSelectedModulesExtensions
   439             label: 'Browse Extensions'
   440             itemValue: browseModuleExtensions
   441             translateLabel: true
   442           )
   443          (MenuItem
   444             enabled: canBrowseSelectedModulesProjectDefinition
   445             label: 'Browse ProjectDefinition'
   446             itemValue: browseModulesProjectDefinition
   447             translateLabel: true
   448           )
   449          (MenuItem
   450             label: 'Find a Class...'
   451             itemValue: findClass
   452             translateLabel: true
   453           )
   454          (MenuItem
   455             label: '-'
   456           )
   457          (MenuItem
   458             enabled: canCopyClassNameList
   459             label: 'Copy Version Info to Clipboard'
   460             itemValue: copyClassOrVMNameList
   461             translateLabel: true
   462           )
   463          (MenuItem
   464             label: '-'
   465           )
   466          (MenuItem
   467             enabled: canUnloadSelectedModulesPackage
   468             label: 'Unload Package...'
   469             itemValue: unloadSelectedModulesPackage
   470             translateLabel: true
   471           )
   472          (MenuItem
   473             enabled: canUnloadSelectedModule
   474             label: 'Remove Classes && Unload DLL...'
   475             itemValue: unloadSelectedModuleAndRemoveClasses
   476             translateLabel: true
   477           )
   478          (MenuItem
   479             enabled: canUnloadSelectedDLL
   480             label: 'Unload DLL...'
   481             itemValue: unloadSelectedModule
   482             translateLabel: true
   483           )
   484          (MenuItem
   485             label: 'Inspect'
   486             itemValue: inspectSelectedObject
   487             translateLabel: true
   488           )
   489          (MenuItem
   490             label: '-'
   491           )
   492          (MenuItem
   493             label: 'Update'
   494             itemValue: menuUpdateModuleList
   495             translateLabel: true
   496           )
   497          )
   498         nil
   499         nil
   500       )
   501 !
   502 
   503 toolbarMenu
   504     "This resource specification was automatically generated
   505      by the MenuEditor of ST/X."
   506 
   507     "Do not manually edit this!! If it is corrupted,
   508      the MenuEditor may not be able to read the specification."
   509 
   510     "
   511      MenuEditor new openOnClass:Tools::ObjectModuleInformation andSelector:#toolbarMenu
   512      (Menu new fromLiteralArrayEncoding:(Tools::ObjectModuleInformation toolbarMenu)) startUp
   513     "
   514 
   515     <resource: #menu>
   516 
   517     ^ 
   518      #(Menu
   519         (
   520          (MenuItem
   521             label: 'Update'
   522             itemValue: menuUpdateModuleList
   523             translateLabel: true
   524             isButton: true
   525             labelImage: (ResourceRetriever ToolbarIconLibrary reloadIcon)
   526           )
   527          (MenuItem
   528             label: '-'
   529           )
   530          (MenuItem
   531             enabled: canBrowseSelectedModule
   532             label: 'Browse the Selected Module''s Classes'
   533             itemValue: browseModule
   534             translateLabel: true
   535             isButton: true
   536             labelImage: (ResourceRetriever ToolbarIconLibrary startSystemBrowserIcon)
   537           )
   538          (MenuItem
   539             enabled: canBrowseSelectedModulesExtensions
   540             label: 'Browse the Selected Module''s Extensions'
   541             itemValue: browseModuleExtensions
   542             translateLabel: true
   543             isButton: true
   544             labelImage: (ResourceRetriever ToolbarIconLibrary browseClassExtensionsIcon)
   545           )
   546          )
   547         nil
   548         nil
   549       )
   550 ! !
   551 
   552 !ObjectModuleInformation class methodsFor:'tableColumns specs'!
   553 
   554 tableColumns
   555     "This resource specification was automatically generated
   556      by the DataSetBuilder of ST/X."
   557 
   558     "Do not manually edit this!! If it is corrupted,
   559      the DataSetBuilder may not be able to read the specification."
   560 
   561     "
   562      DataSetBuilder new openOnClass:Tools::ObjectModuleInformation andSelector:#tableColumns
   563     "
   564 
   565     <resource: #tableColumns>
   566 
   567     ^#(
   568       (DataSetColumnSpec
   569          label: 'Name'
   570          activeHelpKey: ''
   571          activeHelpKeyForLabel: ''
   572          labelButtonType: Button
   573          isSortable: true
   574          sortSelector: name
   575          width: 0.5
   576          height: heightOfFirstRow
   577          model: name
   578          menuFromApplication: false
   579          canSelect: false
   580        )
   581       (DataSetColumnSpec
   582          label: 'Version'
   583          activeHelpKey: ''
   584          labelButtonType: Button
   585          height: heightOfFirstRow
   586          model: version
   587          canSelect: false
   588        )
   589       (DataSetColumnSpec
   590          label: 'Date'
   591          activeHelpKey: ''
   592          activeHelpKeyForLabel: ''
   593          labelButtonType: Button
   594          isSortable: true
   595          sortSelector: dateOrEmpty
   596          height: heightOfFirstRow
   597          model: date
   598          menuFromApplication: false
   599          canSelect: false
   600        )
   601       )
   602     
   603 !
   604 
   605 tableColumnsForSingleInfo
   606     "This resource specification was automatically generated
   607      by the DataSetBuilder of ST/X."
   608 
   609     "Do not manually edit this!! If it is corrupted,
   610      the DataSetBuilder may not be able to read the specification."
   611 
   612     "
   613      DataSetBuilder new openOnClass:Tools::ObjectModuleInformation andSelector:#tableColumnsForSingleInfo
   614     "
   615 
   616     <resource: #tableColumns>
   617 
   618     ^#(
   619       (DataSetColumnSpec
   620          label: ''
   621          activeHelpKey: ''
   622          labelButtonType: None
   623          width: 0.3
   624          model: name
   625          canSelect: false
   626        )
   627       (DataSetColumnSpec
   628          label: ''
   629          activeHelpKey: ''
   630          labelButtonType: None
   631          model: value
   632          canSelect: false
   633        )
   634       )
   635     
   636 ! !
   637 
   638 !ObjectModuleInformation methodsFor:'aspects'!
   639 
   640 canBrowseSelectedClass
   641     ^ [classNamesShown notEmptyOrNil
   642        and:[ self selectedInfoIndex notNil
   643        and:[ self selectedInfoIndex ~~ 0 ]]]
   644 
   645     "Modified: / 05-10-2007 / 10:51:39 / cg"
   646 !
   647 
   648 canBrowseSelectedModule
   649     canBrowseSelectedModule isNil ifTrue:[
   650         canBrowseSelectedModule := false asValue
   651     ].
   652     ^ canBrowseSelectedModule.
   653 
   654     "Modified: / 05-10-2007 / 10:51:39 / cg"
   655 !
   656 
   657 canBrowseSelectedModulesExtensions
   658     canBrowseSelectedModulesExtensions isNil ifTrue:[
   659         canBrowseSelectedModulesExtensions := false asValue
   660     ].
   661     ^ canBrowseSelectedModulesExtensions.
   662 
   663     "Modified: / 05-10-2007 / 10:51:39 / cg"
   664 !
   665 
   666 canBrowseSelectedModulesProjectDefinition
   667     ^ [ self projectDefinitionClassOfSelectedModule notNil ]
   668 !
   669 
   670 canCopyClassNameList
   671     ^ [table1VisibleHolder value 
   672     and:[classInfoShown notEmptyOrNil or:[vmInfoShown notEmptyOrNil] ]]
   673 
   674     "Modified: / 05-10-2007 / 10:51:39 / cg"
   675 !
   676 
   677 canUnloadSelectedDLL
   678     canUnloadSelectedDLL isNil ifTrue:[
   679         canUnloadSelectedDLL := false asValue
   680     ].
   681     ^ canUnloadSelectedDLL.
   682 
   683     "Modified: / 05-10-2007 / 10:51:39 / cg"
   684 !
   685 
   686 canUnloadSelectedModule
   687     canUnloadSelectedModule isNil ifTrue:[
   688         canUnloadSelectedModule := false asValue
   689     ].
   690     ^ canUnloadSelectedModule.
   691 
   692     "Modified: / 05-10-2007 / 10:51:39 / cg"
   693 !
   694 
   695 canUnloadSelectedModulesPackage
   696     canUnloadSelectedModulesPackage isNil ifTrue:[
   697         canUnloadSelectedModulesPackage := false asValue
   698     ].
   699     ^ canUnloadSelectedModulesPackage.
   700 !
   701 
   702 descriptionLabelHolder
   703     ^ builder valueAspectFor:#'descriptionLabelHolder' initialValue:''
   704 !
   705 
   706 infoTable1ListHolder
   707     ^ builder valueAspectFor:#'infoTable1ListHolder' initialValue:#()
   708 
   709     "Created: / 05-10-2007 / 12:48:06 / cg"
   710 !
   711 
   712 infoTable2ListHolder
   713     ^ builder valueAspectFor:#'infoTable2ListHolder' initialValue:#()
   714 
   715     "Created: / 05-10-2007 / 12:48:10 / cg"
   716 !
   717 
   718 listOfModuleNames
   719     listOfModuleNames isNil ifTrue:[
   720         listOfModuleNames := List new.
   721     ].
   722     ^ listOfModuleNames.
   723 
   724     "Modified: / 05-10-2007 / 10:49:19 / cg"
   725 !
   726 
   727 middleLabelHolder
   728     ^ builder valueAspectFor:#'middleLabelHolder' initialValue:''
   729 
   730     "Created: / 05-10-2007 / 11:05:08 / cg"
   731 !
   732 
   733 notReadOnly
   734     ^ self readOnly not
   735 
   736     "Created: / 05-10-2007 / 13:06:00 / cg"
   737 !
   738 
   739 readOnly
   740     ^ readOnly ? false
   741 
   742     "Created: / 05-10-2007 / 13:05:51 / cg"
   743 !
   744 
   745 readOnly:aBoolean
   746     readOnly := aBoolean
   747 
   748     "Created: / 05-10-2007 / 13:05:51 / cg"
   749 !
   750 
   751 selectedInfoIndex
   752     |sel|
   753 
   754     sel := self selectedInfoIndexHolder value.
   755     ^ sel
   756 !
   757 
   758 selectedInfoIndexHolder
   759     selectedInfoIndexHolder isNil ifTrue:[
   760         selectedInfoIndexHolder := ValueHolder new.
   761         selectedInfoIndexHolder onChangeSend:#selectedInfoIndexChanged to:self.
   762     ].
   763     ^ selectedInfoIndexHolder.
   764 
   765     "Modified: / 05-10-2007 / 10:51:39 / cg"
   766 !
   767 
   768 selectedModuleIndex
   769     |sel|
   770 
   771     sel := self selectedModuleIndexHolder value.
   772     ^ sel
   773 !
   774 
   775 selectedModuleIndexHolder
   776     selectedModuleIndexHolder isNil ifTrue:[
   777         selectedModuleIndexHolder := ValueHolder new.
   778         selectedModuleIndexHolder onChangeSend:#selectedModuleIndexChanged to:self.
   779     ].
   780     ^ selectedModuleIndexHolder.
   781 
   782     "Modified: / 05-10-2007 / 10:51:39 / cg"
   783 !
   784 
   785 showBuiltIn
   786     showBuiltIn isNil ifTrue:[
   787         showBuiltIn := true asValue.
   788         showBuiltIn onChangeSend:#filterChanged to:self.
   789     ].
   790     ^ showBuiltIn
   791 
   792     "Modified: / 05-10-2007 / 12:43:23 / cg"
   793 !
   794 
   795 showCObjects
   796     showCObjects isNil ifTrue:[
   797         showCObjects := true asValue.
   798         showCObjects onChangeSend:#filterChanged to:self.
   799     ].
   800     ^ showCObjects
   801 
   802     "Modified: / 05-10-2007 / 12:43:16 / cg"
   803 !
   804 
   805 showClassLibs
   806     showClassLibs isNil ifTrue:[
   807         showClassLibs := true asValue.
   808         showClassLibs onChangeSend:#filterChanged to:self.
   809     ].
   810     ^ showClassLibs
   811 
   812     "Modified: / 05-10-2007 / 12:43:10 / cg"
   813 !
   814 
   815 showMethods
   816     showMethods isNil ifTrue:[
   817         showMethods := true asValue.
   818         showMethods onChangeSend:#filterChanged to:self.
   819     ].
   820     ^ showMethods
   821 
   822     "Modified: / 05-10-2007 / 12:43:02 / cg"
   823 !
   824 
   825 showOnlyDynamicallyLoadedClassLibraries
   826     self showBuiltIn value:false withoutNotifying:self.
   827     self showCObjects value:false withoutNotifying:self.
   828     self showMethods value:false withoutNotifying:self.
   829     self showOthers value:false withoutNotifying:self.
   830     self showClassLibs value:true withoutNotifying:self.
   831     self filterChanged.
   832 !
   833 
   834 showOthers
   835     showOthers isNil ifTrue:[
   836         showOthers := true asValue.
   837         showOthers onChangeSend:#filterChanged to:self.
   838     ].
   839     ^ showOthers
   840 
   841     "Modified: / 05-10-2007 / 12:42:54 / cg"
   842 !
   843 
   844 table1VisibleHolder
   845     table1VisibleHolder isNil ifTrue:[
   846         table1VisibleHolder := true asValue.
   847     ].
   848     ^ table1VisibleHolder.
   849 
   850     "Modified: / 05-10-2007 / 12:53:05 / cg"
   851 !
   852 
   853 table2VisibleHolder
   854     table2VisibleHolder isNil ifTrue:[
   855         table2VisibleHolder := false asValue.
   856     ].
   857     ^ table2VisibleHolder.
   858 
   859     "Modified: / 05-10-2007 / 12:53:14 / cg"
   860 ! !
   861 
   862 !ObjectModuleInformation methodsFor:'change & update'!
   863 
   864 isExtensionName:nm
   865     ^ (nm endsWith:'_extensions')
   866 !
   867 
   868 selectedInfoIndexChanged
   869 !
   870 
   871 selectedModule
   872     |sel|
   873 
   874     sel := self selectedModuleIndex.
   875     sel isNil ifTrue:[^ nil].
   876     ^ objectHandles at:sel.
   877 !
   878 
   879 selectedModuleIndexChanged
   880     | info |
   881 
   882     info := self selectedModuleInfo.
   883 
   884     self canBrowseSelectedModule value:false.
   885     self canBrowseSelectedModulesExtensions value:false.
   886     self canUnloadSelectedDLL value:false.
   887     self canUnloadSelectedModule value:false.
   888     self canUnloadSelectedModulesPackage value:false.
   889 
   890     classNamesShown := nil.
   891     classInfoShown := nil.
   892     vmInfoShown := nil.
   893 
   894     info isNil ifTrue:[
   895         "/ selected a cObject or unknown
   896         self showInfoForNonClassLib:(self selectedModuleIndex).
   897         ^ self.
   898     ].
   899     info == #VM ifTrue:[
   900         "/ selected the pseudo entry for the VM itself
   901         self showInfoForVM.
   902         ^ self.
   903     ].
   904 
   905     "/ selected a class-library package
   906     self showInfoForClassLib:info.
   907 
   908     "Modified: / 05-10-2007 / 12:56:13 / cg"
   909 !
   910 
   911 selectedModuleInfo
   912     |sel|
   913 
   914     sel := self selectedModuleIndex.
   915     sel notNil ifTrue:[
   916         (self showClassLibs value or:[self showBuiltIn value]) ifTrue:[
   917             ^ allModules at:sel ifAbsent:nil.
   918         ].
   919     ].
   920     ^ nil
   921 !
   922 
   923 selectedObjectHandle
   924     |sel|
   925 
   926     sel := self selectedModuleIndex.
   927     sel isNil ifTrue:[^ nil].
   928     ^ objectHandles at:sel.
   929 !
   930 
   931 showInfoForClassLib:info
   932     "selected a lib-package; fill bottom list with class-info"
   933 
   934     |rows projectDefinitionClass mgr canUnload canUnloadPackage|
   935 
   936     self middleLabelHolder value:'Components:'.
   937 
   938     projectDefinitionClass := self selectedModulesProjectDefinitionClass.
   939     projectDefinitionClass isNil ifTrue:[
   940         self descriptionLabelHolder value:''.
   941     ] ifFalse:[
   942         self descriptionLabelHolder value:("'Description: ',"projectDefinitionClass description).
   943     ].
   944 
   945     self canBrowseSelectedModule value:true.
   946 
   947     self canBrowseSelectedModulesExtensions 
   948         value:(info classNames contains:[:nm | self isExtensionName:nm]).
   949 
   950     canUnload := info dynamic and:[self readOnly not].
   951     self canUnloadSelectedModule value:canUnload.
   952     canUnloadPackage := canUnload 
   953                 and:[projectDefinitionClass notNil
   954                 and:[projectDefinitionClass projectIsLoaded]].
   955     self canUnloadSelectedModulesPackage value:canUnloadPackage.
   956 
   957 
   958     classNamesShown := self shownClassNamesFor:info.
   959     rows := classNamesShown collect:[:eachClassName |
   960                     |cls entry rev binRev listEntry revisionInfo versionString dateString|
   961 
   962                     listEntry := InfoRow new.
   963                     listEntry name:eachClassName.
   964 
   965                     cls := Smalltalk classNamed:eachClassName.
   966                     cls isNil ifTrue:[
   967                         (self isExtensionName:eachClassName) ifTrue:[
   968                             projectDefinitionClass notNil ifTrue:[
   969                                 mgr := projectDefinitionClass sourceCodeManager.
   970                                 mgr notNil ifTrue:[
   971                                     versionString := projectDefinitionClass perform:(mgr nameOfVersionMethodForExtensions) ifNotUnderstood:nil.
   972                                     versionString notNil ifTrue:[
   973                                         versionString := '(bin: ',(mgr revisionInfoFromString:versionString) revision,')'.
   974                                     ]
   975                                 ] ifFalse:[
   976                                     versionString := '(SCM disabled)'.
   977                                 ].
   978                             ].
   979                         ] ifFalse:[
   980                             versionString := '(class removed)'.
   981                         ].
   982                     ] ifFalse:[
   983                         binRev := cls binaryRevision.
   984                         binRev notNil ifTrue:[
   985                             cls isLoaded ifTrue:[
   986                                 entry :='(bin: ' , binRev.
   987                             ] ifFalse:[
   988                                 entry := '(stub for: ' , binRev.
   989                             ].    
   990                             (rev := cls revision) ~= binRev ifTrue:[
   991                                 entry := entry , ' / src: ' , (rev printString)
   992                             ].
   993                             entry := entry , ')'.
   994                             versionString := entry
   995                         ] ifFalse:[
   996                             cls revision notNil ifTrue:[
   997                                 versionString := '(overloaded by: ' , cls revision , ')' 
   998                             ]
   999                         ].
  1000                         revisionInfo := cls revisionInfo.
  1001                         revisionInfo notNil ifTrue:[
  1002                             dateString := revisionInfo at:#date.
  1003                         ].
  1004                     ].
  1005                     listEntry version:versionString.
  1006                     listEntry date:dateString.
  1007                   ].
  1008 
  1009     classInfoShown := rows.
  1010 
  1011     self infoTable1ListHolder value:rows.
  1012     self table1VisibleHolder value:true.
  1013     self table2VisibleHolder value:false.
  1014 
  1015     "Modified: / 29-09-2011 / 15:40:42 / cg"
  1016 !
  1017 
  1018 showInfoForNonClassLib:sel
  1019     "selected a method, cObject or unknown"
  1020 
  1021     |module fileName list newEntry|
  1022 
  1023     self descriptionLabelHolder value:''.
  1024 
  1025     sel isNil ifTrue:[
  1026         self table1VisibleHolder value:false.
  1027         self table2VisibleHolder value:false.
  1028         ^ self.
  1029     ].
  1030 
  1031     module := objectHandles at:sel.
  1032     fileName := module pathName.
  1033 
  1034     self canUnloadSelectedDLL value:true.
  1035 
  1036     module isMethodHandle ifTrue:[
  1037         |method nm entries|
  1038 
  1039         self canUnloadSelectedModule value:self readOnly not.
  1040 
  1041         self middleLabelHolder value:'Compiled Method:'.
  1042 
  1043         (method := module method) isNil ifTrue:[
  1044             nm := '** removed **'.
  1045         ] ifFalse:[
  1046             self canBrowseSelectedModule value:true.
  1047 "/            menu := PopUpMenu
  1048 "/                        labels:#('Inspect' 'Browse')
  1049 "/                        selectors:#(inspect browse).
  1050 "/            menu actionAt:#inspect put:[ method inspect ].
  1051 "/            menu actionAt:#browse put:[ |who|
  1052 "/                                        who := method who.
  1053 "/                                        UserPreferences systemBrowserClass
  1054 "/                                            openInClass:(who methodClass) 
  1055 "/                                            selector:(who methodSelector) 
  1056 "/                                      ].
  1057 "/            listView1 middleButtonMenu:menu.
  1058 
  1059             nm := (method whoString) withColor:Color blue.
  1060         ].
  1061         entries := OrderedCollection new.
  1062         newEntry := InfoRow new.
  1063         newEntry name:'Compiled method'; value:nm.
  1064         entries add:newEntry.
  1065 
  1066         newEntry := InfoRow new.
  1067         newEntry name:'Path'; value:fileName.
  1068         entries add:newEntry.
  1069 
  1070         (method notNil and:[method code notNil]) ifTrue:[
  1071             newEntry := InfoRow new.
  1072             newEntry name:'Address'; value:('(16r) ' , (method code address hexPrintString leftPaddedTo:8 with:$0)).
  1073             entries add:newEntry.
  1074         ].
  1075 
  1076         self infoTable2ListHolder value:entries.
  1077         self table1VisibleHolder value:false.
  1078         self table2VisibleHolder value:true.
  1079         ^ self.
  1080     ].
  1081 
  1082     (module isFunctionObjectHandle 
  1083     and:[module functions notEmpty]) ifTrue:[
  1084         self middleLabelHolder value:'Functions:'.
  1085 
  1086 "/        menu := PopUpMenu
  1087 "/                    labels:#('Inspect')
  1088 "/                    selectors:#(inspect).
  1089 "/        menu actionAt:#inspect put:[ module functions inspect  ].
  1090 "/        listView1 middleButtonMenu:menu.
  1091 "/
  1092         list := module functions 
  1093                         select:[:f | f notNil]
  1094                         thenCollect:[:f | |entry code|
  1095                                         entry := InfoRow new.
  1096                                         entry name:(f name withColor:Color blue).
  1097                                         code := f code.
  1098                                         code isNil ifTrue:[
  1099                                             entry value:('address: NULL').
  1100                                         ] ifFalse:[
  1101                                             entry value:('address: (16r) ' , (code address hexPrintString leftPaddedTo:8 with:$0)).
  1102                                         ].
  1103                                         entry
  1104                                 ].
  1105         self infoTable2ListHolder value:list.
  1106         self table1VisibleHolder value:false.
  1107         self table2VisibleHolder value:true.
  1108         ^ self.
  1109     ].
  1110 
  1111     newEntry := InfoRow new.
  1112     newEntry name:'Unknown'.
  1113     self infoTable2ListHolder value:(Array with:newEntry).
  1114     self table1VisibleHolder value:false.
  1115     self table2VisibleHolder value:true.
  1116 
  1117     "Modified: / 05-10-2007 / 13:01:33 / cg"
  1118 !
  1119 
  1120 showInfoForVM
  1121     "show file versions of vm info in lower view."
  1122 
  1123     |l|
  1124 
  1125     self canBrowseSelectedModule value:false.
  1126     self middleLabelHolder value:'VM Components:'.
  1127     self descriptionLabelHolder value:("'Description: '," 'Runtime System (VM)').
  1128 
  1129     l := ObjectMemory getVMIdentificationStrings
  1130             select:[:entry | (entry includesString:'$Header') 
  1131                                     and:[entry includesString:',v']]
  1132             thenCollect:[:entry |
  1133                 |i1 i2 file revision date listEntry|
  1134 
  1135                 listEntry := InfoRow new.
  1136 
  1137                 i1 := entry indexOfSubCollection:'librun'.
  1138                 i1 ~~ 0 ifTrue:[
  1139                     i2 := entry indexOfSubCollection:',v' startingAt:i1.
  1140                     i2 ~~ 0 ifTrue:[
  1141                         file := entry copyFrom:i1+7 to:(i2-1).
  1142                         listEntry name:file.
  1143 
  1144                         i1 := i2+3.
  1145                         i2 := entry indexOfSeparatorStartingAt:i1.
  1146                         revision := entry copyFrom:i1 to:(i2-1).
  1147                         listEntry version:revision.
  1148 
  1149                         i1 := i2+1.
  1150                         i2 := entry indexOfSeparatorStartingAt:i1.
  1151                         date := entry copyFrom:i1 to:(i2-1).
  1152                         listEntry date:date.
  1153                     ].
  1154                 ].
  1155                 listEntry.
  1156             ].
  1157 
  1158     vmInfoShown := l.
  1159     self infoTable1ListHolder value:l.
  1160     self table1VisibleHolder value:true.
  1161     self table2VisibleHolder value:false.
  1162 
  1163 "/    readOnly ifFalse:[
  1164 "/        unloadButton disable.
  1165 "/        unloadAndRemoveButton disable.
  1166 "/    ]
  1167 
  1168     "Modified: / 05-10-2007 / 12:53:44 / cg"
  1169 !
  1170 
  1171 shownClassNamesFor:info
  1172     "/ selected a package; fill bottom list with class-info
  1173 
  1174     |classNames|
  1175 
  1176     classNames := info classNames asSortedCollection.
  1177     ^ classNames 
  1178         select:[:cName |
  1179             |cls|
  1180 
  1181             cls := Smalltalk classNamed:cName.
  1182             cls isNil ifTrue:[
  1183                 true "a removed class"
  1184             ] ifFalse:[
  1185                 cls isPrivate not
  1186             ].
  1187         ].
  1188 ! !
  1189 
  1190 !ObjectModuleInformation methodsFor:'initialization'!
  1191 
  1192 postBuildWith:aBuilder
  1193     |canDoIt|
  1194 
  1195     super postBuildWith:aBuilder.
  1196 
  1197     canDoIt := ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles].
  1198     self showBuiltIn value:canDoIt.
  1199     self showCObjects value:canDoIt.
  1200     self showClassLibs value:canDoIt.
  1201     self showMethods value:canDoIt.
  1202     self showOthers value:canDoIt.
  1203 
  1204     self updateModuleList
  1205 
  1206     "Created: / 05-10-2007 / 10:50:27 / cg"
  1207 ! !
  1208 
  1209 !ObjectModuleInformation methodsFor:'menu actions'!
  1210 
  1211 browseClass
  1212     |info classNames selectedClassName selectedClass|
  1213 
  1214     info := self selectedModuleInfo.
  1215     classNames := (self shownClassNamesFor:info) asSortedCollection.
  1216     selectedClassName := classNames at:(self selectedInfoIndex).
  1217     selectedClass := Smalltalk classNamed:selectedClassName.
  1218 
  1219     selectedClass notNil ifTrue:[
  1220         Smalltalk browseInClass:selectedClass.
  1221         ^ self.
  1222     ].
  1223 
  1224     "/ clicked on an extensions-module ?
  1225     (self isExtensionName:selectedClassName) ifTrue:[
  1226         self browseModuleExtensions.
  1227         ^ self.
  1228     ].
  1229 
  1230     self breakPoint:#cg.
  1231 !
  1232 
  1233 browseModule
  1234     |moduleInfoOrHandle classes method|
  1235 
  1236     moduleInfoOrHandle := self selectedObjectHandle.
  1237     "/ what a hack
  1238     (moduleInfoOrHandle isKindOf: ObjectMemory::BinaryModuleDescriptor) ifTrue:[
  1239         classes := moduleInfoOrHandle classNames collect:[:nm | Smalltalk classNamed:nm].
  1240 
  1241         UserPreferences systemBrowserClass
  1242             perform:#openOnPackage: with:(moduleInfoOrHandle package)
  1243             ifNotUnderstood:[
  1244                 "/ Q: what about extensions ?
  1245                 UserPreferences systemBrowserClass
  1246                     browseClasses:classes
  1247                     label:(resources string:'Classes in %1' with:moduleInfoOrHandle libraryName).
  1248             ]
  1249     ] ifFalse:[
  1250         moduleInfoOrHandle isMethodHandle ifTrue:[
  1251             method := moduleInfoOrHandle method.
  1252             (method notNil and:[method mclass notNil]) ifFalse:[
  1253                 Dialog information:'The method has been redefined/removed'.
  1254                 ^ self.
  1255             ].
  1256             UserPreferences systemBrowserClass 
  1257                 openInMethod:method
  1258         ]
  1259     ].
  1260 !
  1261 
  1262 browseModuleExtensions
  1263     |info name packageID methods|
  1264 
  1265     info := self selectedModuleInfo.
  1266 
  1267     name := info classNames detect:[:nm | self isExtensionName:nm].
  1268     packageID := (name copyButLast:('_extensions' size)) asSymbol.
  1269     methods := Smalltalk allExtensionsForPackage:packageID.
  1270     (UserPreferences browserClass) browseMethods:methods title:('Extensions for ',packageID).
  1271 !
  1272 
  1273 browseModulesProjectDefinition
  1274     |projectDefinitionClass|
  1275 
  1276     projectDefinitionClass := self projectDefinitionClassOfSelectedModule.
  1277     projectDefinitionClass notNil ifTrue:[
  1278         (UserPreferences browserClass) openInClass:projectDefinitionClass class
  1279     ].
  1280 !
  1281 
  1282 copyClassOrVMNameList
  1283     |text|
  1284 
  1285     text := ((classInfoShown ? vmInfoShown)collect:[:eachRow | eachRow infoString]) asStringCollection asString.
  1286     self window setClipboardText:text.
  1287 !
  1288 
  1289 findClass
  1290     |class moduleIndex classNamesShown classIndex|
  1291 
  1292     class := Dialog requestClass:'Classname (Tab for completion):'.
  1293     class isEmptyOrNil ifTrue:[^ self].
  1294 
  1295     moduleIndex := allModules findFirst:[:module | module isSymbol not and:[module classNames includes:class name]].
  1296     moduleIndex == 0 ifTrue:[
  1297         Dialog information:'Class is not contained in a loaded or builtIn package.'.
  1298         ^ self
  1299     ].
  1300     self selectedModuleIndexHolder value:moduleIndex.
  1301 
  1302     classNamesShown := self shownClassNamesFor:(self selectedModuleInfo).
  1303     classIndex := classNamesShown indexOf:class name.
  1304     self selectedInfoIndexHolder value:classIndex.
  1305 
  1306 "/    module := allModules at:moduleIndex.
  1307 "/    info := self selectedModuleInfo.
  1308 "/    classNames := (self shownClassNamesFor:info) asSortedCollection.
  1309 "/    selectedClassName := classNames at:(self selectedInfoIndex).
  1310 "/    selectedClass := Smalltalk classNamed:selectedClassName.
  1311 "/
  1312 "/    selectedClass notNil ifTrue:[
  1313 "/        Smalltalk browseInClass:selectedClass.
  1314 "/        ^ self.
  1315 "/    ].
  1316 "/
  1317 "/    "/ clicked on an extensions-module ?
  1318 "/    (self isExtensionName:selectedClassName) ifTrue:[
  1319 "/        self browseModuleExtensions.
  1320 "/        ^ self.
  1321 "/    ].
  1322 "/
  1323 "/    self breakPoint:#cg.
  1324 !
  1325 
  1326 inspectSelectedObject
  1327     self selectedObjectHandle inspect.
  1328 !
  1329 
  1330 loadPackage
  1331     AbstractLauncherApplication::PackageLoadDialog openModal.
  1332 "/    |package|
  1333 "/
  1334 "/    package := Dialog request:'Name of Package (module:directory)'.
  1335 "/    package isEmptyOrNil ifTrue:[^ self].
  1336 "/    [
  1337 "/        self withWaitCursorDo:[
  1338 "/            Smalltalk loadPackage:package.
  1339 "/        ].
  1340 "/    ] on:PackageLoadError do:[:ex|
  1341 "/        Dialog information:'Package not loaded: ', ex description.
  1342 "/    ].
  1343     self updateModuleList
  1344 !
  1345 
  1346 menuUpdateModuleList
  1347     self updateModuleList
  1348 
  1349     "Modified: / 05-10-2007 / 13:11:45 / cg"
  1350 !
  1351 
  1352 openDocumentation
  1353     self openHTMLDocument: 'tools/misc/TOP.html#MODULEINFO'
  1354 
  1355     "Modified: / 05-10-2007 / 13:11:45 / cg"
  1356 !
  1357 
  1358 selectedModulesProjectDefinitionClass
  1359     "try to figure out, what the definitionClass is inside that module.
  1360      in the future, we should always find one there, however, old libs or
  1361      special libraries (hand built) might be without a projectDefinition."
  1362 
  1363     |info classNames definitionClasses libraryName|
  1364 
  1365     info := self selectedModuleInfo.
  1366     classNames := (self shownClassNamesFor:info) asSortedCollection.
  1367     definitionClasses := classNames ? #()
  1368                                 collect:[:nm | Smalltalk classNamed:nm]
  1369                                 thenSelect:[:cls | cls isProjectDefinition].
  1370 
  1371     definitionClasses size == 1 ifTrue:[
  1372         ^ definitionClasses first
  1373     ] ifFalse:[
  1374         "/ 0 or more definition classes - fall back - some heuristics...
  1375         libraryName := info libraryName.  "maybe something like 'libstx_libbasic'"
  1376         (libraryName notNil and:[ libraryName startsWith:'lib' ]) ifTrue:[
  1377             ^ Smalltalk classNamed:(libraryName copyFrom:4).
  1378         ].
  1379     ].
  1380 
  1381     ^ nil
  1382 !
  1383 
  1384 unloadSelectedModule
  1385     self unloadSelectedModuleRemoveConnectedObjects:false
  1386 !
  1387 
  1388 unloadSelectedModuleAndRemoveClasses
  1389     self unloadSelectedModuleRemoveConnectedObjects:true
  1390 !
  1391 
  1392 unloadSelectedModuleRemoveConnectedObjects:doRemoveClasses 
  1393     |module handle|
  1394 
  1395     module := allModules at:self selectedModuleIndex ifAbsent:nil.
  1396     module notNil ifTrue:[
  1397         (Dialog 
  1398             confirm:'This is a possibly dangerous operation, as the DLL is unloaded without caring for 
  1399 proper package-deinstallation procedures. Please use this only in repair situations and when the 
  1400 regular unloadPackage operation fails.
  1401 
  1402 Continue ?') 
  1403                 ifFalse:[ ^ self ].
  1404         handle := module handle.
  1405     ] ifFalse:[
  1406         handle := objectHandles at:self selectedModuleIndex ifAbsent:nil.
  1407     ].
  1408     handle notNil ifTrue:[
  1409         self 
  1410             withWaitCursorDo:[
  1411                 self selectedModuleIndexHolder value:nil.
  1412                 doRemoveClasses ifTrue:[
  1413                     handle removeConnectedObjects.
  1414                 ].
  1415                 handle unload.
  1416                 self updateModuleList.
  1417             ].
  1418     ]
  1419 !
  1420 
  1421 unloadSelectedModulesPackage
  1422     |definitionClass|
  1423 
  1424     definitionClass := self selectedModulesProjectDefinitionClass.
  1425     definitionClass isNil ifTrue:[^ self].
  1426 
  1427     (Dialog 
  1428         confirm:(resources stringWithCRs:'About to unload the package\\    %1\\Continue' with:definitionClass package allBold))
  1429     ifFalse:[
  1430         ^ self
  1431     ].
  1432     Smalltalk unloadPackage:definitionClass package.
  1433 ! !
  1434 
  1435 !ObjectModuleInformation methodsFor:'private'!
  1436 
  1437 filterChanged
  1438     self updateModuleList
  1439 
  1440     "Created: / 05-10-2007 / 12:43:36 / cg"
  1441 !
  1442 
  1443 projectDefinitionClassOfSelectedModule
  1444     |info packageID projectDefinitionClass|
  1445 
  1446     info := self selectedModuleInfo.
  1447     info isNil ifTrue:[^ nil].
  1448 
  1449     info classNames 
  1450         detect:[:nm | 
  1451             |cls|
  1452 
  1453             cls := Smalltalk at:nm. 
  1454             cls notNil ifTrue:[
  1455                 packageID := cls package.
  1456                 true
  1457             ] ifFalse:[
  1458                 false
  1459             ]
  1460         ]
  1461         ifNone:[^ nil].
  1462 
  1463     projectDefinitionClass := packageID asPackageId projectDefinitionClass.
  1464     ^ projectDefinitionClass
  1465 !
  1466 
  1467 updateModuleList
  1468     |showClassLibs showBuiltIn showMethods showCObjects showOthers
  1469      listOfModuleNames allObjects handles methodObjects |
  1470 
  1471     showClassLibs := self showClassLibs value.
  1472     showBuiltIn := self showBuiltIn value.
  1473     showMethods := self showMethods value.
  1474     showCObjects := self showCObjects value.
  1475     showOthers := self showOthers value.
  1476 
  1477     listOfModuleNames := OrderedCollection new.
  1478     handles := OrderedCollection new.
  1479 
  1480     allObjects := ObjectFileLoader loadedObjectHandles.
  1481     methodObjects := (allObjects select:[:h | h isMethodHandle]) asArray.
  1482 
  1483     (showClassLibs or:[showBuiltIn]) ifTrue:[
  1484         |moduleNames|
  1485 
  1486         allModules := ObjectMemory binaryModuleInfo asOrderedCollection.
  1487         allModules := allModules select:
  1488                                     [:i |
  1489                                         |wantToSee|
  1490 
  1491                                         wantToSee := false.
  1492                                         i dynamic ifTrue:[
  1493                                             showClassLibs ifTrue:[
  1494                                                 i isSingleMethod ifFalse:[
  1495                                                     wantToSee := true
  1496                                                 ].
  1497                                             ].
  1498                                         ] ifFalse:[
  1499                                             showBuiltIn ifTrue:[
  1500                                                 wantToSee := true
  1501                                             ].
  1502                                         ].
  1503                                         wantToSee
  1504                                     ].
  1505 
  1506         "/ sorting by reverse id brings newest ones to the top (a side effect)
  1507         allModules sort:[:a :b | (a name) < (b name)].
  1508         moduleNames := allModules collect:[:entry | entry name].
  1509         listOfModuleNames addAll:moduleNames.
  1510         handles addAll:allModules.
  1511     ].
  1512 
  1513     showMethods ifTrue:[
  1514         |methodNames|
  1515 
  1516         methodNames := methodObjects collect:[:mH | mH method isNil ifTrue:[
  1517                                                         'compiled method - removed' " , ' (in ' , mH pathName , ')' "
  1518                                                     ] ifFalse:[
  1519                                                         'compiled method ' , mH method whoString  " , ' (in ' , mH pathName , ')' "
  1520                                                     ].
  1521                                              ].
  1522         listOfModuleNames addAll:methodNames.
  1523         handles addAll:methodObjects.
  1524     ].
  1525 
  1526     showCObjects ifTrue:[
  1527         |cObjects cObjectNames|
  1528 
  1529         cObjects := (allObjects select:[:h | h isFunctionObjectHandle]) asArray.
  1530         cObjectNames := cObjects collect:[:entry | entry pathName].
  1531         listOfModuleNames addAll:cObjectNames.
  1532         handles addAll:cObjects.
  1533     ].
  1534 
  1535     showOthers ifTrue:[
  1536         |otherObjects otherObjectNames|
  1537 
  1538         otherObjects := (allObjects reject:[:h | (h isFunctionObjectHandle
  1539                                                  or:[h isMethodHandle
  1540                                                  or:[h isClassLibHandle]])]) asArray.
  1541         otherObjectNames := otherObjects collect:[:entry | entry pathName].
  1542         listOfModuleNames addAll:otherObjectNames.
  1543         handles addAll:otherObjects.
  1544     ].
  1545 
  1546     showBuiltIn ifTrue:[
  1547         listOfModuleNames addFirst:'VM'.
  1548         handles addFirst:#VM.
  1549         allModules addFirst:#VM.
  1550     ].
  1551 
  1552     self listOfModuleNames contents:listOfModuleNames.
  1553     objectHandles := handles.
  1554     self selectedModuleIndexChanged.
  1555 
  1556     "Modified: / 05-10-2007 / 12:45:37 / cg"
  1557 ! !
  1558 
  1559 !ObjectModuleInformation::InfoRow methodsFor:'accessing'!
  1560 
  1561 date
  1562     ^ date
  1563 !
  1564 
  1565 date:something
  1566     date := something.
  1567 !
  1568 
  1569 dateOrEmpty
  1570     ^ date ? ''
  1571 !
  1572 
  1573 name
  1574     ^ name
  1575 !
  1576 
  1577 name:something
  1578     name := something.
  1579 !
  1580 
  1581 name:nameArg version:versionArg date:dateArg 
  1582     name := nameArg.
  1583     version := versionArg.
  1584     date := dateArg.
  1585 !
  1586 
  1587 value
  1588     ^ value
  1589 !
  1590 
  1591 value:something
  1592     value := something.
  1593 !
  1594 
  1595 version
  1596     ^ version
  1597 !
  1598 
  1599 version:something
  1600     version := something.
  1601 ! !
  1602 
  1603 !ObjectModuleInformation::InfoRow methodsFor:'info'!
  1604 
  1605 infoString
  1606     ^ name , ' ', (version ? '-') , ' ', (date ? '-') printString
  1607 ! !
  1608 
  1609 !ObjectModuleInformation class methodsFor:'documentation'!
  1610 
  1611 version
  1612     ^ '$Header$'
  1613 !
  1614 
  1615 version_CVS
  1616     ^ '$Header$'
  1617 ! !
  1618