Added pre-open hooks.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 05 Mar 2014 21:25:25 +0100
changeset 3297 eafb68a0471b
parent 3296 e05e84f3d3ca
child 3298 9d82cfd4031c
Added pre-open hooks.
ApplicationModel.st
--- a/ApplicationModel.st	Tue Mar 04 16:06:17 2014 +0100
+++ b/ApplicationModel.st	Wed Mar 05 21:25:25 2014 +0100
@@ -62,12 +62,12 @@
     created by the windowBuilder. If your subclass does not provide such
     a spec, you should at least redefine:
 
-        #openInterface   - to create a topview and open it
+	#openInterface   - to create a topview and open it
 
     you may want to redefine:
 
-        #closeRequest    - to catch window closing
-        #focusSequence   - to define a sequence for focus-stepping
+	#closeRequest    - to catch window closing
+	#focusSequence   - to define a sequence for focus-stepping
 
 
     Once the interfaceBuilder is finished & released, subclasses can
@@ -79,10 +79,10 @@
 
 
     [Instance variables:]
-        resources    ResourcePack       language string translation
-
-        builder      WindowBuilder      a builder who knows how to create
-                                        a window hierarchy from a specification
+	resources    ResourcePack       language string translation
+
+	builder      WindowBuilder      a builder who knows how to create
+					a window hierarchy from a specification
 
 
     Notice: this class was implemented using protocol information
@@ -92,11 +92,11 @@
 
 
     [author:]
-        Claus Gittinger
+	Claus Gittinger
 
     [see also:]
-        StandardSystemView
-        WindowGroup DeviceWorkstation
+	StandardSystemView
+	WindowGroup DeviceWorkstation
 "
 !
 
@@ -110,11 +110,11 @@
     by the second application.
 
     This is implemented via the following mechanism (see StandaloneStartup):
-        the first application instance leaves the information about its existence somewhere
-            (under win32: in the registry, the window-ID of its main window is remembered;
-             under unix, its stored into a locked file).
-        a mutex is created to prevent a race on this informationduring startup
-            (under win32: a mutex proper; under unix, the above locked file will do)
+	the first application instance leaves the information about its existence somewhere
+	    (under win32: in the registry, the window-ID of its main window is remembered;
+	     under unix, its stored into a locked file).
+	a mutex is created to prevent a race on this informationduring startup
+	    (under win32: a mutex proper; under unix, the above locked file will do)
 
     when the app is started the second time, it will not be able to aquire the mutex (and therefore
     knows, that its the second instance). It will then send an event-message (win32: via copyData;
@@ -124,30 +124,30 @@
     This guarantees that only one instance of an application is executing (if desired).
 
     The implementation is found in:
-        StandaloneStartup:
-            checkForAndExitIfAnotherApplicationInstanceIsRunning
-
-        here:
-            processOpenPathCommand:aFilename
+	StandaloneStartup:
+	    checkForAndExitIfAnotherApplicationInstanceIsRunning
+
+	here:
+	    processOpenPathCommand:aFilename
 
     By default, the event is ignored - subclasses which want to support that behavior MUST
     redefine processOpenPathCommand: in ApplicationModel and also make sure that
     checkForAndExitIfAnotherApplicationInstanceIsRunning is called for in StandaloneStartup.
-            
+
 "
 ! !
 
 !ApplicationModel class methodsFor:'initialization'!
 
-initialize 
+initialize
     self == ApplicationModel ifTrue:[
-        Smalltalk addDependent:self
+	Smalltalk addDependent:self
     ].
     DefaultLabels isNil ifTrue:[
-        DefaultLabels := IdentityDictionary new
+	DefaultLabels := IdentityDictionary new
     ].
     DefaultVisuals isNil ifTrue:[
-        DefaultVisuals := IdentityDictionary new
+	DefaultVisuals := IdentityDictionary new
     ].
 
     "
@@ -211,7 +211,7 @@
 
 actionFor:aKey withValue:aValue
     "sent by the builder to ask for an actionBlock for
-     a Button which passes a value to the actionMethod. 
+     a Button which passes a value to the actionMethod.
      The argument, aKey comes from an UI-spec
      for a buttons #action property.
      Here, a corresponding message is sent to myself,
@@ -268,7 +268,7 @@
      Typically, a color is returned there."
 
     (self respondsTo:aSymbol) ifTrue:[
-        ^ (self perform:aSymbol) value.
+	^ (self perform:aSymbol) value.
     ].
 
     "fall back to a possibly well defined color name"
@@ -287,7 +287,7 @@
      Typically, a view is returned there."
 
     (self respondsTo:aKey) ifTrue:[
-        ^ self perform:aKey
+	^ self perform:aKey
     ].
     ^ nil
 !
@@ -303,7 +303,7 @@
      Typically, a font is returned there."
 
     (self respondsTo:aSymbol) ifTrue:[
-        ^ self perform:aSymbol.
+	^ self perform:aSymbol.
     ].
 
 "/    "fall back to a well defined font name"
@@ -329,7 +329,7 @@
     app := self application.
     app isNil ifTrue:[^ nil].
     (app respondsTo:aKey) ifTrue:[
-        ^ app perform:aKey
+	^ app perform:aKey
     ].
     ^ app labelAt:aKey ifAbsent:nil
 !
@@ -349,9 +349,9 @@
 
     app := self application.
     app notNil ifTrue:[
-        (app respondsTo:aKey) ifTrue:[
-            ^ app perform:aKey
-        ]
+	(app respondsTo:aKey) ifTrue:[
+	    ^ app perform:aKey
+	]
     ].
     ^ nil.
 
@@ -385,9 +385,9 @@
      Typically, an interfaceSpecification is returned there."
 
     ^ self
-        specificationFor:aKey 
-        application:self
-        onDevice:nil
+	specificationFor:aKey
+	application:self
+	onDevice:nil
 !
 
 specificationFor:aKey application:app onDevice:deviceOrNil
@@ -408,38 +408,38 @@
     "/ for example, if the type is pda, the xxxSpec_pda spec will be used.
     displayDevice := deviceOrNil.
     displayDevice isNil ifTrue:[
-        displayDevice := Screen current.
-        displayDevice isNil ifTrue:[
-            displayDevice := Screen default.
-        ]
+	displayDevice := Screen current.
+	displayDevice isNil ifTrue:[
+	    displayDevice := Screen default.
+	]
     ].
     displayDevice notNil ifTrue:[
-        displayDeviceType := displayDevice deviceType.
-        displayDeviceType notNil ifTrue:[
-            modifiedKey := (aKey , '_' , displayDeviceType) asSymbolIfInterned.
-            modifiedKey notNil ifTrue:[
-                (app respondsTo:modifiedKey) ifTrue:[
-                    ^ app perform:modifiedKey
-                ].
-                app isBehavior ifFalse:[
-                    appClass := app application.
-                    (appClass respondsTo:modifiedKey) ifTrue:[
-                        ^ appClass perform:modifiedKey
-                    ].
-                ].
-            ]
-        ]
+	displayDeviceType := displayDevice deviceType.
+	displayDeviceType notNil ifTrue:[
+	    modifiedKey := (aKey , '_' , displayDeviceType) asSymbolIfInterned.
+	    modifiedKey notNil ifTrue:[
+		(app respondsTo:modifiedKey) ifTrue:[
+		    ^ app perform:modifiedKey
+		].
+		app isBehavior ifFalse:[
+		    appClass := app application.
+		    (appClass respondsTo:modifiedKey) ifTrue:[
+			^ appClass perform:modifiedKey
+		    ].
+		].
+	    ]
+	]
     ].
 
     app isBehavior ifFalse:[
-        (app respondsTo:aKey) ifTrue:[
-            ^ app perform:aKey
-        ].
-        appClass := app application.
-        (appClass respondsTo:aKey) ifTrue:[
-            ^ appClass perform:aKey
-        ].
-        ^ app masterApplication specificationFor:aKey
+	(app respondsTo:aKey) ifTrue:[
+	    ^ app perform:aKey
+	].
+	appClass := app application.
+	(appClass respondsTo:aKey) ifTrue:[
+	    ^ appClass perform:aKey
+	].
+	^ app masterApplication specificationFor:aKey
     ].
 
     ^ app perform:aKey
@@ -448,7 +448,7 @@
 !
 
 subApplicationFor:aKey
-    "sent by subCanvas to ask for an application inside itself. 
+    "sent by subCanvas to ask for an application inside itself.
      The argument, aKey comes from a TabList-specs majorKey.
      Here, a corresponding message is sent to myself,
      which ought to be defined in the application subclass.
@@ -460,7 +460,7 @@
 
     app := self application.
     (app respondsTo:aKey) ifTrue:[
-        ^ app perform:aKey
+	^ app perform:aKey
     ].
     ^ nil
 !
@@ -480,7 +480,7 @@
 
     app := self application.
     (app respondsTo:aKey) ifTrue:[
-        ^ app perform:aKey
+	^ app perform:aKey
     ].
     ^ app visualAt:aKey ifAbsent:nil
 ! !
@@ -491,7 +491,7 @@
     "flush resources on language changes"
 
     something == #Language ifTrue:[
-        self flushAllClassResources
+	self flushAllClassResources
     ]
 
     "Created: 15.6.1996 / 15:13:29 / cg"
@@ -501,11 +501,11 @@
 
 defaultExtentFor:anApplicationClass
     DefaultExtents notNil ifTrue:[
-        UserPreferences current shouldRememberLastExtent ifTrue:[
-            ^ DefaultExtents at:anApplicationClass name ifAbsent:nil
-        ] ifFalse:[
-            DefaultExtents := nil.
-        ] 
+	UserPreferences current shouldRememberLastExtent ifTrue:[
+	    ^ DefaultExtents at:anApplicationClass name ifAbsent:nil
+	] ifFalse:[
+	    DefaultExtents := nil.
+	]
     ].
     ^ nil.
 
@@ -612,15 +612,15 @@
 
     packageDir := Smalltalk getPackageDirectoryForPackage:(self package).
     packageDir isNil ifTrue:[
-        packageDir := Filename defaultDirectory
+	packageDir := Filename defaultDirectory
     ].
     #(
