UIPainter.st
changeset 1819 cbf2079fd723
parent 1803 a0f73e1695e1
child 1820 3d834d5e5bb4
--- a/UIPainter.st	Wed Mar 24 11:52:31 2004 +0100
+++ b/UIPainter.st	Fri Mar 26 12:08:53 2004 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1995-1998 by eXept Software AG
 	      All Rights Reserved
@@ -3460,26 +3458,32 @@
 doDefineClassAndSelector
     "launches a dialog for defining class, superclass, and selector of the application"
 
-    |again tmp|
+    |again readFromModelKeyed|
+
+    readFromModelKeyed := [:aKey| |ret|
+        ret := (self aspectFor:aKey) value.
+        ret isEmptyOrNil ifTrue:[
+            ret := nil
+        ] ifFalse:[
+            ret isString ifTrue:[
+                ret := ret string withoutSeparators.
+                ret := ret isEmpty ifTrue:[nil] ifFalse:[ret asSymbol].
+            ].
+        ].
+        ret
+    ].
 
     [
         again := false.
 
-        (tmp := specClass) isNil ifTrue:[tmp := 'NewApplication'].
-        aspects at:#classNameChannel put:tmp asValue.
-
-        (tmp := specSelector) isNil ifTrue:[tmp := 'windowSpec'].
-        aspects at:#methodNameChannel put:tmp asValue.
-
-        (tmp := specSuperclass) isNil ifTrue:[tmp := 'ApplicationModel'].
-        aspects at:#superclassNameChannel put:tmp asValue.
+        aspects at:#classNameChannel      put:(specClass      ? 'NewApplication')   asValue.
+        aspects at:#methodNameChannel     put:(specSelector   ? 'windowSpec')       asValue.
+        aspects at:#superclassNameChannel put:(specSuperclass ? 'ApplicationModel') asValue.
 
         (self openDialogInterface:#dialogSpecForDefiningClassAndSelector) ifTrue:[
-
-            specClass    := (self aspectFor:#classNameChannel) value.
-            specSelector := (self aspectFor:#methodNameChannel) value.
-            specSelector notNil ifTrue:[specSelector := specSelector asSymbol].
-            specSuperclass := (self aspectFor:#superclassNameChannel) value.
+            specClass      := readFromModelKeyed value:#classNameChannel.
+            specSelector   := readFromModelKeyed value:#methodNameChannel.
+            specSuperclass := readFromModelKeyed value:#superclassNameChannel.
 
             (again := self checkClassAndSelector not) ifFalse:[
                 self painter className:specClass