Do not log duplicate error messages fpr missing aspect method
authorStefan Vogel <sv@exept.de>
Fri, 06 Apr 2012 16:04:25 +0200
changeset 4119 f5cb7a477fbe
parent 4118 a2a352a255a9
child 4120 fcbdc6b3998d
Do not log duplicate error messages fpr missing aspect method
MenuPanel.st
--- a/MenuPanel.st	Thu Apr 05 20:35:07 2012 +0200
+++ b/MenuPanel.st	Fri Apr 06 16:04:25 2012 +0200
@@ -6322,18 +6322,17 @@
     choice == something ifTrue:[^ self].
 
     choice isValueModel ifTrue:[
-	choice removeDependent:self
-    ].
-
-    (choice := something) notNil ifTrue:[
-	choice isSymbol ifTrue:[
-	    (choice := self aspectAt:choice) isNil ifTrue:[
-		choice := something
-	    ]
-	].
-	choice isValueModel ifTrue:[
-	    choice addDependent:self
-	]
+        choice removeDependent:self
+    ].
+
+    choice := something.
+    choice notNil ifTrue:[
+        choice isSymbol ifTrue:[
+            choice := (self aspectAt:choice) ? choice.
+        ].
+        choice isValueModel ifTrue:[
+            choice addDependent:self
+        ]
     ].
 !
 
@@ -6360,27 +6359,15 @@
     menuPanel enabled ifFalse:[^ false].
 
     enableChannel isSymbol ifTrue:[
-	state := self aspectAt:enableChannel.
-
-	state isNil ifTrue:[
-	    self ifNotInUIBuilderInfoPrintCR:
-		('MenuPanel::Item [info]: no aspect for %1 (in %2)'
-		    bindWith:enableChannel
-		    with:label).
-	    ^ true
-	].
-
-	state isValueModel ifTrue:[
-	    enableChannel := state.
-	    enableChannel addDependent:self.
-	    state := enableChannel value.
-	] ifFalse:[
-	    state := state value
-	]
+        state := self aspectAt:enableChannel.
+        state isValueModel ifTrue:[
+            enableChannel := state.
+            enableChannel addDependent:self.
+        ].
     ] ifFalse:[
-	state := enableChannel value
-    ].
-    ^ state ~~ false
+        state := enableChannel.
+    ].
+    ^ state value ~~ false
 !
 
 enabled:something
@@ -6979,34 +6966,32 @@
     |appl value|
 
     appl := menuPanel receiver.
-
     (appl isValueModel) ifTrue:[
-	^ appl value:aKey
-    ].
-
+        ^ appl value:aKey
+    ].
     appl isNil ifTrue:[
-	appl := menuPanel application.
-    ].
-    appl isNil ifTrue:[ ^ nil].
+        appl := menuPanel application.
+        appl isNil ifTrue:[ ^ nil].
+    ].
 
     MessageNotUnderstood handle:[:ex|
-	ex selector == aKey ifFalse:[
-	    ex reject
-	].
-	self ifNotInUIBuilderInfoPrintCR:
-	    ('MenuPanel::Item [info]: application (%1) does not provide aspect: %2'
-	     bindWith:appl classNameWithArticle
-	     with:aKey).
+        ex selector ~~ aKey ifTrue:[
+            ex reject
+        ].
+        self ifNotInUIBuilderInfoPrintCR:
+            ('MenuPanel::Item [info]: application (%1) does not provide aspect: %2 (in %3)'
+             bindWith:appl classNameWithArticle
+             with:aKey with:label).
     ] do:[
-	aKey numArgs == 1 ifTrue:[
-	    value := appl perform:aKey with:(menuItem argument ? self).
-	] ifFalse:[
-	    (appl respondsTo:#aspectFor:) ifTrue:[
-		value := appl aspectFor:aKey
-	    ] ifFalse:[
-		value := appl perform:aKey
-	    ]
-	]
+        aKey numArgs == 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
 
@@ -7960,42 +7945,38 @@
 
     |numArgs sel recv|
 
-    indication isNil ifTrue:[^ nil].                                    "no indication specified"
+    indication isNil ifTrue:[^ nil].       "no indication specified"
 
     indication isSymbol ifFalse:[
-	^ indication value == true                                      "block or model"
-    ].
-
-    (numArgs := indication numArgs) == 2 ifTrue:[
-	recv := menuPanel receiver.
-
-	(recv isValueModel) ifFalse:[
-	    (recv notNil or:[(recv := menuPanel application) notNil]) ifTrue:[
-		sel := indication copyFrom:1 to:(indication indexOf:$:).
-		sel := sel asSymbol.
-
-		MessageNotUnderstood handle:[:ex|
-		    ex selector == sel ifFalse:[
-			ex reject
-		    ].
-		] do:[
-		    sel := recv perform:sel with:(menuItem argument)
-		]
-	    ].
-	].
-	^ sel value == true
-    ].
-
-    numArgs ~~ 0 ifTrue:[
-	sel := (indication copyWithoutLast:1) asSymbol
+        ^ indication value == true          "block or model"
+    ].
+
+    numArgs := indication numArgs.
+    numArgs == 2 ifTrue:[
+        recv := menuPanel receiver ? menuPanel application.
+        (recv notNil and:[recv isValueModel not]) ifTrue:[
+            sel := indication copyFrom:1 to:(indication indexOf:$:).
+            sel := sel asSymbol.
+
+            MessageNotUnderstood handle:[:ex|
+                ex selector ~~ sel ifTrue:[
+                    ex reject.
+                ].
+            ] do:[
+                sel := recv perform:sel with:(menuItem argument).
+            ]
+        ].
     ] ifFalse:[
-	sel := indication
-    ].
-    sel := self aspectAt:sel.
-
-    sel isValueModel ifTrue:[
-	indication := sel.
-	indication addDependent:self.
+        numArgs == 0 ifTrue:[
+            sel := indication
+        ] ifFalse:[
+            sel := (indication copyWithoutLast:1) asSymbol.
+        ].
+        sel := self aspectAt:sel.
+        sel isValueModel ifTrue:[
+            indication := sel.
+            indication addDependent:self.
+        ].
     ].
     ^ sel value == true
 !
@@ -8303,17 +8284,15 @@
     |state|
 
     isVisible isSymbol ifTrue:[
-	state := self aspectAt:isVisible.
-
-	state isValueModel ifTrue:[
-	    isVisible := state.
-	    isVisible addDependent:self.
-	    state := isVisible.
-	]
+        state := self aspectAt:isVisible.
+        state isValueModel ifTrue:[
+            isVisible := state.
+            isVisible addDependent:self.
+        ].
     ] ifFalse:[
-	state := isVisible
-    ].
-  ^ state value ~~ false
+        state := isVisible
+    ].
+    ^ state value ~~ false
 
     "Modified: / 5.10.1998 / 12:08:28 / cg"
 !
@@ -8631,11 +8610,11 @@
 !MenuPanel class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.537 2012-04-05 18:35:07 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.538 2012-04-06 14:04:25 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.537 2012-04-05 18:35:07 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.538 2012-04-06 14:04:25 stefan Exp $'
 ! !
 
 MenuPanel initialize!