-        'documentation'
-        'doc'
+	'documentation'
+	'doc'
     ) do:[:subDir |
-        (packageDir construct:subDir) exists ifTrue:[
-            ^ packageDir construct:subDir
-        ].
+	(packageDir construct:subDir) exists ifTrue:[
+	    ^ packageDir construct:subDir
+	].
     ].
     ^ packageDir construct:'doc'
 ! !
@@ -637,7 +637,7 @@
 
 rememberRecentlyOpenedApplication
     RecentlyOpenedApplications isNil ifTrue:[
-        RecentlyOpenedApplications := OrderedCollection new.
+	RecentlyOpenedApplications := OrderedCollection new.
     ].
     RecentlyOpenedApplications remove:(self name) ifAbsent:[].
     RecentlyOpenedApplications addFirst:(self name).
@@ -656,7 +656,7 @@
 
 interfaceSpecFor:aSelector
     "return an interface spec"
-    
+
     |specOrSpecArray|
 
     specOrSpecArray := self application specificationFor:aSelector.
@@ -667,21 +667,21 @@
 
     "/ app returns a literal array
     specOrSpecArray class missingClassInLiteralArrayErrorSignal
-        handle:[:ex |
-            |clsInMyNamespace className|
-
-            className := ex parameter.
-            className isSymbol ifTrue:[
-                "retry with my nameSpace"
-                clsInMyNamespace := self nameSpace at:className.
-                clsInMyNamespace notNil ifTrue:[ ex proceedWith:clsInMyNamespace].
-            ].
-            self warn:ex description.
-            ex proceedWith:nil
-        ]
-        do:[
-            ^ UISpecification from:specOrSpecArray
-        ]
+	handle:[:ex |
+	    |clsInMyNamespace className|
+
+	    className := ex parameter.
+	    className isSymbol ifTrue:[
+		"retry with my nameSpace"
+		clsInMyNamespace := self nameSpace at:className.
+		clsInMyNamespace notNil ifTrue:[ ex proceedWith:clsInMyNamespace].
+	    ].
+	    self warn:ex description.
+	    ex proceedWith:nil
+	]
+	do:[
+	    ^ UISpecification from:specOrSpecArray
+	]
 
     "Modified: / 25-07-2010 / 10:36:53 / cg"
 !
@@ -725,7 +725,7 @@
     "if not already loaded, get the classes resourcePack and return it"
 
     ClassResources isNil ifTrue:[
-        ClassResources := super classResources.
+	ClassResources := super classResources.
     ].
     ^ ClassResources
 !
@@ -743,17 +743,17 @@
     ResourcePack flushCachedResourcePacks.
     self flushClassResources.
     self allSubclassesDo:[:aClass |
-        aClass flushClassResources.
+	aClass flushClassResources.
     ].
 
     WindowGroup scheduledWindowGroups
-        do:[:wg | 
-            |app| 
-
-            (app := wg application) notNil ifTrue:[
-                app initializeResources
-            ]
-        ]
+	do:[:wg |
+	    |app|
+
+	    (app := wg application) notNil ifTrue:[
+		app initializeResources
+	    ]
+	]
 
     "Modified: / 13-09-2006 / 12:41:31 / cg"
 !
@@ -766,7 +766,7 @@
 !
 
 resources
-    "return the applications resources - 
+    "return the applications resources -
      that's a ResourcePack containing national language strings"
 
     ^ self classResources
@@ -832,18 +832,18 @@
     "create an instance of the application and open a view as
      specified by the given spec."
 
-    ^ self new 
-        openDialogInterfaceSpec:anInterfaceSpec 
-        withBindings:nil
+    ^ self new
+	openDialogInterfaceSpec:anInterfaceSpec
+	withBindings:nil
 !
 
 openDialogInterfaceSpec:anInterfaceSpec withBindings:bindings
     "create an instance of the application and open a view as
      specified by the given spec."
 
-    ^ self new 
-        openDialogInterfaceSpec:anInterfaceSpec 
-        withBindings:bindings
+    ^ self new
+	openDialogInterfaceSpec:anInterfaceSpec
+	withBindings:bindings
 
     "Modified: 5.9.1995 / 17:54:50 / claus"
     "Modified: 13.1.1997 / 20:55:02 / cg"
@@ -865,9 +865,9 @@
     "create an instance of the application and open a view as
      specified by the spec."
 
-    ^ self new 
-        openDialogSpec:aSpec 
-        withBindings:bindings
+    ^ self new
+	openDialogSpec:aSpec
+	withBindings:bindings
 
     "Modified: / 5.9.1995 / 17:54:50 / claus"
     "Modified: / 13.1.1997 / 20:55:02 / cg"
@@ -898,42 +898,42 @@
 
     wsClass := Smalltalk classNamed:#XWorkstation.
     wsClass isNil ifTrue:[
-        self error:'XWorkstation has not been loaded' 
-    ].        
+	self error:'XWorkstation has not been loaded'
+    ].
 
     [
-        display := wsClass newDispatchingFor:displayName.
-        display deviceIOErrorSignal handlerBlock:[:ex | 
-            'DeviceWorkstation [warning]: stop dispatch due to I/O error: ' errorPrint.
-            display errorPrintCR.
-            display brokenConnection.
-        ].
-
-        Screen currentScreenQuerySignal answer:display do:[
-            Screen default isNil ifTrue:[
-                Smalltalk secureFileIn:'keyboard.rc'.
-                "/ Smalltalk secureFileIn:'display.rc'.
-                display buttonTranslation:#(1 2 2 4 5 6 7).
-                Screen default:display.
-            ].
-
-            app := NewLauncher new openAndWaitUntilVisible.
-            app windowGroup isNil ifTrue:[
-                "terminate event processor on error"
-                display stopDispatch.
-                self error:'Cannot open'.
-            ] ifFalse:[
-                app windowGroup process addExitAction:[
-                    "reset the default display"
-                    Screen default == display ifTrue:[
-                        Screen default:nil.
-                    ].
-                ].
-            ].
-        ]
+	display := wsClass newDispatchingFor:displayName.
+	display deviceIOErrorSignal handlerBlock:[:ex |
+	    'DeviceWorkstation [warning]: stop dispatch due to I/O error: ' errorPrint.
+	    display errorPrintCR.
+	    display brokenConnection.
+	].
+
+	Screen currentScreenQuerySignal answer:display do:[
+	    Screen default isNil ifTrue:[
+		Smalltalk secureFileIn:'keyboard.rc'.
+		"/ Smalltalk secureFileIn:'display.rc'.
+		display buttonTranslation:#(1 2 2 4 5 6 7).
+		Screen default:display.
+	    ].
+
+	    app := NewLauncher new openAndWaitUntilVisible.
+	    app windowGroup isNil ifTrue:[
+		"terminate event processor on error"
+		display stopDispatch.
+		self error:'Cannot open'.
+	    ] ifFalse:[
+		app windowGroup process addExitAction:[
+		    "reset the default display"
+		    Screen default == display ifTrue:[
+			Screen default:nil.
+		    ].
+		].
+	    ].
+	]
     ] on:Screen deviceOpenErrorSignal do:[:ex|
-        self error:('Cannot connect to display: <1s><br><2s>' 
-                        expandMacrosWith:displayName with:ex description).
+	self error:('Cannot connect to display: <1s><br><2s>'
+			expandMacrosWith:displayName with:ex description).
     ].
     ^ app
 
@@ -957,15 +957,15 @@
 
 openOnDevice:aDevice
     "create an instance of the application and open its view
-     on ANOTHER device. 
+     on ANOTHER device.
      For more info, read the document on multiple display
      support and the documentation of the DeviceWorkstation class."
 
-    Screen currentScreenQuerySignal 
-        answer:aDevice
-        do:[
-            ^ (self onDevice:aDevice) open
-        ]
+    Screen currentScreenQuerySignal
+	answer:aDevice
+	do:[
+	    ^ (self onDevice:aDevice) open
+	]
 
     "
      Launcher openOnDevice:Display
@@ -976,7 +976,7 @@
 
 openOnXScreenNamed:aScreenName
     "create an instance of the application and open its view
-     on some X display screen. The argument aScreenName must be 
+     on some X display screen. The argument aScreenName must be
      a valid x-display name (i.e. of the form '<host>:<screenNr>' as in 'foo:0').
      For more info, read the document on multiple display
      support and the documentation of the DeviceWorkstation class."
@@ -984,10 +984,10 @@
     |newDevice|
 
     [
-        newDevice := XWorkstation newDispatchingFor:aScreenName.
+	newDevice := XWorkstation newDispatchingFor:aScreenName.
     ] on:Screen deviceOpenErrorSignal do:[:ex|
-        self warn:'Could not open display: ' , aScreenName.
-        ^ self
+	self warn:'Could not open display: ' , aScreenName.
+	^ self
     ].
     ^ self openOnDevice:newDevice.
 
@@ -1052,9 +1052,9 @@
      Answer the webService.
      Start a HTTP server, if not already running"
 
-    ^ HTTPPortalService 
-        startWithApplication:self 
-        link:linkName
+    ^ HTTPPortalService
+	startWithApplication:self
+	link:linkName
 
     "
      self startAsWebService:'hello'
@@ -1069,10 +1069,10 @@
      Answer the webService.
      Start a HTTP server, if not already running"
 
-    ^ HTTPPortalService 
-        startWithApplication:self 
-        inServer:httpServer
-        link:linkName
+    ^ HTTPPortalService
+	startWithApplication:self
+	inServer:httpServer
+	link:linkName
 
     "
      self startAsWebService:'hello'
@@ -1087,10 +1087,10 @@
      Answer the webService.
      Start a HTTP server, if not already running"
 
-    ^ HTTPPortalService 
-        startWithApplication:self 
-        inServer:(HTTPServer serverOnPort:httpPort)
-        link:linkName
+    ^ HTTPPortalService
+	startWithApplication:self
+	inServer:(HTTPServer serverOnPort:httpPort)
+	link:linkName
 
     "
      self startAsWebService:'hello'
@@ -1127,8 +1127,8 @@
 
     "
      PortalTests::TestApplication1
