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