diff -r 98b04ef482dc -r b8f1b9924f40 ProjectBrowser.st --- a/ProjectBrowser.st Tue Mar 23 14:20:40 1999 +0100 +++ b/ProjectBrowser.st Tue Mar 23 19:57:33 1999 +0100 @@ -1,5 +1,5 @@ ToolApplicationModel subclass:#ProjectBrowser - instanceVariableNames:'projectTree' + instanceVariableNames:'projectTree modifiedChannel' classVariableNames:'' poolDictionaries:'' category:'Interface-Smalltalk' @@ -230,6 +230,129 @@ ) ! +rightCanvasSpecForDeployment + "This resource specification was automatically generated + by the UIPainter of ST/X." + + "Do not manually edit this!! If it is corrupted, + the UIPainter may not be able to read the specification." + + " + UIPainter new openOnClass:ProjectBrowser andSelector:#rightCanvasSpecForDeployment + ProjectBrowser new openInterface:#rightCanvasSpecForDeployment + " + + + + ^ + + #(#FullSpec + #name: #rightCanvasSpecForDeployment + #window: + #(#WindowSpec + #name: 'NewApplication' + #layout: #(#LayoutFrame 216 0 173 0 515 0 472 0) + #level: 0 + #label: 'NewApplication' + #min: #(#Point 10 10) + #max: #(#Point 1280 1024) + #bounds: #(#Rectangle 216 173 516 473) + #usePreferredExtent: false + #returnIsOKInDialog: true + #escapeIsCancelInDialog: true + ) + #component: + #(#SpecCollection + #collection: + #( + #(#HorizontalPanelViewSpec + #name: 'HorizontalPanel1' + #layout: #(#LayoutFrame 0 0 -30 1 0 1 0 1) + #component: + #(#SpecCollection + #collection: + #( + #(#ActionButtonSpec + #name: 'Button1' + #label: 'Cancel' + #translateLabel: true + #model: #cancel + #enableChannel: #modifiedChannel + #extent: #(#Point 145 22) + ) + #(#ActionButtonSpec + #name: 'Button2' + #label: 'OK' + #translateLabel: true + #model: #accept + #enableChannel: #modifiedChannel + #extent: #(#Point 146 22) + ) + ) + ) + #horizontalLayout: #fitSpace + #verticalLayout: #center + #horizontalSpace: 3 + #verticalSpace: 3 + ) + #(#FramedBoxSpec + #name: 'FramedBox1' + #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 124 0) + #component: + #(#SpecCollection + #collection: + #( + #(#CheckBoxSpec + #name: 'CheckBox1' + #layout: #(#LayoutFrame 0 0.0 10 0 0 1.0 32 0) + #model: #deliverCompiledBinary + #label: 'Compiled Binary' + #translateLabel: true + ) + #(#CheckBoxSpec + #name: 'CheckBox2' + #layout: #(#LayoutFrame 0 0.0 38 0 0 1.0 60 0) + #model: #deliverZipArchive + #label: 'Zip Archive' + #translateLabel: true + ) + #(#CheckBoxSpec + #name: 'CheckBox3' + #layout: #(#LayoutFrame 0 0.0 66 0 0 1.0 88 0) + #model: #deliverSources + #label: 'Sources' + #translateLabel: true + ) + ) + ) + #label: 'Delivery' + #labelPosition: #topLeft + #translateLabel: true + ) + #(#FramedBoxSpec + #name: 'FramedBox2' + #layout: #(#LayoutFrame 0 0.0 125 0 0 1.0 190 0) + #component: + #(#SpecCollection + #collection: + #( + #(#InputFieldSpec + #name: 'EntryField1' + #layout: #(#LayoutFrame 0 0.0 5 0 0 1.0 27 0) + #model: #installDirectory + #modifiedChannel: #modifiedChannel + ) + ) + ) + #label: 'Install Directory' + #labelPosition: #topLeft + #translateLabel: true + ) + ) + ) + ) +! + rightCanvasSpecForEditableText "This resource specification was automatically generated by the UIPainter of ST/X." @@ -387,12 +510,12 @@ #window: #(#WindowSpec #name: 'NewApplication' - #layout: #(#LayoutFrame 134 0 100 0 433 0 399 0) + #layout: #(#LayoutFrame 216 0 173 0 515 0 472 0) #level: 0 #label: 'NewApplication' #min: #(#Point 10 10) #max: #(#Point 1280 1024) - #bounds: #(#Rectangle 134 100 434 400) + #bounds: #(#Rectangle 216 173 516 473) #usePreferredExtent: false #returnIsOKInDialog: true #escapeIsCancelInDialog: true @@ -413,6 +536,7 @@ #label: 'Cancel' #translateLabel: true #model: #cancel + #enableChannel: #modifiedChannel #extent: #(#Point 145 22) ) #(#ActionButtonSpec @@ -420,6 +544,7 @@ #label: 'OK' #translateLabel: true #model: #accept + #enableChannel: #modifiedChannel #extent: #(#Point 146 22) ) ) @@ -472,6 +597,7 @@ #layout: #(#LayoutFrame 0 0.0 4 0 0 1.0 26 0) #enableChannel: #currentProjectWasNotLoadedFromFile #model: #projectDirectory + #modifiedChannel: #modifiedChannel ) ) ) @@ -482,8 +608,6 @@ ) ) ) - - "Modified: / 23.3.1999 / 14:20:32 / cg" ! rightCanvasSpecForReadOnlyText @@ -549,6 +673,7 @@ ^ #(#FullSpec + #name: #windowSpec #window: #(#WindowSpec #name: 'ProjectBrowser' @@ -560,6 +685,8 @@ #bounds: #(#Rectangle 216 173 780 496) #menu: #mainMenu #usePreferredExtent: false + #returnIsOKInDialog: true + #escapeIsCancelInDialog: true ) #component: #(#SpecCollection @@ -591,6 +718,7 @@ #showDirectoryIndicator: true #valueChangeSelector: #itemSelected: #hierarchicalList: #projectTreeHolder + #selectConditionSelector: #selectionChangeAllowed #highlightMode: #label ) #(#SubCanvasSpec @@ -1041,6 +1169,60 @@ "Created: / 23.3.1999 / 14:01:09 / cg" ! +deliverCompiledBinary + "automatically generated by UIPainter ..." + + "*** the code below creates a default model when invoked." + "*** (which may not be the one you wanted)" + "*** Please change as required and accept in the browser." + + |holder| + + (holder := builder bindingAt:#deliverCompiledBinary) isNil ifTrue:[ + builder aspectAt:#deliverCompiledBinary put:(holder := ValueHolder new). + holder onChangeSend:#value to:[modifiedChannel value:true]. + ]. + ^ holder. + + "Created: / 23.3.1999 / 14:18:05 / cg" +! + +deliverSources + "automatically generated by UIPainter ..." + + "*** the code below creates a default model when invoked." + "*** (which may not be the one you wanted)" + "*** Please change as required and accept in the browser." + + |holder| + + (holder := builder bindingAt:#deliverSources) isNil ifTrue:[ + builder aspectAt:#deliverSources put:(holder := ValueHolder new). + holder onChangeSend:#value to:[modifiedChannel value:true]. + ]. + ^ holder. + + "Created: / 23.3.1999 / 14:18:05 / cg" +! + +deliverZipArchive + "automatically generated by UIPainter ..." + + "*** the code below creates a default model when invoked." + "*** (which may not be the one you wanted)" + "*** Please change as required and accept in the browser." + + |holder| + + (holder := builder bindingAt:#deliverZipArchive) isNil ifTrue:[ + builder aspectAt:#deliverZipArchive put:(holder := ValueHolder new). + holder onChangeSend:#value to:[modifiedChannel value:true]. + ]. + ^ holder. + + "Created: / 23.3.1999 / 14:18:05 / cg" +! + hasProjectSelectedHolder ^ [ self hasProjectNodeSelected @@ -1068,6 +1250,38 @@ ^ holder. ! +installDirectory + "automatically generated by UIPainter ..." + + "*** the code below creates a default model when invoked." + "*** (which may not be the one you wanted)" + "*** Please change as required and accept in the browser." + + |holder| + + (holder := builder bindingAt:#installDirectory) isNil ifTrue:[ + builder aspectAt:#installDirectory put:(holder := '/opt' asValue). + holder onChangeSend:#value to:[modifiedChannel value:true]. + ]. + ^ holder. + + "Created: / 23.3.1999 / 14:18:05 / cg" +! + +modifiedChannel + "automatically generated by UIPainter ..." + + "*** the code below creates a default model when invoked." + "*** (which may not be the one you wanted)" + "*** Please change as required and accept in the browser." + + modifiedChannel isNil ifTrue:[ + modifiedChannel := false asValue. + ]. + ^ modifiedChannel. + +! + patchesList "automatically generated by UIPainter ..." @@ -1083,6 +1297,24 @@ ^ holder. ! +projectDirectory + "automatically generated by UIPainter ..." + + "*** the code below creates a default model when invoked." + "*** (which may not be the one you wanted)" + "*** Please change as required and accept in the browser." + + |holder| + + (holder := builder bindingAt:#projectDirectory) isNil ifTrue:[ + builder aspectAt:#projectDirectory put:(holder := '.' asValue). + holder onChangeSend:#value to:[modifiedChannel value:true]. + ]. + ^ holder. + + "Created: / 23.3.1999 / 14:18:05 / cg" +! + projectTreeHolder "automatically generated by UIPainter ..." @@ -1110,6 +1342,7 @@ (holder := builder bindingAt:#projectType) isNil ifTrue:[ builder aspectAt:#projectType put:(holder := ValueHolder new). + holder onChangeSend:#value to:[modifiedChannel value:true]. ]. ^ holder. @@ -1146,9 +1379,19 @@ ^ holder. ! ! +!ProjectBrowser methodsFor:'change & update'! + +update:something with:aParameter from:changedObject + changedObject == self currentProject ifTrue:[ + self halt + ]. +! ! + !ProjectBrowser methodsFor:'initialization'! postBuildWith:aBuiler + self modifiedChannel value:false. + self setupCanvasForNoSelection. ^ super postBuildWith:aBuiler ! @@ -1187,6 +1430,22 @@ !ProjectBrowser methodsFor:'private'! +currentProject + |node| + + node := self selectedTreeNode value. + node isNil ifTrue:[^ nil]. + + [node notNil and:[node isProjectNode not]] whileTrue:[ + node := node parent. + ]. + node notNil ifTrue:[ + ^ node contents + ]. + ^ nil + +! + hasClassesNodeSelected |selectedNode| @@ -1289,6 +1548,7 @@ patchesNode icon:(self class methodsIcon). deploymentNode icon:(self class deploymentIcon). + deploymentNode spec:(self class rightCanvasSpecForDeployment). ^ pNode @@ -1311,16 +1571,33 @@ ^ projectTree ! -readAspectsForProject - |p selectedNode| +readAspectsFromProject + |p| - self hasProjectNodeSelected ifTrue:[ - selectedNode := self selectedTreeNode value. - - p := selectedNode contents. + p := self currentProject. + p notNil ifTrue:[ + self rightCanvasTextHolder value:p comment. self currentProjectWasNotLoadedFromFile value:p wasLoadedFromFile not. self projectType value:(p type). + self projectDirectory value:(p directory). + modifiedChannel value:false. + p addDependent:self. + ]. + + "Created: / 23.3.1999 / 14:16:12 / cg" + "Modified: / 23.3.1999 / 14:18:38 / cg" +! + +saveAspectsIntoProject + |p| + + p := self currentProject. + p notNil ifTrue:[ +"/ self currentProjectWasNotLoadedFromFile value:p wasLoadedFromFile not. +"/ self projectType value:(p type). +"/ self projectDirectory value:(p directory). +"/ modifiedChannel value:false. ]. "Created: / 23.3.1999 / 14:16:12 / cg" @@ -1342,7 +1619,6 @@ ]. selectedNode isProjectNode ifTrue:[ - self readAspectsForProject. self showCommentOf:selectedNode. ^ self. ]. @@ -1386,11 +1662,29 @@ !ProjectBrowser methodsFor:'user actions'! +accept + "save values from aspects into the project" + + |p| + + p := self currentProject. + + self halt. +! + +cancel + "reload aspects from the project" + + self readAspectsFromProject +! + itemSelected:index |item action| self updateRightCanvas. + self readAspectsFromProject. + item := self projectTreeHolder value at:index. action := item action. action notNil ifTrue:[ @@ -1501,6 +1795,37 @@ ] ! +saveProject + |d p| + + p := self currentProject. + p directory isNil ifTrue:[ + d := (Dialog request:'Project Directory:'). + d size == 0 ifTrue:[ + ^ self + ]. + p directory:d + ]. + + p saveAsProjectFile. +! + +selectionChangeAllowed + |answer| + + modifiedChannel value ifTrue:[ + answer := Dialog confirmWithCancel:'Accept changes ?'. + answer isNil ifTrue:[ + ^ false + ]. + answer == true ifTrue:[ + self accept. + ]. + ]. + ^ true + +! + showClassListOf:anItem |projectItem project classInfo l|