diff -r 0040d47658c6 -r 0e8a4296dec1 UIPainter.st --- a/UIPainter.st Fri Oct 10 20:59:33 1997 +0200 +++ b/UIPainter.st Wed Oct 15 12:38:20 1997 +0200 @@ -1353,7 +1353,7 @@ "cancel all changes done to the specification; reread attributes from the assigned component " - |spec key| + |spec key view| self isModified ifTrue:[ (spec := self painter specForSelection) notNil ifTrue:[ @@ -1361,7 +1361,12 @@ ]. self helpTool helpKey:key. self specTool specification:spec. - self setViewInLayoutTool:(self layoutTool layoutView). + view := self layoutTool layoutView. + + self setViewInLayoutTool:view. + spec class == DataSetSpec ifTrue:[ + view columnDescriptors:(spec columns) + ]. self modifiedChannel value:false. ] ! @@ -1393,19 +1398,38 @@ ! +openDataSetColumnEditor + "opens a column editor + " + |cls aspect editor columns| + + cls := self resolveName:specClass. + + cls isNil ifTrue:[ + ^ self information:'no application class defined yet' + ]. + aspect := self specTool specification columns. + editor := DataSetBuilder new. + editor columns:aspect fromView:(self layoutTool layoutView). + editor className:(self specTool specification className). + editor openModal. + + editor hasChanged ifTrue:[ + self specTool specification columns:(editor columns). + self specTool specification className:(editor className). + self modifiedChannel value:true. + ]. +! + openEditMenu "opens a menu editor on current widget " |cls aspect editor| - specClass isNil ifTrue:[ - ^ self information:'no application class defined yet'. - ]. - (cls := specClass) isBehavior ifFalse:[ - cls := Smalltalk at:specClass asSymbol. - cls isNil ifTrue:[ - ^ self information:'no application class defined yet' - ] + cls := self resolveName:specClass. + + cls isNil ifTrue:[ + ^ self information:'no application class defined yet' ]. cls notNil ifTrue:[ @@ -1447,46 +1471,38 @@ " |cls aspect editor| - specClass isNil ifTrue:[ - ^ self information:'no application class defined yet'. - ]. - (cls := specClass) isBehavior ifFalse:[ - cls := Smalltalk at:specClass asSymbol. - cls isNil ifTrue:[ - ^ self information:'no application class defined yet' - ] + cls := self resolveName:specClass. + + cls isNil ifTrue:[ + ^ self information:'no application class defined yet' ]. - cls notNil ifTrue:[ - (aspect := self specTool specification hierarchicalList) notNil ifTrue:[ - aspect := aspect asSymbol - ] ifFalse:[ - "/ cg: q&d hack ... - - aspect := treeView propertySelected. - aspect notNil ifTrue:[ - Object errorSignal handle:[:ex | - aspect := nil. - ] do:[ - aspect := aspect view asMenu. - ] - ]. - ]. - - editor := HierarchicalListEditor new. - editor masterApplication:self. - editor openModalOnClass:cls andSelector:aspect. - - editor selectorName ~= aspect ifTrue:[ - editor didInstall ifTrue:[ - self specTool specification hierarchicalList:editor selectorName asSymbol. - self modifiedChannel value:true. - self accept + (aspect := self specTool specification hierarchicalList) notNil ifTrue:[ + aspect := aspect asSymbol + ] ifFalse:[ + "/ cg: q&d hack ... + + aspect := treeView propertySelected. + aspect notNil ifTrue:[ + Object errorSignal handle:[:ex | + aspect := nil. + ] do:[ + aspect := aspect view asMenu. ] ]. + ]. + + editor := HierarchicalListEditor new. + editor masterApplication:self. + editor openModalOnClass:cls andSelector:aspect. + + editor selectorName ~= aspect ifTrue:[ + editor didInstall ifTrue:[ + self specTool specification hierarchicalList:editor selectorName asSymbol. + self modifiedChannel value:true. + self accept + ] ] - - "Modified: 31.7.1997 / 14:26:13 / cg" ! ! !UIPainter methodsFor:'aspects'! @@ -1877,10 +1893,7 @@ hasSpecClass "checks whether an application class is defined " - specClass notNil ifTrue:[ - ^ (specClass isBehavior or:[(Smalltalk at:specClass asSymbol) notNil]) - ]. - ^ false + ^ (self resolveName:specClass) notNil ! hasSpecClassAndSelector @@ -2065,7 +2078,7 @@ ). specSuperclass isNil ifTrue:[ specClass notNil ifTrue:[ - (cls := Smalltalk at:specClass asSymbol) notNil ifTrue:[ + (cls := self resolveName:specClass) notNil ifTrue:[ specSuperclass := cls superclass name. ] ] @@ -2183,13 +2196,12 @@ specClass isNil ifTrue:[^ false]. - specClass isBehavior ifFalse:[ - cls := Smalltalk at:specClass asSymbol - ] ifTrue:[ - cls := specClass - ]. + cls := self resolveName:specClass. + cls isNil ifTrue:[ - (superclass := Smalltalk at:specSuperclass asSymbol) isNil ifTrue:[ + superclass := self resolveName:specSuperclass. + + superclass isNil ifTrue:[ self warn:'no class named ' , specSuperclass , ' exists.'. ^ false. ]. @@ -2210,7 +2222,7 @@ specSuperclass isBehavior ifFalse:[ specSuperclass isEmpty ifFalse:[ - superclass := Smalltalk at:specSuperclass asSymbol + superclass := self resolveName:specSuperclass ] ifTrue:[ specSuperclass := nil. ] @@ -2316,24 +2328,14 @@ self painter isModified ifTrue:[ self warn:'the change have not yet been reinstalled.\\The browser will show the old interfaces code.' withCRs. ]. - - specClass isNil ifTrue:[ - ^ self information:'no class yet'. + cls := self resolveName:specClass. + + cls notNil ifTrue:[ + SystemBrowser openInClass:cls + ] ifFalse:[ + self information:'no class yet'. ]. - specClass isBehavior ifFalse:[ - cls := Smalltalk at:specClass asSymbol - ] ifTrue:[ - cls := specClass - ]. - - cls isNil ifTrue:[ - ^ self information:'no class yet'. - ]. - - SystemBrowser openInClass:cls - - "Modified: 28.7.1997 / 18:30:13 / cg" ! doFromClass @@ -2374,7 +2376,8 @@ ) accepted. accepted ifTrue:[ - cls := Smalltalk classNamed:className value. + self resolveName:className value. + cls isNil ifTrue:[ failed := true. self warn:'no such class'. @@ -2514,11 +2517,7 @@ ^ self information:'no class or selector defined'. ]. - specClass isBehavior ifFalse:[ - cls := Smalltalk at:specClass asSymbol - ] ifTrue:[ - cls := specClass - ]. + cls := self resolveName:specClass. cls isNil ifTrue:[ ^ self information:'class not existant'.