ProjectBrowser.st
changeset 1079 deda6cdfe287
parent 1052 2b65eda2938e
child 1080 98b04ef482dc
equal deleted inserted replaced
1078:84683b5a6979 1079:deda6cdfe287
     3 	classVariableNames:''
     3 	classVariableNames:''
     4 	poolDictionaries:''
     4 	poolDictionaries:''
     5 	category:'Interface-Smalltalk'
     5 	category:'Interface-Smalltalk'
     6 !
     6 !
     7 
     7 
     8 TreeItem subclass:#ProjectTreeItem
     8 TreeItemWithImage subclass:#ProjectTreeItem
     9 	instanceVariableNames:'action'
     9 	instanceVariableNames:'action spec'
    10 	classVariableNames:''
    10 	classVariableNames:''
    11 	poolDictionaries:''
    11 	poolDictionaries:''
    12 	privateIn:ProjectBrowser
    12 	privateIn:ProjectBrowser
    13 !
    13 !
    14 
    14 
    17 	classVariableNames:''
    17 	classVariableNames:''
    18 	poolDictionaries:''
    18 	poolDictionaries:''
    19 	privateIn:ProjectBrowser
    19 	privateIn:ProjectBrowser
    20 !
    20 !
    21 
    21 
       
    22 
       
    23 !ProjectBrowser class methodsFor:'image specs'!
       
    24 
       
    25 classesIcon
       
    26     "This resource specification was automatically generated
       
    27      by the ImageEditor of ST/X."
       
    28 
       
    29     "Do not manually edit this!! If it is corrupted,
       
    30      the ImageEditor may not be able to read the specification."
       
    31 
       
    32     "
       
    33      self classesIcon inspect
       
    34      ImageEditor openOnClass:self andSelector:#classesIcon
       
    35     "
       
    36 
       
    37     <resource: #image>
       
    38 
       
    39     ^Icon
       
    40         constantNamed:#'ProjectBrowser classesIcon'
       
    41         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@ADA@AD"H"DPDPD@@@@@@@@@@P@QDQDQDA@A@AH"H"HPD@@@DQDQDQ@PD@@@@@@@@A@P@ADQDQDPDA@@DRH"HQ@PD@@QDQDQDA@P@ADQDQDPDA@@@@@@@@@PD@DPDQDQDQ@P@Q@@@@@@@A@ADQ@QDQDQD@DQD@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 132 130 132]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'?>C?8O?8??#??/?>??;??/?>??;??/?>O?8?? ?>C?8b') ; yourself); yourself]!
       
    42 
       
    43 commentIcon
       
    44     "This resource specification was automatically generated
       
    45      by the ImageEditor of ST/X."
       
    46 
       
    47     "Do not manually edit this!! If it is corrupted,
       
    48      the ImageEditor may not be able to read the specification."
       
    49 
       
    50     "
       
    51      self commentIcon inspect
       
    52      ImageEditor openOnClass:self andSelector:#commentIcon
       
    53     "
       
    54 
       
    55     <resource: #image>
       
    56 
       
    57     ^Icon
       
    58         constantNamed:#'ProjectBrowser commentIcon'
       
    59         ifAbsentPut:[(Depth8Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDAA@PD@PDA@PDA@PDA@PDA@PPDA@DA@PDA@PDA@PDA@PDDA@PA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PDA@PPDA@DA@PDA@PDA@PDA@P@DA@P@@PDA@PDA@PDA@PD@A@PD@@DA@PDA@PDA@PDA@@PDA@@A@PDA@PDA@PDA@P@DA@P@@PDA@PDA@PDA@PD@A@PD@@DA@PDA@PDA@PDA@@PDA@@A@PDA@PDA@PDA@PD@@@@A@PDA@PDA@PDA@PDA@PD@@PDA@PDA@P@a') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0 0 0 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@8@C @N@@@@C @N@@8@C @N@@8@C @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; yourself); yourself]!
       
    60 
       
    61 deploymentIcon
       
    62     "This resource specification was automatically generated
       
    63      by the ImageEditor of ST/X."
       
    64 
       
    65     "Do not manually edit this!! If it is corrupted,
       
    66      the ImageEditor may not be able to read the specification."
       
    67 
       
    68     "
       
    69      self deploymentIcon inspect
       
    70      ImageEditor openOnClass:self andSelector:#deploymentIcon
       
    71     "
       
    72 
       
    73     <resource: #image>
       
    74 
       
    75     ^Icon
       
    76         constantNamed:#'ProjectBrowser deploymentIcon'
       
    77         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@CL0@3L0@@@CL3@3@3@@@CL@LC@CL@@@L0@0LCL0@@@CMCP3MD@@@@L3L3L3M@@@ADP3QD@4@@@@@3@@ACP@@DQCMDPDM@@@QDL4Q@P4@@ADP3QDACP@@DQCMDPDM@@@QDL4Q@P0@@ADP3QDAC@@@DQCMDP@@@@@@@L0@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 132 132 0 0 132 0 132 255 255 0]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'A30O[A%LF?<O?0??G?<??3??O?<??3??O?8??C?8O?@b') ; yourself); yourself]!
       
    78 
       
    79 filesIcon
       
    80     "This resource specification was automatically generated
       
    81      by the ImageEditor of ST/X."
       
    82 
       
    83     "Do not manually edit this!! If it is corrupted,
       
    84      the ImageEditor may not be able to read the specification."
       
    85 
       
    86     "
       
    87      self filesIcon inspect
       
    88      ImageEditor openOnClass:self andSelector:#filesIcon
       
    89     "
       
    90 
       
    91     <resource: #image>
       
    92 
       
    93     ^Icon
       
    94         constantNamed:#'ProjectBrowser filesIcon'
       
    95         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@DQDQ@P@@@@@P@@@@@@@@@A@QDQDA@@@@DA@@@@@@@@@PDADQDPD@@A@PDQDQ@Q@@DA@QDQD@@@@PDADQDQDQ@A@PDQDQDQD@@A@QDQDQDP@@DADQDQDQ@@@@DQDQDQD@@@@QDQDQDP@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@C? O?@?>C?<O?8??3??/??????????O?<??0??C?<b') ; yourself); yourself]!
       
    96 
       
    97 methodsIcon
       
    98     "This resource specification was automatically generated
       
    99      by the ImageEditor of ST/X."
       
   100 
       
   101     "Do not manually edit this!! If it is corrupted,
       
   102      the ImageEditor may not be able to read the specification."
       
   103 
       
   104     "
       
   105      self multipleUnlockedMagentaIcon inspect
       
   106      ImageEditor openOnClass:self andSelector:#multipleUnlockedMagentaIcon
       
   107     "
       
   108 
       
   109     <resource: #image>
       
   110 
       
   111     ^Icon
       
   112         constantNamed:#'ProjectBrowser methodsIcon'
       
   113         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@DH@@@@@@@@4QA@@@@@@@TQDPP@@@@@@MDQDH@@@@@@PQDQA@@@@@@LTQA@@@@@@M@I@L@@@@@EDPQD@@@@@@CQDIB@@@@@@DDQDPP@@@@@CEDPP@@@@@@@BPC@@@@@@@@DQ@@@@@@@@@B@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 132 132 0 0 132 0 132 255 0 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'B@@\@C8@_0A? C?@G<@? G<@_8@?0A?@C8@G@@H@@@@b') ; yourself); yourself]
       
   114 
       
   115 
       
   116 ! !
    22 
   117 
    23 !ProjectBrowser class methodsFor:'interface specs'!
   118 !ProjectBrowser class methodsFor:'interface specs'!
    24 
   119 
    25 emptyRightCanvasSpec
   120 emptyRightCanvasSpec
    26     "This resource specification was automatically generated
   121     "This resource specification was automatically generated
   242                     #hasVerticalScrollBar: true
   337                     #hasVerticalScrollBar: true
   243                     #dataList: #patchesList
   338                     #dataList: #patchesList
   244                     #has3Dsepartors: false
   339                     #has3Dsepartors: false
   245                     #columnHolder: #patchesTableColumns
   340                     #columnHolder: #patchesTableColumns
   246                     #columnAdaptor: #classTableAdaptor
   341                     #columnAdaptor: #classTableAdaptor
       
   342                 )
       
   343               )
       
   344           )
       
   345       )
       
   346 !
       
   347 
       
   348 rightCanvasSpecForProperties
       
   349     "This resource specification was automatically generated
       
   350      by the UIPainter of ST/X."
       
   351 
       
   352     "Do not manually edit this!! If it is corrupted,
       
   353      the UIPainter may not be able to read the specification."
       
   354 
       
   355     "
       
   356      UIPainter new openOnClass:ProjectBrowser andSelector:#rightCanvasSpecForProperties
       
   357      ProjectBrowser new openInterface:#rightCanvasSpecForProperties
       
   358     "
       
   359 
       
   360     <resource: #canvas>
       
   361 
       
   362     ^
       
   363      
       
   364        #(#FullSpec
       
   365           #name: #rightCanvasSpecForProperties
       
   366           #window: 
       
   367            #(#WindowSpec
       
   368               #name: 'NewApplication'
       
   369               #layout: #(#LayoutFrame 170 0 122 0 469 0 421 0)
       
   370               #level: 0
       
   371               #label: 'NewApplication'
       
   372               #min: #(#Point 10 10)
       
   373               #max: #(#Point 1280 1024)
       
   374               #bounds: #(#Rectangle 170 122 470 422)
       
   375               #usePreferredExtent: false
       
   376               #returnIsOKInDialog: true
       
   377               #escapeIsCancelInDialog: true
       
   378           )
       
   379           #component: 
       
   380            #(#SpecCollection
       
   381               #collection: 
       
   382                #(
       
   383                  #(#HorizontalPanelViewSpec
       
   384                     #name: 'HorizontalPanel1'
       
   385                     #layout: #(#LayoutFrame 0 0 -30 1 0 1 0 1)
       
   386                     #component: 
       
   387                      #(#SpecCollection
       
   388                         #collection: 
       
   389                          #(
       
   390                            #(#ActionButtonSpec
       
   391                               #name: 'Button1'
       
   392                               #label: 'Cancel'
       
   393                               #translateLabel: true
       
   394                               #model: #cancel
       
   395                               #extent: #(#Point 145 22)
       
   396                           )
       
   397                            #(#ActionButtonSpec
       
   398                               #name: 'Button2'
       
   399                               #label: 'OK'
       
   400                               #translateLabel: true
       
   401                               #model: #accept
       
   402                               #extent: #(#Point 146 22)
       
   403                           )
       
   404                         )
       
   405                     )
       
   406                     #horizontalLayout: #fitSpace
       
   407                     #verticalLayout: #center
       
   408                     #horizontalSpace: 3
       
   409                     #verticalSpace: 3
       
   410                 )
       
   411                  #(#FramedBoxSpec
       
   412                     #name: 'FramedBox1'
       
   413                     #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 93 0)
       
   414                     #component: 
       
   415                      #(#SpecCollection
       
   416                         #collection: 
       
   417                          #(
       
   418                            #(#RadioButtonSpec
       
   419                               #name: 'RadioButton1'
       
   420                               #layout: #(#LayoutFrame -1 0.0 10 0 135 0 32 0)
       
   421                               #label: 'Application'
       
   422                               #translateLabel: true
       
   423                               #model: #projectType
       
   424                               #isTriggerOnDown: true
       
   425                               #lampColor: #(#Color 100.0 100.0 0.0)
       
   426                               #select: #application
       
   427                           )
       
   428                            #(#RadioButtonSpec
       
   429                               #name: 'RadioButton2'
       
   430                               #layout: #(#LayoutFrame -1 0.0 38 0 135 0 60 0)
       
   431                               #label: 'Class Library'
       
   432                               #translateLabel: true
       
   433                               #model: #projectType
       
   434                               #isTriggerOnDown: true
       
   435                               #lampColor: #(#Color 100.0 100.0 0.0)
       
   436                               #select: #classLibrary
       
   437                           )
       
   438                         )
       
   439                     )
       
   440                     #label: 'Project Type'
       
   441                     #labelPosition: #topLeft
       
   442                     #translateLabel: true
       
   443                 )
       
   444                  #(#FramedBoxSpec
       
   445                     #name: 'FramedBox2'
       
   446                     #layout: #(#LayoutFrame 0 0.0 94 0.0 0 1.0 159 0)
       
   447                     #component: 
       
   448                      #(#SpecCollection
       
   449                         #collection: 
       
   450                          #(
       
   451                            #(#InputFieldSpec
       
   452                               #name: 'EntryField1'
       
   453                               #layout: #(#LayoutFrame 0 0.0 4 0 0 1.0 26 0)
       
   454                               #model: #projectDirectory
       
   455                               #isReadOnly: true
       
   456                           )
       
   457                         )
       
   458                     )
       
   459                     #label: 'Directory'
       
   460                     #labelPosition: #topLeft
       
   461                     #translateLabel: true
   247                 )
   462                 )
   248               )
   463               )
   249           )
   464           )
   250       )
   465       )
   251 !
   466 !
   444                 #submenu: 
   659                 #submenu: 
   445                  #(#Menu
   660                  #(#Menu
   446                     
   661                     
   447                      #(
   662                      #(
   448                        #(#MenuItem
   663                        #(#MenuItem
   449                           #label: 'New'
   664                           #label: 'Load From...'
   450                           #translateLabel: true
       
   451                           #value: #newProject
       
   452                       )
       
   453                        #(#MenuItem
       
   454                           #label: '-'
       
   455                       )
       
   456                        #(#MenuItem
       
   457                           #label: 'Open...'
       
   458                           #translateLabel: true
   665                           #translateLabel: true
   459                           #value: #openProject
   666                           #value: #openProject
   460                       )
   667                       )
   461                        #(#MenuItem
   668                        #(#MenuItem
   462                           #label: '-'
   669                           #label: '-'
   563           ) nil
   770           ) nil
   564           nil
   771           nil
   565       )
   772       )
   566 !
   773 !
   567 
   774 
   568 projectItemMenu
   775 noItemMenu
   569     "This resource specification was automatically generated
   776     "This resource specification was automatically generated
   570      by the MenuEditor of ST/X."
   777      by the MenuEditor of ST/X."
   571 
   778 
   572     "Do not manually edit this!! If it is corrupted,
   779     "Do not manually edit this!! If it is corrupted,
   573      the MenuEditor may not be able to read the specification."
   780      the MenuEditor may not be able to read the specification."
   583      
   790      
   584        #(#Menu
   791        #(#Menu
   585           
   792           
   586            #(
   793            #(
   587              #(#MenuItem
   794              #(#MenuItem
       
   795                 #label: 'New Project'
       
   796                 #translateLabel: true
       
   797                 #value: #newProject
       
   798             )
       
   799           ) nil
       
   800           nil
       
   801       )
       
   802 !
       
   803 
       
   804 projectItemMenu
       
   805     "This resource specification was automatically generated
       
   806      by the MenuEditor of ST/X."
       
   807 
       
   808     "Do not manually edit this!! If it is corrupted,
       
   809      the MenuEditor may not be able to read the specification."
       
   810 
       
   811     "
       
   812      MenuEditor new openOnClass:ProjectBrowser andSelector:#projectItemMenu
       
   813      (Menu new fromLiteralArrayEncoding:(ProjectBrowser projectItemMenu)) startUp
       
   814     "
       
   815 
       
   816     <resource: #menu>
       
   817 
       
   818     ^
       
   819      
       
   820        #(#Menu
       
   821           
       
   822            #(
       
   823              #(#MenuItem
       
   824                 #label: 'Make Current'
       
   825                 #translateLabel: true
       
   826                 #value: #makeCurrentProject
       
   827                 #enabled: #hasProjectSelectedHolder
       
   828             )
       
   829              #(#MenuItem
       
   830                 #label: '-'
       
   831             )
       
   832              #(#MenuItem
       
   833                 #label: 'New Project'
       
   834                 #translateLabel: true
       
   835                 #value: #newProject
       
   836             )
       
   837              #(#MenuItem
       
   838                 #label: 'New SubProject'
       
   839                 #translateLabel: true
       
   840                 #value: #newSubProject
       
   841                 #enabled: #hasProjectSelectedHolder
       
   842             )
       
   843              #(#MenuItem
       
   844                 #label: '-'
       
   845             )
       
   846              #(#MenuItem
   588                 #label: 'Rename...'
   847                 #label: 'Rename...'
   589                 #translateLabel: true
   848                 #translateLabel: true
   590                 #value: #renameProject
   849                 #value: #renameProject
   591                 #enabled: #hasProjectSelectedHolder
       
   592             )
       
   593              #(#MenuItem
       
   594                 #label: '-'
       
   595             )
       
   596              #(#MenuItem
       
   597                 #label: 'New SubProject'
       
   598                 #translateLabel: true
       
   599                 #value: #newSubProject
       
   600                 #enabled: #hasProjectSelectedHolder
   850                 #enabled: #hasProjectSelectedHolder
   601             )
   851             )
   602              #(#MenuItem
   852              #(#MenuItem
   603                 #label: '-'
   853                 #label: '-'
   604             )
   854             )
   847     self setupCanvasForNoSelection.
  1097     self setupCanvasForNoSelection.
   848     ^ super postBuildWith:aBuiler
  1098     ^ super postBuildWith:aBuiler
   849 !
  1099 !
   850 
  1100 
   851 setupCanvasForNoSelection
  1101 setupCanvasForNoSelection
   852     self showReadOnlyText:'Please select an existing,
  1102     self 
       
  1103         showReadOnlyText:'Please select an existing project,
       
  1104 load one from a (''.prj'')-file,
   853 or create a new project.'.
  1105 or create a new project.'.
   854 ! !
  1106 ! !
   855 
  1107 
   856 !ProjectBrowser methodsFor:'menus'!
  1108 !ProjectBrowser methodsFor:'menus'!
   857 
  1109 
   865         ^ self class subProjectsItemMenu
  1117         ^ self class subProjectsItemMenu
   866     ].      
  1118     ].      
   867     self hasClassesNodeSelected ifTrue:[
  1119     self hasClassesNodeSelected ifTrue:[
   868         ^ self class classesItemMenu
  1120         ^ self class classesItemMenu
   869     ].      
  1121     ].      
   870 
  1122     ^ self class noItemMenu
   871     ^ nil
       
   872 !
  1123 !
   873 
  1124 
   874 itemMenuHolder
  1125 itemMenuHolder
   875     ^ [ self itemMenu]
  1126     ^ [ self itemMenu]
   876 !
  1127 !
   915     "generate and return a treeNode for some project"
  1166     "generate and return a treeNode for some project"
   916 
  1167 
   917     |projectName pNode 
  1168     |projectName pNode 
   918      propertiesNode docNode classesNode patchesNode subprojectsNode filesNode
  1169      propertiesNode docNode classesNode patchesNode subprojectsNode filesNode
   919      commentNode prerequisitesNode analysisNode designNode codeNode
  1170      commentNode prerequisitesNode analysisNode designNode codeNode
   920      userDocNode userOverViewNode userGuideNode userRefManNode|
  1171      userDocNode userOverViewNode userGuideNode userRefManNode
       
  1172      deploymentNode|
   921 
  1173 
   922     projectName := aProject name.
  1174     projectName := aProject name.
   923     pNode := ProjectNode name:projectName.
  1175     pNode := ProjectNode name:projectName.
   924     pNode contents:aProject.
  1176     pNode contents:aProject.
   925 
  1177 
   926     pNode add:(commentNode := ProjectTreeItem name:'Comment').
  1178     pNode add:(commentNode := ProjectTreeItem name:'Comment').
   927     pNode add:(docNode := ProjectTreeItem name:'Documentation').
  1179 "/    pNode add:(docNode := ProjectTreeItem name:'Documentation').
   928     pNode add:(propertiesNode := ProjectTreeItem name:'Properties').
  1180     pNode add:(propertiesNode := ProjectTreeItem name:'Properties').
   929     pNode add:(prerequisitesNode := ProjectTreeItem name:'Prerequisites').
  1181     pNode add:(prerequisitesNode := ProjectTreeItem name:'Prerequisites').
   930     pNode add:(subprojectsNode := ProjectTreeItem name:'SubProjects').
  1182 "/    pNode add:(subprojectsNode := ProjectTreeItem name:'SubProjects').
   931     pNode add:(classesNode := ProjectTreeItem name:'Classes').
  1183     pNode add:(classesNode := ProjectTreeItem name:'Classes').
   932     pNode add:(patchesNode := ProjectTreeItem name:'Patches').
  1184     pNode add:(patchesNode := ProjectTreeItem name:'Patches').
   933     pNode add:(filesNode := ProjectTreeItem name:'Files').
  1185     pNode add:(filesNode := ProjectTreeItem name:'Files').
   934 
  1186     pNode add:(deploymentNode := ProjectTreeItem name:'Deployment').
   935     aProject subProjects do:[:aSubProject |
  1187 
   936         subprojectsNode add:(self nodeFor:aSubProject)
  1188     subprojectsNode notNil ifTrue:[
   937     ].
  1189         subprojectsNode contents:#subprojects.
   938 
  1190         aProject subProjects do:[:aSubProject |
       
  1191             subprojectsNode add:(self nodeFor:aSubProject)
       
  1192         ].
       
  1193     ].
       
  1194 
       
  1195     commentNode icon:(self class commentIcon).
   939     commentNode action:[:item | self showCommentOf:item].
  1196     commentNode action:[:item | self showCommentOf:item].
   940     commentNode contents:#comment.
  1197     commentNode contents:#comment.
   941 
  1198 
   942     docNode contents:#documentation.
  1199     docNode notNil ifTrue:[
   943     docNode action:[:item | self showDocumentationFor:item].
  1200         docNode contents:#documentation.
   944 
  1201         docNode action:[:item | self showDocumentationFor:item].
   945     docNode add:(analysisNode := ProjectTreeItem name:'Analysis').
  1202 
   946     docNode add:(designNode := ProjectTreeItem name:'Design').
  1203         docNode add:(analysisNode := ProjectTreeItem name:'Analysis').
   947     docNode add:(codeNode := ProjectTreeItem name:'Code').
  1204         docNode add:(designNode := ProjectTreeItem name:'Design').
   948     docNode add:(userDocNode := ProjectTreeItem name:'User Documentation').
  1205         docNode add:(codeNode := ProjectTreeItem name:'Code').
   949     userDocNode add:(userOverViewNode := ProjectTreeItem name:'Overview').
  1206         docNode add:(userDocNode := ProjectTreeItem name:'User Documentation').
   950     userDocNode add:(userGuideNode := ProjectTreeItem name:'Guide').
  1207         userDocNode add:(userOverViewNode := ProjectTreeItem name:'Overview').
   951     userDocNode add:(userRefManNode := ProjectTreeItem name:'Reference').
  1208         userDocNode add:(userGuideNode := ProjectTreeItem name:'Guide').
   952     docNode add:(userDocNode := ProjectTreeItem name:'Error Reports').
  1209         userDocNode add:(userRefManNode := ProjectTreeItem name:'Reference').
   953     docNode add:(userDocNode := ProjectTreeItem name:'Other').
  1210         docNode add:(userDocNode := ProjectTreeItem name:'Error Reports').
       
  1211         docNode add:(userDocNode := ProjectTreeItem name:'Other').
       
  1212     ].
   954 
  1213 
   955     prerequisitesNode contents:#prerequisites.
  1214     prerequisitesNode contents:#prerequisites.
   956 
  1215 
   957     classesNode contents:#classes.
  1216     classesNode contents:#classes.
       
  1217     classesNode icon:(self class classesIcon).
   958     ((aProject classes ? #()) copy sort:[:a :b | a name < b name]) 
  1218     ((aProject classes ? #()) copy sort:[:a :b | a name < b name]) 
   959     do:[:aClass |
  1219     do:[:aClass |
   960         |cNode|
  1220         |cNode|
   961 
  1221 
   962         cNode := ProjectTreeItem name:aClass name.
  1222         cNode := ProjectTreeItem name:aClass name.
   963         classesNode add:cNode.
  1223         classesNode add:cNode.
   964     ].
  1224     ].
   965 
  1225 
   966     propertiesNode contents:#properties.
  1226     propertiesNode contents:#properties.
   967 
  1227     propertiesNode spec:(self class rightCanvasSpecForProperties).
   968     subprojectsNode contents:#subprojects.
       
   969 
  1228 
   970     filesNode contents:#files.
  1229     filesNode contents:#files.
       
  1230     filesNode icon:(self class filesIcon).
   971 
  1231 
   972     patchesNode contents:#patches.
  1232     patchesNode contents:#patches.
       
  1233     patchesNode icon:(self class methodsIcon).
       
  1234 
       
  1235     deploymentNode icon:(self class deploymentIcon).
   973 
  1236 
   974     ^ pNode
  1237     ^ pNode
   975 
  1238 
   976 !
  1239 !
   977 
  1240 
   990 
  1253 
   991     ^ projectTree
  1254     ^ projectTree
   992 !
  1255 !
   993 
  1256 
   994 updateRightCanvas
  1257 updateRightCanvas
   995     |selectedNode nodeContents|
  1258     |selectedNode nodeContents spec|
   996 
  1259 
   997     selectedNode := self selectedTreeNode value.
  1260     selectedNode := self selectedTreeNode value.
   998     selectedNode isNil ifTrue:[
  1261     selectedNode isNil ifTrue:[
   999         self setupCanvasForNoSelection.
  1262         self setupCanvasForNoSelection.
  1000         ^ self
  1263         ^ self
  1001     ].
  1264     ].
  1002 
  1265 
       
  1266     (spec := selectedNode spec) notNil ifTrue:[
       
  1267         self currentCanvasHolder value:spec.
       
  1268         ^ self
       
  1269     ].
       
  1270 
  1003     selectedNode isProjectNode ifTrue:[
  1271     selectedNode isProjectNode ifTrue:[
  1004         self showCommentOf:selectedNode.
  1272         self showCommentOf:selectedNode.
  1005         ^ self.
  1273         ^ self.
  1006     ].
  1274     ].
  1007 
  1275 
  1011     ].
  1279     ].
  1012     selectedNode contents == #patches ifTrue:[
  1280     selectedNode contents == #patches ifTrue:[
  1013         self showPatchesListOf:selectedNode.
  1281         self showPatchesListOf:selectedNode.
  1014         ^ self.
  1282         ^ self.
  1015     ].
  1283     ].
  1016 
       
  1017 
  1284 
  1018     self currentCanvasHolder value:(self class emptyRightCanvasSpec).
  1285     self currentCanvasHolder value:(self class emptyRightCanvasSpec).
  1019     self rightCanvasTextHolder value:''.
  1286     self rightCanvasTextHolder value:''.
  1020 
  1287 
  1021 ! !
  1288 ! !
  1052     item := self projectTreeHolder value at:index.
  1319     item := self projectTreeHolder value at:index.
  1053     action := item action.
  1320     action := item action.
  1054     action notNil ifTrue:[
  1321     action notNil ifTrue:[
  1055         action value:item.
  1322         action value:item.
  1056     ].
  1323     ].
       
  1324 !
       
  1325 
       
  1326 makeCurrentProject
       
  1327     "make the selected Project the current project"
       
  1328 
       
  1329     |project selectedNode|
       
  1330 
       
  1331     self hasProjectNodeSelected ifTrue:[
       
  1332         selectedNode := self selectedTreeNode value.
       
  1333         project := selectedNode contents.
       
  1334 
       
  1335         Project current:project.
       
  1336     ]
  1057 !
  1337 !
  1058 
  1338 
  1059 newProject
  1339 newProject
  1060     self newProject:Project new.
  1340     self newProject:Project new.
  1061 
  1341 
  1119 
  1399 
  1120     self hasProjectNodeSelected ifTrue:[
  1400     self hasProjectNodeSelected ifTrue:[
  1121         selectedNode := self selectedTreeNode value.
  1401         selectedNode := self selectedTreeNode value.
  1122         projectToRemove := selectedNode contents.
  1402         projectToRemove := selectedNode contents.
  1123 
  1403 
  1124 "/        parentNode := selectedNode parent.
  1404         (self confirm:'Really remove the project ?') ifTrue:[
  1125 "/        parentNode contents == #subprojects ifTrue:[
  1405             self projectTreeHolder removeSelection
  1126 "/            parentNode removeChild:selectedNode.
  1406         ]
  1127 "/        ] ifFalse:[
       
  1128 "/            parentNode removeChild:selectedNode.
       
  1129 "/        ].
       
  1130         self projectTreeHolder removeSelection
       
  1131 
       
  1132 "/        self projectTreeHolder root:projectTree.
       
  1133 
       
  1134 "/        parentProject addSubProject:newProject.
       
  1135 "/        subNode := selectedNode children detect:[:child | child contents == #subprojects].
       
  1136 "/        subNode add:newNode.
       
  1137 "/        self projectTreeHolder root:projectTree.
       
  1138     ]
  1407     ]
  1139 !
  1408 !
  1140 
  1409 
  1141 renameProject
  1410 renameProject
  1142     |nm selectedNode selectedProject|
  1411     |nm selectedNode selectedProject|
  1231 
  1500 
  1232 showReadOnlyText:someText
  1501 showReadOnlyText:someText
  1233     self currentCanvasHolder value:(self class rightCanvasSpecForReadOnlyText).
  1502     self currentCanvasHolder value:(self class rightCanvasSpecForReadOnlyText).
  1234     self rightCanvasTextHolder value:someText.
  1503     self rightCanvasTextHolder value:someText.
  1235 
  1504 
  1236 !
       
  1237 
       
  1238 showTreeItem:anItem
       
  1239     anItem contents == #comment ifTrue:[
       
  1240         self showCommentOf:anItem.
       
  1241         ^ self
       
  1242     ].
       
  1243 ! !
  1505 ! !
  1244 
  1506 
  1245 !ProjectBrowser::ProjectTreeItem methodsFor:'accessing'!
  1507 !ProjectBrowser::ProjectTreeItem methodsFor:'accessing'!
  1246 
  1508 
  1247 action
  1509 action
  1250     ^ action!
  1512     ^ action!
  1251 
  1513 
  1252 action:something
  1514 action:something
  1253     "set the value of the instance variable 'action' (automatically generated)"
  1515     "set the value of the instance variable 'action' (automatically generated)"
  1254 
  1516 
  1255     action := something.! !
  1517     action := something.!
       
  1518 
       
  1519 spec
       
  1520     "return the value of the instance variable 'spec' (automatically generated)"
       
  1521 
       
  1522     ^ spec!
       
  1523 
       
  1524 spec:something
       
  1525     "set the value of the instance variable 'spec' (automatically generated)"
       
  1526 
       
  1527     spec := something.! !
  1256 
  1528 
  1257 !ProjectBrowser::ProjectTreeItem methodsFor:'queries'!
  1529 !ProjectBrowser::ProjectTreeItem methodsFor:'queries'!
  1258 
  1530 
  1259 isProjectNode
  1531 isProjectNode
  1260     ^ false
  1532     ^ false