NewLauncher.st
author Claus Gittinger <cg@exept.de>
Mon, 14 Feb 2011 18:16:30 +0100
changeset 9774 5bde45b1c359
parent 9699 1b105800385a
child 9962 6d5bd2fa7dbd
permissions -rw-r--r--
automatically generated by browser

"
 COPYRIGHT (c) 1997-1998 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice. This software may not
 be provided or otherwise made available to, or used by, any
 other person. No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libtool' }"

AbstractLauncherApplication subclass:#NewLauncher
	instanceVariableNames:'isMainLauncher helpIsOn errorListCanvas infoLineTemplate'
	classVariableNames:'UserAddedMenuItems UserAddedToolBarItems'
	poolDictionaries:''
	category:'Interface-Smalltalk'
!

Object subclass:#AddedToolInfo
	instanceVariableNames:'item resourceProvider where positionSpec space before
		menuWithNewItem originalLabel'
	classVariableNames:''
	poolDictionaries:''
	privateIn:NewLauncher
!

!NewLauncher class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1997-1998 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice. This software may not
 be provided or otherwise made available to, or used by, any
 other person. No title to or ownership of the software is
 hereby transferred.
"


!

documentation
"
    The new launcher.
    This one provides all of the Launchers functionality, 
    but has been written using the new GUI painter tools.
    (i.e. its menu and toolbar is defined by specs, which can be
     easily modified).
    Functionality which can be shared with the old launcher
    has been moved to a common superclass.

    If you want to write your own (application-)launcher, we recommend
    creating a subclass, and redefining the appropriate menu & menuToolBar
    methods there.

    [start with:]
        NewLauncher open

    [see also:]
        Launcher

    [author:]
        Thomas Zwick, eXept Software AG
        Claus Gittinger, eXept Software AG
"

!

examples
"
    reopening a standard launcher (without any added tools)
                                                                        [exBegin]
     NewLauncher removeAllUserAddedTools.
     NewLauncher open.
                                                                        [exEnd]



    adding your own menu items (for user-applications)

    an additional item in the tools menu:
                                                                        [exBegin]
     Transcript topView application
        addMenuItem:(MenuItem new 
                        label: 'Foo';
                        value: [Transcript showCR:'foo invoked'];
                        isButton: false;
                        labelImage: nil;
                        nameKey: #foo;
                        activeHelpKey: #Foo)
        in:#menu
        position:#(before workspace)
        space:true
                                                                        [exEnd]

    an additional item in the tools menu:
                                                                        [exBegin]
     Transcript topView application
        addMenuItem:(MenuItem new 
                        label: 'Foo';
                        value: [Transcript showCR:'foo invoked'];
                        isButton: false;
                        labelImage: nil;
                        activeHelpKey: #Foo)
        in:#menu
        position:#(after guiPainter)
        space:true
                                                                        [exEnd]

    an additional item in one of the tools sub menus:
                                                                        [exBegin]
     Transcript topView application
        addMenuItem:(MenuItem new 
                        label: 'Foo';
                        value: [Transcript showCR:'foo invoked'];
                        isButton: false;
                        labelImage: nil;
                        activeHelpKey: #Foo)
        in:#menu
        position:#(after Workspace)
        space:true
                                                                        [exEnd]
"
! !

!NewLauncher class methodsFor:'accessing'!

label

    ^'ST/X Launcher'


! !

!NewLauncher class methodsFor:'defaults'!

defaultInfoLineTemplate
    "available values:
        PACKAGE         - the current packageID
        PACKAGEOREMPTY  - the current packageID or empty if its __NoPackage__
        IMAGE           - the current snapshot image
        CVS             - the CVS source repository or empty
        DB              - the Store source repository DB or empty
        SVN_WORKING_COPY- the SVN working copy dir or empty
        NOREPOSITORY    - the tring 'No Repository' empty
        NS              - the default namespace, or empty (if Smalltalk)
        PROJECTDIR      - the default fileOut directory or empty (if current)
    "

    (SVN::RepositoryManager notNil
    and:[ SVN::RepositoryManager isLoaded    
    and:[ SVN::RepositoryManager enabled ]]) ifTrue:[
        ^ '%(PACKAGEOREMPTY)%(IMAGE) %(CVS)%(DB)%(SVN_WORKING_COPY)'
    ].
    ^ '%(PACKAGEOREMPTY)%(IMAGE)%(CVS)%(DB)%(NOREPOSITORY)%(NS)'

    "/ ^ '%(PACKAGEOREMPTY)%(IMAGE)%(CVS)%(DB)%(NOREPOSITORY)%(NS)'
    "/ ^ '%(PACKAGE)%(IMAGE)%(CVS)%(DB)%(NOREPOSITORY)%(NS)%(PROJECTDIR)'

    "Modified: / 30-09-2008 / 12:45:49 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

windowIcon
    ^ Icon stxIcon

    "Created: / 16.8.1998 / 13:11:58 / cg"
    "Modified: / 17.8.1998 / 10:07:09 / cg"
! !

!NewLauncher class methodsFor:'help specs'!

flyByHelpSpec
    <resource: #help>

    ^super flyByHelpSpec addPairsFrom:#(

#fileFileBrowser
'FileBrowser'

#fileBrowserV2
'FileBrowser'

#fileSaveImage
'Save Image'

#fileSaveImageAs
'Save Image'

#helpSTXOnlineDocumentation
'Online Manual'

#classesSystemBrowserOnClass
'Browser history'

#classesSystemBrowser
'SystemBrowser'

#newSystemBrowser
'New SystemBrowser'

#systemGarbageCollect
'GarbageCollect'

#systemGarbageCollectAndCompress
'GarbageCollect'

#toolsGUIPainter
'GUIPainter'

#toolsImageEditor
'BitmapEditor'

#toolsMenuEditor
'MenuEditor'

#toolsChangesBrowser
'Changes Browser'

toolsChangesBrowserOrNavigateToRecentChange
'Changes Browser / Recent Change'

#toolsMiscProjectsNewProject
'New Project'

#toolsNewChangesBrowser
'ChangesBrowser (new GUI)'

#toolsOldChangesBrowser
'ChangesBrowser (old GUI)'

#toolsWorkspace
'Workspace'

#toolsMyWorkspace
'Workspace on the "MyWorkspace.wsp" file'

#toolsSystemWorkspace
'The SystemWorkspace with Welcome Messages'

#toolsEvaluationWorkspace
'A 3-pane EvaluationWorkspace - good for lectures and Smalltalk courses'

#toolsInternationalLanguageTranslationEditor
'National Language Translation Editor'
)
!

helpSpec
    "This resource specification was automatically generated
     by the UIHelpTool of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIHelpTool may not be able to read the specification."

    "
     UIHelpTool openOnClass:NewLauncher    
    "

    <resource: #help>

    ^ super helpSpec addPairsFrom:#(

#aboutLicenseConditions
'Show the license conditions of ST/X.'

#chickenFun
'Watch your views'

#classBrowserOnChangedClasses
'Open a Browser on changed classes'

#classBrowserOnChangedMethod
'Open a Browser on a that changed method'

#classBrowserOnChangedMethods
'Open a Browser on changed methods'

#classes
'Class functions.'

#classesClassBrowser
'Open a dialog for defining and opening a Class Browser on a class.'

#classesClassBrowserOnChanges
'Open a Browser on changed classes'

#classesClassHierarchyBrowser
'Open a dialog for defining and opening a Class Hierarchy Browser on a class.'

#classesClassTreeBrowser
'Open a Class Tree View.'

#classesFullClassBrowser
'Open a dialog for defining and opening a Full Class Browser on a class.'

#classesImplementors
'Find all methods which implement a particular message'

#classesRemoveAllTracePoints
'Remove all trace- and break-points.'

#classesResourceMethods
'Open a dialog for searching resource methods.'

#classesSenders
'Find all methods which send a particular message.'

#classesShowTracePoints
'Browse mthods with a Trace- or Break-point.'

#classesSpecial
'Special class functions.'

#classesSpecialReferencesToUnboundGlobals
'rbowse methods refering to unbound globals.'

#classesSpecialReferencesToUndeclared
'Browse methods refering to undeclared variables.'

#classesStopIgnoringHalts
'Stop ignoring Halts in the debugger.'

#classesSystemBrowser
'Open a System Browser.'

#classesSystemBrowserOnClass
'Open a System Browser on a previously visited class.'

#demos
'Demo programs.'

#demos3D
'3D GL graphic demos.'

#demos3DcubeSolid
'A rotating solid cube.'

#demos3DcubeWire
'A rotating wireframe cube.'

#demos3Ddoughnut
'A rotating wireframe doughnut.'

#demos3Dlogo
'The ST/X logo.'

#demos3Dplane
'A rotating plane.'

#demos3Dplanet
'Two spheres - one rotating around the other.'

#demos3Drubics
'A rubics cube - with interaction.'

#demos3Dsphere
'A rotating wireframe sphere.'

#demos3Dteapot
'A teopot.'

#demos3Dtetra
'A rotating tetrahedron.'

#demosAnimations
'Simple animation demos.'

#demosBabelFish
'A Language Translator'

#demosCalculator
'Opens a calculator with decimal to hex conversion.'

#demosCalendar
'Opens a GUI on the cal program (unix only).'

#demosClock
'Opens an analog clock application.'

#demosCommander
'Opens a demo for the Commander class.'

#demosDigitalClock
'Opens a digital clock application'

#demosDrawingProtocol
'Drawing protocol demo (for programmers)'

#demosFTP
'Opens a simple FTP interface demo.'

#demosFractalPatterns
'Opens a view displaying fractal patterns.'

#demosFractalPlants
'Opens a view displaying fractal plants (iterated function systems).'

#demosGUI
'GUI builder demos.'

#demosGUICalculator
'Calculator built using the GUI builder.'

#demosGUIWidgets
'GUI widgets usage.'

#demosGames
'Games.'

#demosGeometric
'Various demos displaying geometric designs.'

#demosGlobe
'Opens a rotating globe animation demo.'

#demosGoodies
'Goodies and Utilities.'

#demosGraphicEditors
'Graphic editing demos.'

#demosGraphicEditorsDrawTool
'Object drawing demo.'

#demosGraphicEditorsLogicTool
'Simulating Logic demo.'

#demosGraphicEditorsPaintTool
'Painting demo.'

#demosLSystems
'Opens a view displaying fractal patterns using Lindenmayer Systems.'

#demosMail
'Opens a simple mail viewer demo.'

#demosMandel
'Opens a view displaying the mandelbrot set.'

#demosMoreFractalPatterns
'Opens a view with more fractal patterns.'

#demosNews
'Opens a simple news reader demo.'

#demosOldStuff
'Very old demos'

#demosPen
'Opens a demo for the Pen class.'

#demosRemoteLauncher
'Opens a launcher on a remote display.'

#demosTelnet
'Opens a Telnet terminal demo.'

#demosWalkingMan
'Opens a walking man animation demo.'

#fileApplicationBuilder
'Open an Application Builder for building stand alone ST/X-applications.'

#fileBrowserV2
'Open a FileBrowser to manipulate files.'

#fileFileBrowser
'Open a FileBrowser to manipulate files.'

#fileLibraryBuilder
'Open a Library Builder for building binary class libraries.'

#fileModules
'Show class libraries and other modules.'

#fileSaveImage
'Save a snapshot image of ST/X into the current snapshot file.'

#fileSaveImageAs
'Save a snapshot image of ST/X into a file.'

#gamesPingPong
'Play classic PingPong against the computer.'

#gamesPingPong2
'Play classic PingPong against a friend.'

#gamesReversi
'The game of reversi (an embedded Java applet)'

#gamesTetris
'The tetris game - written in Smalltalk.'

#gamesTicTacToe
'Play TicTacToe against the computer.'

#gamesTicTacToe2
'Play TicTacToe against a friend.'

#helpActiveHelp
'Toggle display of active help texts in browsers.'

#helpClassDocumentation
'Show the smalltalk class documentation.'

#helpCredits
'Say thanks to some friends.'

#helpIndex
'Show the index of the online documentation.'

#helpPrintDocumentation
'Print various parts of the ST/X documentation.'

#helpProgrammersGuide
'Show the programmer''s guide.'

#helpRFC
'Show an RFC by number.'

#helpSTXOnlineDocumentation
'Show the ST/X online documentation.'

#helpShowTipOfTheDay
'Show a tip-of-the-day.'

#helpSmalltalkTutorial
'Show the Smalltalk Language Tutorial.'

#helpToolsDocumentation
'Show the tool documentation.'

#helpTutorial
'Show the ST/X Tutorial.'

#helpWhatsNew
'Show the latest news about the ST/X documentation.'

#helpWhatsNewInSTX
'Show the latest news about ST/X.'

#newSystemBrowser
'Open the new, improved System Browser.'

#settingsCommunications
'Change communication settings.'

#settingsCompilation
'Change compiler settings.'

#settingsFonts
'Change of the font defaults.'

#settingsKeyboardMappings
'Show the keyboard mappings.'

#settingsLanguage
'Change the national language.'

#settingsLoadSettings
'Restore the settings from a file.'

#settingsMessages
'Change the settings for info- / error-messagess.'

#settingsMisc
'Misc other settings.'

#settingsMouse
'Configure the mouse'

#settingsObjectMemory
'Change the object memory settings.'

#settingsPrinter
'Change the printer setup.'

#settingsSaveSettings
'Save the current settings to a file.'

#settingsScreen
'Change the display screen settings.'

#settingsSourceAndDebugger
'Change the settings of the source code management.'

#settingsTools
'Change tool settings.'

#settingsViewStyle
'Change the current view style.'

#startChangeSetBrowser
'Open a Browser on recent changes (the ChangeSet)'

#system
'System tools.'

#systemEventTrace
'Select a view to toggle the event trace for it.'

#systemEventView
'Open a view and trace its window events on the console.'

#systemGarbageCollect
'Reclaim unused memory.'

#systemGarbageCollectAndCompress
'Reclaim unused memory and minimize the amount of used memory.'

#systemInterruptLatency
'Open an Interrupt Latency Monitor displaying methods which block interrupts for longer than a given time goal.'

#systemMemory
'Display object memory statistics.'

#systemMemoryUsage
'Display object memory usage by class.'

#systemProcesses
'Open a Process Monitor displaying ST/X processes.'

#systemReloadResources
'Reload Language Resources (National language strings)'

#systemSemaphores
'Open a Semaphore Monitor displaying ST/X semaphores.'

#systemSettings
'Open a Settings Dialog'

#tools
'Tools.'

#toolsChangesBrowser
'Open a Changes Browser.'

#toolsChangesBrowserOrNavigateToRecentChange
'Open a Changes Browser or navigate to a recent Change.'

#toolsEvaluationWorkspace
'A 3-pane EvaluationWorkspace - good for lectures and Smalltalk courses'

#toolsGUIPainter
'Open a GUI Painter for graphical user interface construction.'

#toolsImageEditor
'Open a Bitmap Image Editor.'

#toolsInternationalLanguageTranslationEditor
'Open the National Language Translation Editor'

#toolsMenuEditor
'Open a Menu Editor for building menus and toolBars.'

#toolsMisc
'Misc Tools.'

#toolsMiscNewChangesBrowser
'Open a ChangesBrowser (new GUI).'

#toolsMiscNewLauncher
'(Re-)open a Launcher (new GUI).'

#toolsMiscOldChangesBrowser
'Open a ChangesBrowser (old GUI).'

#toolsMiscOldLauncher
'Open an OldLauncher.'

#toolsMiscProjects
'Project functions.'

#toolsMiscProjectsNewProject
'Create a new project.'

#toolsMiscProjectsSelectProject
'Select an existing project and reopen its windows.'

#toolsMyWorkspace
'Workspace on the "MyWorkspace.wsp" file'

#toolsNewChangesBrowser
'Open the new changes browser.'

#toolsOOM
''

#toolsOldChangesBrowser
'Open the old changes browser.'

#toolsProjects
''

#toolsSUnit
'Open the SUnit TestRunner.'

#toolsSmaCC
'Open the SmaCC Parsergenerator Tool.'

#toolsSystemWorkspace
'The SystemWorkspace with Welcome Messages'

#toolsTerminal
'Open a terminal view (aka xterm)'

#toolsWorkspace
'Open a Workspace for evaluating smalltalk expressions.'

#windows
'Window functions.'

#windowsDeiconifyAll
'Restore all minimized ST/X windows.'

#windowsFindAndDestroy
'Select an ST/X window by name and destroy it.'

#windowsFindAndMigrate
'Select an ST/X window by name and move it to another display.'

#windowsFindAndMigrateBack
'Select an ST/X window by name and move it (back) to this screen.'

#windowsFindAndRaise
'Select an ST/X window by name and raise it.'

#windowsGrapScreen
'Grab the whole screen and save it to a bitmap-file.'

#windowsGrapScreenArea
'Grab an area of the screen and save it to a bitmap-file.'

#windowsGrapWidget
'Grab a single widget and save it to a bitmap-file.'

#windowsGrapWindow
'Grab a window and save it to a bitmap-file.'

#windowsIconifyAll
'Minimize all ST/X windows to icons.'

#windowsMigrateAllWindows
'Migrate all ST/X windows to some other display.'

#windowsRedrawAll
'Redraw all ST/X windows.'

#windowsSelectAndDestroy
'Select a window and destroy it.'

#windowsSelectAndInspect
'Select an ST/X window and open an Inspector on it.'

#windowsSelectAndMigrate
'Select an ST/X window and move it to another display.'

#windowsViewTree
'Select an ST/X window and display its widget hierarchy.'

#windowsViewTreeAllScreens
'Display the widget hierarchies of all ST/X windows (on all displays).'

#windowsViewTreeAllViews
'Display the widget hierarchies of all ST/X windows (on this display).'

#flyByWindowInformation
'Show flyby info about the window under the pointer. Easy access to View, Application and Model.'
)
! !

!NewLauncher class methodsFor:'interface specs'!

windowSpec
    ^ self windowSpec_old.
    "/ ^ self windowSpec_new.
!

windowSpec_new
    "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:NewLauncher andSelector:#windowSpec_new
     NewLauncher new openInterface:#windowSpec_new
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: #'windowSpec_new'
        window: 
       (WindowSpec
          label: 'ST/X Launcher'
          name: 'ST/X Launcher'
          min: (Point 374 44)
          bounds: (Rectangle 0 0 374 202)
          menu: menu
          icon: windowIcon
        )
        component: 
       (SpecCollection
          collection: (
           (MenuPanelSpec
              name: 'menuToolbarView'
              layout: (LayoutFrame 0 0.0 0 0 0 1.0 40 0)
              menu: menuToolbar
            )
           (NoteBookViewSpec
              name: 'NoteBook1'
              layout: (LayoutFrame 0 0.0 40 0.0 0 1.0 -26 1.0)
              level: 0
              model: selectedTabHolder
              menu: tabList
              direction: bottom
              useIndex: true
              translateLabel: true
              canvas: noteBookCanvasHolder
              keepCanvasAlive: true
            )
           (UISubSpecification
              name: 'infoBarSubSpec'
              layout: (LayoutFrame 0 0.0 -26 1 0 1.0 0 1.0)
              majorKey: ToolApplicationModel
              minorKey: windowSpecForInfoBarWithClock
            )
           )
         
        )
      )
