DataSetBuilder.st
changeset 1974 f3e9c2ded641
parent 1944 f35d2f61f294
child 1981 d28960fc1576
--- a/DataSetBuilder.st	Mon Feb 13 09:51:00 2006 +0100
+++ b/DataSetBuilder.st	Mon Feb 13 09:51:09 2006 +0100
@@ -2436,10 +2436,26 @@
 
 !DataSetBuilder methodsFor:'building'!
 
-buildFromClass:aClass andSelector:aSelector
+buildFromResourceSpec:aResourceSpec
+
+    self columns:aResourceSpec.
+
+"/    columns notEmpty ifTrue: [
+"/        self tabModel value: 1. 
+"/        self selectedColumnModel value:nil; value:1.    "/ toggle to force change
+"/        self updateInputFields.
+"/        self updateInfoLabel.
+"/        self updateHistory
+"/    ].
+
+!
+
+loadFromClass:aClass andSelector:aSelector
 
     |updateBlock cls list|
 
+    self assert:(aClass isNil or:[aClass isClass]).
+
     selectedColumnIndex := 0.
 
     updateBlock := [
@@ -2463,7 +2479,8 @@
         self seqList removeAll.
         self updateColumnView.
         self updateInfoLabel.
-      ^ self isColumnSelected value: false.
+        self isColumnSelected value: false.
+        ^ self.
     ].
 
     specSelector isNil ifTrue: [updateBlock value. ^self].
@@ -2471,34 +2488,18 @@
     list := nil.
 
     (aClass notNil or:[self isStandAlone or:[self window shown]]) ifTrue:[
-
         (aClass notNil and:[aSelector notNil]) ifTrue:[
-            cls := self resolveName:aClass.
-
-            (cls respondsTo:aSelector) ifTrue:[
-                list := cls perform:aSelector        
-            ]
+            cls := aClass isBehavior ifTrue:[ aClass ] ifFalse:[ self resolveName:aClass].
+
+            (cls respondsTo: aSelector) ifTrue:[ 
+                list := cls perform: aSelector.
+            ].
         ]
     ] ifFalse:[
         list := columns
     ].
     self columns:list.
     updateBlock value.
-
-!
-
-buildFromResourceSpec:aResourceSpec
-
-    self columns:aResourceSpec.
-
-"/    columns notEmpty ifTrue: [
-"/        self tabModel value: 1. 
-"/        self selectedColumnModel value:nil; value:1.    "/ toggle to force change
-"/        self updateInputFields.
-"/        self updateInfoLabel.
-"/        self updateHistory
-"/    ].
-
 ! !
 
 !DataSetBuilder methodsFor:'code generation'!
@@ -3099,7 +3100,7 @@
     self seqList at:selectedColumnIndex put:(self labelFromColumn:column).
     self updateColumnView.
     self cancel.
-    modified := true.
+    self clearModified.
 !
 
 cancel
@@ -3138,8 +3139,7 @@
         self isColumnSelected value: false
     ].
     self cancel.
-    modified := true.
-
+    self setModified.
 !
 
 doBrowseRowClass
@@ -3181,7 +3181,7 @@
     ].
     self cancel.
     self updateColumnView.
-    modified := true.
+    self setModified.
 !
 
 doCut
@@ -3338,8 +3338,7 @@
     list    add:label beforeIndex:idx.  
     self selectedColumnModel value:idx.
     self updateColumnView.
-    modified := true.
-
+    self setModified.
 !
 
 doPaste
@@ -3359,8 +3358,7 @@
     ].
     self updateColumnView.
     self updateInputFields.
-    modified := true.
-
+    self setModified.
 !
 
 doPickColumns
@@ -3427,7 +3425,7 @@
     self updateInfoLabel.
 
     hasSaved := true.
-    modified := false.
+    self clearModified.
 !
 
 openDocumentation