'From Squeak3.6alpha of ''17 March 2003'' [latest update: #5278] on 29 June 2003 at 1:58:47 pm'! "Change Set: WorldMenuSorted-nk Date: 29 June 2003 Author: Ned Konz This change set makes sure that the WorldMenu/open menu has the registered packages sorted by menu description. "! !TheWorldMenu methodsFor: 'commands' stamp: 'nk 6/29/2003 13:38'! openBrowser "Open the RefactoringBrowser if present. Should be a preference, though." | browserClass | browserClass _ Smalltalk at: #RefactoringBrowser ifAbsent: [ Browser ]. browserClass openBrowser! ! !TheWorldMenu methodsFor: 'construction' stamp: 'nk 6/29/2003 13:57'! openMenu "Build the open window menu for the world." | menu | menu _ self menu: 'open...'. self fillIn: menu from: { {'browser (b)' . { self . #openBrowser}. 'A five-paned tool that lets you see all the code in the system'}. {'package-pane browser' . { PackagePaneBrowser . #openBrowser} . 'Similar to the regular browser, but adds an extra pane at top-left that groups class-categories that start with the same prefix' }. {'workspace (k)' . {self . #openWorkspace}. 'A window for composing text' }. {'file list' . {self . #openFileList} . 'A tool allowing you to browse any file' }. {'file...' . { FileList . #openFileDirectly} . 'Lets you open a window on a single file'}. {'transcript (t)' . {self . #openTranscript}. 'A window used to report messages sent to Transcript' }. "{'inner world' . { WorldWindow . #test1} }." nil. {'method finder' . { self . #openSelectorBrowser} . 'A tool for discovering methods' }. {'message names (W)' . { self . #openMessageNames} . 'A tool for finding and editing methods that contain any given keyword in their names.'}. nil. {'simple change sorter' . {self . #openChangeSorter1} . 'A tool allowing you to view the methods in a single change set' }. {'dual change sorter' . {self . #openChangeSorter2} . 'A tool allowing you to compare and manipulate two change sets concurrently' }. nil. }. self fillIn: menu from: self class registeredOpenCommands. menu addLine. self mvcProjectsAllowed ifTrue: [self fillIn: menu from: { {'mvc project' . {self. #openMVCProject} . 'Creates a new project of the classic "mvc" style'} }]. ^ self fillIn: menu from: { {'morphic project' . {self. #openMorphicProject} . 'Creates a new morphic project'}. }.! ! !TheWorldMenu class methodsFor: 'open-menu registry' stamp: 'nk 6/29/2003 13:56'! registeredOpenCommands "Answer the list of dynamic open commands, sorted by description" ^self registry asArray sort: [ :a :b | a first asLowercase < b first asLowercase ]! ! !TheWorldMenu class methodsFor: 'open-menu registry' stamp: 'nk 6/29/2003 13:55'! registry "Answer the registry of dynamic open commands" ^OpenMenuRegistry ifNil: [OpenMenuRegistry _ OrderedCollection new]. ! ! !TheWorldMenu class methodsFor: 'open-menu registry' stamp: 'nk 6/29/2003 13:55'! unregisterOpenCommand: label "Remove the open command with the given label from the registry" self registry removeAllSuchThat: [:e | e first = label]! ! !TheWorldMenu class methodsFor: 'open-menu registry' stamp: 'nk 6/29/2003 13:55'! unregisterOpenCommandWithReceiver: aReceiver "Remove the open command with the given object as receiver from the registry" self registry removeAllSuchThat: [:e | e second first == aReceiver]! !