-        startInPortalService:
-            (HTTPPortalService allInstances select:[:s | s httpServer port = 8080]) first
+	startInPortalService:
+	    (HTTPPortalService allInstances select:[:s | s httpServer port = 8080]) first
     "
 !
 
@@ -1178,9 +1178,9 @@
 
 device
     device isNil ifTrue:[
-        self isWebService ifTrue:[
-            device := WebApplicationDevice new
-        ]
+	self isWebService ifTrue:[
+	    device := WebApplicationDevice new
+	]
     ].
     ^ device
 !
@@ -1196,28 +1196,28 @@
     "set the value of the instance variable 'masterApplication' (automatically generated)"
 
     something == self ifTrue:[
-        self error:'an application cannot be its own masterApplication' mayProceed:true.
-        ^ self
+	self error:'an application cannot be its own masterApplication' mayProceed:true.
+	^ self
     ].
     masterApplication := something.
 
     "/ ensure that the device is compatible.
     masterApplication notNil ifTrue:[
-        device := masterApplication device.
+	device := masterApplication device.
     ].
 !
 
 resources
-    "return the applications resources - 
+    "return the applications resources -
      that's a ResourcePack containing national language strings"
 
     resources isNil ifTrue:[
-        masterApplication notNil ifTrue:[
-            ^ masterApplication resources
-        ]
+	masterApplication notNil ifTrue:[
+	    ^ masterApplication resources
+	]
     ].
     resources isNil ifTrue:[
-        ^ ResourcePack new
+	^ ResourcePack new
     ].
     ^ resources
 !
@@ -1249,13 +1249,13 @@
 
     builder isNil ifTrue:[^ nil].
     (win := builder window) notNil ifTrue:[
-        ^ win
+	^ win
     ].
     masterApplication notNil ifTrue:[
-        masterApplication ~~ self ifTrue:[
-            "/ is that true ?
-            ^ masterApplication window
-        ]
+	masterApplication ~~ self ifTrue:[
+	    "/ is that true ?
+	    ^ masterApplication window
+	]
     ].
     ^ nil.
 
@@ -1269,25 +1269,25 @@
      when the builder is accessed."
 
     builder isNil ifTrue:[
-        self createBuilder
+	self createBuilder
     ].
     builder window:aTopView
 
     "Created: 18.4.1996 / 14:55:26 / cg"
 !
 
-windowGroup 
+windowGroup
     "return the applications windowGroup"
 
     |w|
 
     builder notNil ifTrue:[
-        (w := builder window) notNil ifTrue:[
-            ^ w windowGroup
-        ].
+	(w := builder window) notNil ifTrue:[
+	    ^ w windowGroup
+	].
     ].
     masterApplication notNil ifTrue:[
-        ^ masterApplication windowGroup
+	^ masterApplication windowGroup
     ].
     ^ nil
 
@@ -1313,9 +1313,9 @@
     aKey isNil ifTrue:[ self error:'nil action key' ].
 
     masterApplication notNil ifTrue:[
-        (self respondsTo:aKey) ifFalse:[
-            ^ masterApplication actionFor:aKey
-        ].
+	(self respondsTo:aKey) ifFalse:[
+	    ^ masterApplication actionFor:aKey
+	].
     ].
 
     ^ MessageSend receiver:self selector:aKey
@@ -1326,7 +1326,7 @@
 
 actionFor:aKey withValue:aValue
     "sent by the builder to ask for an actionBlock for
-     a Button which passes a value. 
+     a Button which passes a value.
      The argument, aKey comes from an UI-spec for a buttons #action property.
      Here, a corresponding message is sent to myself,
      which ought to be defined in the application subclass.
@@ -1337,9 +1337,9 @@
     aKey isNil ifTrue:[ self error:'nil action key' ].
 
     masterApplication notNil ifTrue:[
-        (self respondsTo:aKey) ifFalse:[
-            ^ masterApplication actionFor:aKey withValue:aValue
-        ].
+	(self respondsTo:aKey) ifFalse:[
+	    ^ masterApplication actionFor:aKey withValue:aValue
+	].
     ].
 
 "/ sigh - too many senders of #isBlock around...
@@ -1351,7 +1351,7 @@
 !
 
 actionFor:aKey withValue:value1 withValue:value2
-    "sent by the builder to ask for an actionBlock for a Button which passes two values. 
+    "sent by the builder to ask for an actionBlock for a Button which passes two values.
      The argument, aKey comes from an UI-spec for a buttons #action property.
      Here, a corresponding message is sent to myself,
      which ought to be defined in the application subclass.
@@ -1362,9 +1362,9 @@
     aKey isNil ifTrue:[ self error:'nil action key' ].
 
     masterApplication notNil ifTrue:[
-        (self respondsTo:aKey) ifFalse:[
-            ^ masterApplication actionFor:aKey withValue:value1 withValue:value2
-        ].
+	(self respondsTo:aKey) ifFalse:[
+	    ^ masterApplication actionFor:aKey withValue:value1 withValue:value2
+	].
     ].
     ^ [self perform:aKey with:value1 with:value2]
 !
@@ -1382,9 +1382,9 @@
     aKey isNil ifTrue:[ self error:'nil aspect key' ].
 
     masterApplication notNil ifTrue:[
-        (self respondsTo:aKey) ifFalse:[
-            ^ masterApplication aspectFor:aKey
-        ].
+	(self respondsTo:aKey) ifFalse:[
+	    ^ masterApplication aspectFor:aKey
+	].
     ].
     ^ self perform:aKey
 
@@ -1409,9 +1409,9 @@
     aKey isNil ifTrue:[ self error:'nil client key' ].
 
     masterApplication notNil ifTrue:[
-        (self respondsTo:aKey) ifFalse:[
-            ^ masterApplication clientFor:aKey
-        ].
+	(self respondsTo:aKey) ifFalse:[
+	    ^ masterApplication clientFor:aKey
+	].
     ].
     ^ self perform:aKey
 
@@ -1429,13 +1429,13 @@
      Typically, a color is returned there."
 
     (self respondsTo:aKey) ifTrue:[
-        ^ (self perform:aKey) value
+	^ (self perform:aKey) value
     ].
     (self class respondsTo:aKey) ifTrue:[
-        ^ (self class perform:aKey) value
+	^ (self class perform:aKey) value
     ].
     masterApplication notNil ifTrue:[
-        ^ masterApplication colorFor:aKey
+	^ masterApplication colorFor:aKey
     ].
     ^ self class colorFor:aKey.
 !
@@ -1454,9 +1454,9 @@
     aKey isNil ifTrue:[ self error:'nil component key' ].
 
     masterApplication notNil ifTrue:[
-        (self respondsTo:aKey) ifFalse:[
-            ^ masterApplication componentFor:aKey
-        ].
+	(self respondsTo:aKey) ifFalse:[
+	    ^ masterApplication componentFor:aKey
+	].
     ].
     ^ self perform:aKey
 
@@ -1474,13 +1474,13 @@
      Typically, a font is returned there."
 
     (self respondsTo:aKey) ifTrue:[
-        ^ self perform:aKey
+	^ self perform:aKey
     ].
     (self class respondsTo:aKey) ifTrue:[
-        ^ self class perform:aKey
+	^ self class perform:aKey
     ].
     masterApplication notNil ifTrue:[
-        ^ masterApplication fontFor:aKey
+	^ masterApplication fontFor:aKey
     ].
     ^ self class fontFor:aKey.
 !
@@ -1499,15 +1499,15 @@
     aKey isNil ifTrue:[ self error:'nil label key' ].
 
     masterApplication notNil ifTrue:[
-        (self respondsTo:aKey) ifFalse:[
-            ^ masterApplication labelFor:aKey
-        ].
+	(self respondsTo:aKey) ifFalse:[
+	    ^ masterApplication labelFor:aKey
+	].
     ].
 
     (self respondsTo:aKey) ifFalse:[
-        (self class respondsTo:aKey) ifTrue:[
-            ^ self class perform:aKey
-        ].
+	(self class respondsTo:aKey) ifTrue:[
+	    ^ self class perform:aKey
+	].
     ].
     ^ self perform:aKey
 !
@@ -1532,17 +1532,16 @@
 
     a := self aspectFor:aKey.
     a notNil ifTrue:[
-        ^ a
+	^ a
     ].
     ^ self application listFor:aKey
 
     "Modified: / 18.6.1998 / 20:33:50 / cg"
 !
 
-menuFor:aKey
-    "sent by the builder to ask for an application provided
-     holder for a menu.
-     The argument, aKey comes from an UI-spec
+menuFor:key
+    "Sent by the builder to ask for an application provided
+     holder for a menu. The argument, `key`, comes from an UI-spec
      for a widgets #menu property.
      Here, a corresponding message is sent to myself,
      which ought to be defined in the application subclass.
@@ -1550,24 +1549,33 @@
      holders from a Dictionary or whatever.
      Typically, a menu or a menu-holding valueHolder is returned there."
 
