subApplicationFor
authorClaus Gittinger <cg@exept.de>
Wed, 14 Sep 2005 12:25:22 +0200
changeset 2058 3f814cdba5d6
parent 2057 76f79bbaf531
child 2059 36e4aa247402
subApplicationFor
ApplicationModel.st
--- a/ApplicationModel.st	Wed Sep 07 15:21:01 2005 +0200
+++ b/ApplicationModel.st	Wed Sep 14 12:25:22 2005 +0200
@@ -248,11 +248,14 @@
      labels from a Dictionary or whatever.
      Typically, a string is returned there."
 
-    (self application respondsTo:aKey) ifTrue:[
-        ^ self application perform:aKey
+    |app|
+
+    app := self application.
+    app isNil ifTrue:[^ nil].
+    (app respondsTo:aKey) ifTrue:[
+        ^ app perform:aKey
     ].
-    ^ self application labelAt:aKey ifAbsent:nil
-
+    ^ app labelAt:aKey ifAbsent:nil
 !
 
 listFor:aKey
@@ -268,7 +271,8 @@
 
     |app|
 
-    (app := self application) notNil ifTrue:[
+    app := self application.
+    app notNil ifTrue:[
         (app respondsTo:aKey) ifTrue:[
             ^ app perform:aKey
         ]
@@ -359,6 +363,24 @@
     ^ app perform:aKey
 !
 
+subApplicationFor:aKey
+    "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.
+     Alternatively, a subclass may redefine this method, to provide
+     an application from a Dictionary or whatever.
+     Typically, an ApplicationModel subinstance is returned there."
+
+    |app|
+
+    app := self application.
+    (app respondsTo:aKey) ifTrue:[
+        ^ app perform:aKey
+    ].
+    ^ nil
+!
+
 visualFor:aKey
     "sent by the builder to ask for an application provided
      image or element for a label.
@@ -1170,6 +1192,24 @@
         onDevice:(self graphicsDevice)
 !
 
+subApplicationFor:aKey
+    "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.
+     Alternatively, a subclass may redefine this method, to provide
+     an application from a Dictionary or whatever.
+     Typically, an ApplicationModel subinstance is returned there."
+
+     (self respondsTo:aKey) ifTrue:[
+         ^ self perform:aKey 
+     ].
+     masterApplication notNil ifTrue:[
+         ^ masterApplication subApplicationFor:aKey
+     ].
+     ^ nil.
+!
+
 visualFor:aKey
     "sent by the builder to ask for an application provided
      image or element for a label.
@@ -2818,7 +2858,7 @@
 !ApplicationModel class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.213 2005-07-13 15:39:25 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.214 2005-09-14 10:25:22 cg Exp $'
 ! !
 
 ApplicationModel initialize!