'From Squeak3.1alpha of 5 February 2001 [latest update: #3630] on 17 February 2001 at 1:04:58 pm'! "Change Set: simplerFind Date: 17 February 2001 Author: Bob Arning Default actions for Find and Publish made simpler. The original versions (more directories) are in the popup menus under the buttons."! !FileList2 methodsFor: 'as yet unclassified' stamp: 'RAA 2/17/2001 12:25'! limitedSuperSwikiDirectoryList | dir nameToShow dirList | dirList _ OrderedCollection new. ServerDirectory serverNames do: [ :n | dir _ ServerDirectory serverNamed: n. (dir isKindOf: SuperSwikiServer) ifTrue: [ nameToShow _ n. dirList add: ((dir directoryWrapperClass with: dir name: nameToShow model: self) balloonText: dir realUrl) ]. ]. {Project current squeakletDirectory} do: [ :each | dirList add: (FileDirectoryWrapper with: each name: each localName model: self) ]. ^dirList! ! !FileList2 methodsFor: 'as yet unclassified' stamp: 'RAA 2/17/2001 12:48'! limitedSuperSwikiPublishDirectoryList | dir nameToShow dirList | dirList _ OrderedCollection new. ServerDirectory serverNames do: [ :n | dir _ ServerDirectory serverNamed: n. (dir isKindOf: SuperSwikiServer) ifTrue: [ nameToShow _ n. dirList add: ((dir directoryWrapperClass with: dir name: nameToShow model: self) balloonText: dir realUrl) ]. ]. ^dirList! ! !FileList2 methodsFor: 'as yet unclassified' stamp: 'RAA 2/17/2001 12:18'! morphicDirectoryTreePane ^self morphicDirectoryTreePaneFiltered: #initialDirectoryList ! ! !FileList2 methodsFor: 'as yet unclassified' stamp: 'RAA 2/17/2001 12:17'! morphicDirectoryTreePaneFiltered: aSymbol ^(SimpleHierarchicalListMorph on: self list: aSymbol selected: #getSelectedDirectory changeSelected: #setSelectedDirectoryTo: menu: nil keystroke: nil) autoDeselect: false ! ! !FileList2 class methodsFor: 'blue ui' stamp: 'RAA 2/17/2001 12:26'! morphicViewProjectLoader2InWorld: aWorld reallyLoad: aBoolean dirFilterType: aSymbol | window aFileList buttons treePane textColor1 fileListPane pane2a pane2b | window _ AlignmentMorphBob1 newColumn. window hResizing: #shrinkWrap; vResizing: #shrinkWrap. textColor1 _ Color r: 0.742 g: 0.839 b: 1.0. aFileList _ self new directory: FileDirectory default. aFileList optionalButtonSpecs: self specsForProjectLoader; fileSelectionBlock: self projectOnlySelectionBlock; "dirSelectionBlock: self hideSqueakletDirectoryBlock;" modalView: window. window setProperty: #FileList toValue: aFileList; wrapCentering: #center; cellPositioning: #topCenter; borderWidth: 4; borderColor: (Color r: 0.355 g: 0.516 b: 1.0); useRoundedCorners. buttons _ #('OK' 'Cancel') collect: [ :each | self blueButtonText: each textColor: textColor1 inWindow: window ]. (treePane _ aFileList morphicDirectoryTreePaneFiltered: aSymbol) extent: 250@300; retractable: false; borderWidth: 0. fileListPane _ aFileList morphicFileListPane extent: 350@300; retractable: false; borderWidth: 0. window addARow: { window fancyText: 'Load A Project' ofSize: 21 color: textColor1 }; addARowCentered: { buttons first. (Morph new extent: 30@5) color: Color transparent. buttons second }; addARow: { window fancyText: 'Please select a project' ofSize: 21 color: Color blue }; addARow: { (window inAColumn: {(pane2a _ window inARow: {window inAColumn: {treePane}}) useRoundedCorners; layoutInset: 6}) layoutInset: 10. (window inAColumn: {(pane2b _ window inARow: {window inAColumn: {fileListPane}}) useRoundedCorners; layoutInset: 6}) layoutInset: 10. }. window fullBounds. window fillWithRamp: self blueRamp1 oriented: 0.65. pane2a fillWithRamp: self blueRamp3 oriented: (0.7 @ 0.35). pane2b fillWithRamp: self blueRamp3 oriented: (0.7 @ 0.35). buttons do: [ :each | each fillWithRamp: self blueRamp2 oriented: (0.75 @ 0). ]. buttons first on: #mouseUp send: (aBoolean ifTrue: [#okHitForProjectLoader] ifFalse: [#okHit]) to: aFileList. buttons second on: #mouseUp send: #cancelHit to: aFileList. aFileList postOpen. window position: aWorld topLeft + (aWorld extent - window extent // 2). ^ window openInWorld: aWorld.! ! !FileList2 class methodsFor: 'blue ui' stamp: 'RAA 2/17/2001 13:03'! morphicViewProjectSaverFor: aProject " (FileList2 morphicViewProjectSaverFor: Project current) openInWorld " | window aFileList buttons treePane pane2 textColor1 option | textColor1 _ Color r: 0.742 g: 0.839 b: 1.0. aFileList _ self new directory: FileDirectory default. aFileList dirSelectionBlock: self hideSqueakletDirectoryBlock. window _ AlignmentMorphBob1 newColumn. window hResizing: #shrinkWrap; vResizing: #shrinkWrap. aFileList modalView: window. window setProperty: #FileList toValue: aFileList; wrapCentering: #center; cellPositioning: #topCenter; borderWidth: 4; borderColor: (Color r: 0.355 g: 0.516 b: 1.0); useRoundedCorners. buttons _ #( ('OK' okHit) ('Cancel' cancelHit) ) collect: [ :each | (self blueButtonText: each first textColor: textColor1 inWindow: window) on: #mouseUp send: each second to: aFileList ]. option _ aProject world valueOfProperty: #SuperSwikiPublishOptions ifAbsent: [#initialDirectoryList]. aProject world removeProperty: #SuperSwikiPublishOptions. (treePane _ aFileList morphicDirectoryTreePaneFiltered: option) extent: 350@300; retractable: false; borderWidth: 0. window addARowCentered: { window fancyText: 'Publish This Project' ofSize: 21 color: textColor1 }; addARowCentered: { buttons first. (Morph new extent: 30@5) color: Color transparent. buttons second }; addARowCentered: { (window inAColumn: {(ProjectViewMorph on: aProject) lock}) layoutInset: 4}; addARowCentered: { window fancyText: 'Please select a folder' ofSize: 21 color: Color blue }; addARow: { ( window inAColumn: { (pane2 _ window inARow: {window inAColumn: {treePane}}) useRoundedCorners; layoutInset: 6 } ) layoutInset: 10 }. window fullBounds. window fillWithRamp: self blueRamp1 oriented: 0.65. pane2 fillWithRamp: self blueRamp3 oriented: (0.7 @ 0.35). buttons do: [ :each | each fillWithRamp: self blueRamp2 oriented: (0.75 @ 0). ]. window setProperty: #morphicLayerNumber toValue: 11. aFileList postOpen. ^ window ! ! !ProjectNavigationMorph methodsFor: 'as yet unclassified' stamp: 'RAA 2/17/2001 12:46'! currentNavigatorVersion ^20 "since these guys get saved, we fix them up if they are older versions"! ! !ProjectNavigationMorph methodsFor: 'as yet unclassified' stamp: 'RAA 2/17/2001 12:44'! showMenuFor: aSymbol event: evt (aSymbol == #publishProject or: [aSymbol == #publishProjectSimple]) ifTrue: [ self doPublishButtonMenuEvent: evt. ^true "we did show the menu" ]. (aSymbol == #findAProject or: [aSymbol == #findAProjectSimple]) ifTrue: [ self doFindButtonMenuEvent: evt. ^true "we did show the menu" ]. ^false ! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'RAA 2/17/2001 12:27'! buttonFind ^self makeButton: 'FIND' balloonText: 'Find a project' for: #findAProjectSimple ! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'RAA 2/17/2001 12:43'! buttonPublish ^self makeButton: 'PUBLISH IT!!' balloonText: 'Publish this project. Save it where it came from (server, hard disk, etc.) ' for: #publishProjectSimple! ! !ProjectNavigationMorph methodsFor: 'the actions' stamp: 'RAA 2/17/2001 12:28'! doFindButtonMenuEvent: evt | menu selection | menu _ CustomMenu new. menu add: 'find a project' action: [self findAProjectSimple]; add: 'find a project (more places)' action: [self findAProject]; add: 'find any file' action: [self findAnything]; add: 'search the SuperSwiki' action: [self findSomethingOnSuperSwiki]. selection _ menu build startUpCenteredWithCaption: 'Find options'. selection ifNil: [^self]. selection value. ! ! !ProjectNavigationMorph methodsFor: 'the actions' stamp: 'RAA 2/17/2001 12:43'! doPublishButtonMenuEvent: evt | menu selection | menu _ CustomMenu new. menu add: 'publish normally' action: [self publishProjectSimple]; add: 'publish normally (more choices)' action: [self publishProject]; add: 'publish to different server' action: [self publishDifferent]; add: 'edit project info' action: [self editProjectInfo]. selection _ menu build startUpCenteredWithCaption: 'Publish options'. selection ifNil: [^self]. selection value. ! ! !ProjectNavigationMorph methodsFor: 'the actions' stamp: 'RAA 2/17/2001 12:27'! findAProject FileList2 morphicViewProjectLoader2InWorld: self world reallyLoad: true dirFilterType: #initialDirectoryList! ! !ProjectNavigationMorph methodsFor: 'the actions' stamp: 'RAA 2/17/2001 12:27'! findAProjectSimple FileList2 morphicViewProjectLoader2InWorld: self world reallyLoad: true dirFilterType: #limitedSuperSwikiDirectoryList! ! !ProjectNavigationMorph methodsFor: 'the actions' stamp: 'RAA 2/17/2001 12:55'! publishDifferent self publishStyle: #initialDirectoryList forgetURL: true ! ! !ProjectNavigationMorph methodsFor: 'the actions' stamp: 'RAA 2/17/2001 12:55'! publishProject self publishStyle: #initialDirectoryList forgetURL: false ! ! !ProjectNavigationMorph methodsFor: 'the actions' stamp: 'RAA 2/17/2001 12:55'! publishProjectSimple self publishStyle: #limitedSuperSwikiPublishDirectoryList forgetURL: false ! ! !ProjectNavigationMorph methodsFor: 'the actions' stamp: 'RAA 2/17/2001 12:54'! publishStyle: aSymbol forgetURL: aBoolean | w | w _ self world ifNil: [^1 beep]. w setProperty: #SuperSwikiPublishOptions toValue: aSymbol. w project storeOnServerShowProgressOn: self forgetURL: aBoolean. ! !