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