ProjectBrowser.st
changeset 1080 98b04ef482dc
parent 1079 deda6cdfe287
child 1081 b8f1b9924f40
equal deleted inserted replaced
1079:deda6cdfe287 1080:98b04ef482dc
   111     ^Icon
   111     ^Icon
   112         constantNamed:#'ProjectBrowser methodsIcon'
   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]
   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 
   114 
   115 
   115 
       
   116 !
       
   117 
       
   118 prerequisitesIcon
       
   119     "This resource specification was automatically generated
       
   120      by the ImageEditor of ST/X."
       
   121 
       
   122     "Do not manually edit this!! If it is corrupted,
       
   123      the ImageEditor may not be able to read the specification."
       
   124 
       
   125     "
       
   126      self prerequisitesIcon inspect
       
   127      ImageEditor openOnClass:self andSelector:#prerequisitesIcon
       
   128     "
       
   129 
       
   130     <resource: #image>
       
   131 
       
   132     ^Icon
       
   133         constantNamed:#'ProjectBrowser prerequisitesIcon'
       
   134         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@A8@D(@RPA80@C@^@=HRT/)^D$@C7#@RLAI@G(@@@@b') ; yourself); yourself]
       
   135 
       
   136     "Modified: / 23.3.1999 / 14:28:11 / cg"
   116 ! !
   137 ! !
   117 
   138 
   118 !ProjectBrowser class methodsFor:'interface specs'!
   139 !ProjectBrowser class methodsFor:'interface specs'!
   119 
   140 
   120 emptyRightCanvasSpec
   141 emptyRightCanvasSpec
   364        #(#FullSpec
   385        #(#FullSpec
   365           #name: #rightCanvasSpecForProperties
   386           #name: #rightCanvasSpecForProperties
   366           #window: 
   387           #window: 
   367            #(#WindowSpec
   388            #(#WindowSpec
   368               #name: 'NewApplication'
   389               #name: 'NewApplication'
   369               #layout: #(#LayoutFrame 170 0 122 0 469 0 421 0)
   390               #layout: #(#LayoutFrame 134 0 100 0 433 0 399 0)
   370               #level: 0
   391               #level: 0
   371               #label: 'NewApplication'
   392               #label: 'NewApplication'
   372               #min: #(#Point 10 10)
   393               #min: #(#Point 10 10)
   373               #max: #(#Point 1280 1024)
   394               #max: #(#Point 1280 1024)
   374               #bounds: #(#Rectangle 170 122 470 422)
   395               #bounds: #(#Rectangle 134 100 434 400)
   375               #usePreferredExtent: false
   396               #usePreferredExtent: false
   376               #returnIsOKInDialog: true
   397               #returnIsOKInDialog: true
   377               #escapeIsCancelInDialog: true
   398               #escapeIsCancelInDialog: true
   378           )
   399           )
   379           #component: 
   400           #component: 
   420                               #layout: #(#LayoutFrame -1 0.0 10 0 135 0 32 0)
   441                               #layout: #(#LayoutFrame -1 0.0 10 0 135 0 32 0)
   421                               #label: 'Application'
   442                               #label: 'Application'
   422                               #translateLabel: true
   443                               #translateLabel: true
   423                               #model: #projectType
   444                               #model: #projectType
   424                               #isTriggerOnDown: true
   445                               #isTriggerOnDown: true
   425                               #lampColor: #(#Color 100.0 100.0 0.0)
       
   426                               #select: #application
   446                               #select: #application
   427                           )
   447                           )
   428                            #(#RadioButtonSpec
   448                            #(#RadioButtonSpec
   429                               #name: 'RadioButton2'
   449                               #name: 'RadioButton2'
   430                               #layout: #(#LayoutFrame -1 0.0 38 0 135 0 60 0)
   450                               #layout: #(#LayoutFrame -1 0.0 38 0 135 0 60 0)
   431                               #label: 'Class Library'
   451                               #label: 'Class Library'
   432                               #translateLabel: true
   452                               #translateLabel: true
   433                               #model: #projectType
   453                               #model: #projectType
   434                               #isTriggerOnDown: true
   454                               #isTriggerOnDown: true
   435                               #lampColor: #(#Color 100.0 100.0 0.0)
   455                               #select: #library
   436                               #select: #classLibrary
       
   437                           )
   456                           )
   438                         )
   457                         )
   439                     )
   458                     )
   440                     #label: 'Project Type'
   459                     #label: 'Project Type'
   441                     #labelPosition: #topLeft
   460                     #labelPosition: #topLeft
   449                         #collection: 
   468                         #collection: 
   450                          #(
   469                          #(
   451                            #(#InputFieldSpec
   470                            #(#InputFieldSpec
   452                               #name: 'EntryField1'
   471                               #name: 'EntryField1'
   453                               #layout: #(#LayoutFrame 0 0.0 4 0 0 1.0 26 0)
   472                               #layout: #(#LayoutFrame 0 0.0 4 0 0 1.0 26 0)
       
   473                               #enableChannel: #currentProjectWasNotLoadedFromFile
   454                               #model: #projectDirectory
   474                               #model: #projectDirectory
   455                               #isReadOnly: true
       
   456                           )
   475                           )
   457                         )
   476                         )
   458                     )
   477                     )
   459                     #label: 'Directory'
   478                     #label: 'Directory'
   460                     #labelPosition: #topLeft
   479                     #labelPosition: #topLeft
   461                     #translateLabel: true
   480                     #translateLabel: true
   462                 )
   481                 )
   463               )
   482               )
   464           )
   483           )
   465       )
   484       )
       
   485 
       
   486     "Modified: / 23.3.1999 / 14:20:32 / cg"
   466 !
   487 !
   467 
   488 
   468 rightCanvasSpecForReadOnlyText
   489 rightCanvasSpecForReadOnlyText
   469     "This resource specification was automatically generated
   490     "This resource specification was automatically generated
   470      by the UIPainter of ST/X."
   491      by the UIPainter of ST/X."
  1001         builder aspectAt:#currentCanvasHolder put:(holder :=  ValueHolder new).
  1022         builder aspectAt:#currentCanvasHolder put:(holder :=  ValueHolder new).
  1002     ].
  1023     ].
  1003     ^ holder.
  1024     ^ holder.
  1004 !
  1025 !
  1005 
  1026 
       
  1027 currentProjectWasNotLoadedFromFile
       
  1028     "automatically generated by UIPainter ..."
       
  1029 
       
  1030     "*** the code below creates a default model when invoked."
       
  1031     "*** (which may not be the one you wanted)"
       
  1032     "*** Please change as required and accept in the browser."
       
  1033 
       
  1034     |holder|
       
  1035 
       
  1036     (holder := builder bindingAt:#currentProjectWasNotLoadedFromFile) isNil ifTrue:[
       
  1037         builder aspectAt:#currentProjectWasNotLoadedFromFile put:(holder :=  ValueHolder new).
       
  1038     ].
       
  1039     ^ holder.
       
  1040 
       
  1041     "Created: / 23.3.1999 / 14:01:09 / cg"
       
  1042 !
       
  1043 
  1006 hasProjectSelectedHolder
  1044 hasProjectSelectedHolder
  1007     ^ [
  1045     ^ [
  1008         self hasProjectNodeSelected
  1046         self hasProjectNodeSelected
  1009       ]
  1047       ]
  1010 !
  1048 !
  1057     (holder := builder bindingAt:#projectTree) isNil ifTrue:[
  1095     (holder := builder bindingAt:#projectTree) isNil ifTrue:[
  1058         builder aspectAt:#projectTree put:(holder :=  SelectionInTree new).
  1096         builder aspectAt:#projectTree put:(holder :=  SelectionInTree new).
  1059         holder root:self projectTree.
  1097         holder root:self projectTree.
  1060     ].
  1098     ].
  1061     ^ holder.
  1099     ^ holder.
       
  1100 !
       
  1101 
       
  1102 projectType
       
  1103     "automatically generated by UIPainter ..."
       
  1104 
       
  1105     "*** the code below creates a default model when invoked."
       
  1106     "*** (which may not be the one you wanted)"
       
  1107     "*** Please change as required and accept in the browser."
       
  1108 
       
  1109     |holder|
       
  1110 
       
  1111     (holder := builder bindingAt:#projectType) isNil ifTrue:[
       
  1112         builder aspectAt:#projectType put:(holder :=  ValueHolder new).
       
  1113     ].
       
  1114     ^ holder.
       
  1115 
       
  1116     "Created: / 23.3.1999 / 14:18:05 / cg"
  1062 !
  1117 !
  1063 
  1118 
  1064 rightCanvasTextHolder
  1119 rightCanvasTextHolder
  1065     "automatically generated by UIPainter ..."
  1120     "automatically generated by UIPainter ..."
  1066 
  1121 
  1210         docNode add:(userDocNode := ProjectTreeItem name:'Error Reports').
  1265         docNode add:(userDocNode := ProjectTreeItem name:'Error Reports').
  1211         docNode add:(userDocNode := ProjectTreeItem name:'Other').
  1266         docNode add:(userDocNode := ProjectTreeItem name:'Other').
  1212     ].
  1267     ].
  1213 
  1268 
  1214     prerequisitesNode contents:#prerequisites.
  1269     prerequisitesNode contents:#prerequisites.
       
  1270     prerequisitesNode icon:(self class prerequisitesIcon).
  1215 
  1271 
  1216     classesNode contents:#classes.
  1272     classesNode contents:#classes.
  1217     classesNode icon:(self class classesIcon).
  1273     classesNode icon:(self class classesIcon).
  1218     ((aProject classes ? #()) copy sort:[:a :b | a name < b name]) 
  1274     ((aProject classes ? #()) copy sort:[:a :b | a name < b name]) 
  1219     do:[:aClass |
  1275     do:[:aClass |
  1234 
  1290 
  1235     deploymentNode icon:(self class deploymentIcon).
  1291     deploymentNode icon:(self class deploymentIcon).
  1236 
  1292 
  1237     ^ pNode
  1293     ^ pNode
  1238 
  1294 
       
  1295     "Modified: / 23.3.1999 / 14:27:30 / cg"
  1239 !
  1296 !
  1240 
  1297 
  1241 projectTree
  1298 projectTree
  1242     |tree root|
  1299     |tree root|
  1243 
  1300 
  1252     ].
  1309     ].
  1253 
  1310 
  1254     ^ projectTree
  1311     ^ projectTree
  1255 !
  1312 !
  1256 
  1313 
       
  1314 readAspectsForProject
       
  1315     |p selectedNode|
       
  1316 
       
  1317     self hasProjectNodeSelected ifTrue:[
       
  1318         selectedNode := self selectedTreeNode value.
       
  1319 
       
  1320         p := selectedNode contents.
       
  1321 
       
  1322         self currentProjectWasNotLoadedFromFile value:p wasLoadedFromFile not.
       
  1323         self projectType value:(p type).
       
  1324     ].
       
  1325 
       
  1326     "Created: / 23.3.1999 / 14:16:12 / cg"
       
  1327     "Modified: / 23.3.1999 / 14:18:38 / cg"
       
  1328 !
       
  1329 
  1257 updateRightCanvas
  1330 updateRightCanvas
  1258     |selectedNode nodeContents spec|
  1331     |selectedNode nodeContents spec|
  1259 
  1332 
  1260     selectedNode := self selectedTreeNode value.
  1333     selectedNode := self selectedTreeNode value.
  1261     selectedNode isNil ifTrue:[
  1334     selectedNode isNil ifTrue:[
  1267         self currentCanvasHolder value:spec.
  1340         self currentCanvasHolder value:spec.
  1268         ^ self
  1341         ^ self
  1269     ].
  1342     ].
  1270 
  1343 
  1271     selectedNode isProjectNode ifTrue:[
  1344     selectedNode isProjectNode ifTrue:[
       
  1345         self readAspectsForProject.
  1272         self showCommentOf:selectedNode.
  1346         self showCommentOf:selectedNode.
  1273         ^ self.
  1347         ^ self.
  1274     ].
  1348     ].
  1275 
  1349 
  1276     selectedNode contents == #classes ifTrue:[
  1350     selectedNode contents == #classes ifTrue:[
  1283     ].
  1357     ].
  1284 
  1358 
  1285     self currentCanvasHolder value:(self class emptyRightCanvasSpec).
  1359     self currentCanvasHolder value:(self class emptyRightCanvasSpec).
  1286     self rightCanvasTextHolder value:''.
  1360     self rightCanvasTextHolder value:''.
  1287 
  1361 
       
  1362     "Modified: / 23.3.1999 / 14:16:02 / cg"
  1288 ! !
  1363 ! !
  1289 
  1364 
  1290 !ProjectBrowser methodsFor:'private - table col access'!
  1365 !ProjectBrowser methodsFor:'private - table col access'!
  1291 
  1366 
  1292 classFilenameFromClassInfo:cInfo
  1367 classFilenameFromClassInfo:cInfo