!

windowSpec_old
    "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:NewLauncher andSelector:#windowSpec
     NewLauncher new openInterface:#windowSpec
     NewLauncher open
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: windowSpec
        window: 
       (WindowSpec
          label: 'ST/X Launcher'
          name: 'Launcher'
          min: (Point 374 44)
          bounds: (Rectangle 0 0 291 202)
          menu: menu
          icon: windowIcon
        )
        component: 
       (SpecCollection
          collection: (
           (MenuPanelSpec
              name: 'menuToolbarView'
              layout: (LayoutFrame 0 0.0 0 0 0 1.0 40 0)
              menu: menuToolbar
            )
           (WorkspaceSpec
              name: 'transcriptView'
              layout: (LayoutFrame 0 0.0 40 0.0 0 1.0 -26 1.0)
              hasHorizontalScrollBar: true
              hasVerticalScrollBar: true
              miniScrollerHorizontal: true
            )
           (UISubSpecification
              name: 'infoBarSubSpec'
              layout: (LayoutFrame 0 0.0 -26 1 0 1.0 0 1.0)
              majorKey: ToolApplicationModel
              minorKey: windowSpecForInfoBarWithClock
            )
           )
         
        )
      )
!

windowSpec_pda
    "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:NewLauncher andSelector:#windowSpec_pda
     NewLauncher new openInterface:#windowSpec_pda
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: #'windowSpec_pda'
        window: 
       (WindowSpec
          label: 'Launcher'
          name: 'Launcher'
          min: (Point 100 20)
          max: (Point 240 300)
          bounds: (Rectangle 13 23 197 224)
          menu: #'menu_pda'
          icon: windowIcon
        )
        component: 
       (SpecCollection
          collection: (
           (MenuPanelSpec
              name: 'menuToolbarView'
              layout: (LayoutFrame 0 0.0 0 0 0 1.0 38 0)
              menu: #'menuToolbar_pda'
            )
           (WorkspaceSpec
              name: 'transcriptView'
              layout: (LayoutFrame 0 0.0 40 0.0 0 1.0 -26 1.0)
              hasHorizontalScrollBar: true
              hasVerticalScrollBar: true
              miniScrollerHorizontal: true
              miniScrollerVertical: false
            )
           (UISubSpecification
              name: 'infoBarSubSpec'
              layout: (LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
              majorKey: ToolApplicationModel
              minorKey: windowSpecForInfoBarWithClock
            )
           )
         
        )
      )
! !

!NewLauncher class methodsFor:'menu configuration'!

addMenuItem:newItem from:anApplicationWhichProvidesResourcesOrNil in:where position:positionSpecOrNilArg space:space
    |positionSpecOrNil itemNameOrNil before launcherApp|

    (Transcript notNil 
    and:[ Transcript isStream not
    and:[ (launcherApp := Transcript application) notNil
    and:[ launcherApp isKindOf:self]]]) ifTrue:[
        "/ add to instance
        launcherApp addMenuItem:newItem from:anApplicationWhichProvidesResourcesOrNil in:where position:positionSpecOrNilArg space:space.
        ^ self
    ].

    positionSpecOrNil := positionSpecOrNilArg.
    positionSpecOrNil isArray ifTrue:[
        positionSpecOrNil size > 1 ifTrue:[
            itemNameOrNil := positionSpecOrNil at:2.
        ].
        positionSpecOrNil := positionSpecOrNil at:1.
    ].
    before := (positionSpecOrNil == #first) or:[positionSpecOrNil == #before].

    (where isNil or: [where = 'toolbar']) ifTrue:[
        UserAddedToolBarItems isNil ifTrue: [UserAddedToolBarItems := Dictionary new].
        (UserAddedToolBarItems contains:[:info | info item nameKey = newItem nameKey])
        ifFalse:[
            UserAddedToolBarItems
                at:newItem put:(AddedToolInfo new
                                            item:newItem;
                                            resourceProvider:anApplicationWhichProvidesResourcesOrNil;
                                            where:where;
                                            positionSpec:positionSpecOrNilArg;
                                            space:space;
                                            before:before;
                                            menuWithNewItem:nil;
                                            yourself)
        ]
    ].
    (where isNil or:[where startsWith:'menu']) ifTrue:[
        UserAddedMenuItems isNil ifTrue: [UserAddedMenuItems := Dictionary new].
        (UserAddedMenuItems contains:[:info | info item nameKey = newItem nameKey])
        ifFalse:[
            UserAddedMenuItems 
                at:newItem put:(AddedToolInfo new
                                            item:newItem;
                                            resourceProvider:anApplicationWhichProvidesResourcesOrNil;
                                            where:where;
                                            positionSpec:positionSpecOrNilArg;
                                            space:space;
                                            before:before;
                                            menuWithNewItem:nil;
                                            yourself)
        ]
    ]
!

addMenuItem:newItem in:where position:positionSpecOrNilArg space:space
    ^ self
        addMenuItem:newItem 
        from:nil
        in:where 
        position:positionSpecOrNilArg 
        space:space
!

removeAllUserAddedTools
    UserAddedToolBarItems := nil.
    UserAddedMenuItems := nil.

    "
     self removeAllUserAddedTools
    "
!

removeUserTool:toolNameOrMenuItem
    "removes a menu item labeled toolName
     This can be invoked by a classes #deinitialize method, 
     to remove its item from the toolbar or menu.
    "

    self removeUserTool:toolNameOrMenuItem from:UserAddedToolBarItems.
    self removeUserTool:toolNameOrMenuItem from:UserAddedMenuItems.

    "
     Transcript topView application
        removeUserTool:'Bar' 
    "
    "
     Transcript topView application
        removeUserTool:'Foo' 
    "


!

removeUserTool:toolNameOrMenuItem from:addedToolsCollection
    "removes a menu item labeled toolName
     This can be invoked by a classes #deinitialize method, 
     to remove its item from the toolbar or menu.
    "

    |info space menuIndex whichMenu before menuItemToRemove|

    addedToolsCollection size == 0 ifTrue: [^nil].

    [true] whileTrue:[
        (toolNameOrMenuItem isString or:[toolNameOrMenuItem isSymbol]) ifTrue:[
            info := addedToolsCollection detect:[:eachInfo | |eachItem|
                                            eachItem := eachInfo item.
                                            (eachItem nameKey notNil and:[ toolNameOrMenuItem = eachItem nameKey])
                                            or:[ (eachItem activeHelpKey notNil and:[ toolNameOrMenuItem = eachItem activeHelpKey])
                                            or:[ (eachItem label notNil and:[ toolNameOrMenuItem = eachItem label])]]
                                          ]
                                   ifNone:nil.
        ] ifFalse:[
            info := addedToolsCollection detect:[:eachInfo | |eachItem| eachItem := eachInfo item. (eachItem == toolNameOrMenuItem)] ifNone:nil.
        ].
        info isNil ifTrue:[^ self].

        space     := info space.
        whichMenu := info menuWithNewItem.
        menuItemToRemove := info item.
        before := info before.

        whichMenu notNil ifTrue:[
            menuIndex := whichMenu findFirst:[:item | 
                                                    (item nameKey notNil and:[item nameKey == menuItemToRemove nameKey])
                                                    or:[ (item activeHelpKey notNil and:[item activeHelpKey == menuItemToRemove activeHelpKey])
                                                    or:[ (item label notNil and:[item label = menuItemToRemove label]) ]]
                                             ].
            menuIndex ~~ 0 ifTrue:[              
                whichMenu remove: menuIndex.
                space ifTrue: [
                    whichMenu remove:(menuIndex - (before ifTrue:0 ifFalse:1))
                ].
            ].
        ].
        addedToolsCollection removeKey:menuItemToRemove. 
        ^ self
    ].


    "
     Transcript topView application
        removeUserTool:'Bar' 
    "
    "
     Transcript topView application
        removeUserTool:'Foo' 
    "
! !

!NewLauncher class methodsFor:'menu specs'!

aboutMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#aboutMenu
     (Menu new fromLiteralArrayEncoding:(NewLauncher aboutMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(#Menu
        #(
         #(#MenuItem
            #label: 'About Smalltalk/X...'
            #translateLabel: true
            #value: #openAbout
            #activeHelpKey: #aboutSTX
          )
         #(#MenuItem
            #label: '-'
          )
         #(#MenuItem
            #label: 'Licence Conditions'
            #translateLabel: true
            #value: #openLicenseConditions
            #activeHelpKey: #aboutLicenseConditions
          )
         )
        nil
        nil
      )
!

classesMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#classesMenu
     (Menu new fromLiteralArrayEncoding:(NewLauncher classesMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            activeHelpKey: classesSystemBrowser
            label: 'System Browser'
            itemValue: openApplication:
            nameKey: systemBrowser
            translateLabel: true
            submenuChannel: menuClassHistory
            labelImage: (ResourceRetriever ToolbarIconLibrary startSystemBrowserIcon 'System Browser')
            argument: 'Tools::NewSystemBrowser'
            showBusyCursorWhilePerforming: true
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: startChangeSetBrowser
            label: 'Recent Changes'
            itemValue: startChangeSetBrowser
            nameKey: startChangeSetBrowser
            translateLabel: true
            showBusyCursorWhilePerforming: true
          )
         (MenuItem
            activeHelpKey: classesClassBrowserOnChanges
            label: 'Changed Classes'
            itemValue: startClassBrowserOnChanges
            nameKey: classBrowserOnChanges
            translateLabel: true
            showBusyCursorWhilePerforming: true
          )
         (MenuItem
            activeHelpKey: classBrowserOnChangedMethods
            label: 'Changed Methods'
            itemValue: startClassBrowserOnChangedMethods
            nameKey: classBrowserOnChangedMethods
            translateLabel: true
            showBusyCursorWhilePerforming: true
          )
         (MenuItem
            activeHelpKey: startSmallTeamChangeSetBrowser
            label: 'Recent Changes on SmallTeam Host'
            translateLabel: true
            isVisible: smallTeamAvailable
            submenuChannel: startBrowserOnSmallTeamChangesMenu
            showBusyCursorWhilePerforming: true
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: classesDebugging
            label: 'Debugging'
            nameKey: debugging
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: breakPointBrowser
                  label: 'Breakpoint Browser'
                  itemValue: openApplication:
                  translateLabel: true
                  argument: 'Tools::BreakpointBrowser'
                )
               (MenuItem
                  label: '-'
                )
               (MenuItem
                  activeHelpKey: classesShowTracePoints
                  label: 'Show all Break && Trace Points'
                  itemValue: browseAllBreakAndTracePoints
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: classesRemoveAllTracePoints
                  label: 'Remove all Break && Trace Points'
                  itemValue: removeAllBreakAndTracePoints
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: classesStopIgnoringHalts
                  enabled: debuggerHasIgnoredHalts
                  label: 'Stop Ignoring Halts/BreakPoints'
                  itemValue: stopIgnoringHalts
                  translateLabel: true
                )
               )
              nil
              nil
            )
          )
         (MenuItem
            label: 'Special Browsers'
            translateLabel: true
            submenuChannel: classesSpecialBrowserMenu
          )
         (MenuItem
            activeHelpKey: classesClassTreeBrowser
            label: 'Class Tree'
            itemValue: openApplication:
            translateLabel: true
            argument: 'ClassTreeGraphView'
            showBusyCursorWhilePerforming: true
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: classesImplementors
            label: 'Implementors Of...'
            itemValue: browseImplementors
            translateLabel: true
            showBusyCursorWhilePerforming: true
          )
         (MenuItem
            activeHelpKey: classesSenders
            label: 'Senders Of...'
            itemValue: browseSenders
            translateLabel: true
            showBusyCursorWhilePerforming: true
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: classesSpecial
            label: 'Special'
            nameKey: special
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: classesSpecialReferencesToUnboundGlobals
                  label: 'References to Unbound Globals'
                  itemValue: browseUnboundGlobals
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: classesSpecialReferencesToUndeclared
                  label: 'References to Undeclared'
                  itemValue: browseUndeclared
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: classesSpecialReferencesToUndeclared
                  label: 'Clear Undeclared Variables'
                  itemValue: clearUndeclaredVariables
                  translateLabel: true
                )
               )
              nil
              nil
            )
          )
         )
        nil
        nil
      )
!

classesSpecialBrowserMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#classesMenu
     (Menu new fromLiteralArrayEncoding:(NewLauncher classesMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
              (
               (MenuItem
                  activeHelpKey: classesClassBrowser
                  label: 'Class Browser On...'
                  itemValue: startClassBrowser
                  nameKey: classBrowserOn
                  translateLabel: true
                  showBusyCursorWhilePerforming: true
                )
               (MenuItem
                  activeHelpKey: classesFullClassBrowser
                  label: 'Full Class Browser On...'
                  itemValue: startFullClassBrowser
                  translateLabel: true
                  showBusyCursorWhilePerforming: true
                )
               (MenuItem
                  activeHelpKey: classesClassHierarchyBrowser
                  label: 'Class Hierarchy Browser On...'
                  itemValue: startClassHierarchyBrowser
                  translateLabel: true
                  showBusyCursorWhilePerforming: true
                )
               (MenuItem
                  label: '-'
                )
               (MenuItem
                  label: 'Method Finder'
                  itemValue: openMethodFinder
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: classesResourceMethods
                  label: 'Find Resource Methods...'
                  itemValue: browseResources
                  translateLabel: true
                )
               (MenuItem
                  label: '-'
                )
               (MenuItem
                  label: 'Snapshot Image Browser...'
                  itemValue: startSnapshotImageBrowser
                  translateLabel: true
                  showBusyCursorWhilePerforming: true
                )
               (MenuItem
                  enabled: remoteImageBrowserAvailable
                  label: 'Remote Image Browser...'
                  itemValue: startRemoteImageBrowser
                  translateLabel: true
                  showBusyCursorWhilePerforming: true
                )
               )
              nil
              nil
            )
!

demosMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#demosMenu
     (Menu new fromLiteralArrayEncoding:(NewLauncher demosMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            activeHelpKey: demosGoodies
            label: 'Goodies'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: demosClock
                  label: 'Clock'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'Clock'
                )
               (MenuItem
                  activeHelpKey: demosDigitalClock
                  label: 'Digital Clock'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'DigitalClockView'
                )
               (MenuItem
                  activeHelpKey: demosBabelFish
                  label: 'BabelFish'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'SOAP::TranslationServiceApplication'
                )
               )
              nil
              nil
            )
          )
         (MenuItem
            activeHelpKey: demosGames
            label: 'Games'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: gamesTetris
                  label: 'Blocks (Tetris look alike)'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'Games::Tetris'
                )
               (MenuItem
                  activeHelpKey: gamesTicTacToe
                  label: 'Tic Tac Toe'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'Games::TicTacToeGame'
                )
               (MenuItem
                  activeHelpKey: gamesTicTacToe2
                  label: 'Tic Tac Toe (2 Players)'
                  itemValue: startTicTacToe2
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: gamesPingPong
                  label: 'PingPong'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'Games::PingPongGame'
                )
               (MenuItem
                  activeHelpKey: gamesPingPong2
                  label: 'PingPong - (2 Players)'
                  itemValue: startPingPong2
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: gamesReversi
                  label: 'Reversi (Java)'
                  itemValue: startReversi
                  translateLabel: true
                )
               (MenuItem
                  label: 'Towers of Hanoi (Prolog)'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'Prolog::TowersOfHanoiApplication'
                )
               (MenuItem
                  label: 'MasterMind (Prolog)'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'Prolog::MasterMind'
                )
               )
              nil
              nil
            )
          )
         (MenuItem
            activeHelpKey: demosGeometric
            label: 'Geometric Designs'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: demosPen
                  label: 'Pen Demo'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'PenDemo'
                )
               (MenuItem
                  activeHelpKey: demosCommander
                  label: 'Commander Demo'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'CommanderDemo'
                )
               (MenuItem
                  label: '-'
                )
               (MenuItem
                  activeHelpKey: demosMandel
                  label: 'Mandel'
                  itemValue: openMandelbrotDemo
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: demosFractalPlants
                  label: 'Fractal Plants Demo'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'FractalPlantsDemo'
                )
               (MenuItem
                  activeHelpKey: demosFractalPatterns
                  label: 'Fractal Patterns Demo'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'FractalPatternsDemo'
                )
               (MenuItem
                  activeHelpKey: demosLSystems
                  label: 'Lindenmayer Patterns Demo'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'LSystemsDemo'
                )
               (MenuItem
                  activeHelpKey: demosMoreFractalPatterns
                  label: 'More Fractal Patterns Demo'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'ArmchairUniverseDemo'
                )
               (MenuItem
                  label: '-'
                )
               (MenuItem
                  label: 'Jan''s FractalApplication'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'Demos::FractalApplication'
                )
               (MenuItem
                  label: 'Jan''s Superformula'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'Demos::SuperFormulaApplication'
                )
               )
              nil
              nil
            )
          )
         (MenuItem
            activeHelpKey: demosAnimations
            label: 'Simple Animations'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: demosWalkingMan
                  label: 'Walking Man'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'Animation'
                )
               (MenuItem
                  activeHelpKey: demosWalkingMan
                  label: 'Walking Girl'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'WalkingGirl'
                )
               (MenuItem
                  activeHelpKey: demosGlobe
                  label: 'Globe Demo'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GlobeDemo'
                )
               (MenuItem
                  activeHelpKey: chickenFun
                  label: 'Chicken Fun'
                  itemValue: startStopDemo:
                  translateLabel: true
                  indication: chickenFunIsRunning
                  argument: 'ChickenFun'
                )
               (MenuItem
                  activeHelpKey: chickenFun
                  label: 'Chicks Eyes'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'ChickenEyes'
                )
               )
              nil
              nil
            )
          )
         (MenuItem
            activeHelpKey: demos3D
            label: '3D GL Graphics'
            translateLabel: true
            isVisible: displaySupportsGLDrawing
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: demos3Dplane
                  label: 'Plane'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GLPlaneDemoView2'
                )
               (MenuItem
                  activeHelpKey: demos3Dtetra
                  label: 'Tetra'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GLTetraDemoView'
                )
               (MenuItem
                  activeHelpKey: demos3DcubeWire
                  label: 'Cube (Wireframe)'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GLWireCubeDemoView'
                )
               (MenuItem
                  activeHelpKey: demos3DcubeSolid
                  label: 'Cube (Solid)'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GLCubeDemoView'
                )
               (MenuItem
                  activeHelpKey: demos3Dsphere
                  label: 'Sphere (Wireframe)'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GLWireSphereDemoView'
                )
               (MenuItem
                  activeHelpKey: demos3Ddoughnut
                  label: 'Doughnut (Wireframe)'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GLDoughnutDemoView'
                )
               (MenuItem
                  activeHelpKey: demos3Dplanet
                  label: 'Planet'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GLPlanetDemoView'
                )
               (MenuItem
                  activeHelpKey: demos3Dteapot
                  label: 'Teapot'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GLTeapotDemo'
                )
               (MenuItem
                  activeHelpKey: demos3Dlogo
                  label: 'Logo'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'Logo3DView1'
                )
               (MenuItem
                  activeHelpKey: demosCommander
                  label: 'Rubics Cube'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'RubicsCubeView'
                )
               (MenuItem
                  label: 'X/Y Graph'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GLXYGraph'
                )
               (MenuItem
                  label: 'X/Y Graph Widget'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'CodingExamples_GUI::GLXYGraph3DDemo'
                )
               (MenuItem
                  label: 'X/Y Graph Animated'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'CodingExamples_GUI::AnimatedGLXYGraph3DDemo'
                )
               (MenuItem
                  label: '-'
                )
               (MenuItem
                  label: 'Cube (Light)'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GLCubeDemoView2'
                )
               (MenuItem
                  label: 'Cube (Light and Texture)'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GLBrickCubeDemoView'
                )
               (MenuItem
                  label: 'Sphere (Light)'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GLSphereDemoView2'
                )
               (MenuItem
                  label: 'Colored Octahedron'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'GLOctaHedronDemoView'
                )
               )
              nil
              nil
            )
          )
         (MenuItem
            activeHelpKey: demosGraphicEditors
            label: 'Graphic Editors'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: demosGraphicEditorsDrawTool
                  label: 'Draw Tool'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'DrawTool'
                )
               (MenuItem
                  activeHelpKey: demosGraphicEditorsLogicTool
                  label: 'Logic Tool'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'LogicTool'
                )
               (MenuItem
                  activeHelpKey: demosGraphicEditorsPaintTool
                  label: 'Paint Demo'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'ColorDrawDemo3'
                )
               )
              nil
              nil
            )
          )
         (MenuItem
            activeHelpKey: demosGUI
            label: 'GUI'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: demosGUIWidgets
                  label: 'Widget Gallery'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'CodingExamples_GUI::GUIDemo'
                )
               (MenuItem
                  activeHelpKey: demosDrawingProtocol
                  label: 'Drawing Protocol Demo'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'CodingExamples_GUI::DrawingProtocolDemonstration'
                )
               (MenuItem
                  label: '-'
                )
               (MenuItem
                  activeHelpKey: demosGUICalculator
                  label: 'Calculator (simple)'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'CodingExamples_GUI::GUIDemoCalculator'
                )
               (MenuItem
                  activeHelpKey: demosGUICalculator
                  label: 'Calculator (nice)'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'CodingExamples_GUI::GUIDemoFoxCalculatorClone'
                )
               )
              nil
              nil
            )
          )
         (MenuItem
            activeHelpKey: demosOldStuff
            label: 'Old Stuff'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: demosCalendar
                  label: 'Calendar'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'Calendar'
                )
               (MenuItem
                  activeHelpKey: demosCalculator
                  label: 'Calculator'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'CalculatorView'
                )
               (MenuItem
                  label: '-'
                )
               (MenuItem
                  activeHelpKey: demosMail
                  label: 'Mail Tool'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'MailView'
                )
               (MenuItem
                  activeHelpKey: demosNews
                  label: 'News Tool'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'NewsView'
                )
               (MenuItem
                  activeHelpKey: demosFTP
                  label: 'FTP Tool'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'FTPTool'
                )
               (MenuItem
                  activeHelpKey: demosTelnet
                  label: 'Telnet Tool'
                  itemValue: openDemo:
                  translateLabel: true
                  argument: 'TelnetTool'
                )
               )
              nil
              nil
            )
          )
         )
        nil
        nil
      )
!

fileMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#fileMenu
     (Menu new fromLiteralArrayEncoding:(NewLauncher fileMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            activeHelpKey: fileFileBrowser
            label: 'File Browser'
            itemValue: openFileBrowser
            nameKey: fileBrowser
            translateLabel: true
            labelImage: (ResourceRetriever ToolbarIconLibrary startFileBrowserIcon 'File Browser')
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: fileSaveImage
            enabled: enableDangerousMenuItemsInRemoteLauncher
            label: 'Save Image'
            itemValue: saveImage
            nameKey: saveImage
            translateLabel: true
            labelImage: (ResourceRetriever ToolbarIconLibrary saveImageIcon 'Save Image')
          )
         (MenuItem
            activeHelpKey: fileSaveImageAs
            enabled: enableDangerousMenuItemsInRemoteLauncher
            label: 'Save Image As...'
            itemValue: saveImageAs
            nameKey: saveImageAs
            translateLabel: true
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: fileExit
            enabled: enableDangerousMenuItemsInRemoteLauncher
            label: 'Exit Smalltalk...'
            itemValue: exit
            nameKey: exitSmalltalk
            translateLabel: true
            isVisible: isMainLauncherHolder
          )
         (MenuItem
            activeHelpKey: fileClose
            label: 'Close...'
            itemValue: closeRequest
            translateLabel: true
            isVisible: isNotMainLauncherHolder
          )
         )
        nil
        nil
      )