-    aKey isNil ifTrue:[ self error:'nil menu key' ].
-
-    masterApplication notNil ifTrue:[
-        (self respondsTo:aKey) ifFalse:[
-            (self class respondsTo:aKey) ifFalse:[
-                ^ masterApplication clientFor:aKey
-            ]
-        ].
+    | menu |
+
+    key isNil ifTrue:[ self error:'nil menu key' ].
+
+    "/ Ask myself first...
+    (thisContext isRecursive not and:[ self respondsTo: key ]) ifTrue:[
+	menu := self perform: key
+    ] ifFalse:[
+	"/ Ask my class...
+	(self class respondsTo: key) ifTrue:[
+	    menu := self class perform: key
+	] ifFalse:[
+	    "/ Ask masterApplication if any...
+	    masterApplication notNil ifTrue:[
+		menu := masterApplication menuFor: key
+	    ].
+	].
     ].
 
-    (self respondsTo:aKey) ifFalse:[
-        (self class respondsTo:aKey) ifTrue:[
-            ^ self class perform:aKey
-        ].
+    "/ If the provided menu is a menu spec, create Menu from it...
+    menu isArray ifTrue:[
+	menu :=  Menu decodeFromLiteralArray: menu.
     ].
-    ^ self perform:aKey
-
-    "Modified: / 18.6.1998 / 20:33:56 / cg"
+    ^ menu.
+
+    "Modified: / 18-06-1998 / 20:33:56 / cg"
+    "Modified: / 24-01-2014 / 09:46:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 specificationFor:aKey
@@ -1582,13 +1590,13 @@
      Typically, an interfaceSpecification is returned there."
 
     ^ ApplicationModel
-        specificationFor:aKey 
-        application:self
-        onDevice:(self graphicsDevice)
+	specificationFor:aKey
+	application:self
+	onDevice:(self graphicsDevice)
 !
 
 subApplicationFor:aKey
-    "sent by subCanvas to ask for an application inside itself. 
+    "sent by subCanvas to ask for an application inside itself.
      The argument, aKey comes from a TabList-specs majorKey.
      Here, a corresponding message is sent to myself,
      which ought to be defined in the application subclass.
@@ -1597,10 +1605,10 @@
      Typically, an ApplicationModel subinstance is returned there."
 
      (self respondsTo:aKey) ifTrue:[
-         ^ self perform:aKey 
+	 ^ self perform:aKey
      ].
      masterApplication notNil ifTrue:[
-         ^ masterApplication subApplicationFor:aKey
+	 ^ masterApplication subApplicationFor:aKey
      ].
      ^ nil.
 !
@@ -1636,7 +1644,7 @@
     |window|
 
     window notNil ifTrue:[
-        self error:'building twice (window is already built) ?' mayProceed:true.
+	self error:'building twice (window is already built) ?' mayProceed:true.
     ].
 
 "/ DISABLED; see comment in basicInitialize
@@ -1654,7 +1662,7 @@
 "/    builder bindings:builder bindings.
 
     builder isNil ifTrue:[
-        self createBuilder.
+	self createBuilder.
     ].
 
     self preBuildWith:builder.
@@ -1663,7 +1671,7 @@
 
     window model:self.
     (window respondsTo:#application:) ifTrue:[
-        window application:self.
+	window application:self.
     ].
 
     self showingHelp ifTrue: [ActiveHelp startFor: self].
@@ -1690,15 +1698,15 @@
     |sameApp prevSpec prevSource|
 
     aBuilder notNil ifTrue:[
-        prevSpec := aBuilder spec.
-        prevSource := aBuilder source.
+	prevSpec := aBuilder spec.
+	prevSource := aBuilder source.
     ].
 
     builder isNil ifTrue:[
-        builder := aBuilder.
-        aBuilder isNil ifTrue:[
-            self createBuilder
-        ]
+	builder := aBuilder.
+	aBuilder isNil ifTrue:[
+	    self createBuilder
+	]
     ].
 
     aBuilder source:self.
@@ -1712,26 +1720,26 @@
 
     sameApp := aBuilder application == aBuilder window topView application.
     sameApp ifTrue:[
-        self preBuildAsSubcanvasWith:aBuilder.
+	self preBuildAsSubcanvasWith:aBuilder.
     ] ifFalse:[
-        self preBuildWith:aBuilder.
+	self preBuildWith:aBuilder.
     ].
 
     aBuilder buildFromSpec:specToBuild.
 
     sameApp ifTrue:[
-        self postBuildAsSubcanvasWith:aBuilder.
+	self postBuildAsSubcanvasWith:aBuilder.
     ] ifFalse:[
-        self postBuildWith:aBuilder.
+	self postBuildWith:aBuilder.
     ].
 
     prevSpec notNil ifTrue:[
-        "/ restore state in builder if original builder was used
-        aBuilder spec:prevSpec.
+	"/ restore state in builder if original builder was used
+	aBuilder spec:prevSpec.
     ].
     prevSource notNil ifTrue:[
-        "/ restore state in builder if original builder was used
-        aBuilder source:prevSource.
+	"/ restore state in builder if original builder was used
+	aBuilder source:prevSource.
     ].
 
     ^ aBuilder
@@ -1753,10 +1761,10 @@
 
     specToBuild := spec.
     withMenuBoolean ifFalse:[
-        "/ subapps should not build the menu and other fullSpec stuff.
-        spec class == FullSpec ifTrue:[
-            specToBuild := spec component.
-        ]
+	"/ subapps should not build the menu and other fullSpec stuff.
+	spec class == FullSpec ifTrue:[
+	    specToBuild := spec component.
+	]
     ].
     self buildSpec:specToBuild asSubCanvasWithBuilder:aBuilder
 ! !
@@ -1769,17 +1777,17 @@
     |coll|
 
     aSymbolOrArray isSymbol ifTrue:[
-        "/ a single components name
-        coll := Array with:aSymbolOrArray
+	"/ a single components name
+	coll := Array with:aSymbolOrArray
     ] ifFalse:[
-        coll := aSymbolOrArray
+	coll := aSymbolOrArray
     ].
     coll do:[:aSymbol |
-        |component|
-
-        (component := self componentFor:aSymbol) isNil ifFalse:[
-            aBlock value:component
-        ]
+	|component|
+
+	(component := self componentFor:aSymbol) isNil ifFalse:[
+	    aBlock value:component
+	]
     ]
 
     "Modified: 26.3.1997 / 16:23:14 / cg"
@@ -1835,7 +1843,7 @@
 !
 
 makeWritable:aSymbolOrArray
-    "make all components identified by aSymbolOrArray writable 
+    "make all components identified by aSymbolOrArray writable
      (for editText components)."
 
     self components:aSymbolOrArray do:[:comp | comp readOnly:false]
@@ -1860,7 +1868,7 @@
 !ApplicationModel methodsFor:'delayed actions (enqueue)'!
 
 delayedUpdate:something with:aParameter from:changedObject
-    "support for delayed updates - 
+    "support for delayed updates -
      subclasses which invoke #enqueueDelayedUpdate:with:from: (from #update:with:from:)
      must also redefine this method, and perform the actual update there."
 
@@ -1873,9 +1881,9 @@
      Useful for synchronization"
 
     ^ self
-        enqueueMessage:#value
-        for:aBlock
-        arguments:#().
+	enqueueMessage:#value
+	for:aBlock
+	arguments:#().
 
     "Modified: / 26.2.2000 / 18:01:44 / cg"
 !
@@ -1889,12 +1897,12 @@
      multiple redraws."
 
     ^ self
-        enqueueMessage:#delayedUpdate:with:from:
-        for:self
-        arguments:(Array 
-                        with:something 
-                        with:aParameter 
-                        with:changedObject).
+	enqueueMessage:#delayedUpdate:with:from:
+	for:self
+	arguments:(Array
+			with:something
+			with:aParameter
+			with:changedObject).
 
     "Modified: / 26.2.2000 / 18:01:44 / cg"
 !
@@ -1910,18 +1918,18 @@
 
 
     self isWebService ifTrue:[
-        self breakPoint:#sr.
-        ^ self
+	self breakPoint:#sr.
+	^ self
     ].
 
     (window := self window) notNil ifTrue:[
-        sensor := window sensor.
+	sensor := window sensor.
     ].
 
     sensor isNil ifTrue:[
-        "no window (yet or any longer)"
-        someone perform:selector withArguments:argList.
-        ^ self.
+	"no window (yet or any longer)"
+	someone perform:selector withArguments:argList.
+	^ self.
     ].
 
     "/
@@ -1952,7 +1960,7 @@
     "drop manager asked if a drop is possible
      - should be redefined by apps which can do it, to return true"
 
-    ^ self canDropObjects:aCollectionOfDropObjects 
+    ^ self canDropObjects:aCollectionOfDropObjects
 !
 
 canDropObjects:aCollectionOfDropObjects in:aComponent at:position
@@ -2001,19 +2009,19 @@
 
 registerInterestIn:aValueModel using:aSelectorOrArray
     "Register interest in a change in aValueModel using information in aSelectorOrArray.
-     aSelectorOrArray can be one of three things:  
-
-            1) nil                  in which case no interest is registered
-            2) a selector           in which case the receiver is understood to be self
-            3) an Array             in which case the size is two where the first element is the
-                                    message to be sent and the second element is the receiver."
+     aSelectorOrArray can be one of three things:
+
+	    1) nil                  in which case no interest is registered
+	    2) a selector           in which case the receiver is understood to be self
+	    3) an Array             in which case the size is two where the first element is the
+				    message to be sent and the second element is the receiver."
 
     aSelectorOrArray isNil ifTrue:[^ aValueModel].
 
     (aSelectorOrArray isArray) ifTrue:[
-        aValueModel onChangeSend:(aSelectorOrArray at:1) to:(aSelectorOrArray at:2)
+	aValueModel onChangeSend:(aSelectorOrArray at:1) to:(aSelectorOrArray at:2)
     ] ifFalse: [
-        aValueModel onChangeSend:aSelectorOrArray to:self
+	aValueModel onChangeSend:aSelectorOrArray to:self
     ].
     ^aValueModel
 
@@ -2021,7 +2029,7 @@
 !
 
 valueHolderFor:aSelector initialValue:anObject
-    "Return a ValueHolder on anObject." 
+    "Return a ValueHolder on anObject."
 
     ^ self valueHolderFor:aSelector initialValue:anObject changeMessage:nil
 
@@ -2029,21 +2037,21 @@
 !
 
 valueHolderFor:aSelector initialValue:anObject changeMessage:aSelectorOrArrayOrNil
-    "Return a ValueHolder on anObject.  aSelectorOrArrayOrNil is the change information 
-     for the ValueHolder.  This argument is either a Symbol or an Array of two elements.  
+    "Return a ValueHolder on anObject.  aSelectorOrArrayOrNil is the change information
+     for the ValueHolder.  This argument is either a Symbol or an Array of two elements.
      If it is a Symbol, then it is the change message and the interested object is understood
-     to be the reciever.  If it is an Array, then the first element is the change message and 
-     the second element is the interested object. " 
+     to be the reciever.  If it is an Array, then the first element is the change message and
+     the second element is the interested object. "
 
     |holder|
 
     (builder bindings includesKey:aSelector) ifFalse:[
-        holder := ValueHolder with:anObject.
-        builder aspectAt:aSelector put:holder.
-        aSelectorOrArrayOrNil notNil ifTrue:[
-            ^ self registerInterestIn:holder using:aSelectorOrArrayOrNil
-        ].
-        ^ holder
+	holder := ValueHolder with:anObject.
+	builder aspectAt:aSelector put:holder.
+	aSelectorOrArrayOrNil notNil ifTrue:[
+	    ^ self registerInterestIn:holder using:aSelectorOrArrayOrNil
+	].
+	^ holder
     ].
     ^ builder aspectAt:aSelector
 
