#REFACTORING by stefan
authorStefan Vogel <sv@exept.de>
Wed, 15 Mar 2017 17:48:27 +0100
changeset 5515 f87f470e99c9
parent 5514 8f0a8c426831
child 5516 565035d19b67
#REFACTORING by stefan class: MenuPanel MenuPanel::Item >> #aspectAt:
MenuPanel.st
--- a/MenuPanel.st	Mon Mar 13 18:12:27 2017 +0100
+++ b/MenuPanel.st	Wed Mar 15 17:48:27 2017 +0100
@@ -7505,40 +7505,42 @@
 aspectAt:aKey
     "returns the value assigned to key or nil"
 
-    |appl value|
+    |appl|
 
     appl := menuPanel receiver.
-    (appl isValueModel) ifTrue:[
-        ^ appl value:aKey
-    ].
     appl isNil ifTrue:[
         appl := menuPanel application.
-        appl isNil ifTrue:[ ^ nil].
-    ].
-
-    MessageNotUnderstood handle:[:ex|
+        appl isNil ifTrue:[ 
+            ^ nil
+        ].
+    ] ifFalse:[appl isValueModel ifTrue:[
+        ^ appl value:aKey
+    ]].
+
+    ^ [
+        aKey argumentCount == 1 ifTrue:[
+            appl perform:aKey with:(menuItem argument ? self).
+        ] ifFalse:[
+            (appl respondsTo:#aspectFor:) ifTrue:[
+                appl aspectFor:aKey
+            ] ifFalse:[
+                appl perform:aKey
+            ]
+        ]
+    ] on:MessageNotUnderstood do:[:ex|
         ex selector ~~ aKey ifTrue:[
-            ex reject
+            ex reject.
         ].
         self ifNotInUIBuilderInfoPrintCR:
             ('MenuPanel::Item [error]: application (%1) does not provide aspect: %2 (in %3)'
              bindWith:appl classNameWithArticle
              with:aKey
              with:(label isString ifTrue:[label] ifFalse:[self nameKey ? self itemValue ? '???'])).
-    ] do:[
-        aKey argumentCount == 1 ifTrue:[
-            value := appl perform:aKey with:(menuItem argument ? self).
-        ] ifFalse:[
-            (appl respondsTo:#aspectFor:) ifTrue:[
-                value := appl aspectFor:aKey
-            ] ifFalse:[
-                value := appl perform:aKey
-            ]
-        ]
-    ].
-    ^ value
+        nil
+    ].
 
     "Modified: / 02-08-2013 / 16:44:28 / cg"
+    "Modified (format): / 15-03-2017 / 17:00:31 / stefan"
 ! !
 
 !MenuPanel::Item methodsFor:'change & update'!