DataSetBuilder.st
changeset 556 914a2f26aa72
parent 555 54dbb4838d23
child 567 2406b6193e93
equal deleted inserted replaced
555:54dbb4838d23 556:914a2f26aa72
    14 
    14 
    15 
    15 
    16 
    16 
    17 ToolApplicationModel subclass:#DataSetBuilder
    17 ToolApplicationModel subclass:#DataSetBuilder
    18 	instanceVariableNames:'className superclassName hasChanged columnView columns
    18 	instanceVariableNames:'className superclassName hasChanged columnView columns
    19 		selectedColumnIndex tabSelectionIndex aspects isModified'
    19 		selectedColumnIndex tabSelectionIndex aspects'
    20 	classVariableNames:'Number'
    20 	classVariableNames:'Number'
    21 	poolDictionaries:''
    21 	poolDictionaries:''
    22 	category:'Interface-UIPainter'
    22 	category:'Interface-UIPainter'
    23 !
    23 !
    24 
    24 
  1506 !DataSetBuilder methodsFor:'change & update'!
  1506 !DataSetBuilder methodsFor:'change & update'!
  1507 
  1507 
  1508 update:something with:aParameter from:someObject
  1508 update:something with:aParameter from:someObject
  1509     "one of my aspects has changed; update modified channel"
  1509     "one of my aspects has changed; update modified channel"
  1510 
  1510 
  1511     isModified 
  1511     hasChanged
  1512     ifFalse:
  1512     ifFalse:
  1513     [
  1513     [
  1514         self valueOfEnablingCommitButtons value: true.
  1514         self valueOfEnablingCommitButtons value: true.
  1515         self columnIsNotEditing value: false
  1515         self columnIsNotEditing value: false
  1516     ]
  1516     ]
  1794     selectedColumnIndex := 0.
  1794     selectedColumnIndex := 0.
  1795     tabSelectionIndex   := 0.
  1795     tabSelectionIndex   := 0.
  1796     columns := OrderedCollection new.
  1796     columns := OrderedCollection new.
  1797     aspects := IdentityDictionary new.
  1797     aspects := IdentityDictionary new.
  1798     hasChanged := false.
  1798     hasChanged := false.
  1799     isModified := false.
       
  1800 
  1799 
  1801     #(
  1800     #(
  1802         label
  1801         label
  1803         canSelect
  1802         canSelect
  1804         choices
  1803         choices
  1976     "accept changes made"
  1975     "accept changes made"
  1977 
  1976 
  1978     |column type|
  1977     |column type|
  1979 
  1978 
  1980     self valueOfEnablingCommitButtons value == false ifTrue: [^self].
  1979     self valueOfEnablingCommitButtons value == false ifTrue: [^self].
  1981     isModified := hasChanged := true.
  1980     hasChanged := true.
  1982 
  1981 
  1983     (column := self selectedColumn) isNil ifTrue: [^self cancel].
  1982     (column := self selectedColumn) isNil ifTrue: [^self cancel].
  1984 
  1983 
  1985     type := (aspects at:#rendererType) value.
  1984     type := (aspects at:#rendererType) value.
  1986 
  1985 
  2003     |column|
  2002     |column|
  2004 
  2003 
  2005     self updateInputFields.
  2004     self updateInputFields.
  2006     self valueOfEnablingCommitButtons value:false.
  2005     self valueOfEnablingCommitButtons value:false.
  2007     self columnIsNotEditing value: true.
  2006     self columnIsNotEditing value: true.
  2008     isModified := false
       
  2009 !
  2007 !
  2010 
  2008 
  2011 doBrowseClass
  2009 doBrowseClass
  2012     "browse class of columns spec"
  2010     "browse class of columns spec"
  2013 
  2011 
  2059         self selectedColumnModel value:0.
  2057         self selectedColumnModel value:0.
  2060         self clipboard: (columns at: idx).
  2058         self clipboard: (columns at: idx).
  2061         columns removeIndex:idx.
  2059         columns removeIndex:idx.
  2062         self seqList removeIndex:idx.
  2060         self seqList removeIndex:idx.
  2063         columns size > 0 ifTrue: [self selectedColumnModel value: ((idx - 1) max: 1)].
  2061         columns size > 0 ifTrue: [self selectedColumnModel value: ((idx - 1) max: 1)].
       
  2062         self updateColumnView.
  2064         self updateInputFields.
  2063         self updateInputFields.
  2065         self updateColumnView.
       
  2066         columns isEmpty ifTrue: [self isColumnSelected value: false].
  2064         columns isEmpty ifTrue: [self isColumnSelected value: false].
  2067         self cancel.
  2065         self cancel.
  2068         isModified := hasChanged := true.
  2066         hasChanged := true.
  2069     ]
  2067     ]
  2070 !
  2068 !
  2071 
  2069 
  2072 doDefineClass
  2070 doDefineClass
  2073     "launch a dialog to define class and superclass"
  2071     "launch a dialog to define class and superclass"
  2223     self seqList add: label afterIndex:selectedColumnIndex.
  2221     self seqList add: label afterIndex:selectedColumnIndex.
  2224     hasChanged := true.
  2222     hasChanged := true.
  2225 
  2223 
  2226     self valueOfEnablingCommitButtons value ifFalse:[self selectedColumnModel value:selectedColumnIndex + 1].
  2224     self valueOfEnablingCommitButtons value ifFalse:[self selectedColumnModel value:selectedColumnIndex + 1].
  2227     self updateColumnView.
  2225     self updateColumnView.
  2228 
  2226     self updateInputFields.
  2229 ! !
  2227 ! !
  2230 
  2228 
  2231 !DataSetBuilder class methodsFor:'documentation'!
  2229 !DataSetBuilder class methodsFor:'documentation'!
  2232 
  2230 
  2233 version
  2231 version