@@ -2056,12 +2064,12 @@
     |acceptAction|
 
     builder notNil ifTrue:[
-        acceptAction := builder bindingAt:#doAccept.
+	acceptAction := builder bindingAt:#doAccept.
     ].
     acceptAction notNil ifTrue:[
-        acceptAction value
+	acceptAction value
     ] ifFalse:[
-        self doAccept
+	self doAccept
     ]
 !
 
@@ -2069,12 +2077,12 @@
     |cancelAction|
 
     builder notNil ifTrue:[
-        cancelAction := builder bindingAt:#doCancel.
+	cancelAction := builder bindingAt:#doCancel.
     ].
     cancelAction notNil ifTrue:[
-        cancelAction value
+	cancelAction value
     ] ifFalse:[
-        self doCancel
+	self doCancel
     ]
 ! !
 
@@ -2101,7 +2109,7 @@
 !
 
 activeHelpViewFor:text onDevice:aDevice
-    "redefinable to allow for applications to provide their own active help 
+    "redefinable to allow for applications to provide their own active help
      (aka tooltip) bubble window"
 
     ^ ActiveHelpView for:text onDevice:aDevice
@@ -2120,9 +2128,9 @@
      and #aboutThisApplicationLabel"
 
     Dialog
-        about:(self translateString:self aboutThisApplicationText)
-        label:(self translateString:self aboutThisApplicationLabel)
-        icon:self aboutImage
+	about:(self translateString:self aboutThisApplicationText)
+	label:(self translateString:self aboutThisApplicationLabel)
+	icon:self aboutImage
 
     "Modified: / 17.11.2001 / 23:05:52 / cg"
 !
@@ -2133,7 +2141,7 @@
      (but a file under the current directory is tried first)"
 
     self withWaitCursorDo:[
-        HTMLDocumentView openFullOnHelpFile:pathToHelpText
+	HTMLDocumentView openFullOnHelpFile:pathToHelpText
     ]
 
 !
@@ -2151,7 +2159,7 @@
     |wg mySensor|
 
     self showingHelp ifFalse: [
-        ^ true
+	^ true
     ].
 
 "/    masterApplication notNil ifTrue:[
@@ -2166,14 +2174,14 @@
     "/  instead of occurring in the activeHelp context).
 
     (wg := self windowGroup) notNil ifTrue:[
-        mySensor := wg sensor.
-        mySensor notNil ifTrue:[
-            mySensor flushEventsFor:self withType:#showHelp:for:.
-            mySensor 
-                pushUserEvent:#showHelp:for: for:self 
-                withArguments:(Array with:aHelpText with:view).
-            ^ true
-        ]
+	mySensor := wg sensor.
+	mySensor notNil ifTrue:[
+	    mySensor flushEventsFor:self withType:#showHelp:for:.
+	    mySensor
+		pushUserEvent:#showHelp:for: for:self
+		withArguments:(Array with:aHelpText with:view).
+	    ^ true
+	]
     ].
 
     "/ mhmh - can this happen ?
@@ -2190,7 +2198,7 @@
      Here, the help text is ignored."
 
     masterApplication notNil ifTrue:[
-        masterApplication showHelp:aHelpText for:view
+	masterApplication showHelp:aHelpText for:view
     ].
 
     "Modified: / 31.7.1998 / 19:13:59 / cg"
@@ -2221,23 +2229,23 @@
 
     helpSpecFromBindings := self aspectFor:#flyByHelpSpec.
     helpSpecFromBindings notNil ifTrue:[
-        helpText := helpSpecFromBindings at:aKey ifAbsent:nil.
+	helpText := helpSpecFromBindings at:aKey ifAbsent:nil.
     ] ifFalse:[
-        helpSpecFromBindings := self aspectFor:#helpSpec.
-        helpSpecFromBindings notNil ifTrue:[
-            helpText := helpSpecFromBindings at:aKey ifAbsent:nil.
-        ].
+	helpSpecFromBindings := self aspectFor:#helpSpec.
+	helpSpecFromBindings notNil ifTrue:[
+	    helpText := helpSpecFromBindings at:aKey ifAbsent:nil.
+	].
     ].
     helpText isNil ifTrue:[
-        helpSpec := self flyByHelpSpec.
-        helpSpec notNil ifTrue:[
-            helpText := helpSpec at:aKey ifAbsent:nil.
-        ].
+	helpSpec := self flyByHelpSpec.
+	helpSpec notNil ifTrue:[
+	    helpText := helpSpec at:aKey ifAbsent:nil.
+	].
     ].
 
     "/ new: allow for a collection (resource-key arg1 arg2...)
     helpText isNonByteCollection ifTrue:[
-        helpText := helpText first.
+	helpText := helpText first.
 "/        resourceArgs := helpText copyFrom:2.
     ].
     ^ helpText
@@ -2254,12 +2262,12 @@
 
     helpSpec := self helpSpec.
     helpSpec notNil ifTrue:[
-        helpText := helpSpec at:aKey ifAbsent:nil.
+	helpText := helpSpec at:aKey ifAbsent:nil.
     ].
 
     "/ new: allow for a collection (resource-key arg1 arg2...)
     helpText isNonByteCollection ifTrue:[
-        helpText := helpText first.
+	helpText := helpText first.
 "/        resourceArgs := helpText copyFrom:2.
     ].
     ^ helpText
@@ -2271,9 +2279,9 @@
     |specFromBuilder|
 
     builder notNil ifTrue:[
-        (specFromBuilder := builder bindingAt:#flyByHelpSpec) notNil ifTrue:[
-            ^ specFromBuilder
-        ].
+	(specFromBuilder := builder bindingAt:#flyByHelpSpec) notNil ifTrue:[
+	    ^ specFromBuilder
+	].
 
     ].
     ^ self class flyByHelpSpec
@@ -2285,12 +2293,12 @@
     |key|
 
     builder notNil ifTrue:[
-        (key := builder helpKeyFor:aComponent) notNil ifTrue:[
-            ^ self flyByHelpTextForKey:key
-        ]
+	(key := builder helpKeyFor:aComponent) notNil ifTrue:[
+	    ^ self flyByHelpTextForKey:key
+	]
     ].
     masterApplication notNil ifTrue:[
-        ^ masterApplication flyByHelpTextFor:aComponent
+	^ masterApplication flyByHelpTextFor:aComponent
     ].
     ^ nil
 
@@ -2308,29 +2316,29 @@
 
     helpText := self basicFlyByHelpTextForKey:aKey.
     helpText isNil ifTrue:[
-        masterApplication notNil ifTrue:[
-            "here we get an already translated helpText"
-            helpText := masterApplication flyByHelpTextForKey:aKey.
-        ].
-        helpText isNil ifTrue:[
-            "there is no help text - resolve key from resources"
-            helpText := (self translateString:aKey) withCRs.
-        ].
-        ^ helpText.
+	masterApplication notNil ifTrue:[
+	    "here we get an already translated helpText"
+	    helpText := masterApplication flyByHelpTextForKey:aKey.
+	].
+	helpText isNil ifTrue:[
+	    "there is no help text - resolve key from resources"
+	    helpText := (self translateString:aKey) withCRs.
+	].
+	^ helpText.
     ].
     "/ kludge to allow for dynamic translation by the application itself, avoiding the key translation below.
     helpText isBlock ifTrue:[
-        ^ helpText value.
+	^ helpText value.
     ].
 
     "get the translation"
     translatedHelpText := self translateString:helpText.
     (helpText = aKey and:[ translatedHelpText = helpText ]) ifTrue:[
-        "there is no translation in the resources - maybe there is one for the key?"
-        translatedKey := self translateString:aKey.
-        translatedKey ~~ aKey ifTrue:[
-             translatedHelpText := translatedKey.
-        ].
+	"there is no translation in the resources - maybe there is one for the key?"
+	translatedKey := self translateString:aKey.
+	translatedKey ~~ aKey ifTrue:[
+	     translatedHelpText := translatedKey.
+	].
     ].
     ^ translatedHelpText withCRs.
 
@@ -2357,12 +2365,12 @@
     |key|
 
     builder notNil ifTrue:[
-        (key := builder helpKeyFor:aComponent) notNil ifTrue:[
-            ^ self helpTextForKey:key
-        ]
+	(key := builder helpKeyFor:aComponent) notNil ifTrue:[
+	    ^ self helpTextForKey:key
+	]
     ].
     masterApplication notNil ifTrue:[
-        ^ masterApplication helpTextFor:aComponent
+	^ masterApplication helpTextFor:aComponent
     ].
     ^ nil
 
@@ -2378,15 +2386,15 @@
 
     helpText := self basicHelpTextForKey:aKey.
     helpText isNil ifTrue:[
-        masterApplication notNil ifTrue:[
-            "here we get an already translated helpText"
-            helpText := masterApplication helpTextForKey:aKey.
-        ].
-        helpText isNil ifTrue:[
-            "there is no help text - resolve key from resources"
-            helpText := (self translateString:aKey) withCRs.
-        ].
-        ^ helpText.
+	masterApplication notNil ifTrue:[
+	    "here we get an already translated helpText"
+	    helpText := masterApplication helpTextForKey:aKey.
+	].
+	helpText isNil ifTrue:[
+	    "there is no help text - resolve key from resources"
+	    helpText := (self translateString:aKey) withCRs.
+	].
+	^ helpText.
 
 "/        aKey isSymbol ifFalse:[
 "/            ^ nil
@@ -2395,23 +2403,23 @@
 "/        "/ if someone already maps the flyByHelpTexts to the helpTexts
 "/        helpText := self flyByHelpTextForKey:aKey.
 "/        helpText notNil ifTrue:[ ^ helpText ].
-        ^ nil.
+	^ nil.
 "/        ^ self resources string:'Sorry, no help for: %1' with:aKey "/ nil
     ].
 
     "/ kludge to allow for dynamic translation by the application itself.
     helpText isBlock ifTrue:[
-        ^ helpText value.
+	^ helpText value.
     ].
 
     "get the translation"
     translatedHelpText := self translateString:helpText.
     translatedHelpText == helpText ifTrue:[
-        "there is no translation in the resources - maybe there is one for the key?"
-        translatedKey := self translateString:aKey.
-        translatedKey ~~ aKey ifTrue:[
-             translatedHelpText := translatedKey.
-        ].
+	"there is no translation in the resources - maybe there is one for the key?"
+	translatedKey := self translateString:aKey.
+	translatedKey ~~ aKey ifTrue:[
+	     translatedHelpText := translatedKey.
+	].
     ].
     ^ translatedHelpText withCRs.
 