!

helpMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#helpMenu
     (Menu new fromLiteralArrayEncoding:(NewLauncher helpMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            activeHelpKey: helpSTXOnlineDocumentation
            label: 'ST/X Online Documentation'
            itemValue: startDocumentationTool
            translateLabel: true
            labelImage: (ResourceRetriever ToolbarIconLibrary helpIcon2 'ST/X Online Documentation')
          )
         (MenuItem
            activeHelpKey: helpTutorial
            label: 'Smalltalk/X Tutorial'
            itemValue: startTutorial
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: helpSmalltalkTutorial
            label: 'Smalltalk Language Tutorial'
            itemValue: startSmalltalkTutorial
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: helpProgrammersGuide
            label: 'Programmer''s Guide'
            itemValue: startProgrammersGuide
            translateLabel: true
"/            labelImage: (ResourceRetriever ToolbarIconLibrary helpIcon 'Programmer''s Guide')
          )
         (MenuItem
            activeHelpKey: helpToolsDocumentation
            label: 'Tool Documentation'
            itemValue: startToolsDocumentation
            translateLabel: true
"/            labelImage: (ResourceRetriever ToolbarIconLibrary helpIcon 'Tool Documentation')
          )
         (MenuItem
            activeHelpKey: helpClassDocumentation
            label: 'Class Documentation'
            itemValue: startClassDocumentation
            translateLabel: true
"/            labelImage: (ResourceRetriever ToolbarIconLibrary helpIcon 'Class Documentation')
          )
         (MenuItem
            label: 'Web-Documents'
            translateLabel: true
            isVisible: webDocumentsItemShownInHelpMenu
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: helpRFC
                  label: 'RFCs...'
                  itemValue: showRFC
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: helpPortInfo
                  label: 'TCP/UDP Ports...'
                  itemValue: showPortInfo
                  translateLabel: true
                )
               )
              nil
              nil
            )
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: helpPrintDocumentation
            label: 'Print Documentation...'
            itemValue: showBookPrintDocument
            translateLabel: true
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: helpShowTipOfTheDay
            label: 'Tip of the Day'
            itemValue: showTipOfTheDay
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: helpActiveHelp
            label: 'Tooltips (FlyBy Help)'
            itemValue: toggleFlyByHelp:
            translateLabel: true
            indication: activeHelp
          )
         (MenuItem
            activeHelpKey: helpShowHelp
            label: 'Show Help Texts'
            translateLabel: true
            isVisible: false
            indication: showingHelp:
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: helpWhatsNew
            label: 'What''s New in the Documentation'
            itemValue: startWhatsNewDocumentation
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: helpWhatsNewInSTX
            label: 'What''s New in ST/X'
            itemValue: startWhatsNewSTX
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: helpIndex
            label: 'Keyword Index'
            itemValue: startDocumentationIndex
            translateLabel: true
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: helpCredits
            label: 'Credits'
            itemValue: showCredits
            translateLabel: true
          )
         )
        nil
        nil
      )
!

menu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#menu
     (Menu new fromLiteralArrayEncoding:(NewLauncher menu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            label: 'About'
            nameKey: about
            translateLabel: true
            submenuChannel: aboutMenu
            labelImage: (ResourceRetriever nil menuIcon)
          )
         (MenuItem
            label: 'File'
            nameKey: file
            translateLabel: true
            submenuChannel: fileMenu
          )
         (MenuItem
            label: 'Classes'
            nameKey: classes
            translateLabel: true
            submenuChannel: classesMenu
          )
         (MenuItem
            label: 'Tools'
            nameKey: tools
            translateLabel: true
            submenuChannel: toolsMenu
          )
         (MenuItem
            label: 'System'
            nameKey: system
            translateLabel: true
            submenuChannel: systemMenu
          )
         (MenuItem
            label: 'Settings'
            nameKey: settings
            translateLabel: true
            isVisible: useOldSettingsApplication
            submenuChannel: settingsMenu
          )
         (MenuItem
            label: 'Windows'
            nameKey: windows
            translateLabel: true
            submenuChannel: windowsMenu
          )
         (MenuItem
            label: 'Demos'
            nameKey: demos
            translateLabel: true
            submenuChannel: demosMenu
          )
         (MenuItem
            label: 'MENU_Help'
            nameKey: help
            translateLabel: true
            startGroup: conditionalRight
            submenuChannel: helpMenu
          )
         )
        nil
        nil
      )
!

menuOpenWorkspaceTypes
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#systemMenu
     (Menu new fromLiteralArrayEncoding:(NewLauncher systemMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            activeHelpKey: toolsWorkspace
            label: 'Normal'
            itemValue: openWorkspace
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: toolsMyWorkspace
            label: 'My Workspace'
            itemValue: openMyWorkspace
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: toolsSystemWorkspace
            label: 'System Workspace'
            itemValue: openSystemWorkspace
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: toolsEvaluationWorkspace
            label: 'Evaluation Workspace'
            itemValue: openEvaluationWorkspace
            translateLabel: true
          )
         )
        nil
        nil
      )
!

menuToolbar
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#menuToolbar
     (Menu new fromLiteralArrayEncoding:(NewLauncher menuToolbar)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            activeHelpKey: fileSaveImage
            enabled: enableDangerousMenuItemsInRemoteLauncher
            label: 'save image'
            itemValue: saveImage
            nameKey: saveImage
            translateLabel: true
            isButton: true
            labelImage: (ResourceRetriever ToolbarIconLibrary saveImageIcon)
          )
         (MenuItem
            activeHelpKey: fileFileBrowser
            label: 'open file browser'
            itemValue: openFileBrowser
            nameKey: fileBrowser
            translateLabel: true
            isButton: true
            isVisible: fileBrowserItemVisible
            submenuChannel: menuFileHistory
            labelImage: (ResourceRetriever ToolbarIconLibrary startFileBrowserIcon)
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: toolsWorkspace
            label: 'open workspace'
            itemValue: openWorkspace
            nameKey: workspace
            translateLabel: true
            isButton: true
            submenuChannel: menuOpenWorkspaceTypes
            labelImage: (ResourceRetriever ToolbarIconLibrary startWorkspaceIcon)
          )
         (MenuItem
            activeHelpKey: classesSystemBrowser
            label: 'open system browser'
            itemValue: openApplication:
            nameKey: systemBrowser
            translateLabel: true
            isButton: true
            isVisible: systemBrowserItemVisible
            submenuChannel: menuClassHistory
            labelImage: (ResourceRetriever ToolbarIconLibrary startSystemBrowserIcon)
            argument: 'SystemBrowser'
          )
         (MenuItem
            activeHelpKey: classesSystemBrowserOnClass
            label: 'System Browser On Class'
            translateLabel: true
            isButton: true
            isVisible: false
            submenuChannel: menuClassHistory
            labelImage: (ResourceRetriever ToolbarIconLibrary startSystemBrowserOnHistoryClassIcon)
          )
         (MenuItem
            activeHelpKey: toolsChangesBrowserOrNavigateToRecentChange
            label: 'open changes browser'
            itemValue: startChangesBrowser
            nameKey: changesBrowser
            translateLabel: true
            isButton: true
            submenuChannel: menuChangeHistory
            labelImage: (ResourceRetriever ToolbarIconLibrary startChangesBrowserIcon)
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: toolsGUIPainter
            label: 'open GUI Builder'
            itemValue: openApplication:
            nameKey: guiBuilder
            translateLabel: true
            isButton: true
            labelImage: (ResourceRetriever ToolbarIconLibrary startUIPainterIcon)
            argument: 'UIPainter'
          )
         (MenuItem
            activeHelpKey: toolsMenuEditor
            label: 'open menu editor'
            itemValue: openApplication:
            nameKey: menuEditor
            translateLabel: true
            isButton: true
            labelImage: (ResourceRetriever ToolbarIconLibrary startMenuEditorIcon)
            argument: 'MenuEditor'
          )
         (MenuItem
            activeHelpKey: toolsImageEditor
            label: 'open image editor'
            itemValue: openApplication:
            nameKey: imageEditor
            translateLabel: true
            isButton: true
            labelImage: (ResourceRetriever ToolbarIconLibrary startImageEditorIcon)
            argument: 'ImageEditor'
          )
         (MenuItem
            label: ''
          )
         (MenuItem
            activeHelpKey: systemGarbageCollectAndCompress
            label: 'garbage collect and compress'
            itemValue: compressingGarbageCollect
            nameKey: garbageCollect
            translateLabel: true
            isButton: true
            isVisible: false
            labelImage: (ResourceRetriever ToolbarIconLibrary garbageCollectIcon)
          )
         (MenuItem
            activeHelpKey: helpSTXOnlineDocumentation
            label: 'help'
            itemValue: startDocumentationTool
            nameKey: help
            translateLabel: true
            isButton: true
            startGroup: right
            labelImage: (ResourceRetriever XPToolbarIconLibrary stxHelpIcon)
          )
         )
        nil
        nil
      )
!

menuToolbar_pda
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#menuToolbar_pda
     (Menu new fromLiteralArrayEncoding:(NewLauncher menuToolbar_pda)) startUp
    "

    <resource: #menu>

    ^ 
     #(#Menu
        #(
         #(#MenuItem
            #label: 'open file browser'
            #isButton: true
            #nameKey: #fileBrowser
            #value: #openFileBrowser
            #activeHelpKey: #fileFileBrowser
            #labelImage: #(#ResourceRetriever ToolbarIconLibrary #startFileBrowserIcon)
          )
         #(#MenuItem
            #label: ''
          )
         #(#MenuItem
            #label: 'open system browser'
            #isButton: true
            #nameKey: #systemBrowser
            #value: #openApplication:
            #activeHelpKey: #classesSystemBrowser
            #argument: 'SystemBrowser'
            #labelImage: #(#ResourceRetriever ToolbarIconLibrary #startSystemBrowserIcon)
            #submenuChannel: #menuClassHistory
          )
         #(#MenuItem
            #label: ''
          )
         #(#MenuItem
            #label: 'help'
            #translateLabel: true
            #isButton: true
            #nameKey: #help
            #startGroup: #right
            #value: #startDocumentationTool
            #activeHelpKey: #helpSTXOnlineDocumentation
            #labelImage: #(#ResourceRetriever ToolbarIconLibrary #helpIcon2)
          )
         )
        nil
        nil
      )

    "Modified: / 05-11-2007 / 11:16:57 / cg"
!

menu_pda
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#menu_pda
     (Menu new fromLiteralArrayEncoding:(NewLauncher menu_pda)) startUp
    "

    <resource: #menu>

    ^ 
     #(#Menu
        #(
         #(#MenuItem
            #label: 'About'
            #translateLabel: true
            #nameKey: #about
            #activeHelpKey: #settings
            #labelImage: #(#ResourceRetriever nil #menuIcon)
            #submenuChannel: #aboutMenu
            #keepLinkedMenu: true
          )
         #(#MenuItem
            #label: '&File'
            #translateLabel: true
            #nameKey: #file
            #activeHelpKey: #settings
            #submenuChannel: #fileMenu
            #keepLinkedMenu: true
          )
         #(#MenuItem
            #label: 'Apps'
            #translateLabel: true
            #submenu: 
           #(#Menu
              #(
               #(#MenuItem
                  #label: 'Classes'
                  #translateLabel: true
                  #nameKey: #classes
                  #activeHelpKey: #settings
                  #submenuChannel: #classesMenu
                  #keepLinkedMenu: true
                )
               #(#MenuItem
                  #label: 'Tools'
                  #translateLabel: true
                  #nameKey: #tools
                  #activeHelpKey: #settings
                  #submenuChannel: #toolsMenu
                  #keepLinkedMenu: true
                )
               #(#MenuItem
                  #label: 'System'
                  #translateLabel: true
                  #nameKey: #system
                  #activeHelpKey: #settings
                  #submenuChannel: #systemMenu
                  #keepLinkedMenu: true
                )
               #(#MenuItem
                  #label: 'Demos'
                  #translateLabel: true
                  #nameKey: #demos
                  #activeHelpKey: #settings
                  #submenuChannel: #demosMenu
                  #keepLinkedMenu: true
                )
               )
              nil
              nil
            )
          )
         #(#MenuItem
            #label: 'Windows'
            #translateLabel: true
            #nameKey: #windows
            #activeHelpKey: #settings
            #submenuChannel: #windowsMenu
            #keepLinkedMenu: true
          )
         #(#MenuItem
            #label: '&Help'
            #translateLabel: true
            #nameKey: #help
            #startGroup: #right
            #activeHelpKey: #settings
            #submenuChannel: #helpMenu
            #keepLinkedMenu: true
          )
         )
        nil
        nil
      )

    "Modified: / 19-09-2006 / 20:48:22 / cg"
!

systemMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#systemMenu
     (Menu new fromLiteralArrayEncoding:(NewLauncher systemMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            activeHelpKey: systemMemory
            label: 'Memory'
            itemValue: openApplication:
            translateLabel: true
            argument: 'MemoryMonitor'
          )
         (MenuItem
            activeHelpKey: systemMemoryUsage
            label: 'Memory Usage'
            itemValue: openApplication:
            translateLabel: true
            argument: 'MemoryUsageView'
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: systemProcesses
            label: 'Processes'
            itemValue: startProcessMonitor
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: systemSemaphores
            label: 'Semaphores'
            itemValue: openApplication:
            translateLabel: true
            argument: 'SemaphoreMonitor'
          )
         (MenuItem
            activeHelpKey: fileModules
            enabled: enableDangerousMenuItemsInRemoteLauncher
            label: 'Modules...'
            itemValue: objectModuleDialog
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: filePackages
            enabled: enableDangerousMenuItemsInRemoteLauncher
            label: 'Packages...'
            itemValue: packageDialog
            translateLabel: true
            isVisible: packageDialogVisible
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: systemInterruptLatency
            label: 'Interrupt Latency'
            itemValue: startLatencyMonitor
            translateLabel: true
            isVisible: false
          )
         (MenuItem
            label: '-'
            isVisible: false
          )
         (MenuItem
            activeHelpKey: systemEventView
            label: 'Event View'
            itemValue: openApplication:
            translateLabel: true
            argument: 'EventMonitor'
          )
         (MenuItem
            activeHelpKey: systemEventTrace
            label: 'Event Trace'
            itemValue: startStopEventTrace
            translateLabel: true
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: systemGarbageCollect
            label: 'Collect Garbage'
            itemValue: garbageCollect
            translateLabel: true
            labelImage: (ResourceRetriever nil garbageCollectIcon 'Collect Garbage')
          )
         (MenuItem
            activeHelpKey: systemGarbageCollectAndCompress
            label: 'Collect Garbage and Compress'
            itemValue: compressingGarbageCollect
            translateLabel: true
            labelImage: (ResourceRetriever nil garbageCollectIcon 'Collect Garbage and Compress')
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: systemReloadResources
            label: 'Reload Resources'
            itemValue: flushCachedResources
            translateLabel: true
            labelImage: (ResourceRetriever nil garbageCollectIcon 'Reload Resources')
            showBusyCursorWhilePerforming: true
          )
         (MenuItem
            label: '-'
            isVisible: useNewSettingsApplication
          )
         (MenuItem
            activeHelpKey: systemSettings
            label: 'Settings...'
            itemValue: openSettings
            translateLabel: true
            isVisible: useNewSettingsApplication
          )
         )
        nil
        nil
      )