@@ -2444,8 +2452,14 @@
     "Modified (comment): / 07-07-2011 / 17:13:51 / cg"
 !
 
+commonPreOpen
+    "A common hook for preOpenWith:, preOpenAsSubcanvasWith: and preOpenAsDialogWith:."
+
+    "Created: / 05-03-2014 / 18:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 postApplicationProcessCreate:newProcess windowGroup:newGroup
-    "this is sent whenever a new application is launched from this app, 
+    "this is sent whenever a new application is launched from this app,
      which forks its own windowGroup process. Allows for process group management,
      or process-global exception handlers to be installed.
      Nothing done here - to be redefined in concrete applications"
@@ -2465,10 +2479,10 @@
     "/ then treat this like a regular open.
     "/ otherwise ignore it.
     sameApp ifFalse:[
-        self postBuildWith:aBuilder.
+	self postBuildWith:aBuilder.
     ] ifTrue:[
-        "/ I no not think, that this is a good default
-        "/ self commonPostBuild.
+	"/ I no not think, that this is a good default
+	"/ self commonPostBuild.
     ].
 
     "Modified (comment): / 07-07-2011 / 17:16:30 / cg"
@@ -2488,9 +2502,9 @@
     "/ then treat this like a regular open.
     "/ otherwise ignore it.
     sameApp ifFalse:[
-        self postBuildWith:aBuilder.
+	self postBuildWith:aBuilder.
     ] ifTrue:[
-        self commonPostBuild.
+	self commonPostBuild.
     ].
 
     "Modified: / 08-07-1998 / 18:28:55 / cg"
@@ -2519,7 +2533,10 @@
      as a source (for aspects) i.e. via openDialogInterface:.
      Can be redefined in subclasses for actions after opening a dialog view."
 
+    self commonPostOpen
+
     "Created: / 07-07-2011 / 17:20:37 / cg"
+    "Modified: / 05-03-2014 / 18:42:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 postOpenWith:aBuilder
@@ -2552,6 +2569,25 @@
     self commonPreBuild
 !
 
+preOpenAsSubcanvasWith:aBuilder
+    "this is sent before the applications window is opened inside another application.
+     Can be redefined in subclasses for actions after showing the canvas view."
+
+    self commonPreOpen
+
+    "Created: / 05-03-2014 / 18:40:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+preOpenDialogWith:aBuilder
+    "this is sent after the applications window is opened as a dialog with me
+     as a source (for aspects) i.e. via openDialogInterface:.
+     Can be redefined in subclasses for actions after opening a dialog view."
+
+    self commonPreOpen
+
+    "Created: / 05-03-2014 / 18:41:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 preOpenWith:aBuilder
     "this is sent before the applications main window is opened.
      Can be redefined in subclasses for actions right before opening the view."
@@ -2568,9 +2604,9 @@
     |wg|
 
     (wg := self windowGroup) notNil ifTrue:[
-        (wg topViews ? #()) do:[:aView |
-            aView addToCurrentProject
-        ]
+	(wg topViews ? #()) do:[:aView |
+	    aView addToCurrentProject
+	]
     ]
 
     "Modified: 17.1.1997 / 19:43:39 / cg"
@@ -2608,9 +2644,9 @@
 
 initializeDevice
     self isWebService ifTrue:[
-        self initializeWebServiceDevice
+	self initializeWebServiceDevice
     ] ifFalse:[
-        self initializeScreenDevice
+	self initializeScreenDevice
     ].
 !
 
@@ -2624,7 +2660,7 @@
 
 initializeScreenDevice
     Screen notNil ifTrue:[
-        device := Screen current.
+	device := Screen current.
     ]
 !
 
@@ -2670,7 +2706,7 @@
 openAsSlave
     "open a standard interface as slave.
      Notice: there is still a need to make the current window a master
-        (see code and comments in WindowBuilder >> openAt:withExtent:andType:)"
+	(see code and comments in WindowBuilder >> openAt:withExtent:andType:)"
 
     ^ self openAs:#slave
 
@@ -2698,7 +2734,7 @@
 openInterface
     "open a standard interface.
 
-     Subclasses which do not have an interfaceSpec 
+     Subclasses which do not have an interfaceSpec
      should redefine this method and create & open their view(s) there.
      (see Launcher as an example).
 
@@ -2716,7 +2752,7 @@
 
      The argument, aSymbol specifies which interface. The concrete
      application subclass must provide a method with that name,
-     which must return an interfaceSpec. 
+     which must return an interfaceSpec.
      This is forwarded to the builder to create the views.
      Typically, applications only use one interface, returned by the #windowSpec method.
 
@@ -2733,7 +2769,7 @@
 openInterface:aSymbol as:windowType
     "open a specific interface in a special mode.
 
-     The argument, aSymbol specifies which interface. 
+     The argument, aSymbol specifies which interface.
      The concrete application subclass must provide a method with that name,
      which must return an interfaceSpec. This is forwarded to the builder to create the views.
      Typically, applications only use one interface, returned by the #windowSpec method.
@@ -2750,13 +2786,13 @@
 !
 
 openInterface:aSymbol at:aLocation
-    "open a specific interface at a location in default mode. 
+    "open a specific interface at a location in default mode.
 
      The argument, aSymbol specifies which interface. The concrete
      application subclass must provide a method with that name,
      which must return an interfaceSpec. This is forwarded to
      the builder to create the views.
-     Typically, applications only use one interface, 
+     Typically, applications only use one interface,
      returned by the #windowSpec method."
 
     self allButOpenInterface:aSymbol.
@@ -2799,12 +2835,12 @@
 !
 
 openInterfaceModal:aSymbol
-    "open a specific interface as a modal dialog. 
+    "open a specific interface as a modal dialog.
      The argument, aSymbol specifies which interface. The concrete
      application subclass must provide a method with that name,
      which must return an interfaceSpec. This is forwarded to
      the builder to create the views.
-     Typically, applications only use one interface, 
+     Typically, applications only use one interface,
      returned by the #windowSpec method."
 
     self allButOpenInterface:aSymbol.
@@ -2815,12 +2851,12 @@
 !
 
 openInterfaceModal:aSymbol at:location
-    "open a specific interface modal at some screen location. 
+    "open a specific interface modal at some screen location.
      The argument, aSymbol specifies which interface. The concrete
      application subclass must provide a method with that name,
      which must return an interfaceSpec. This is forwarded to
      the builder to create the views.
-     Typically, applications only use one interface, 
+     Typically, applications only use one interface,
      returned by the #windowSpec method."
 
     self allButOpenInterface:aSymbol.
@@ -2844,7 +2880,7 @@
     self setDevice:aDevice.
     Screen currentScreenQuerySignal answer:aDevice
     do:[
-        ^ self open
+	^ self open
     ]
 
     "Created: 13.1.1997 / 21:24:11 / cg"
@@ -2872,12 +2908,12 @@
     "open a view as specified in anInterfaceSpec."
 
     self createBuilder.
-    builder bindings:bindings.            
+    builder bindings:bindings.
     self allButOpenFrom:anInterfaceSpec.
     modal ifTrue:[
-        self openWindowModal.
+	self openWindowModal.
     ] ifFalse:[
-        self openWindow.
+	self openWindow.
     ]
 !
 
@@ -2893,51 +2929,51 @@
 !
 
 openWindow
-    "open the window 
+    "open the window
      - assumes that the builder has already setup the interface."
 
     builder "openWindow."
-        openAt:nil
-        withExtent:(self defaultWindowExtent)
-        andType:(self defaultWindowType)
+	openAt:nil
+	withExtent:(self defaultWindowExtent)
+	andType:(self defaultWindowType)
 
     "Created: / 14-02-1997 / 20:20:39 / cg"
     "Modified: / 11-07-2011 / 22:30:27 / cg"
 !
 
 openWindowAs:windowType
-    "open the window - assumes that the builder has already setup the interface. 
+    "open the window - assumes that the builder has already setup the interface.
      The windowType can be any of #slave, #partner, #dialog, #popUp etc."
 
-    builder 
-        openAt:nil 
-        withExtent:(self defaultWindowExtent) 
-        andType:windowType
+    builder
+	openAt:nil
+	withExtent:(self defaultWindowExtent)
+	andType:windowType
 
     "Modified: / 11-07-2011 / 22:30:35 / cg"
 !
 
 openWindowAs:windowType at:originOrNil
-    "open the window - assumes that the builder has already setup the interface. 
+    "open the window - assumes that the builder has already setup the interface.
      The windowType can be any of #slave, #partner, #dialog, #popUp etc."
 
-    builder 
-        openAt:originOrNil 
-        withExtent:(self defaultWindowExtent) 
-        andType:windowType
+    builder
+	openAt:originOrNil
+	withExtent:(self defaultWindowExtent)
+	andType:windowType
 
     "Modified: / 11-07-2011 / 22:30:35 / cg"
     "Created: / 25-07-2011 / 16:00:24 / cg"
 !
 
 openWindowAt:aPoint
-    "open the window 
+    "open the window
      - assumes that the builder has already setup the interface."
 
     builder "openWindowAt:aLocation."
-        openAt:aPoint
-        withExtent:(self defaultWindowExtent)
-        andType:(self defaultWindowType)
+	openAt:aPoint
+	withExtent:(self defaultWindowExtent)
+	andType:(self defaultWindowType)
 
     "Created: / 14-02-1997 / 20:20:55 / cg"
 !