!

toolsMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#toolsMenu
     (Menu new fromLiteralArrayEncoding:(NewLauncher toolsMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            activeHelpKey: toolsWorkspace
            label: 'Workspace'
            itemValue: openWorkspace
            nameKey: workspace
            translateLabel: true
            labelImage: (ResourceRetriever ToolbarIconLibrary startWorkspaceIcon 'Workspace')
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            label: 'GUI'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: toolsGUIPainter
                  label: 'GUI Painter'
                  itemValue: openApplication:
                  nameKey: guiPainter
                  translateLabel: true
                  labelImage: (ResourceRetriever ToolbarIconLibrary startUIPainterIcon 'GUI Painter')
                  argument: 'UIPainter'
                )
               (MenuItem
                  activeHelpKey: toolsMenuEditor
                  label: 'Menu Editor'
                  itemValue: openApplication:
                  nameKey: menuEditor
                  translateLabel: true
                  labelImage: (ResourceRetriever ToolbarIconLibrary startMenuEditorIcon 'Menu Editor')
                  argument: 'MenuEditor'
                )
               (MenuItem
                  activeHelpKey: toolsImageEditor
                  label: 'Image Editor'
                  itemValue: openApplication:
                  nameKey: imageEditor
                  translateLabel: true
                  labelImage: (ResourceRetriever ToolbarIconLibrary startImageEditorIcon 'Image Editor')
                  argument: 'ImageEditor'
                )
               )
              nil
              nil
            )
          )
         (MenuItem
            label: 'Programming'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: toolsChangesBrowser
                  label: 'Change File Browser'
                  itemValue: startChangesBrowser
                  nameKey: changesBrowser
                  translateLabel: true
                  labelImage: (ResourceRetriever ToolbarIconLibrary startChangesBrowserIcon 'Change File Browser')
                )
               (MenuItem
                  activeHelpKey: toolsSUnit
                  label: 'SUnit Test'
                  itemValue: startSUnitTestRunner
                  nameKey: startSUnitTestRunner
                  translateLabel: true
                  labelImage: (ResourceRetriever NewLauncher startSUnitIcon 'SUnit Test')
                )
               (MenuItem
                  activeHelpKey: toolsToDoList
                  label: 'Programmer''s ToDo List'
                  itemValue: startToDoListBrowser
                  nameKey: startToDoListBrowser
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: toolsOOM
                  enabled: oomPackageLoaded
                  label: 'Code Metrics Browser'
                  itemValue: startOOMBrowser
                  nameKey: startOOMBrowser
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: toolsSmaCC
                  enabled: smaccPackageLoaded
                  label: 'SmaCC ParserGenerator'
                  itemValue: startSmaCCParserGenerator
                  nameKey: startSmaCCParserGenerator
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: toolsInternationalLanguageTranslationEditor
                  label: 'International Language Translation Editor'
                  itemValue: startInternationalLanguageTranslationEditor
                  translateLabel: true
                  labelImage: (ResourceRetriever ToolbarIconLibrary languagesIcon 'International Language Translation Editor')
                )
               )
              nil
              nil
            )
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            label: 'Bug Reporter'
            itemValue: startBugMessages
            nameKey: bugMessages
            translateLabel: true
            isVisible: bugReporterAvailable
            labelImage: (ResourceRetriever NewLauncher bugReporterIcon 'Bug Reporter')
          )
         (MenuItem
            label: 'SQL Workspace'
            itemValue: startSQLWorkspace
            translateLabel: true
            isVisible: sqlWorkspaceItemVisible
          )
         (MenuItem
            activeHelpKey: fileApplicationBuilder
            label: 'Application Packager (exe-Builder)'
            itemValue: openApplication:
            translateLabel: true
            labelImage: (ResourceRetriever ToolbarIconLibrary projectBuilderIcon 'Application Packager (exe-Builder)')
            argument: 'Tools::ProjectBuilderAssistantApplication'
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            label: 'Recently Opened'
            translateLabel: true
            submenuChannel: recentlyOpenedApplicationsMenu
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: toolsMisc
            label: 'Misc'
            nameKey: misc
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: toolsMiscProjects
                  label: 'Projects'
                  translateLabel: true
                  isVisible: false
                  submenu: 
                 (Menu
                    (
                     (MenuItem
                        activeHelpKey: toolsMiscProjectsNewProject
                        label: 'New Project'
                        itemValue: newProject
                        translateLabel: true
                      )
                     (MenuItem
                        label: '-'
                      )
                     (MenuItem
                        activeHelpKey: toolsMiscProjectsSelectProject
                        label: 'Select Project...'
                        itemValue: selectProject
                        translateLabel: true
                      )
                     )
                    nil
                    nil
                  )
                )
               (MenuItem
                  label: '-'
                  isVisible: false
                )
               (MenuItem
                  activeHelpKey: toolsMiscNewLauncher
                  label: 'Reopen Launcher'
                  itemValue: startNewLauncher
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: demosRemoteLauncher
                  enabled: canOpenRemoteLauncher
                  label: 'Remote Launcher...'
                  itemValue: startRemoteLauncher
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: demosPDALauncher
                  label: 'PDA Launcher...'
                  itemValue: startPDALauncher
                  translateLabel: true
                  isVisible: hasPDALauncher
                )
               (MenuItem
                  label: '-'
                )
               (MenuItem
                  activeHelpKey: toolsMiscNewChangesBrowser
                  label: 'New Changes Browser'
                  itemValue: startNewChangesBrowser
                  translateLabel: true
                )
               (MenuItem
                  activeHelpKey: toolsMiscOldChangesBrowser
                  label: 'Old Changes Browser'
                  itemValue: startOldChangesBrowser
                  translateLabel: true
                )
               (MenuItem
                  label: '-'
                  isVisible: canDoTerminal
                )
               (MenuItem
                  activeHelpKey: toolsTerminal
                  label: 'Terminal'
                  itemValue: openTerminal
                  translateLabel: true
                  isVisible: canDoTerminal
                )
               (MenuItem
                  label: '-'
                  isVisible: canDoTerminal
                )
               (MenuItem
                  label: 'Inspect Global Variables'
                  itemValue: inspectGlobalVariables
                  translateLabel: true
                )
               (MenuItem
                  label: 'Inspect Workspace Variables'
                  itemValue: inspectWorkspaceVariables
                  translateLabel: true
                )
               (MenuItem
                  label: 'Remove all Workspace Variables'
                  itemValue: removeAllWorkspaceVariables
                  translateLabel: true
                )
               )
              nil
              nil
            )
          )
         )
        nil
        nil
      )
!

windowsMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#windowsMenu
     (Menu new fromLiteralArrayEncoding:(NewLauncher windowsMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            activeHelpKey: windowsRedrawAll
            label: 'Redraw All'
            itemValue: redrawAllWindows
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: windowsIconifyAll
            label: 'Iconify All'
            itemValue: iconifyAllWindows
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: windowsDeiconifyAll
            label: 'Deiconify All'
            itemValue: deIconifyAllWindows
            translateLabel: true
          )
         (MenuItem
            label: 'Migrate'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  activeHelpKey: windowsMigrateAllWindows
                  label: 'Migrate All To...'
                  itemValue: migrateAllWindows
                  translateLabel: true
                  enabled: windowMigrationFunctionsAreShown
                )
               (MenuItem
                  activeHelpKey: windowsSelectAndMigrate
                  label: 'Select and Migrate To...'
                  itemValue: viewMigrate
                  translateLabel: true
                  enabled: windowMigrationFunctionsAreShown
                )
               (MenuItem
                  activeHelpKey: windowsFindAndMigrate
                  label: 'Find by Name and Migrate To...'
                  itemValue: findAndMigrateWindow
                  translateLabel: true
                  enabled: windowMigrationFunctionsAreShown
                )
               (MenuItem
                  activeHelpKey: windowsFindAndMigrateBack
                  label: 'Find by Name and Migrate Back...'
                  itemValue: findAndMigrateWindowBack
                  translateLabel: true
                  enabled: windowMigrationFunctionsAreShown
                )
               )
              nil
              nil
            )
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: windowsViewTree
            label: 'Window Tree'
            itemValue: startWindowTreeView
            translateLabel: true
            isVisible: windowTreeViewAvailable
          )
         (MenuItem
            activeHelpKey: windowsViewTreeAllViews
            label: 'Window Tree (All Windows)'
            itemValue: openApplication:
            translateLabel: true
            isVisible: windowTreeViewAvailable
            argument: 'WindowTreeView'
          )
         (MenuItem
            activeHelpKey: windowsViewTreeAllScreens
            label: 'Window Tree (All on All Screens)'
            itemValue: startWindowTreeViewForAll
            translateLabel: true
            isVisible: windowTreeViewAvailable
          )
         (MenuItem
            activeHelpKey: flyByWindowInformation
            label: 'FlyBy Window Information'
            itemValue: showFlyByWindowInformation
            translateLabel: true
            labelImage: (ResourceRetriever ToolbarIconLibrary viewInspect22x22Icon 'FlyBy Window Information')
          )
         (MenuItem
            activeHelpKey: flyByWindowInformation
            label: 'Window Tree Inspector'
            itemValue: openWindowTreeInspector
            translateLabel: true
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: windowsSelectAndInspect
            label: 'Select and Inspect'
            itemValue: viewInspect
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: windowsSelectAndDestroy
            label: 'Select and Destroy'
            itemValue: viewDestroy
            translateLabel: true
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: windowsFindAndRaise
            enabled: enableDangerousMenuItemsInRemoteLauncher
            label: 'Find by Name and Raise...'
            itemValue: findAndRaiseWindow
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: windowsFindAndDestroy
            enabled: enableDangerousMenuItemsInRemoteLauncher
            label: 'Find by Name and Destroy...'
            itemValue: findAndDestroyWindow
            translateLabel: true
          )
         (MenuItem
            label: '-'
          )
         (MenuItem
            activeHelpKey: windowsGrapWindow
            label: 'Grab Window...'
            itemValue: viewHardcopy
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: windowsGrapWidget
            label: 'Grab Widget...'
            itemValue: widgetHardcopy
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: windowsGrapScreen
            label: 'Grab Screen...'
            itemValue: fullScreenHardcopy
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: windowsGrapScreenArea
            label: 'Grab Screen Area...'
            itemValue: screenHardcopy
            translateLabel: true
          )
         (MenuItem
            activeHelpKey: windowsGrapScreenArea
            label: 'Grab Screen Area with Delay...'
            itemValue: screenHardcopyWithDelay
            translateLabel: true
          )
         )
        nil
        nil
      )
! !

!NewLauncher class methodsFor:'oldstyle-menu specs'!

settingsMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#settingsMenu
     (Menu new fromLiteralArrayEncoding:(NewLauncher settingsMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(#Menu
        #(
         #(#MenuItem
            #activeHelpKey: #settingsLanguage
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Language...'
            #itemValue: #languageSetting
            #translateLabel: true
          )
         #(#MenuItem
            #activeHelpKey: #settingsKeyboardMappings
            #label: 'Keyboard Mappings...'
            #itemValue: #keyboardSetting
            #translateLabel: true
          )
         #(#MenuItem
            #activeHelpKey: #settingsViewStyle
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'View Style...'
            #itemValue: #viewStyleSetting
            #translateLabel: true
          )
         #(#MenuItem
            #activeHelpKey: #settingsFonts
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Fonts...'
            #itemValue: #fontSettings
            #translateLabel: true
          )
         #(#MenuItem
            #label: '-'
          )
         #(#MenuItem
            #activeHelpKey: #settingsMessages
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Messages...'
            #itemValue: #messageSettings
            #translateLabel: true
          )
         #(#MenuItem
            #activeHelpKey: #settingsCompilation
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Compilation...'
            #itemValue: #compilerSettings
            #translateLabel: true
          )
         #(#MenuItem
            #activeHelpKey: #settingsObjectMemory
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Object Memory...'
            #itemValue: #memorySettings
            #translateLabel: true
          )
         #(#MenuItem
            #activeHelpKey: #settingsSourceAndDebugger
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Source and Debugger...'
            #itemValue: #sourceAndDebuggerSettings
            #translateLabel: true
          )
         #(#MenuItem
            #activeHelpKey: #settingsTools
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Tools...'
            #itemValue: #toolSettings
            #translateLabel: true
          )
         #(#MenuItem
            #activeHelpKey: #settingsJava
            #label: 'Java...'
            #itemValue: #javaSettings
            #translateLabel: true
            #isVisible: #javaSupportPresent
          )
         #(#MenuItem
            #label: '-'
          )
         #(#MenuItem
            #activeHelpKey: #settingsPrinter
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Printer...'
            #itemValue: #printerSettings
            #translateLabel: true
          )
         #(#MenuItem
            #activeHelpKey: #settingsScreen
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Screen...'
            #itemValue: #displaySettings
            #translateLabel: true
          )
         #(#MenuItem
            #label: '-'
          )
         #(#MenuItem
            #activeHelpKey: #settingsMisc
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Editing...'
            #itemValue: #editSettings
            #translateLabel: true
          )
         #(#MenuItem
            #activeHelpKey: #settingsMisc
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Misc...'
            #itemValue: #miscSettings
            #translateLabel: true
          )
         #(#MenuItem
            #activeHelpKey: #settingsCommunications
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Communications...'
            #itemValue: #communicationsSettings
            #translateLabel: true
            #isVisible: false
          )
         #(#MenuItem
            #label: '-'
          )
         #(#MenuItem
            #activeHelpKey: #settingsSaveSettings
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Save Settings...'
            #itemValue: #saveSettings
            #translateLabel: true
          )
         #(#MenuItem
            #activeHelpKey: #settingsLoadSettings
            #enabled: #enableDangerousMenuItemsInRemoteLauncher
            #label: 'Load Settings...'
            #itemValue: #loadSettings
            #translateLabel: true
          )
         )
        nil
        nil
      )
! !

!NewLauncher class methodsFor:'resources'!

bugReporterIcon
    <resource: #programImage>

    ^ ToolbarIconLibrary bugReporter24x24Icon    
    "/ ^ ToolbarIconLibrary bugReporter28x28Icon    
!

startNewFileBrowserIcon
    <resource: #programImage>

    ^ ToolbarIconLibrary startNewFileBrowserIcon
!

startNewSystemBrowserIcon
    <resource: #programImage>

    ^ ToolbarIconLibrary startNewSystemBrowserIcon
!

startSUnitIcon
    <resource: #programImage>

    ^ ToolbarIconLibrary sUnit24x24Icon    
    "/ ^ ToolbarIconLibrary sUnit28x28Icon    
! !

!NewLauncher methodsFor:'accessing'!

errorListCanvas
    errorListCanvas isNil ifTrue:[
        errorListCanvas := DataSetView new.
    ].
    ^ errorListCanvas
!

examples
"
    reopening a standard launcher (without any added tools)
                                                                        [exBegin]
     NewLauncher removeAllUserAddedTools.
     NewLauncher open.
                                                                        [exEnd]



    adding your own menu items (for user-applications)

    an additional item in the tools menu:
                                                                        [exBegin]
     Transcript topView application
        addMenuItem:(MenuItem new 
                        label: 'Foo';
                        value: [Transcript showCR:'foo invoked'];
                        isButton: false;
                        labelImage: nil;
                        nameKey: #foo;
                        activeHelpKey: #Foo)
        in:#menu
        position:#(before workspace)
        space:true
                                                                        [exEnd]

    an additional item in the tools menu:
                                                                        [exBegin]
     Transcript topView application
        addMenuItem:(MenuItem new 
                        label: 'Foo';
                        value: [Transcript showCR:'foo invoked'];
                        isButton: false;
                        labelImage: nil;
                        activeHelpKey: #Foo)
        in:#menu
        position:#(after guiPainter)
        space:true
                                                                        [exEnd]

    an additional item in one of the tools sub menus:
                                                                        [exBegin]
     Transcript topView application
        addMenuItem:(MenuItem new 
                        label: 'Foo';
                        value: [Transcript showCR:'foo invoked'];
                        isButton: false;
                        labelImage: nil;
                        activeHelpKey: #Foo)
        in:#toolbar
        position:#(after Workspace)
        space:true
                                                                        [exEnd]
"
!

infoLineTemplate
    "controls what is shown in the lower info - line.
     See classes defaultInfoLineTemplate and updateInfo for desription."

    ^ infoLineTemplate ? (self class defaultInfoLineTemplate)
!

infoLineTemplate:aString
    "controls what is shown in the lower info - line.
     See classes defaultInfoLineTemplate and updateInfo for desription."

    infoLineTemplate := aString.
!

menuToolbar
    "provide access to my toolBar"

    |menu|

    menu := Menu decodeFromLiteralArray:(self class menuToolbar).
    "/ menu receiver:self. -- now done in findGuiResources ...
    menu findGuiResourcesIn:self.

    ^ menu

    "Modified: / 27-03-2007 / 08:43:32 / cg"
!

transcriptView
    "provide access to my transcript view"

    transcript isNil ifTrue:[
        (self componentAt: #transcriptView) notNil ifTrue:[
            transcript := (self componentAt: #transcriptView) subViews first.
        ] ifFalse:[
            transcript := Workspace new.
        ]
    ].
    ^ transcript
! !

!NewLauncher methodsFor:'aspects'!

canDoTerminal
    "return a 'valueHolder', which returns true if the terminal application
     is available. For now, this is true if we run under unix"

    ^ OperatingSystem isUNIXlike 
      or:[OperatingSystem isMSWINDOWSlike]

    "Created: / 27.7.1998 / 12:47:54 / cg"
    "Modified: / 28.4.1999 / 11:55:24 / cg"
!

canOpenRemoteLauncher
    ^ XWorkstation notNil and:[ XWorkstation isLoaded ]

    "Created: / 09-11-2007 / 12:10:51 / cg"
!

chickenFunIsRunning
    "return a 'valueHolder', which returns true if the chickenFun demo is running."

    ^ [Demos::ChickenFun notNil
      and:[Demos::ChickenFun isLoaded
      and:[Demos::ChickenFun isRunning]]]
!

chickenFunRunning
    "return a 'valueHolder', which returns true if the chickenFun demo is running."

    ^ [Demos::ChickenFun notNil
      and:[Demos::ChickenFun isLoaded
      and:[Demos::ChickenFun isRunning]]]
!

debuggerHasIgnoredHalts
    ^ DebugView notNil and:[ DebugView hasIgnoredHalts ]

    "Modified: / 10-07-2010 / 18:47:36 / cg"
!

displaySupportsGLDrawing
    "return a 'valueHolder', which returns true if the GL support
     is available."

    ^ [Screen current supportsGLDrawing]

    "Modified: / 13.2.1998 / 14:26:31 / cg"
    "Created: / 3.5.1999 / 16:47:22 / cg"
!

enableDangerousMenuItemsInRemoteLauncher

    |holder|

    (holder := builder bindingAt:#enableDangerousMenuItemsInRemoteLauncher) isNil ifTrue:[
        builder aspectAt:#enableDangerousMenuItemsInRemoteLauncher put:(holder :=  true asValue).
    ].
    ^ holder
!

fileBrowserItemVisible
    |holder|

    (holder := builder bindingAt:#fileBrowserItemVisible) isNil ifTrue:[
        builder 
            aspectAt:#fileBrowserItemVisible 
            put:(holder := UserPreferences current useNewFileBrowser not asValue)
    ].
    ^ holder
!

historyManagerActive
    "Answer whether the history manager is active."

    ^[HistoryManager isActive]

    "Created: / 20-06-2004 / 16:05:41 / masca"
    "Modified: / 20-04-2005 / 18:59:28 / janfrog"
!

isMainLauncherHolder
    ^ [ isMainLauncher ]
!

isNotMainLauncherHolder
    ^ [ isMainLauncher not ]
!

javaSupportPresent
    "return a 'valueHolder', which returns true if the java support
     is available."

    ^ [JavaVM notNil and:[JavaVM isBehavior and:[JavaVM isLoaded]]]

    "Created: / 13.2.1998 / 14:25:59 / cg"
    "Modified: / 13.2.1998 / 14:26:31 / cg"
!

libraryBuilderAvailable
    ^ false

    "Created: / 20.6.1998 / 16:54:31 / cg"
!

noteBookCanvasHolder
    |holder|

    (holder := builder bindingAt:#noteBookCanvasHolder) isNil ifTrue:[
        builder aspectAt:#noteBookCanvasHolder put:(holder := nil asValue).
        holder value:self transcriptView.
    ].
    ^ holder
!

oomPackageLoaded
    "true if the oom (metrics) package is loaded"

    "/ access via at: to prevent preference-detector from including oom as
    "/ prerequisite for NewLaucher.
    ^ (Smalltalk at:#'OOM::MetricVisualizer') isBehavior
!

packageDialogVisible
"/    ^ true.
    ^ false
!

selectedTabHolder
    |holder|

    (holder := builder bindingAt:#selectedTabHolder) isNil ifTrue:[
        builder aspectAt:#selectedTabHolder put:(holder := 1 asValue).
        holder addDependent:self.
    ].
    ^ holder
!

showActiveHelpMenuItem
    ^ false
!

smaccPackageLoaded
    "true if the oom (metrics) package is loaded"

    "/ access via at: to prevent preference-detector from including oom as
    "/ prerequisite for NewLaucher.
    ^ (Smalltalk at:#'SmaCC::SmaccParserGenerator') isBehavior
!

smallTeamAvailable
    ^ SmallTeam notNil

    "Created: / 12-11-2006 / 16:09:18 / cg"
!

sqlWorkspaceItemVisible
    ^ (Smalltalk at:#'SQL::ODBCScratchpad') notNil
!

systemBrowserItemVisible
    |holder|

    (holder := builder bindingAt:#systemBrowserItemVisible) isNil ifTrue:[
        builder 
            aspectAt:#systemBrowserItemVisible 
            put:(holder := UserPreferences current useNewSystemBrowser not asValue).
    ].
    ^ holder
!

tabList
    ^ resources array:#('Transcript' 'Errors').
!

webDocumentsItemShownInHelpMenu
    ^ false
! !

!NewLauncher methodsFor:'change & update'!

update:something with:aParameter from:changedObject
    "care for project changes & update my infoView"

    ((something == #currentProject) or:[changedObject == Project]) ifTrue: [self updateInfo].
    changedObject == self selectedTabHolder ifTrue: [
        changedObject value == 1 ifTrue:[
            self noteBookCanvasHolder value:self transcriptView.
            ^ self.
        ].
        changedObject value == 2 ifTrue:[
            self noteBookCanvasHolder value:self errorListCanvas.
            ^ self.
        ].
    ].
    super update:something with:aParameter from:changedObject.
!

updateInfo
    "update the infoLabel (at the bottom) from the current project"

    |project projectName projectDir packageName packageNameOrNil defNameSpace projectInfo
     cvsRepository storeDB image bindings makeInfoString svnWorkDirBaseName|

    (Project notNil and:[(project := Project current) notNil]) ifTrue:[
        projectName := project name.
        projectDir := project directory.
        packageName := packageNameOrNil := project package.
        defNameSpace := project defaultNameSpace.
        packageNameOrNil = PackageId noProjectID ifTrue:[
            packageNameOrNil := nil
        ].
    ].
    defNameSpace isNil ifTrue:[
        defNameSpace := Smalltalk.
    ].
    image := ((ObjectMemory imageName ? 'none') asFilename baseName).

    SourceCodeManager notNil ifTrue:[
        SourceCodeManager isCVS ifTrue:[
            cvsRepository := SourceCodeManager repositoryName.
            (cvsRepository notNil and:[cvsRepository startsWith:':pserver:']) ifTrue:[
                cvsRepository := cvsRepository copyFrom:':pserver:'size+1.
            ].
        ] ifFalse:[
            SourceCodeManager isStore ifTrue:[
                storeDB := SourceCodeManager hostAndDBName
            ]
        ]
    ].

    makeInfoString := [:title :value |
            (resources string:title) allBold
            ,': '
            ,(value colorizeAllWith:(Color blue darkened))
            ,' '
        ].

    bindings := Dictionary new.
    packageName isNil ifTrue:[
        bindings at:'PACKAGE' put:''.
    ] ifFalse:[
        bindings at:'PACKAGE' put:(makeInfoString value:'Pkg' value:packageName).
    ].
    packageNameOrNil isNil ifTrue:[
        bindings at:'PACKAGEOREMPTY' put:''.
    ] ifFalse:[
        bindings at:'PACKAGEOREMPTY' put:(makeInfoString value:'Pkg' value:packageNameOrNil).
    ].

    bindings
        at:'IMAGE'
        put:(makeInfoString value:'Img' value:image).

    bindings
        at:'NS' put:( defNameSpace == Smalltalk 
                        ifTrue:[ '' ] 
                        ifFalse:[ '"',defNameSpace name,'" '] ).

    bindings
        at:'PROJECTDIR'
        put:(makeInfoString value:'Dir' value:(projectDir contractTo: 30)).


    cvsRepository isNil ifTrue:[
        bindings at:'CVS' put:''
    ] ifFalse:[
        bindings at:'CVS' put:(makeInfoString value:'CVS' value:cvsRepository).
    ].
    storeDB isNil ifTrue:[
        bindings at:'DB' put:''.
    ] ifFalse:[
        bindings at:'DB' put:(makeInfoString value:'DB' value:storeDB).
    ].
    (cvsRepository isNil and:[storeDB isNil]) ifTrue:[
        bindings at:'NOREPOSITORY' put:' >','No Repository'allBold,'< '.
    ] ifFalse:[
        bindings at:'NOREPOSITORY' put:''.
    ].

    (SVN::RepositoryManager notNil
    and:[ SVN::RepositoryManager isLoaded    
    and:[ SVN::RepositoryManager enabled ]])
        ifTrue:[
            svnWorkDirBaseName := SVN::RepositoryManager current workingCopyBase asFilename baseName.

            bindings
                at:  'SVN_WORKING_COPY'
                put: (makeInfoString value:'SVN Work' value:svnWorkDirBaseName).
        ] ifFalse:[
            bindings
                at:  'SVN_WORKING_COPY'
                put: ''
        ].

    projectInfo := self infoLineTemplate bindWithArguments:bindings.
    self infoLabelHolder value:projectInfo.
    ^projectInfo.
! !

!NewLauncher methodsFor:'help'!

defaultInfoLabel

    ^self updateInfo

! !

!NewLauncher methodsFor:'menu configuration'!

addMenuItem:newItem from:anApplicationClassWhichProvidesResourcesOrNil in:where position:positionSpecOrNilArg space:space
    "adds a menu item;
       where == #menu        - menu item is added at the end of the sub menu 'Tools',
       where == #toolbar     - menu item is added at the end of the tool bar,
       where == #menu.<name> - menu item is added at the end of the sub menu named 'name',

    position may be one of:
        #(before <someItemPath>)
        #(after  <someItemPath>)
        #( #first )   or #first
        #( #last )    or #last   or nil

     If space is true, some empty space is inserted.
     This can be invoked by a classes #initialize method, to add an item
     for itself to the toolbar or menu."

    |what menuPanel freeMenuIndex mainMenuPanel item subViews subMenuPath 
     rest subMenu subItem positionSpecOrNil itemNameOrNil before itemsOriginalLabel|

    itemsOriginalLabel := newItem label.
    newItem findGuiResourcesIn:anApplicationClassWhichProvidesResourcesOrNil rememberResourcesIn:nil.

    positionSpecOrNil := positionSpecOrNilArg.
    positionSpecOrNil isArray ifTrue:[
        positionSpecOrNil size > 1 ifTrue:[
            itemNameOrNil := positionSpecOrNil at:2.
        ].
        positionSpecOrNil := positionSpecOrNil at:1.
    ].
    before := (positionSpecOrNil == #first) or:[positionSpecOrNil == #before].

    what := where.
    (what isNil or:[what = 'toolbar']) ifTrue:[
        menuPanel := builder namedComponents at:#menuToolbarView ifAbsent:nil.
        menuPanel isNil ifTrue:[
            'NewLauncher [warning]: addUserTool failed - no menuPanel' infoPrintCR.
            ^ self
        ].
        "/ look if not already in the toolBar
        (self findItem:newItem inMenuPanel:menuPanel) ~~ 0 ifTrue:[
            "item already exists - do nothing"
            ^ self.
        ].

        "/ ok, not there; search for the position to put the item
        freeMenuIndex := 0.
        itemNameOrNil notNil ifTrue:[
            freeMenuIndex := menuPanel findFirst: [:i| i nameKey = itemNameOrNil].
            freeMenuIndex == 0 ifTrue:[
                freeMenuIndex := menuPanel findFirst: [:i| i activeHelpKey = itemNameOrNil 
                                                           or:[i label = itemNameOrNil]].
            ]
        ].

        freeMenuIndex == 0 ifTrue:[
            "item to insert relative to not found, insert at the begin or end"
            freeMenuIndex := before ifTrue:1 ifFalse:[menuPanel numberOfItems + 1].
        ] ifFalse:[
            before ifFalse:[freeMenuIndex := freeMenuIndex +1].
        ].

        space ifTrue:[
            "want an empty entry before or after newItem"
            (menuPanel createAtIndex:freeMenuIndex) menuItem:(MenuItem labeled:'').
            before ifFalse:[
                freeMenuIndex := freeMenuIndex + 1.
            ].
        ].

        (menuPanel createAtIndex:freeMenuIndex) menuItem:newItem.

        UserAddedToolBarItems isNil ifTrue: [UserAddedToolBarItems := Dictionary new].
        UserAddedToolBarItems at:newItem put:(AddedToolInfo new
                                            item:newItem;
                                            originalLabel:itemsOriginalLabel;
                                            resourceProvider:anApplicationClassWhichProvidesResourcesOrNil;
                                            where:where;
                                            positionSpec:positionSpecOrNilArg;
                                            space:space;
                                            before:before;
                                            menuWithNewItem:menuPanel;
                                            yourself)
    ].

    what isNil ifTrue:[
        what := #menu
    ].

    (what includes:$.) ifTrue:[
        subMenuPath := what asCollectionOfSubstringsSeparatedBy:$..
        what := subMenuPath at:1.
        subMenuPath := subMenuPath copyFrom:2.
    ] ifFalse:[
        subMenuPath := #('tools').
    ].

    what = 'menu' ifTrue:[
        mainMenuPanel := self builder menuBar.
        mainMenuPanel isNil ifTrue:[
            subViews := self builder window subViews.
            subViews notNil ifTrue:[
                mainMenuPanel := subViews at:1 ifAbsent:nil.
            ]
        ].
        mainMenuPanel isNil ifTrue:[
            'NewLauncher [warning]: addUserTool failed - no mainMenu' infoPrintCR.
            ^ self
        ].

        subMenuPath first isEmptyOrNil ifTrue:[
            "add to top menu"
            menuPanel := mainMenuPanel.
        ] ifFalse:[
            "lookup sub menu"
            item := mainMenuPanel itemAt:subMenuPath first.
            item isNil ifTrue:[
                item := mainMenuPanel itemAt:'tools'.
                item isNil ifTrue:[
                    'NewLauncher [warning]: addUserTool failed - no tools menu' infoPrintCR.
                    ^ self
                ].
            ].
            rest := subMenuPath copyFrom:2.
            menuPanel := subMenu := item submenu.

            rest do:[:pathComponent|
                subMenu notNil ifTrue:[
                    menuPanel := subMenu.
                    subItem := subMenu itemAt:pathComponent.
                    subItem isNil ifTrue:[
                        subMenu := nil
                    ] ifFalse:[
                        subMenu := subItem submenu.
                    ]
                ].
            ].
            subMenu notNil ifTrue:[
                menuPanel := subMenu.
            ]
        ].

        "/ look if not already in the panel
        (self findItem:newItem inMenuPanel:menuPanel) ~~ 0 ifTrue:[
            "item already exists - do nothing"
            ^ self.
        ].

        "/ ok, search for the position to put the item

        freeMenuIndex := 0.
        itemNameOrNil notNil ifTrue:[
            freeMenuIndex := menuPanel findFirst:[:i| i nameKey = itemNameOrNil].
            freeMenuIndex == 0 ifTrue:[
                freeMenuIndex := menuPanel findFirst:[:i| i itemValue = itemNameOrNil].
                freeMenuIndex == 0 ifTrue:[
                    freeMenuIndex := menuPanel findFirst:[:i| i activeHelpKey = itemNameOrNil 
                                                              or:[i label = itemNameOrNil]].
                ]
            ]
        ].
        freeMenuIndex == 0 ifTrue:[
            freeMenuIndex := before ifTrue:1 ifFalse:[menuPanel numberOfItems + 1].
        ] ifFalse:[
            before ifFalse:[freeMenuIndex := freeMenuIndex +1].
        ].
        space ifTrue:[
            "want a line before or after newItem"
            (menuPanel createAtIndex:freeMenuIndex) menuItem:(MenuItem labeled: '-').
            before ifFalse:[
                freeMenuIndex := freeMenuIndex + 1.
            ].
        ].

        (menuPanel createAtIndex:freeMenuIndex) menuItem:newItem.

        UserAddedMenuItems isNil ifTrue: [UserAddedMenuItems := Dictionary new].
        UserAddedMenuItems at:newItem put:(AddedToolInfo new
                                            item:newItem;
                                            originalLabel:itemsOriginalLabel;
                                            resourceProvider:anApplicationClassWhichProvidesResourcesOrNil;
                                            where:where;
                                            positionSpec:positionSpecOrNilArg;
                                            space:space;
                                            before:before;
                                            menuWithNewItem:menuPanel;
                                            yourself)
    ].

    "
     UserAddedToolBarItems := nil.
     UserAddedMenuItems := nil.
     NewLauncher open.

     Transcript topView application
        addMenuItem:(MenuItem new 
                        label: 'Foo';
                        value: [Transcript showCR:'foo'];
                        isButton: false;
                        labelImage: nil;
                        nameKey: #foo)
        in:'menu.'
        position:#(last)
        space:true.

     Transcript topView application
        addMenuItem:(MenuItem new 
                        label: 'Foo';
                        value: [Transcript showCR:'foo'];
                        isButton: false;
                        labelImage: nil;
                        nameKey: #foo)
        in:#menu
        position:#(before Workspace)
        space:true.

     Transcript topView application
        addMenuItem:(MenuItem new 
                        label: 'Bar';
                        value: [Transcript showCR:'bar'];
                        isButton: false;
                        labelImage: nil;
                        nameKey: #bar)
        in:#menu
        position:#(after foo)
        space:true.

     Transcript topView application
        addMenuItem:(MenuItem new 
                        label: 'Baz';
                        value: [Transcript showCR:'baz'];
                        isButton: false;
                        labelImage: nil;
                        nameKey: #baz)
        in:#menu
        position:#(before bar)
        space:false.

     Transcript topView application
        addMenuItem:(MenuItem new 
                        label: 'Baz2';
                        value: [Transcript showCR:'baz2'];
                        isButton: false;
                        labelImage: nil;
                        nameKey: #baz2)
        in:#menu
        position:#(after bar)
        space:false.

     Transcript topView application
        addMenuItem:(MenuItem new 
                        label: 'Foo2';
                        value: [Transcript showCR:'foo2'];
                        isButton: false;
                        labelImage: nil;
                        nameKey: #foo2)
        in:'menu.classes'
        position:#last
        space:false.

     Transcript topView application
        addMenuItem:(MenuItem new 
                        label: 'Foo3';
                        value: [Transcript showCR:'foo3'];
                        isButton: false;
                        labelImage: nil;
                        nameKey: #foo3)
        in:'menu.classes.special'
        position:#first
        space:true.
    "
!

addMenuItem:newItem in:where position:positionSpecOrNilArg space:space
    "adds a menu item;
       where == #menu        - menu item is added at the end of the sub menu 'Tools',
       where == #toolbar     - menu item is added at the end of the tool bar,
       where == #menu.<name> - menu item is added at the end of the sub menu named 'name',

    position may be one of:
        #(before <someItemPath>)
        #(after  <someItemPath>)
        #( #first )   or #first
        #( #last )    or #last   or nil

     If space is true, some empty space is inserted.
     This can be invoked by a classes #initialize method, to add an item
     for itself to the toolbar or menu."

    ^ self
        addMenuItem:newItem from:self in:where position:positionSpecOrNilArg space:space
!

findItem:menuItem inMenuPanel:menuPanel
    "find a menu item in the menupanel.
     Return the index of the item in the panel or 0
     if not found"

    |idx|

    idx := 0.
    menuItem nameKey notNil ifTrue:[
        idx := menuPanel findFirst: [:i| i nameKey = menuItem nameKey].
    ].
    idx == 0 ifTrue:[
        idx := menuPanel findFirst: [:i| (menuItem activeHelpKey notNil 
                                          and:[i activeHelpKey = menuItem activeHelpKey])
                                         or:[menuItem label notNil 
                                             and:[i label = menuItem label]]]
    ].

    ^ idx
!

removeUserTool:toolNameOrMenuItem
    "removes a menu item labeled toolName
     This can be invoked by a classes #deinitialize method, 
     to remove its item from the toolbar or menu.
    "
    self class removeUserTool:toolNameOrMenuItem
!

removeUserTool:toolNameOrMenuItem from:addedToolsCollection
    "removes a menu item labeled toolName
     This can be invoked by a classes #deinitialize method, 
     to remove its item from the toolbar or menu.
    "

    self class removeUserTool:toolNameOrMenuItem from:addedToolsCollection

    "
     Transcript topView application
        removeUserTool:'Bar' 
    "
    "
     Transcript topView application
        removeUserTool:'Foo' 
    "

!

userAddedMenuItems
    "return a dictionary of user-added menu item infos.
    "

    ^ UserAddedMenuItems ? #()


!

userAddedToolBarItems
    "return a dictionary of user-added toolBar item infos.
    "

    ^ UserAddedToolBarItems ? #()


! !

!NewLauncher methodsFor:'menus-dynamic'!

menuChangeHistory
    "returns a sub menu on the last changes"

    |changeSet menu changeHistory|

    changeSet := ChangeSet current.
    changeHistory := OrderedCollection new.

    [:exit |
        changeSet reverseDo:[:change |
            change isMethodChange ifTrue:[
                change changeClass notNil ifTrue:[
                    (changeHistory contains:[:chg | chg className = change className
                                                 and:[chg selector = change selector]])
                    ifFalse:[
                        changeHistory add:change.
                        changeHistory size > 15 ifTrue:[
                            exit value:nil
                        ]
                    ].
                ].
            ].
        ]
    ] valueWithExit.

    changeHistory isEmpty ifTrue:[
        ^ nil
    ].

    menu := Menu new receiver: self.
    menu addItemGroup: 
        (changeHistory collect:[:change|
            MenuItem new 
                translateLabel: false;
                label: (change className , ' ' , (change selector ? '???')); 
                value: [UserPreferences systemBrowserClass openInClass:change changeClass selector:change selector]; 
                activeHelpKey: #classBrowserOnChangedMethod
        ]
    ).

    menu findGuiResourcesIn:self.
    ^menu

    "Modified: / 25-01-2011 / 16:45:51 / cg"
!

menuClassHistory
    "returns a sub menu on the history of the classes"

    ^ self menuClassHistoryFor:(UserPreferences current systemBrowserClass)
!

menuClassHistoryFor:whichBrowserClass
    "returns a sub menu on the history of the classes"

    |menu classHistory|

    whichBrowserClass checkClassHistory.

    classHistory := whichBrowserClass classHistory.
    classHistory isEmpty ifTrue:[
        ^ nil
    ].

    menu := Menu new receiver: self.
    menu addItemGroup: 
        (classHistory collect:[:histEntry|
            MenuItem new 
                translateLabel: false;
                label: (histEntry className); 
                value: [whichBrowserClass openInClass:histEntry theClass selector:histEntry selector]; 
                activeHelpKey: #classesSystemBrowserOnClass
        ]
    ).
    menu addItem: (MenuItem new 
                        label: 'Clear History'; 
                        value: [classHistory removeAll]; 
                        translateLabel: true;
                        enabled:(classHistory notEmpty);
                        activeHelpKey: #historyEmptyMenu).

    menu findGuiResourcesIn:self.
    ^ menu

    "Modified: / 25-01-2011 / 16:45:07 / cg"
!

menuClassHistoryNew
    "returns a sub menu on the history of the classes"

    ^ self menuClassHistoryFor:(Tools::NewSystemBrowser ? NewSystemBrowser)
!

menuFileHistory
    "returns a subMenu on the history of the filebrowsers directories"

    |menu dirHistory|

    dirHistory := AbstractFileBrowser directoryHistory.
    dirHistory isEmpty ifTrue:[^nil].

    menu := Menu new receiver: self.
    menu addItemGroup: 
        (dirHistory collect:[:item|
            |dirNameString| 
            dirNameString := item path.
            MenuItem new 
                translateLabel: false;
                label: dirNameString; 
                value: [UserPreferences fileBrowserClass openOn:dirNameString]; 
                activeHelpKey: #FileBrowserOnDirectory
        ]
    ).
    menu addItem: (MenuItem new 
                        label: 'Clear History'; 
                        value: [dirHistory removeAll]; 
                        translateLabel: true;
                        enabled:(dirHistory notEmpty);
                        activeHelpKey: #historyEmptyMenu).

    menu findGuiResourcesIn:self.
    ^menu

    "Modified: / 25-01-2011 / 16:45:39 / cg"
!

recentlyOpenedApplicationsMenu
    |menu appHistory|

    appHistory := ApplicationModel recentlyOpenedApplications.
    appHistory isEmpty ifTrue:[^nil].

    menu := Menu new receiver: self.
    menu addItemGroup: 
        (appHistory collect:[:appClassName|
            |item appClass label|

            appClass := Smalltalk classNamed:appClassName.
            appClass isNil ifTrue:[
                label := appClassName.
            ] ifFalse:[
                label := appClass nameWithoutPrefix
            ].
            item := MenuItem new 
                label: label; 
                value: #openApplication:; 
                argument: appClassName. 

            appClass isNil ifTrue:[
                item enabled:false.
                item label:(LabelAndIcon icon:(ToolbarIconLibrary erase16x16Icon2) string:appClassName)
            ].
            item
        ]
    ).
    menu addItem: (MenuItem new 
                        label: 'Clear History'; 
                        value: [ ApplicationModel forgetRecentlyOpenedApplications ]; 
                        translateLabel: true;
                        enabled:(appHistory notEmpty);
                        activeHelpKey: #historyEmptyMenu).

    menu findGuiResourcesIn:self.
    ^menu
!

startBrowserOnSmallTeamChangesMenu
    "returns a subMenu on the history of the filebrowsers directories"

    <resource: #programMenu >

    ^ [
        |m anyItem hosts|

        m := Menu new.

        hosts := SmallTeam hostsWithChanges asSortedCollection.
        hosts do:[:eachHost |
            |item|

            item := MenuItem label:eachHost.
            item value:#'startBrowserOnChangesOnSmallTeamHost:'.
            item argument:eachHost.
            m addItem:item.
            anyItem := true.
        ].
        hosts isEmptyOrNil ifTrue:[ nil ] ifFalse:[ m ]
    ].

    "Created: / 12-11-2006 / 16:06:06 / cg"
! !

!NewLauncher methodsFor:'private-settings callBacks'!

reopenLauncher
    "reopen a new launcher.
     for now (since style & language settings currently do
     not affect living views ...)
     WARNING: bad design: Message known in LauncherDialogs"

    |newLauncher wasShowingHelp|

    wasShowingHelp := self showingHelp.
    newLauncher := super reopenLauncher.
    newLauncher showingHelp:wasShowingHelp.
    ^ newLauncher
! !

!NewLauncher methodsFor:'queries'!

preferredExtent

    ^ super preferredExtent max: Screen current extent // (2.5 @ 3.5)
!

useNewSettingsApplication
    ^ UserPreferences current useNewSettingsApplication.
!

useOldSettingsApplication

    ^ self useNewSettingsApplication not
!

windowMigrationFunctionsAreShown
    ^ XWorkstation notNil
! !

!NewLauncher methodsFor:'startup & release'!

allButOpenInterface:anInterface
    "sent by my superclass to open up my interface"

    "/ if there is already a transcript on my device,
    "/ I am a slave launcher with limited functionality.

    Transcript notNil ifTrue:[
        Transcript ~~ Stderr ifTrue:[
            isMainLauncher := (Transcript graphicsDevice == device).
            self enableDangerousMenuItemsInRemoteLauncher value: isMainLauncher.
        ] ifFalse:[
            isMainLauncher := true
        ]
    ] ifFalse:[
        isMainLauncher := true
    ].

    super allButOpenInterface:anInterface.

    self setupTranscript; updateInfo.
    Project notNil ifTrue: [Project addDependent:self].
    self class openLaunchers add: self.
    ^ builder

    "Created: / 5.2.1998 / 19:45:07 / cg"
    "Modified: / 20.6.1998 / 14:53:58 / cg"
!

postBuildWith:aBuilder
    "setup my preferred size"

    |win hMin|

    super postBuildWith:aBuilder.
    win := aBuilder window .
    win extent:(self preferredExtent).

"/
"/ TODO: somehow find out how much decoration is added by the window manager ...
"/

    hMin := (aBuilder window margin * 2)
            + aBuilder menuBar preferredHeight
            + (aBuilder componentAt:#infoBarSubSpec) height
            + (aBuilder componentAt:#menuToolbarView) preferredHeight
            -3 "+ 8".   "/ I guess this is menuToolbar level abs + textCollector level abs...

    win minExtent:( win minExtent x @ hMin ).

    "Modified: / 16-11-2006 / 14:23:17 / cg"
!

postOpenWith:aBuilder
    |toolInfo addMenuForToolInfo window|

    "/ increase my priority"
"/    self windowGroup process priority:(Processor userSchedulingPriority + 1).
    Processor activeProcess priority:(Processor userSchedulingPriority + 1).

    addMenuForToolInfo := 
        [:toolInfo|
            |menuItem originalLabel|

            menuItem := toolInfo item.
            originalLabel := toolInfo originalLabel.
            originalLabel notNil ifTrue:[ menuItem label:originalLabel ].
            self 
                addMenuItem:menuItem
                from:(toolInfo resourceProvider)
                in:toolInfo where
                position:toolInfo positionSpec
                space:toolInfo space
        ].

    "/ add user tools
    UserAddedToolBarItems notNil ifTrue:[
        toolInfo := UserAddedToolBarItems.
        [
            UserAddedToolBarItems := nil.
             toolInfo do:addMenuForToolInfo.
        ] ifCurtailed:[
            UserAddedToolBarItems := toolInfo
        ]
    ].
    UserAddedMenuItems notNil ifTrue:[
        toolInfo := UserAddedMenuItems.
        [
            UserAddedMenuItems := nil.
            toolInfo do:addMenuForToolInfo.
        ] ifCurtailed:[
            UserAddedMenuItems := toolInfo
        ]
    ].

    super postOpenWith:aBuilder.

    "/ set the time-block
    UserPreferences current showClockInLauncher ifTrue:[
        self startClock
    ].

    "Modified: / 16-11-2006 / 12:50:21 / cg"
!

requestForWindowClose
    |answer|

    isMainLauncher ifFalse:[
        "/ remote launchers may not finish ST/X

        answer := Dialog 
                    confirmWithCancel:(resources string:'Really close %1 (slave)?' with:self class name)
                    labels:(resources array:#('Cancel' 'Close'))
                    values:#(nil true)
                    default:1.
        answer isNil ifTrue:[
            "/ cancel
            ^ false
        ].
        ^ true
    ].

    ^ super requestForWindowClose
!

setupTranscript 
    "create the transcript view"

    |launcher oldLauncherClass|

    "/ check if this is an additional launcher on a remote display.
    "/ if so, do not close the real launcher.

    (Transcript notNil and:[Transcript ~~ Stderr]) ifTrue:[
        isMainLauncher ifTrue:[
            launcher := Transcript topView application
        ] ifFalse:[
            launcher := self class current.
        ].

        (launcher notNil and:[launcher ~~ self]) ifTrue:[
            launcher window graphicsDevice == device ifTrue:[
                OpenLaunchers notNil ifTrue:[
                    OpenLaunchers remove:launcher ifAbsent:nil.
                ].
                ((oldLauncherClass := Smalltalk at:#Launcher) notNil 
                and:[oldLauncherClass isLoaded]) ifTrue: [
                    oldLauncherClass openLaunchers remove:launcher ifAbsent:nil
                ].
                launcher close
            ]
        ]
    ].

    transcript := self transcriptView. "/ (self componentAt: #transcriptView) subViews first.

    isMainLauncher ifTrue:[
        transcript beTranscript.
    ] ifFalse:[
        transcript showCR:'**************** Notice ***********************'.
        transcript showCR:'**       this is NOT the Transcript          **'.
        transcript showCR:'** The real Transcript is on the main screen **'.
        transcript showCR:'**                                           **'.
        transcript showCR:'** Menus affecting common state are disabled **'.
        transcript showCR:'***********************************************'.
    ]

    "Modified: / 5.3.1999 / 18:00:36 / cg"
!

uninitialize

    super uninitialize.

    OpenLaunchers notNil ifTrue:[OpenLaunchers remove:self ifAbsent:nil].
    Project notNil ifTrue:[Project removeDependent:self]
! !

!NewLauncher methodsFor:'user actions-classes'!

openMethodFinder
    "open the methodFinder (ported from squeak)"
    
    self openApplication:'MethodFinderWindow'
    "/ MethodFinderWindow open

    "Modified: / 16-10-2006 / 13:36:36 / cg"
!

startBrowserOnChangesOnSmallTeamHost:aHostName
    ChangeSetBrowser openOn:(SmallTeam changesOnHost:aHostName)

    "Created: / 12-11-2006 / 16:07:12 / cg"
!

startOOMBrowser
    self openApplication:'OOM::MetricVisualizer'

    "Created: / 23-10-2006 / 16:00:25 / cg"
    "Modified: / 23-10-2006 / 20:38:34 / cg"
!

startToDoListBrowser
    self openApplication:'Tools::ToDoListBrowser'

    "Created: / 23-10-2006 / 16:00:25 / cg"
    "Modified: / 23-10-2006 / 20:38:34 / cg"
!

stopIgnoringHalts
    DebugView stopIgnoringHalts
! !

!NewLauncher methodsFor:'user actions-demos'!

openDemo:className
    "open a demo, given its name.
     Looks in both the Smalltalk- and the Demos-Namespace
     for that class."

    self openApplication:className nameSpace:Demos

!

openMandelbrotDemo
    self openDemo:#ComplexIterationView 

    "Created: / 8.7.1998 / 20:36:37 / cg"
!

startPingPong2
    "opens a 2-user PingPong game"

    self openApplication:'PingPongGame' nameSpace:Games with:#open2PlayerGame

    "Modified: / 13.12.1999 / 22:24:15 / cg"
!

startReversi
    "opens a reversi game (java)"

    self openApplication:'JavaAppletDemo3' nameSpace:CodingExamples_GUI

    "Modified: / 13.12.1999 / 22:24:15 / cg"
!

startStopDemo:className
    "start/stop a demo, given its name.
     Looks in both the Smalltalk- and the Demos-Namespace
     for that class."

    |cls|

    cls := self findApplicationClass:className nameSpace:Demos.
    cls isNil ifTrue:[
        ^ self
    ].

    Autoload autoloadFailedSignal handle:[:ex |
        self warn:(resources string:'Sorry, the %1 class seems to be not available.' with:cls name)
    ] do:[
        self withWaitCursorDo:[
            cls isRunning ifTrue:[
                cls stop
            ] ifFalse:[
                cls start
            ]
        ]
    ]
!

startTicTacToe2
    "opens a 2-user ticTacToe game"

    self openApplication:'TicTacToeGame' nameSpace:Games with:#open2UserGame
! !

!NewLauncher methodsFor:'user actions-file'!

clearTranscript
    Transcript current contents:''

    "Modified: / 20-04-2005 / 18:59:28 / janfrog"
!

saveImage
    "save image"

    [
        self saveImageAs:ObjectMemory nameForSnapshot.
    ] on:SnapshotError do:[:ex|
        self warn:ex description.
    ]
!

saveImageAs
    "save image, after asking for a file name"

    |imageFilename|

    imageFilename := Dialog 
                        requestFileName:(resources string:'Save Image As') 
                        default:ObjectMemory nameForSnapshot
                        pattern:'*.img'
                        fromDirectory:Filename currentDirectory.

    imageFilename notNil ifTrue:[
        [
            self saveImageAs:imageFilename
        ] on:SnapshotError do:[:ex|
            self warn:ex description.
        ].
    ].
! !

!NewLauncher methodsFor:'user actions-help'!

activeHelp

    helpIsOn isNil ifTrue:[
        helpIsOn := PluggableAdaptor new
                        getBlock:[:m | UserPreferences current flyByHelpActive] 
                        putBlock:[:m :newValue | UserPreferences current flyByHelpActive:newValue] 
                        updateBlock:[:m :aspect :param | true].
        "/ helpIsOn addDependent:self.
    ].
    ^ helpIsOn
!

toggleFlyByHelp:aBoolean
    "turn on/off active help"

    UserPreferences current flyByHelpActive:aBoolean.

    "Modified: / 18.8.1998 / 16:06:27 / cg"
! !

!NewLauncher methodsFor:'user actions-system'!

initJavaVM
    JavaVM initializeVM

    "Created: / 9.2.1998 / 12:06:07 / cg"
!

startLatencyMonitor
    "open an interruptLatencyMonitor view"

    InterruptLatencyMonitor notNil ifTrue:[
        Autoload autoloadFailedSignal catch:[
            InterruptLatencyMonitor open.
            ^ self.
        ].
    ].
    self warn:'Sorry - the irq latency monitor is not available
in this release'.
!

startProcessMonitor
    "open an ProcessMonitor view"

    self openApplication:(
        (UserPreferences current useProcessMonitorV2
        and:[ProcessMonitorV2 notNil]) 
            ifTrue:['ProcessMonitorV2']
            ifFalse:['ProcessMonitor']).
!

startSQLWorkspace
    self openApplication:'SQL::ODBCScratchpad'.
!

toggleHistoryManager
    "Toggle history manager usage."

    HistoryManager isActive
        ifTrue: [HistoryManager deactivate]
        ifFalse: [HistoryManager activate]

    "Created: / 20-06-2004 / 16:08:09 / masca"
    "Modified: / 20-04-2005 / 18:59:28 / janfrog"
! !

!NewLauncher methodsFor:'user actions-windows'!

redrawAllWindows
    device redrawAllWindows.
! !

!NewLauncher::AddedToolInfo methodsFor:'accessing'!

before

    ^ before
!

before:something
    before := something.
!

item
    ^ item
!

item:something
    item := something.
!

menuWithNewItem
    ^ menuWithNewItem
!

menuWithNewItem:something
    menuWithNewItem := something.
!

originalLabel
    ^ originalLabel
!

originalLabel:something
    originalLabel := something.
!

positionSpec
    ^ positionSpec
!

positionSpec:something
    positionSpec := something.
!

resourceProvider
    ^ resourceProvider
!

resourceProvider:something
    resourceProvider := something.
!

space
    ^ space
!

space:something
    space := something.
!

where
    ^ where
!

where:something
    where := something.
! !

!NewLauncher class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libtool/NewLauncher.st,v 1.405 2011-01-25 15:45:59 cg Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/libtool/NewLauncher.st,v 1.405 2011-01-25 15:45:59 cg Exp $'
! !