@@ -2957,9 +2993,9 @@
 
 "/    builder openDialog.
     builder
-        openAt:nil 
-        withExtent:(self defaultWindowExtent) 
-        andType:#dialog
+	openAt:nil
+	withExtent:(self defaultWindowExtent)
+	andType:#dialog
 
     "Created: / 14-02-1997 / 20:20:39 / cg"
 !
@@ -2997,7 +3033,7 @@
 !ApplicationModel methodsFor:'opening-dialogs'!
 
 openDialog
-    "open my window as a modal dialog 
+    "open my window as a modal dialog
      - assumes that the builder has already setup the interface."
 
     self window beToolDialog.
@@ -3027,10 +3063,10 @@
     "/ (of SimpleDialog) but use me as aspect provider.
     "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
 
-    ^ SimpleDialog new 
-        openFor:self 
-        interface:aSelector 
-        withBindings:bindings
+    ^ SimpleDialog new
+	openFor:self
+	interface:aSelector
+	withBindings:bindings
 
     "Created: / 28-02-1997 / 14:07:45 / cg"
     "Modified: / 23-01-1998 / 18:18:14 / cg"
@@ -3044,10 +3080,10 @@
     "/ (of SimpleDialog) but use me as aspect provider.
     "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
 
-    ^ SimpleDialog new 
-        openFor:self 
-        interfaceSpec:aSpec 
-        withBindings:bindings
+    ^ SimpleDialog new
+	openFor:self
+	interfaceSpec:aSpec
+	withBindings:bindings
 
     "Created: / 28-02-1997 / 14:07:45 / cg"
     "Modified: / 23-01-1998 / 18:18:14 / cg"
@@ -3061,10 +3097,10 @@
     "/ (of SimpleDialog) but use me as aspect provider.
     "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
 
-    ^ SimpleDialog new 
-        openFor:self 
-        spec:aSpec 
-        withBindings:bindings
+    ^ SimpleDialog new
+	openFor:self
+	spec:aSpec
+	withBindings:bindings
 
     "Modified: / 23-01-1998 / 18:18:14 / cg"
     "Created: / 20-05-1998 / 20:27:56 / cg"
@@ -3073,17 +3109,17 @@
 !ApplicationModel methodsFor:'opening-webInterface'!
 
 addToService
-    self service 
-        addPage:(builder page) 
-        link:(self webLink)
+    self service
+	addPage:(builder page)
+	link:(self webLink)
 !
 
 createWebBuilder
     "create a Web-UIBuilder if not already present"
 
     builder isNil ifTrue:[
-        builder := self webBuilderClass new.
-        builder application:self.
+	builder := self webBuilderClass new.
+	builder application:self.
     ]
 
     "Created: / 19.6.1998 / 03:32:37 / cg"
@@ -3096,7 +3132,7 @@
 defineInterface
     "define a standard interface.
 
-     Subclasses which do not have an interfaceSpec 
+     Subclasses which do not have an interfaceSpec
      should redefine this method and create their page there."
 
     ^ self defineInterface:(self defaultPageSpecName)
@@ -3114,7 +3150,7 @@
     |page|
 
     builder isNil ifTrue:[
-        self createWebBuilder.
+	self createWebBuilder.
     ].
 
     self preBuildWith:builder.
@@ -3147,19 +3183,19 @@
     |server|
 
     self service isNil ifTrue:[
-        server := HTTPServer serverOnPort:(self httpServerPort).
-
-        self service:(server 
-                    serviceForLink:(self serviceLinkName)
-                    ifAbsent:[
-                        |service|
-
-                        service := HTTPPortalService new.
-                        service linkName:(self serviceLinkName).
-                        service class unRegisterServiceOn:server.
-                        service registerServiceOn:server.
-                        service
-                    ]).
+	server := HTTPServer serverOnPort:(self httpServerPort).
+
+	self service:(server
+		    serviceForLink:(self serviceLinkName)
+		    ifAbsent:[
+			|service|
+
+			service := HTTPPortalService new.
+			service linkName:(self serviceLinkName).
+			service class unRegisterServiceOn:server.
+			service registerServiceOn:server.
+			service
+		    ]).
     ].
 !
 
@@ -3183,7 +3219,7 @@
 
 startAsWebService
     device isNil ifTrue:[
-        self initializeDevice.
+	self initializeDevice.
     ].
     self startInPortalService:self service
 
@@ -3192,7 +3228,7 @@
     "
 !
 
-startInPortalService:aPortalServiceOrSession 
+startInPortalService:aPortalServiceOrSession
     aPortalServiceOrSession application:self.
     self service:aPortalServiceOrSession.
     self defineInterface.
@@ -3229,7 +3265,7 @@
      spec readers for other UI languages (motif UIL ?)"
 
     self isWebService ifTrue:[
-        ^ self webBuilderClass
+	^ self webBuilderClass
     ].
     ^ UIBuilder
 
@@ -3241,8 +3277,8 @@
     "create a WindowBuilder if not already present"
 
     builder isNil ifTrue:[
-        builder := self builderClass new.
-        builder application:self.
+	builder := self builderClass new.
+	builder application:self.
     ]
 
     "Created: / 19.6.1998 / 03:32:37 / cg"
@@ -3283,8 +3319,8 @@
      Here, the query is forwarded to my class.
      Can be refefined in subclasses which want to provide per-instance specs."
 
-    aSelectorOrSpec isSymbol ifFalse:[     
-        (aSelectorOrSpec isKindOf:UISpecification) ifTrue:[^ aSelectorOrSpec].
+    aSelectorOrSpec isSymbol ifFalse:[
+	(aSelectorOrSpec isKindOf:UISpecification) ifTrue:[^ aSelectorOrSpec].
     ].
     ^ self class interfaceSpecFor:aSelectorOrSpec
 
@@ -3308,7 +3344,7 @@
     "return a name to be shown for me in the process monitor"
 
     self class == ApplicationModel ifTrue:[
-        ^ 'Application'
+	^ 'Application'
     ].
     ^ self class nameWithoutPrefix
 
@@ -3334,19 +3370,19 @@
 
 resolveName:something inClass:aClass
     "return the class from something, a class, symbol, string or nil.
-     first we are looking in the namespace of the application, 
+     first we are looking in the namespace of the application,
      then in the current namespace and finally in Smalltalk"
 
     |cls|
 
     aClass notNil ifTrue:[
-        (cls := Smalltalk resolveName:something inClass:aClass) notNil ifTrue:[
-            ^ cls
-        ].
-
-        masterApplication notNil ifTrue:[
-            ^ masterApplication resolveName:something
-        ]
+	(cls := Smalltalk resolveName:something inClass:aClass) notNil ifTrue:[
+	    ^ cls
+	].
+
+	masterApplication notNil ifTrue:[
+	    ^ masterApplication resolveName:something
+	]
     ].
     ^ nil
 !
@@ -3372,7 +3408,7 @@
     "return the top-master application"
 
     masterApplication isNil ifTrue:[
-        ^ self
+	^ self
     ].
     ^ masterApplication topApplication
 
@@ -3408,21 +3444,21 @@
     window := self window.
 
     self shouldRememberLastExtent ifTrue:[
-        self rememberLastExtent.
+	self rememberLastExtent.
     ].
-    ((wg := self windowGroup) notNil 
+    ((wg := self windowGroup) notNil
     and:[ wg isModal not ]) ifTrue:[
-        wgProcess := wg process.
-        (Processor activeProcess ~~ wgProcess
-        and:[wgProcess notNil]) ifTrue:[
-            wgProcess terminate
-        ] ifFalse:[
-            wg closeDownViews.
-        ]
+	wgProcess := wg process.
+	(Processor activeProcess ~~ wgProcess
+	and:[wgProcess notNil]) ifTrue:[
+	    wgProcess terminate
+	] ifFalse:[
+	    wg closeDownViews.
+	]
     ] ifFalse:[
-        window notNil ifTrue:[
-            window destroy.
-        ]
+	window notNil ifTrue:[
+	    window destroy.
+	]
     ].
 
     "Modified: / 31-07-2013 / 17:41:08 / cg"
@@ -3436,48 +3472,48 @@
 
     window := self window.
     window isNil ifTrue:[
-        'ApplicationModel [warning]: oops - closeRequest for non-view application arrived' infoPrintCR.
-        ^ self
+	'ApplicationModel [warning]: oops - closeRequest for non-view application arrived' infoPrintCR.
+	^ self
     ].
 
     window isTopView ifFalse:[
-        window topView isModal ifTrue:[
-            WindowGroup leaveSignal raise.
-        ].
-
-        'ApplicationModel [warning]: oops - closeRequest for non-TopView arrived' infoPrintCR.
-        ^ self
+	window topView isModal ifTrue:[
+	    WindowGroup leaveSignal raise.
+	].
+
+	'ApplicationModel [warning]: oops - closeRequest for non-TopView arrived' infoPrintCR.
+	^ self
     ].
 
     "/ In multiView apps, tell my master.
     "/ (but not if I am a modal reincarnation)
-    (masterApplication notNil 
+    (masterApplication notNil
     and:[window isModal not]) ifTrue:[
 
-        "/ temporary clear my masterApplication to prevent
-        "/ endless recursion, in case the master sends me
-        "/ a closeRequest (although, it is supposed to
-        "/ send me a closeDownViews ...)
-
-        sav := masterApplication.
-        masterApplication := nil.
-        sav closeRequestFor:window.
-
-        "/ restore - in case master did not want me to close ...
-        masterApplication := sav.
+	"/ temporary clear my masterApplication to prevent
+	"/ endless recursion, in case the master sends me
+	"/ a closeRequest (although, it is supposed to
+	"/ send me a closeDownViews ...)
+
+	sav := masterApplication.
+	masterApplication := nil.
+	sav closeRequestFor:window.
+
+	"/ restore - in case master did not want me to close ...
+	masterApplication := sav.
     ] ifFalse:[
-        "/ ST/X does close-check by redefining this message without
-        "/ a supersend;
-        "/ VW does it by returning false from requestForWindowClose
-        "/ sigh.
-
-        self requestForWindowClose ifTrue:[
-            window isSlave ifTrue:[
-                window destroy
-            ] ifFalse:[
-                self closeDownViews
-            ]
-        ]
+	"/ ST/X does close-check by redefining this message without
+	"/ a supersend;
+	"/ VW does it by returning false from requestForWindowClose
+	"/ sigh.
+
+	self requestForWindowClose ifTrue:[
+	    window isSlave ifTrue:[
+		window destroy
+	    ] ifFalse:[
+		self closeDownViews
+	    ]
+	]
     ].
 
     "Modified: / 19.6.1998 / 01:37:17 / cg"
@@ -3497,41 +3533,41 @@
 
     "/ In multiView apps, tell my master.
     "/ (but not if I am a modal reincarnation)
-    (masterApplication notNil 
+    (masterApplication notNil
     and:[myWindow topView isModal not]) ifTrue:[
 
-        "/ temporary clear my masterApplication to prevent
-        "/ endless recursion, in case the master sends me
-        "/ a closeRequest (although, it is supposed to
-        "/ send me a closeDownViews ...)
-
-        savedMaster := masterApplication.
-        masterApplication := nil.
-        aTopView isSlave ifTrue:[
-            savedMaster closeRequestFor:aTopView.
-        ] ifFalse:[
-            savedMaster closeRequestFor:myWindow.
-        ].
-
-        "/ restore - in case master did not want me to close ...
-        masterApplication := savedMaster.
-        ^ self
+	"/ temporary clear my masterApplication to prevent
+	"/ endless recursion, in case the master sends me
+	"/ a closeRequest (although, it is supposed to
+	"/ send me a closeDownViews ...)
+
+	savedMaster := masterApplication.
+	masterApplication := nil.
+	aTopView isSlave ifTrue:[
+	    savedMaster closeRequestFor:aTopView.
+	] ifFalse:[
+	    savedMaster closeRequestFor:myWindow.
+	].
+
+	"/ restore - in case master did not want me to close ...
+	masterApplication := savedMaster.
+	^ self
     ].
 
     (aTopView == myWindow) ifTrue:[
-        self closeRequest.
-        ^ self
+	self closeRequest.
+	^ self
     ].
 
     (aTopView isPartner or:[aTopView isMaster]) ifTrue:[
-        aTopView application closeRequest.
-        self closeRequest.
-        ^ self.
+	aTopView application closeRequest.
+	self closeRequest.
+	^ self.
     ].
     aTopView isSlave ifTrue:[
-        aTopView closeRequest 
+	aTopView closeRequest
     ] ifFalse:[
-        aTopView application closeRequest.
+	aTopView application closeRequest.
     ]
 !
 
@@ -3549,18 +3585,18 @@
     "/ to remember the accept vs. cancel case.
     "/
     self window isModal ifTrue:[
-        masterApplication notNil ifTrue:[
-            masterApplication window topView == self window topView ifTrue:[
-                masterApplication window isModal ifTrue:[
-                    masterApplication doAccept.
-                    ^ self.
-                ].
-            ].
-        ].
-
-        "/ mhmh - is this a good idea ?
-        self perform:#accept ifNotUnderstood:[self closeRequest].
-        ^ self
+	masterApplication notNil ifTrue:[
+	    masterApplication window topView == self window topView ifTrue:[
+		masterApplication window isModal ifTrue:[
+		    masterApplication doAccept.
+		    ^ self.
+		].
+	    ].
+	].
+
+	"/ mhmh - is this a good idea ?
+	self perform:#accept ifNotUnderstood:[self closeRequest].
+	^ self
     ].
 
     ^ self      "/ nothing done here ...
@@ -3580,9 +3616,9 @@
     "/ to remember the accept vs. cancel case.
     "/
     self window isModal ifTrue:[
-        "/ mhmh - is this a good idea ?
-        self perform:#cancel ifNotUnderstood:[self closeRequest].
-        ^ self
+	"/ mhmh - is this a good idea ?
+	self perform:#cancel ifNotUnderstood:[self closeRequest].
+	^ self
     ].
     ^ self      "/ nothing done here ...
 !
@@ -3604,10 +3640,10 @@
 
     window := self window.
     (window notNil and:[window isTopView]) ifTrue:[
-        DefaultExtents isNil ifTrue:[
-            DefaultExtents := Dictionary new.
-        ].
-        DefaultExtents at:self class name put:(window extent).
+	DefaultExtents isNil ifTrue:[
+	    DefaultExtents := Dictionary new.
+	].
+	DefaultExtents at:self class name put:(window extent).
     ].
 
     "Created: / 31-07-2013 / 14:41:33 / cg"
@@ -3655,7 +3691,7 @@
   "output an audible beep or bell on my screen device"
 
    device notNil ifTrue:[
-        device beep.
+	device beep.
    ].
 !
 
@@ -3680,7 +3716,7 @@
 
 openDocumentationFile:aFilename
     HTMLDocumentView notNil ifTrue:[
-        HTMLDocumentView openFullOnDocumentationFile:aFilename.
+	HTMLDocumentView openFullOnDocumentationFile:aFilename.
     ].
 !
 
@@ -3715,9 +3751,9 @@
     "like Objects warn, but optionally translates the string via the
      resourcePack, thus giving a translated string automatically"
 
-    super warn:(aBoolean 
-                    ifTrue:[ (self translateString:aString) withCRs ]
-                    ifFalse:[ aString ]).
+    super warn:(aBoolean
+		    ifTrue:[ (self translateString:aString) withCRs ]
+		    ifFalse:[ aString ]).
 !
 
 warn:aString with:arg
@@ -3772,7 +3808,7 @@
 
     w := self window.
     w notNil ifTrue:[
-        ^ w topView withCursor:aCursor do:aBlock
+	^ w topView withCursor:aCursor do:aBlock
     ].
     aCursor showWhile:[ret := aBlock value].
     ^ ret.
@@ -3799,23 +3835,23 @@
     "Modified: 14.12.1995 / 20:57:36 / cg"
 !
 
-withVisibleCursor:aCursor do:aBlock 
+withVisibleCursor:aCursor do:aBlock
     "evaluate aBlock, showing a waitCursor in my topView and all of its subviews.
      Return the value of aBlock.
      Ensure, that the cursor is visible by the user for a minimal amount of time."
-    
+
     |ret|
 
-    self 
-        withCursor:aCursor do:[
-            |time|
-
-            time := Time millisecondsToRun:[ ret := aBlock value].
-            time := UserPreferences current waitCursorVisibleTime - time.
-            time > 0 ifTrue:[
-                Delay waitForMilliseconds:time.
-            ].
-        ].
+    self
+	withCursor:aCursor do:[
+	    |time|
+
+	    time := Time millisecondsToRun:[ ret := aBlock value].
+	    time := UserPreferences current waitCursorVisibleTime - time.
+	    time > 0 ifTrue:[
+		Delay waitForMilliseconds:time.
+	    ].
+	].
     ^ ret.
 
     "Modified (comment): / 12-09-2011 / 12:14:31 / cg"
@@ -3828,7 +3864,7 @@
     ^ self withCursor:(Cursor wait) do:aBlock
 !
 
-withWaitCursorVisibleDo:aBlock 
+withWaitCursorVisibleDo:aBlock
     "evaluate aBlock, showing a waitCursor in my topView and all of its subviews.
      Return the value of aBlock.
      Guarantee, that the cursor is visible by the user for a minimal amount of time."
@@ -3878,10 +3914,10 @@
      This allows for events for an appModel to be pushed into the event queue
      the same way as events for a view are pushable."
 
-    ^ self 
-        dispatchEvent:event 
-        withFocusOn:nil
-        delegate:true
+    ^ self
+	dispatchEvent:event
+	withFocusOn:nil
+	delegate:true
 
 !
 
@@ -3907,15 +3943,15 @@
     "Modified: / 20.6.1998 / 16:44:05 / cg"
 !
 
-dispatchEvent:event withFocusOn:focusViewOrNil 
+dispatchEvent:event withFocusOn:focusViewOrNil
     "dispatch a user-pushed event.
      This allows for events for an appModel to be pushed into the event queue
      the same way as events for a view are pushable."
 
-    ^ self 
-        dispatchEvent:event 
-        withFocusOn:focusViewOrNil
-        delegate:true
+    ^ self
+	dispatchEvent:event
+	withFocusOn:focusViewOrNil
+	delegate:true
 
 
 !
@@ -3925,12 +3961,12 @@
      This allows for events for an appModel to be pushed into the event queue
      the same way as events for a view are pushable."
 
-    ^ self 
-        dispatchEvent:event 
-        type:event type
-        arguments:(event arguments)
-        withFocusOn:focusViewOrNil
-        delegate:doDelegate
+    ^ self
+	dispatchEvent:event
+	type:event type
+	arguments:(event arguments)
+	withFocusOn:focusViewOrNil
+	delegate:doDelegate
 
 
 !
@@ -3964,8 +4000,8 @@
      Typically, the command is one like 'openPath:', as generated in StandaloneStartup."
 
     command = 'openPath' ifTrue:[
-        self processOpenPathCommand:argument.
-        ^ self.
+	self processOpenPathCommand:argument.
+	^ self.
     ].
 
     Transcript showCR: 'Invalid command received: ', command.
@@ -3980,7 +4016,7 @@
 
 processShortcut:aKeyEvent
      "a shortcut key event as forwarded from the keyboardProcessor - if there is the
-      shortcut key defined, process the shortcut and return true - otherwise false." 
+      shortcut key defined, process the shortcut and return true - otherwise false."
 
     ^false
 
@@ -3994,11 +4030,11 @@
     |w k|
 
     builder notNil ifTrue:[
-        (w := builder window) notNil ifTrue:[
-            (k := w keyboardProcessor) notNil ifTrue:[
-                ^ k requestForWindowClose
-            ]
-        ]
+	(w := builder window) notNil ifTrue:[
+	    (k := w keyboardProcessor) notNil ifTrue:[
+		^ k requestForWindowClose
+	    ]
+	]
     ].
     ^ true
 
@@ -4030,11 +4066,11 @@
 !ApplicationModel class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.351 2014-02-28 13:27:37 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.352 2014-03-05 20:25:25 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.351 2014-02-28 13:27:37 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.352 2014-03-05 20:25:25 vrany Exp $'
 ! !