DataSetBuilder.st
author Claus Gittinger <cg@exept.de>
Wed, 20 May 1998 04:14:16 +0200
changeset 843 273d9a7c2712
parent 842 b412ee25ae80
child 846 c028ad61ac0e
permissions -rw-r--r--
checkin from browser

"
 COPYRIGHT (c) 1997 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"





ResourceSpecEditor subclass:#DataSetBuilder
	instanceVariableNames:'rowClass rowSuperClass columnView columns selectedColumnIndex
		modalOpened'
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-UIPainter'
!

!DataSetBuilder class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1997 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"




!

documentation
"
    create and modify or inspect dataset columns; used by UIPainter (DataSetColumnSpec)

    [see also:]
        DataSetColumnSpec
        DataSetSpec
        DataSetView
        DataSetColumn

    [author:]
        Claus Atzkern, eXept Software AG
"

! !

!DataSetBuilder class methodsFor:'accessing'!

resourceType
    "get the type of resource of the method generated by the MenuEditor"

    ^#tableColumns


! !

!DataSetBuilder class methodsFor:'aspects'!

aspects
    "get the aspects for the attributes of the table columns"

    ^#(
        id
        label
        canSelect
        choices
        editorType
        formatString
        labelIsImage
        translateLabel
        size
        type
        width
        minWidth
        height
        menu
        foregroundSelector
        backgroundSelector
        doubleClickedSelector
        selectSelector
        printSelector
        readSelector
        writeSelector
        rendererType
        showColSeparator
        showRowSeparator
        backgroundColor
        foregroundColor
        labelForegroundColor
        labelBackgroundColor
        labelFont
        labelActionSelector
        labelActionArgument
        labelAlignment
        columnAlignment
     )

    "Modified: / 19.5.1998 / 21:27:06 / cg"
! !

!DataSetBuilder class methodsFor:'help specs'!

helpSpec
    "This resource specification was automatically generated
     by the UIHelpTool of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIHelpTool may not be able to read the specification."

    "
     UIHelpTool openOnClass:DataSetBuilder    
    "

    <resource: #help>

    ^super helpSpec addPairsFrom:#(

#addColumn
'Adds a new column.'

#basicsEditor
'Default widget type or a selector returning an instance of a user defined widget opened in the cell.'

#basicsFont
'Sets the font of the label text.'

#basicsJustification
'Aligns the label text to the left, right, or centered in the cell.'

#basicsLabel
'The label of the column or a selector returning a string or an image.'

#basicsLabelIsImage
'Turns on/off image behavior of the label string; i.e. it is used as selector returning an image.'

#basicsRenderer
'Specifies displaying cell as Text, CheckToggle, ComboBox, ComboList or as a RowSelector.'

#browseRowClass
'Open a browser on the row class'

#colorsBackgroundCellColor
'Sets the background color of the column.'

#colorsBackgroundLabelColor
'Sets the background color of the label.'

#colorsBackgroundSelector
'Selector returning the background color for a cell (optional).'

#colorsForegroundCellColor
'Sets the foreground color of the column.'

#colorsForegroundLabelColor
'Sets the foreground color of the label.'

#colorsForegroundSelector
'Selector returning the foreground color for a cell (optional).'

#fileNew
'Discard changes and continue with a new, empty column description'

#fileLoad
'Specify class/selector and edit that column description'

#fileSave
'Install the column description'

#fileSaveAs
'Specify class/selector and install the column description'

#formatInputType
'A type converter symbol used by the input field.'

#formatMaxSize
'Maximum size of the string which can be typed in. 0 or nil means unlimited.'

#formatTextFormat
'Format string specifying the output format of the cell text. In this release, only numbers are supported (for example: 0.0000).'

#frameColumnWidth
'Width (fixed) of a column (optional).'

#frameMinWidth
'Minimum width of the column (optional).'

#frameRowHeight
'Height of the row (optional).'

#frameShowColumnSeparator
'Turns on/off displaying column separators.'

#frameShowRowSeparator
'Turns on/off displaying row separators.'

#generate
'Code generation.'

#generateCode
'Generate code and install in the selected class/selector.'

#pickColumns
'Select an open view and readOut the column specification from it.'

#selectionCellClickSelector
'A selector called if cell was selected.'

#selectionCellDoubleClickSelector
'A selector called if cell was double clicked.'

#selectionCellSelector
'An optional selector, which is used to test whether the cell in the column is selectable; the ''Is Selectable'' flag must be enabled.'

#selectionIsSelectable
'Turns on/off selection behavior of a column.'

#selectionLabelClickSelector
'A selector called if label cell was clicked.'

#selectionLabelSelectorArgument
'An argument passed to label selection selector.'

#valuesChoiceSelector
'A selector returning a collection of choices for a cell having a ComboBox or a ComboList widget.'

#valuesMenuSelector
'A selector returning a middle button menu.'

#valuesPrintSelector
'A key selector used to register images on a DSVColumnView (the arg). For more detailed info see #register... methods in DSVColumnView.'

#valuesReadSelector
'A selector used to get (string or a bitmap) or set (if the write selector is undefined) the contents of a cell.'

#valuesWriteSelector
'A selector used to set the value of a cell.'

)

    "Modified: / 19.5.1998 / 23:20:51 / cg"
! !

!DataSetBuilder class methodsFor:'interface specs'!

basicsEditSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:DataSetBuilder andSelector:#basicsEditSpec
     DataSetBuilder new openInterface:#basicsEditSpec
    "

    <resource: #canvas>

    ^
     
       #(#FullSpec
          #window: 
           #(#WindowSpec
              #name: 'DataSet Basic'
              #layout: #(#LayoutFrame 216 0 173 0 538 0 499 0)
              #label: 'DataSet Basic'
              #min: #(#Point 10 10)
              #max: #(#Point 1280 1024)
              #bounds: #(#Rectangle 216 173 539 500)
              #usePreferredExtent: false
          )
          #component: 
           #(#SpecCollection
              #collection: 
               #(
                 #(#FramedBoxSpec
                    #name: 'framedBox1'
                    #layout: #(#LayoutFrame 0 0.0 3 0 0 1.0 164 0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#LabelSpec
                              #name: 'label1'
                              #layout: #(#AlignmentOrigin 107 0 52 0 1 0.5)
                              #label: 'Label:'
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'labelField'
                              #layout: #(#LayoutFrame 110 0 41 0 15 1.0 63 0)
                              #activeHelpKey: #basicsLabel
                              #tabable: true
                              #model: #label
                          )
                           #(#LabelSpec
                              #name: 'LabelFont'
                              #layout: #(#AlignmentOrigin 107 0 81 0 1 0.5)
                              #label: 'Font::'
                              #adjust: #left
                              #resizeForLabel: true
                          )
                           #(#FontMenuSpec
                              #name: 'fontMenu'
                              #layout: #(#LayoutFrame 110 0 69 0 13 1.0 91 0)
                              #activeHelpKey: #labelFont
                              #model: #style
                          )
                           #(#PopUpListSpec
                              #name: 'Alignment'
                              #layout: #(#LayoutFrame 155 0 98 0 15 1.0 120 0)
                              #activeHelpKey: #basicsJustification
                              #label: 'Alignment'
                              #model: #labelAlignment
                              #menu: 
                               #(#left
                                  #right #center
                              )
                              #useIndex: false
                          )
                           #(#LabelSpec
                              #name: 'JustificationLabel'
                              #layout: #(#AlignmentOrigin 153 0 109 0 1 0.5)
                              #label: 'Justification:'
                              #adjust: #left
                              #resizeForLabel: true
                          )
                           #(#CheckBoxSpec
                              #name: 'labelIsImage'
                              #layout: #(#LayoutOrigin 10 0 123 0)
                              #activeHelpKey: #basicsLabelIsImage
                              #tabable: true
                              #model: #labelIsImage
                              #label: 'Label Is Image'
                          )
                           #(#CheckBoxSpec
                              #name: 'CheckBox2'
                              #layout: #(#LayoutOrigin 155 0 123 0)
                              #activeHelpKey: #basicsLabelIsImage
                              #tabable: true
                              #model: #translateLabel
                              #label: 'Translate Label'
                          )
                           #(#LabelSpec
                              #name: 'idLabel'
                              #layout: #(#AlignmentOrigin 107 0 27 0 1 0.5)
                              #label: 'ID:'
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'idField'
                              #layout: #(#LayoutFrame 110 0 13 0 15 1.0 35 0)
                              #activeHelpKey: #basicsLabel
                              #tabable: true
                              #model: #id
                          )
                        )
                    )
                    #label: 'Header:'
                    #labelPosition: #topLeft
                )
                 #(#FramedBoxSpec
                    #name: 'typesFrame'
                    #layout: #(#LayoutFrame 0 0.0 178 0 0 1.0 286 0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#LabelSpec
                              #name: 'rendererLabel'
                              #layout: #(#AlignmentOrigin 107 0 29 0 1 0.5)
                              #label: 'Renderer:'
                              #resizeForLabel: true
                          )
                           #(#ComboListSpec
                              #name: 'rendererField'
                              #layout: #(#LayoutFrame 110 0 18 0 15 1.0 40 0)
                              #activeHelpKey: #basicsRenderer
                              #tabable: true
                              #model: #rendererType
                              #comboList: #rendererTypeList
                              #useIndex: false
                          )
                           #(#LabelSpec
                              #name: 'editorLabel'
                              #layout: #(#AlignmentOrigin 107 0 55 0 1 0.5)
                              #label: 'Editor:'
                              #resizeForLabel: true
                          )
                           #(#ComboBoxSpec
                              #name: 'editorField'
                              #layout: #(#LayoutFrame 110 0 44 0 15 1.0 66 0)
                              #activeHelpKey: #basicsEditor
                              #tabable: true
                              #model: #editorType
                              #type: #symbolOrNil
                              #comboList: #editorTypeList
                              #useIndex: false
                          )
                           #(#LabelSpec
                              #name: 'JustificationC'
                              #layout: #(#AlignmentOrigin 153 0 82 0 1 0.5)
                              #label: 'Justification:'
                              #adjust: #left
                              #resizeForLabel: true
                          )
                           #(#PopUpListSpec
                              #name: 'AlignmentC'
                              #layout: #(#LayoutFrame 155 0 71 0 15 1.0 93 0)
                              #activeHelpKey: #basicsJustification
                              #label: 'Alignment'
                              #model: #columnAlignment
                              #menu: 
                               #(#left
                                  #right #center
                              )
                              #useIndex: false
                          )
                        )
                    )
                    #label: 'Cell Type:'
                    #labelPosition: #topLeft
                )
              )
          )
      )

    "Modified: / 20.5.1998 / 00:28:01 / cg"
!

colorsEditSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:DataSetBuilder andSelector:#colorsEditSpec
     DataSetBuilder new openInterface:#colorsEditSpec
    "

    <resource: #canvas>

    ^
     
       #(#FullSpec
          #window: 
           #(#WindowSpec
              #name: 'DataSet Misc'
              #layout: #(#LayoutFrame 216 0 173 0 584 0 472 0)
              #label: 'DataSet Misc'
              #min: #(#Point 10 10)
              #max: #(#Point 1280 1024)
              #bounds: #(#Rectangle 216 173 585 473)
              #usePreferredExtent: false
          )
          #component: 
           #(#SpecCollection
              #collection: 
               #(
                 #(#FramedBoxSpec
                    #name: 'ColorsBox'
                    #layout: #(#LayoutFrame 0 0.0 3 0 0 1.0 95 0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#LabelSpec
                              #name: 'label1'
                              #layout: #(#AlignmentOrigin 127 0 38 0 1 0.5)
                              #label: 'Foreground:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#ColorMenuSpec
                              #name: 'colorMenu1'
                              #layout: #(#LayoutFrame 130 0 26 0 12 1.0 48 0)
                              #activeHelpKey: #colorsForegroundLabelColor
                              #model: #labelForegroundColor
                              #labelsAreColored: true
                          )
                           #(#LabelSpec
                              #name: 'label2'
                              #layout: #(#AlignmentOrigin 127 0 66 0 1 0.5)
                              #label: 'Background:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#ColorMenuSpec
                              #name: 'colorMenu2'
                              #layout: #(#LayoutFrame 130 0 54 0 12 1.0 76 0)
                              #activeHelpKey: #colorsBackgroundLabelColor
                              #model: #labelBackgroundColor
                              #labelsAreColored: false
                          )
                        )
                    )
                    #label: 'Label Colors:'
                    #labelPosition: #topLeft
                )
                 #(#FramedBoxSpec
                    #name: 'defaultColorsBox'
                    #layout: #(#LayoutFrame 0 0.0 108 0 0 1.0 263 0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#LabelSpec
                              #name: 'fgLabel'
                              #layout: #(#AlignmentOrigin 127 0 42 0 1 0.5)
                              #label: 'Foreground:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#ColorMenuSpec
                              #name: 'fgMenu'
                              #layout: #(#LayoutFrame 130 0 30 0 12 1.0 52 0)
                              #activeHelpKey: #colorsForegroundCellColor
                              #model: #foregroundColor
                              #labelsAreColored: true
                          )
                           #(#LabelSpec
                              #name: 'bgLabel'
                              #layout: #(#AlignmentOrigin 127 0 70 0 1 0.5)
                              #label: 'Background:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#ColorMenuSpec
                              #name: 'bgMenu'
                              #layout: #(#LayoutFrame 130 0 58 0 12 1.0 80 0)
                              #activeHelpKey: #colorsBackgroundCellColor
                              #model: #backgroundColor
                              #labelsAreColored: false
                          )
                           #(#LabelSpec
                              #name: 'fgSelLabel'
                              #layout: #(#AlignmentOrigin 127 0 104 0 1 0.5)
                              #label: 'FG-Selector:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'fgSelField'
                              #layout: #(#LayoutFrame 130 0 93 0 15 1.0 115 0)
                              #activeHelpKey: #colorsForegroundSelector
                              #tabable: true
                              #model: #foregroundSelector
                              #type: #symbolOrNil
                          )
                           #(#LabelSpec
                              #name: 'bgSelLabel'
                              #layout: #(#AlignmentOrigin 127 0 129 0 1 0.5)
                              #label: 'BG-Selector:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'bgSelField'
                              #layout: #(#LayoutFrame 130 0 118 0 15 1.0 140 0)
                              #activeHelpKey: #colorsBackgroundSelector
                              #tabable: true
                              #model: #backgroundSelector
                              #type: #symbolOrNil
                          )
                        )
                    )
                    #label: 'Cell Colors:'
                    #labelPosition: #topLeft
                )
              )
          )
      )

    "Modified: / 20.5.1998 / 00:31:50 / cg"
!

defineClassNameSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:DataSetBuilder andSelector:#defineClassNameSpec
     DataSetBuilder new openInterface:#defineClassNameSpec
    "

    <resource: #canvas>

    ^
     
       #(#FullSpec
          #window: 
           #(#WindowSpec
              #name: 'Data Set Builder'
              #layout: #(#LayoutFrame 414 0 336 0 740 0 471 0)
              #label: 'Data Set Builder'
              #min: #(#Point 10 10)
              #max: #(#Point 1152 900)
              #bounds: #(#Rectangle 414 336 741 472)
              #usePreferredExtent: false
          )
          #component: 
           #(#SpecCollection
              #collection: 
               #(
                 #(#FramedBoxSpec
                    #name: 'framedBox1'
                    #layout: #(#LayoutFrame 0 0.0 3 0.0 0 1.0 -34 1.0)
                    #label: 'Class for code'
                    #translateLabel: true
                    #labelPosition: #topLeft
                )
                 #(#LabelSpec
                    #name: 'classLabel'
                    #layout: #(#AlignmentOrigin 73 0.11 38 0 1 0.5)
                    #label: 'Class:'
                    #translateLabel: true
                    #adjust: #right
                    #resizeForLabel: true
                )
                 #(#InputFieldSpec
                    #name: 'classNameInputField'
                    #layout: #(#LayoutFrame 77 0.11 27 0 -16 1.0 49 0)
                    #tabable: true
                    #model: #classNameChannel
                )
                 #(#LabelSpec
                    #name: 'superClassLabel'
                    #layout: #(#AlignmentOrigin 73 0.11 65 0 1 0.5)
                    #label: 'Superclass:'
                    #translateLabel: true
                    #adjust: #right
                    #resizeForLabel: true
                )
                 #(#InputFieldSpec
                    #name: 'superclassNameInputField'
                    #layout: #(#LayoutFrame 76 0.11 55 0 -16 1.0 77 0)
                    #tabable: true
                    #model: #superclassNameChannel
                )
                 #(#UISubSpecification
                    #name: 'SubSpecification'
                    #layout: #(#LayoutFrame 0 0.0 -29 1 0 1.0 -5 1.0)
                    #majorKey: #ToolApplicationModel
                    #minorKey: #windowSpecForCommitWithoutChannels
                )
              )
          )
      )

    "Modified: / 20.5.1998 / 03:46:17 / cg"
!

formatEditSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:DataSetBuilder andSelector:#formatEditSpec
     DataSetBuilder new openInterface:#formatEditSpec
    "

    <resource: #canvas>

    ^
     
       #(#FullSpec
          #window: 
           #(#WindowSpec
              #name: 'DataSet Details'
              #layout: #(#LayoutFrame 218 0 175 0 605 0 466 0)
              #label: 'DataSet Details'
              #min: #(#Point 10 10)
              #max: #(#Point 1280 1024)
              #bounds: #(#Rectangle 218 175 606 467)
              #usePreferredExtent: false
          )
          #component: 
           #(#SpecCollection
              #collection: 
               #(
                 #(#FramedBoxSpec
                    #name: 'framedBox1'
                    #layout: #(#LayoutFrame 0 0.0 3 0 0 1.0 127 0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#LabelSpec
                              #name: 'typeLabel'
                              #layout: #(#AlignmentOrigin 127 0 42 0 1 0.5)
                              #label: 'Input Type:'
                              #resizeForLabel: true
                          )
                           #(#ComboListSpec
                              #name: 'typeCombo'
                              #layout: #(#LayoutFrame 130 0 31 0 15 1.0 53 0)
                              #activeHelpKey: #formatInputType
                              #tabable: true
                              #model: #type
                              #comboList: 
                               #(#string
                                  #password #number
                                  #numberOrNil #symbolOrNil
                              )
                              #useIndex: false
                          )
                           #(#LabelSpec
                              #name: 'sizeLabel'
                              #layout: #(#AlignmentOrigin 127 0 68 0 1 0.5)
                              #label: 'Max Size:'
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'sizeField'
                              #layout: #(#LayoutFrame 130 0 57 0 15 1.0 79 0)
                              #activeHelpKey: #formatMaxSize
                              #tabable: true
                              #model: #size
                              #type: #numberOrNil
                          )
                           #(#LabelSpec
                              #name: 'formatLabel'
                              #layout: #(#AlignmentOrigin 127 0 93 0 1 0.5)
                              #label: 'Text Format:'
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'formatField'
                              #layout: #(#LayoutFrame 130 0 82 0 15 1.0 104 0)
                              #activeHelpKey: #formatTextFormat
                              #tabable: true
                              #model: #formatString
                          )
                        )
                    )
                    #label: 'Input Format'
                    #labelPosition: #topLeft
                )
              )
          )
      )

    "Modified: / 20.5.1998 / 00:28:53 / cg"
!

frameEditSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:DataSetBuilder andSelector:#frameEditSpec
     DataSetBuilder new openInterface:#frameEditSpec
    "

    <resource: #canvas>

    ^
     
       #(#FullSpec
          #window: 
           #(#WindowSpec
              #name: 'DataSet Dimension'
              #layout: #(#LayoutFrame 216 0 173 0 506 0 416 0)
              #label: 'DataSet Dimension'
              #min: #(#Point 10 10)
              #max: #(#Point 1280 1024)
              #bounds: #(#Rectangle 216 173 507 417)
              #usePreferredExtent: false
          )
          #component: 
           #(#SpecCollection
              #collection: 
               #(
                 #(#FramedBoxSpec
                    #name: 'separatorBox'
                    #layout: #(#LayoutFrame 0 0.0 3 0 0 1.0 95 0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#CheckBoxSpec
                              #name: 'showRowSeparator'
                              #layout: #(#LayoutFrame 18 0 27 0 194 0 50 0)
                              #activeHelpKey: #frameShowRowSeparator
                              #tabable: true
                              #model: #showRowSeparator
                              #label: 'Show Row-Separator'
                          )
                           #(#CheckBoxSpec
                              #name: 'showColSeparator'
                              #layout: #(#LayoutFrame 18 0 53 0 194 0 76 0)
                              #activeHelpKey: #frameShowColumnSeparator
                              #tabable: true
                              #model: #showColSeparator
                              #label: 'Show Column-Separator'
                          )
                        )
                    )
                    #label: 'Separators'
                    #labelPosition: #topLeft
                )
                 #(#FramedBoxSpec
                    #name: 'framedBox1'
                    #layout: #(#LayoutFrame 0 0.0 108 0 0 1.0 225 0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#LabelSpec
                              #name: 'widthLabel'
                              #layout: #(#AlignmentOrigin 153 0.0 35 0 1 0.5)
                              #label: 'Column Width:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'widthField'
                              #layout: #(#LayoutFrame 155 0 24 0 15 1.0 46 0)
                              #activeHelpKey: #frameColumnWidth
                              #tabable: true
                              #model: #width
                              #type: #numberOrNil
                          )
                           #(#LabelSpec
                              #name: 'minWidthLabel'
                              #layout: #(#AlignmentOrigin 153 0.0 63 0 1 0.5)
                              #label: 'Min Width:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'minWidthField'
                              #layout: #(#LayoutFrame 155 0 52 0 15 1.0 74 0)
                              #activeHelpKey: #frameMinWidth
                              #tabable: true
                              #model: #minWidth
                              #type: #numberOrNil
                          )
                           #(#LabelSpec
                              #name: 'heightLabel'
                              #layout: #(#AlignmentOrigin 153 0.0 91 0 1 0.5)
                              #label: 'Row Height:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'heightField'
                              #layout: #(#LayoutFrame 155 0 80 0 15 1.0 102 0)
                              #activeHelpKey: #frameRowHeight
                              #tabable: true
                              #model: #height
                              #type: #numberOrNil
                          )
                        )
                    )
                    #label: 'Dimensions:'
                    #labelPosition: #topLeft
                )
              )
          )
      )

    "Modified: / 20.5.1998 / 00:29:47 / cg"
!

selectionEditSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:DataSetBuilder andSelector:#selectionEditSpec
     DataSetBuilder new openInterface:#selectionEditSpec
    "

    <resource: #canvas>

    ^
     
       #(#FullSpec
          #window: 
           #(#WindowSpec
              #name: 'DataSet Basic'
              #layout: #(#LayoutFrame 218 0 175 0 506 0 430 0)
              #label: 'DataSet Basic'
              #min: #(#Point 10 10)
              #max: #(#Point 1280 1024)
              #bounds: #(#Rectangle 218 175 507 431)
              #usePreferredExtent: false
          )
          #component: 
           #(#SpecCollection
              #collection: 
               #(
                 #(#FramedBoxSpec
                    #name: 'framedBox1'
                    #layout: #(#LayoutFrame 0 0.0 3 0 0 1.0 87 0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#LabelSpec
                              #name: 'ActionLabel'
                              #layout: #(#AlignmentOrigin 107 0 33 0 1 0.5)
                              #label: 'Selector:'
                              #adjust: #left
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'ActionSelector'
                              #layout: #(#LayoutFrame 110 0 22 0 15 1.0 44 0)
                              #activeHelpKey: #selectionLabelClickSelector
                              #tabable: true
                              #model: #labelActionSelector
                              #type: #symbolOrNil
                          )
                           #(#LabelSpec
                              #name: 'ArgumentLabel'
                              #layout: #(#AlignmentOrigin 107 0 58 0 1 0.5)
                              #label: 'Argument:'
                              #adjust: #left
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'ArgumentValue'
                              #layout: #(#LayoutFrame 110 0 47 0 15 1.0 69 0)
                              #activeHelpKey: #selectionLabelSelectorArgument
                              #tabable: true
                              #model: #labelActionArgument
                              #type: #string
                          )
                        )
                    )
                    #label: 'Label Select Action:'
                    #labelPosition: #topLeft
                )
                 #(#FramedBoxSpec
                    #name: 'framedBox2'
                    #layout: #(#LayoutFrame 0 0.0 95 0 0 1.0 178 0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#CheckBoxSpec
                              #name: 'canSelect'
                              #layout: #(#Point 107 21)
                              #activeHelpKey: #selectionIsSelectable
                              #tabable: true
                              #model: #canSelect
                              #label: 'Is Selectable'
                          )
                           #(#LabelSpec
                              #name: 'selectorLabel'
                              #layout: #(#AlignmentOrigin 107 0 57 0 1 0.5)
                              #label: 'Selector:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'selectSelector'
                              #layout: #(#LayoutFrame 110 0 46 0 15 1.0 68 0)
                              #activeHelpKey: #selectionCellClickSelector
                              #tabable: true
                              #model: #selectSelector
                              #type: #symbolOrNil
                          )
                        )
                    )
                    #label: 'Cell Selection:'
                    #labelPosition: #topLeft
                )
                 #(#FramedBoxSpec
                    #name: 'framedBox3'
                    #layout: #(#LayoutFrame 0 0.0 186 0 0 1.0 243 0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#LabelSpec
                              #name: 'doubleLabel'
                              #layout: #(#AlignmentOrigin 107 0 32 0 1 0.5)
                              #label: 'Selector:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'doubleClicked'
                              #layout: #(#LayoutFrame 110 0 21 0 15 1.0 43 0)
                              #activeHelpKey: #selectionCellDoubleClickSelector
                              #tabable: true
                              #model: #doubleClickedSelector
                              #type: #symbolOrNil
                          )
                        )
                    )
                    #label: 'Cell Double Click:'
                    #labelPosition: #topLeft
                )
              )
          )
      )

    "Modified: / 19.5.1998 / 22:36:08 / cg"
!

slices
    ^#(
        (Basics         basicsEditSpec)
        (Values         valuesEditSpec)
        (Format         formatEditSpec)
        (Selection      selectionEditSpec)
        (Frame          frameEditSpec)
        (Colors         colorsEditSpec)
    )
!

valuesEditSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:DataSetBuilder andSelector:#valuesEditSpec
     DataSetBuilder new openInterface:#valuesEditSpec
    "

    <resource: #canvas>

    ^
     
       #(#FullSpec
          #window: 
           #(#WindowSpec
              #name: 'DataSet Basic'
              #layout: #(#LayoutFrame 216 0 173 0 511 0 478 0)
              #label: 'DataSet Basic'
              #min: #(#Point 10 10)
              #max: #(#Point 1280 1024)
              #bounds: #(#Rectangle 216 173 512 479)
              #usePreferredExtent: false
          )
          #component: 
           #(#SpecCollection
              #collection: 
               #(
                 #(#FramedBoxSpec
                    #name: 'valuesBox'
                    #layout: #(#LayoutFrame 0 0.0 3 0 0 1.0 110 0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#LabelSpec
                              #name: 'readLabel'
                              #layout: #(#AlignmentOrigin 107 0 29 0 1 0.5)
                              #label: 'Read:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'readSelector'
                              #layout: #(#LayoutFrame 110 0 18 0 15 1.0 40 0)
                              #activeHelpKey: #valuesReadSelector
                              #tabable: true
                              #model: #readSelector
                              #type: #symbolOrNil
                          )
                           #(#LabelSpec
                              #name: 'writeLabel'
                              #layout: #(#AlignmentOrigin 107 0 54 0 1 0.5)
                              #label: 'Write:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'writeSelector'
                              #layout: #(#LayoutFrame 110 0 43 0 15 1.0 65 0)
                              #activeHelpKey: #valuesWriteSelector
                              #tabable: true
                              #model: #writeSelector
                              #type: #symbolOrNil
                          )
                           #(#LabelSpec
                              #name: 'printLabel'
                              #layout: #(#AlignmentOrigin 107 0 79 0 1 0.5)
                              #label: 'Print:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'printSelector'
                              #layout: #(#LayoutFrame 110 0 68 0 15 1.0 90 0)
                              #activeHelpKey: #valuesPrintSelector
                              #tabable: true
                              #model: #printSelector
                              #type: #symbolOrNil
                          )
                        )
                    )
                    #label: 'Value Selectors:'
                    #labelPosition: #topLeft
                )
                 #(#FramedBoxSpec
                    #name: 'menusBox'
                    #layout: #(#LayoutFrame 0 0.0 119 0 0 1.0 176 0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#LabelSpec
                              #name: 'menuLabel'
                              #layout: #(#AlignmentOrigin 107 0 29 0 1 0.5)
                              #label: 'Selector:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'menuSelector'
                              #layout: #(#LayoutFrame 110 0 18 0 15 1.0 40 0)
                              #activeHelpKey: #valuesMenuSelector
                              #tabable: true
                              #model: #menu
                              #type: #symbolOrNil
                          )
                        )
                    )
                    #label: 'Menu:'
                    #labelPosition: #topLeft
                )
                 #(#FramedBoxSpec
                    #name: 'framedBox1'
                    #layout: #(#LayoutFrame 1 0.0 191 0 1 1.0 249 0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#LabelSpec
                              #name: 'label2'
                              #layout: #(#AlignmentOrigin 107 0 29 0 1 0.5)
                              #activeHelpKey: #valuesChoiceSelector
                              #label: 'Selector:'
                              #adjust: #right
                              #resizeForLabel: true
                          )
                           #(#InputFieldSpec
                              #name: 'inputField2'
                              #layout: #(#LayoutFrame 110 0 18 0 15 1.0 40 0)
                              #activeHelpKey: #valuesChoiceSelector
                              #tabable: true
                              #model: #choices
                              #type: #symbolOrNil
                          )
                        )
                    )
                    #label: 'List Choice:'
                    #labelPosition: #topLeft
                )
              )
          )
      )

    "Modified: / 19.5.1998 / 22:33:53 / cg"
!

windowSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:DataSetBuilder andSelector:#windowSpec
     DataSetBuilder new openInterface:#windowSpec
     DataSetBuilder open
    "

    <resource: #canvas>

    ^
     
       #(#FullSpec
          #window: 
           #(#WindowSpec
              #name: 'Data Set Builder'
              #layout: #(#LayoutFrame 28 0 46 0 660 0 612 0)
              #label: 'Data Set Builder'
              #min: #(#Point 10 10)
              #max: #(#Point 1152 900)
              #bounds: #(#Rectangle 28 46 661 613)
              #menu: #menu
              #usePreferredExtent: false
          )
          #component: 
           #(#SpecCollection
              #collection: 
               #(
                 #(#MenuPanelSpec
                    #name: 'menuToolbarView'
                    #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 32 0)
                    #menu: #menuToolbar
                )
                 #(#VariableVerticalPanelSpec
                    #name: 'VariableVerticalPanel1'
                    #layout: #(#LayoutFrame 0 0.0 38 0.0 0 1.0 -26 1.0)
                    #component: 
                     #(#SpecCollection
                        #collection: 
                         #(
                           #(#FramedBoxSpec
                              #name: 'FramedBox'
                              #component: 
                               #(#SpecCollection
                                  #collection: 
                                   #(
                                     #(#DataSetSpec
                                        #name: 'columnView'
                                        #layout: #(#LayoutFrame 15 0.0 16 0.0 15 1.0 16 1.0)
                                        #hasHorizontalScrollBar: true
                                        #hasVerticalScrollBar: false
                                        #miniScrollerHorizontal: true
                                        #rowClassName: 'CodingExamples_GUI::GUIDemoDataSetView::Row'
                                        #useIndex: false
                                        #has3Dsepartors: true
                                    )
                                  )
                              )
                              #label: 'Table Columns'
                              #labelPosition: #topLeft
                          )
                           #(#VariableHorizontalPanelSpec
                              #name: 'VariablePanel'
                              #component: 
                               #(#SpecCollection
                                  #collection: 
                                   #(
                                     #(#ViewSpec
                                        #name: 'labelsView'
                                        #component: 
                                         #(#SpecCollection
                                            #collection: 
                                             #(
                                               #(#SequenceViewSpec
                                                  #name: 'labelAndColumns'
                                                  #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
                                                  #model: #selectedColumnModel
                                                  #menu: #menuEdit
                                                  #hasHorizontalScrollBar: true
                                                  #hasVerticalScrollBar: true
                                                  #miniScrollerHorizontal: true
                                                  #useIndex: true
                                                  #sequenceList: #seqList
                                              )
                                            )
                                        )
                                    )
                                     #(#ViewSpec
                                        #name: 'specView'
                                        #component: 
                                         #(#SpecCollection
                                            #collection: 
                                             #(
                                               #(#TabViewSpec
                                                  #name: 'tabView'
                                                  #layout: #(#LayoutFrame 1 0.0 0 0 0 1.0 50 0)
                                                  #model: #tabModel
                                                  #menu: #tabList
                                                  #useIndex: true
                                              )
                                               #(#SubCanvasSpec
                                                  #name: 'specCanvas'
                                                  #layout: #(#LayoutFrame 1 0.0 50 0.0 0 1.0 -30 1.0)
                                                  #specHolder: #specChannel
                                              )
                                               #(#UISubSpecification
                                                  #name: 'SubSpecification'
                                                  #layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0)
                                                  #majorKey: #ToolApplicationModel
                                                  #minorKey: #windowSpecForCommit
                                              )
                                            )
                                        )
                                        #level: -1
                                    )
                                  )
                              )
                              #level: -1
                              #handles: #(#Any 0.235387 1.0)
                          )
                        )
                    )
                    #handles: #(#Any 0.25 1.0)
                )
                 #(#UISubSpecification
                    #name: 'infoBarSubSpec'
                    #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
                    #majorKey: #ToolApplicationModel
                    #minorKey: #windowSpecForInfoBar
                )
              )
          )
      )

    "Modified: / 19.5.1998 / 23:35:33 / cg"
! !

!DataSetBuilder class methodsFor:'menu specs'!

menu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:DataSetBuilder andSelector:#menu
     (Menu new fromLiteralArrayEncoding:(DataSetBuilder menu)) startUp
    "

    <resource: #menu>

    ^
     
       #(#Menu
          
           #(
             #(#MenuItem
                #label: 'About'
                #translateLabel: true
                #accessCharacterPosition: 1
                #labelImage: #(#ResourceRetriever nil #menuIcon)
                #submenuChannel: #menuAbout
            )
             #(#MenuItem
                #label: 'File'
                #translateLabel: true
                #activeHelpKey: #file
                #submenu: 
                 #(#Menu
                    
                     #(
                       #(#MenuItem
                          #label: 'New'
                          #translateLabel: true
                          #value: #doNew
                          #activeHelpKey: #fileNew
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Load...'
                          #translateLabel: true
                          #value: #doLoad
                          #activeHelpKey: #fileLoad
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Save'
                          #translateLabel: true
                          #value: #doSave
                          #activeHelpKey: #fileSave
                      )
                       #(#MenuItem
                          #label: 'Save As...'
                          #translateLabel: true
                          #value: #doSaveAs
                          #activeHelpKey: #fileSaveAs
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Pick Columns...'
                          #translateLabel: true
                          #value: #doPickColumns
                          #activeHelpKey: #pickColumns
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Browse Class'
                          #translateLabel: true
                          #value: #doBrowseClass
                          #activeHelpKey: #fileBrowseClass
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Exit'
                          #translateLabel: true
                          #value: #closeRequest
                          #activeHelpKey: #fileExit
                      )
                    ) nil
                    nil
                )
            )
             #(#MenuItem
                #label: 'Edit'
                #translateLabel: true
                #activeHelpKey: #edit
                #submenuChannel: #menuEdit
            )
             #(#MenuItem
                #label: 'Add'
                #translateLabel: true
                #submenu: 
                 #(#Menu
                    
                     #(
                       #(#MenuItem
                          #label: 'Column'
                          #translateLabel: true
                          #value: #doCreateColumn
                          #activeHelpKey: #addColumn
                          #enabled: #columnIsNotEditing
                          #labelImage: #(#ResourceRetriever nil #newColumnIcon 'Column')
                      )
                    ) nil
                    nil
                )
            )
             #(#MenuItem
                #label: 'Generate'
                #translateLabel: true
                #activeHelpKey: #generate
                #submenu: 
                 #(#Menu
                    
                     #(
                       #(#MenuItem
                          #label: 'Define Row Class...'
                          #translateLabel: true
                          #value: #doDefineRowClass
                          #activeHelpKey: #fileDefineClass
                      )
                       #(#MenuItem
                          #label: 'Browse Row Class'
                          #translateLabel: true
                          #value: #doBrowseRowClass
                          #activeHelpKey: #browseRowClass
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Generate Code'
                          #translateLabel: true
                          #value: #doGenerateCode
                          #activeHelpKey: #generateCode
                      )
                    ) nil
                    nil
                )
            )
             #(#MenuItem
                #label: 'Settings'
                #translateLabel: true
                #activeHelpKey: #settings
                #submenu: 
                 #(#Menu
                    
                     #(
                       #(#MenuItem
                          #label: 'Fonts'
                          #translateLabel: true
                          #submenuChannel: #menuFont
                      )
                    ) nil
                    nil
                )
            )
             #(#MenuItem
                #label: 'History'
                #translateLabel: true
                #activeHelpKey: #history
                #submenuChannel: #menuHistory
            )
             #(#MenuItem
                #label: 'Help'
                #translateLabel: true
                #startGroup: #right
                #submenuChannel: #menuHelp
            )
          ) nil
          nil
      )

    "Modified: / 19.5.1998 / 23:10:01 / cg"
!

menuEdit
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:DataSetBuilder andSelector:#menuEdit
     (Menu new fromLiteralArrayEncoding:(DataSetBuilder menuEdit)) startUp
    "

    <resource: #menu>

    ^
     
       #(#Menu
          
           #(
             #(#MenuItem
                #label: 'Cut'
                #value: #doCut
                #translateLabel: true
                #activeHelpKey: #editCut
                #enabled: #isColumnSelected
            )
             #(#MenuItem
                #label: 'Copy'
                #value: #doCopy
                #translateLabel: true
                #activeHelpKey: #editCopy
                #enabled: #isColumnSelected
            )
             #(#MenuItem
                #label: 'Paste'
                #value: #doPaste
                #translateLabel: true
                #activeHelpKey: #editPaste
                #enabled: #valueOfHavingClipboard
            )
             #(#MenuItem
                #label: 'Delete'
                #value: #doDelete
                #translateLabel: true
                #activeHelpKey: #editDelete
                #enabled: #valueOfHavingClipboard
            )
             #(#MenuItem
                #label: '-'
            )
             #(#MenuItem
                #label: 'Move Up'
                #value: #doMoveColumn:
                #activeHelpKey: #editMoveUp
                #translateLabel: true
                #enabled: #isColumnSelected
                #argument: #up
                #labelImage: #(#ResourceRetriever #DataSetBuilder #upIcon 'Move Up')
            )
             #(#MenuItem
                #label: 'Move Down'
                #value: #doMoveColumn:
                #translateLabel: true
                #activeHelpKey: #editMoveDown
                #enabled: #isColumnSelected
                #argument: #down
                #labelImage: #(#ResourceRetriever #DataSetBuilder #downIcon 'Move Down')
            )
          ) nil
          nil
      )

    "Modified: / 19.5.1998 / 23:10:19 / cg"
!

menuToolbar
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:DataSetBuilder andSelector:#menuToolbar
     (Menu new fromLiteralArrayEncoding:(DataSetBuilder menuToolbar)) startUp
    "

    <resource: #menu>

    ^
     
       #(#Menu
          
           #(
             #(#MenuItem
                #label: 'New'
                #isButton: true
                #value: #doNew
                #activeHelpKey: #fileNew
                #labelImage: #(#ResourceRetriever nil #newIcon)
            )
             #(#MenuItem
                #label: 'Load'
                #isButton: true
                #value: #doLoad
                #activeHelpKey: #fileLoad
                #labelImage: #(#ResourceRetriever nil #loadIcon)
            )
             #(#MenuItem
                #label: 'Save'
                #isButton: true
                #value: #doSave
                #activeHelpKey: #fileSave
                #labelImage: #(#ResourceRetriever nil #saveIcon)
            )
             #(#MenuItem
                #label: ''
            )
             #(#MenuItem
                #label: 'Cut'
                #isButton: true
                #value: #doCut
                #activeHelpKey: #editCut
                #enabled: #isColumnSelected
                #labelImage: #(#ResourceRetriever nil #cutIcon)
            )
             #(#MenuItem
                #label: 'Copy'
                #isButton: true
                #value: #doCopy
                #activeHelpKey: #editCopy
                #enabled: #isColumnSelected
                #labelImage: #(#ResourceRetriever nil #copyIcon)
            )
             #(#MenuItem
                #label: 'Paste'
                #isButton: true
                #value: #doPaste
                #activeHelpKey: #editPaste
                #enabled: #valueOfCanPaste
                #labelImage: #(#ResourceRetriever nil #pasteIcon)
            )
             #(#MenuItem
                #label: 'Delete'
                #isButton: true
                #value: #doDelete
                #activeHelpKey: #editDelete
                #enabled: #isColumnSelected
                #labelImage: #(#ResourceRetriever nil #deleteIcon)
            )
             #(#MenuItem
                #label: ''
            )
             #(#MenuItem
                #label: 'Add Column'
                #isButton: true
                #value: #doCreateColumn
                #activeHelpKey: #addColumn
                #enabled: #columnIsNotEditing
                #labelImage: #(#ResourceRetriever nil #newColumnIcon)
            )
             #(#MenuItem
                #label: ''
            )
             #(#MenuItem
                #label: 'Move Up'
                #isButton: true
                #value: #doMoveColumn:
                #activeHelpKey: #editMoveUp
                #enabled: #isColumnSelected
                #argument: #up
                #labelImage: #(#ResourceRetriever nil #upIcon)
            )
             #(#MenuItem
                #label: 'Move Down'
                #isButton: true
                #value: #doMoveColumn:
                #activeHelpKey: #editMoveDown
                #enabled: #isColumnSelected
                #argument: #down
                #labelImage: #(#ResourceRetriever nil #downIcon)
            )
          ) nil
          nil
      )
! !

!DataSetBuilder class methodsFor:'resources'!

newColumnIcon
    "This resource specification was automatically generated
     by the ImageEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the ImageEditor may not be able to read the specification."

    "
     self newColumnIcon inspect
     ImageEditor openOnClass:self andSelector:#newColumnIcon
    "

    <resource: #image>

    ^Icon
        constantNamed:#'DataSetBuilder newColumnIcon'
        ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UT@@@@UPUTUUUXUPUTZ**,UPUTZB",UPUTX*H,UYUTX*H,UPUTZB",UPQTZ**,UPUTX*H,UPUTX*H,UPUTX*H,UPUTXB@,UPUTZ**,UPUTZ**,UPUTX"H,UYUTXB@,UPUTX"@,UPUTX"H,UPUTZ**,UPUTZ**,UPUT/??<UPUT@@@@UP') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 127 127]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'A??@A??@A??@A??@A??@A??@A??@A??@A??CA??@A??@A??@A??@A??CA??AA??@A??CA??@A??CA??@A??@A??A') ; yourself); yourself]! !

!DataSetBuilder methodsFor:'accessing'!

columns
    "returns list of columns"

    ^ columns
!

columns:aListOfColumns
    "setup columns from a column view"

    |list|

    columns    := OrderedCollection new.
    list       := self seqList.

    list removeAll.

    aListOfColumns size ~~ 0 ifTrue:[
        aListOfColumns do:[:aColumn||column|
            (column := aColumn) isSequenceable ifTrue:[
                column := DataSetColumnSpec new fromLiteralArrayEncoding:aColumn
            ] ifFalse:[
                column := aColumn copy
            ].
            columns add:column.
            list add:(self labelFromColumn:column).  
        ]
    ].
    self updateColumnView.

!

rowClassName

    ^(Smalltalk resolveName:rowClass inClass:self class) notNil ifTrue:[rowClass] ifFalse:[nil]
!

rowClassName:aClassName

    |cls|

    rowSuperClass := nil.

    (rowClass := aClassName) notNil ifTrue:[
        (cls := self resolveClassNamed) notNil 
            ifTrue: [rowSuperClass := cls superclass name asString] 
            ifFalse:[rowSuperClass := 'Object']
    ]

! !

!DataSetBuilder methodsFor:'aspects'!

columnIsNotEditing
    "returns a boolean value holder which is set to true if column is not editing"

    ^builder valueAspectFor:#columnIsNotEditing initialValue: true



!

editorTypeList
    "generate list of supported editor types"

    |list|

    (list := builder bindingAt:#editorTypeList) isNil 
    ifTrue:
    [
        list := OrderedCollection new.
        DataSetColumnSpec slices do:
        [:aSlice||type|
            type := aSlice at:1.
            (list includes:type) ifFalse:[list add:type]
        ].
        builder aspectAt:#editorTypeList put:list
    ].
    ^list
!

isColumnSelected
    "returns a boolean value holder which is set to true if something is modified
     and not accepted"

    ^builder valueAspectFor:#isColumnSelected initialValue: false



!

rendererTypeList
    "generate list of supported renderer types"

    |list|

    (list := builder bindingAt:#rendererTypeList) isNil 
    ifTrue:
    [
        list := OrderedCollection new.
        DataSetColumnSpec slices do:
        [:aSlice||type|
            type := aSlice at:2.
            (list includes:type) ifFalse:[list add:type]
        ].
        builder aspectAt:#rendererTypeList put:list
    ].
    ^list
!

selectedColumnModel
    "returns a value holder which keeps selected column"

    |holder|

    (holder := builder bindingAt:#selectedColumnModel) isNil ifTrue:[
        holder := AspectAdaptor new subject:self; forAspect:#selectedColumnIndex.
        builder aspectAt:#selectedColumnModel put:holder.
    ].
    ^ holder
!

seqList

    |list|

    (list := builder bindingAt:#seqList) isNil ifTrue:[
        builder aspectAt:#seqList put:(list :=  List new).
    ].
    ^ list
!

specChannel

    |holder|

    (holder := builder bindingAt:#specChannel) isNil ifTrue:[
        builder aspectAt:#specChannel put:(holder :=  ValueHolder new).
    ].
    ^ holder
!

style

    ^self aspectFor:#labelFont
!

tabList

    ^self class slices collect:[:aSlice|aSlice first]

! !

!DataSetBuilder methodsFor:'building'!

buildFromClass:aClass andSelector:aSelector

    |updateBlock cls list|

    selectedColumnIndex := 0.

    updateBlock := [
        columns notEmpty ifTrue: [
            self tabModel value: 0. 
            self tabModel value: 1. 
            self selectedColumnModel value: nil.
            self selectedColumnModel value: 1.
            self updateColumnView.
            self updateInputFields.
            self updateInfoLabel.
            self updateHistory
        ]
    ].

    "if opened on table columns"  

    aClass isNil ifTrue: [ 
        self tabModel value: 0. 
        self columns removeAll.
        self seqList removeAll.
        self updateColumnView.
        self updateInfoLabel.
        self specChannel value:nil.
        self isColumnSelected value: false.
        ^self
    ].

    specSelector isNil ifTrue: [updateBlock value. ^self].

    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        
            ]
        ]
    ] ifFalse:[
        list := columns
    ].
    self columns:list.
    updateBlock value

!

buildFromResourceSpec:aResourceSpec

    self columns:aResourceSpec.

    columns notEmpty ifTrue: [
        self tabModel value: 1. 
        self selectedColumnModel value: nil.
        self selectedColumnModel value: 1.
        self updateInputFields.
        self updateInfoLabel.
        self updateHistory
    ]
! !

!DataSetBuilder methodsFor:'change & update'!

update:something with:aParameter from:someObject
    "one of my aspects has changed; update modified channel"

    super update:something with:aParameter from:someObject.

    self columnIsNotEditing value: false

! !

!DataSetBuilder methodsFor:'code generation'!

compile:aCode forClass:aClass inCategory:aCategory
    "compile method for class in a category"

    ByteCodeCompiler compile:aCode withCRs forClass:aClass inCategory:aCategory
!

generateBackgroundSelectorIn:aClass
    "generate code for #backgroundSelector"

    |sel catg code bCode|

    catg := 'accessing look' asSymbol.
    code :=   '\'
            , '    "automatically generated by DataSetBuilder ..."\'
            , '\'
            , '    "specific background color for a cell"\'
            , '\'
            .

    columns do:
    [:aColumn|
        ((sel := aColumn backgroundSelector) notNil and:[(aClass implements:sel) not]) 
        ifTrue:
        [
            bCode := sel asString, code, '    ^nil'.
            self compile:bCode forClass:aClass inCategory:catg
        ]
    ]


!

generateChoicesIn:aClass
    "generate code for #choices"

    |sel catg code|

    catg := 'accessing menu' asSymbol.
    code :=   '\'
            , '    "automatically generated by DataSetBuilder ..."\'
            , '\'
            , '    "get choices for visual editor; (a list of labels)\'
            , '\'
            , '    ^nil'
            .

    columns do:
    [:aColumn|
        (aColumn canSelect
        and:[aColumn rendererType ~~ #rowSelector
        and:[(sel := aColumn choices) notNil
        and:[(aClass implements:sel) not]]]) 
        ifTrue:
        [
            self compile:(sel asString, code) forClass:aClass inCategory:catg
        ]
    ]
!

generateDoubleClickSelectorIn:aClass
    "generate code for #foregroundSelector"

    |sel catg code bCode|

    catg := 'accessing action' asSymbol.
    code :=   '\'
            , '    "automatically generated by DataSetBuilder ..."\'
            , '\'
            , '    "specific selector to be called on double click"\'
            , '\'
            .

    columns do:
    [:aColumn|
        ((sel := aColumn doubleClickedSelector) notNil 
        and:[(aClass implements:sel) not]) 
        ifTrue:
        [
            bCode := sel asString, code.
            self compile:bCode forClass:aClass inCategory:catg
        ]
    ]


!

generateForegroundSelectorIn:aClass
    "generate code for #foregroundSelector
    "
    |sel catg code bCode|

    catg := 'accessing look' asSymbol.
    code :=   '\'
            , '    "automatically generated by DataSetBuilder ..."\'
            , '\'
            , '    "specific foreground color for a cell"\'
            , '\'
            .

    columns do:
    [:aColumn|
        ((sel := aColumn foregroundSelector) notNil 
        and:[(aClass implements:sel) not]) 
        ifTrue:
        [
            bCode := sel asString, code, '    ^nil'.
            self compile:bCode forClass:aClass inCategory:catg
        ]
    ]


!

generateMenuIn:aClass
    "generate code for #menu"

    |sel catg code|

    catg := 'accessing menu' asSymbol.
    code :=   '\'
            , '    "automatically generated by DataSetBuilder ..."\'
            , '\'
            , '    "get middleButton menu for selected cell in column"\'
            , '\'
            , '    ^nil'
            .

    columns do:
    [:aColumn|
        (aColumn canSelect
        and:[(sel := aColumn menu) notNil
        and:[(aClass implements:sel) not]]) 
        ifTrue:
        [
            self compile:(sel asString, code) forClass:aClass inCategory:catg
        ]
    ]
!

generatePrintSelectorIn:aClass
    "generate code for #printSelector"

    |sel catg code|

    catg := 'accessing' asSymbol.
    code :=   'aGC\'
            , '    "automatically generated by DataSetBuilder ..."\'
            , '\'
            , '    "get drawable image or text on a gc"\'
            , '\'
            , '    ^nil'
            .

    columns do:
    [:aColumn|
        (aColumn rendererType ~~ #rowSelector
        and:[(sel := aColumn printSelector) notNil
        and:[(aClass implements:sel) not]]) 
        ifTrue:
        [
            self compile:(sel asString, code) forClass:aClass inCategory:catg
        ]
    ]
!

generateReadSelectorIn:aClass
    "generate code for #readSelector"

    |sel catg code bCode|

    catg := 'accessing' asSymbol.
    code :=   '\'
            , '    "automatically generated by DataSetBuilder ..."\'
            , '\'
            , '    "get value"\'
            , '\'
            .

    columns do:
    [:aColumn|
        (aColumn rendererType ~~ #rowSelector 
        and:[(sel := aColumn readSelector) notNil
        and:[(aClass implements:sel) not]]) 
        ifTrue:
        [
            (aColumn printSelector isNil or:[aColumn canSelect]) 
            ifTrue:
            [
                sel numArgs == 0 
                    ifTrue: [bCode := sel asString, code] 
                    ifFalse:[bCode := sel asString, 'anIndex\', code].
                aColumn rendererType == #CheckToggle 
                    ifFalse:[bCode := bCode, '    ^nil'] 
                    ifTrue: [bCode := bCode, '    ^true']. 
                self compile:bCode forClass:aClass inCategory:catg
            ]
        ]
    ]
!

generateSelectSelectorIn:aClass
    "generate code for #selectSelector
    "
    |sel catg code bCode|

    catg := 'accessing selection' asSymbol.
    code :=   '\'
            , '    "automatically generated by DataSetBuilder ..."\'
            , '\'
            , '    "can select cell in column"\'
            , '\'
            .

    columns do:
    [:aColumn|
        (aColumn rendererType ~~ #rowSelector 
         and:[(sel := aColumn selectSelector) notNil
         and:[(aClass implements:sel) not]]) 
         ifTrue:
         [
            aColumn canSelect 
            ifTrue:
            [
                bCode := sel asString, code, '    ^true'.
                self compile:bCode forClass:aClass inCategory:catg
            ]
        ]
    ]
!

generateWriteSelectorIn:aClass
    "generate code for #writeSelector"

    |sel catg code bCode sz|

    catg := 'accessing' asSymbol.
    code :=   'aValue\'
            , '    "automatically generated by DataSetBuilder ..."\'
            , '\'
            , '    "set value"\'
            .

    columns do:
    [:aColumn|
        ((sel := aColumn writeSelector) notNil
         and:[aColumn canSelect
         and:[(aClass implements:sel) not]]) 
        ifTrue:
        [
            sel numArgs == 1 
            ifTrue:
            [
                bCode := sel asString
            ] 
            ifFalse:
            [
                sz := sel indexOf:$:.
                bCode := sel copyTo:sz.
                bCode := bCode, 'anIndex ', (sel copyFrom:sz + 1)
            ].
            self compile:(bCode, code) forClass:aClass inCategory:catg
        ]
    ]
! !

!DataSetBuilder methodsFor:'initialization'!

initialize
    "initializes"

    super initialize.

    selectedColumnIndex := 0.
    columns := OrderedCollection new.
    modalOpened := false


! !

!DataSetBuilder methodsFor:'private'!

askForListModification
    "asks for resource modification"

    modalOpened
    ifFalse:
    [
        ^super askForListModification
    ].
    ^true

!

labelFromColumn:aColumn

    ^ aColumn rendererType == #rowSelector 
        ifFalse:[aColumn label]
        ifTrue: ['Row Selector'].
!

updateColumnView
    "updates column view from column descriptions"   

    columnView notNil ifTrue:[
        |previewColumns columnItems columnList|
        columnList     := List new.
        previewColumns := columns deepCopy.
        columns notEmpty
        ifTrue:
        [               
            previewColumns do: 
            [:column| 
                column readSelector:  #at:.
                column writeSelector: #at:put:.
                column backgroundSelector:nil.
                column foregroundSelector:nil.
                column selectSelector: nil.
                column doubleClickedSelector: nil.
                column printSelector: nil.
                column menu: nil
            ].
            #('1' '2' '...' 'x') do:
            [:suffix|
                columnItems := Array new: previewColumns size.
                1 to: previewColumns size do: [:i| columnItems at: i put: (previewColumns at: i) label ? 'Cell', suffix].
                columnList add: columnItems.
            ]
        ].
        columnView list: #().
        columnView columnDescriptors: previewColumns.
        columnView list: columnList.
    ]
!

updateInputFields
    "reloads item value into input fields"

    |column|

    (column := self selectedColumn) isNil 
    ifTrue:
    [
        self tabModel value:0.
    ] 
    ifFalse:
    [
        aspects keysAndValuesDo:[:aKey :aModel|aModel value:(column perform:aKey) withoutNotifying: self].
        tabSelection == 0 ifTrue:[self tabModel value:1]
    ]
! !

!DataSetBuilder methodsFor:'selection'!

selectedColumn
    "returns selected column or nil"

    ^selectedColumnIndex == 0 
        ifFalse:[columns at:selectedColumnIndex ifAbsent: nil]
        ifTrue: [nil]
!

selectedColumnIndex
    "returns selected column index or 0"

    ^selectedColumnIndex
!

selectedColumnIndex:something
    "changes selected column and update specifications"

    something == selectedColumnIndex 
    ifFalse:
    [
        selectedColumnIndex := something ? 0.
        self isColumnSelected value: true
    ]

!

tabSelection:something
    "changes selected tab and set corresponding specification"

    |specSelector|

    something == tabSelection ifTrue:[^self].
    self selectedColumn isNil 
    ifTrue:
    [
        tabSelection == 0 ifTrue:[^self].
        tabSelection := 0
    ] 
    ifFalse:
    [
        (tabSelection := something) ~~ 0 
            ifTrue: [specSelector := (self class slices at:tabSelection) last]
    ].
    self specChannel value:specSelector.
    (self window notNil and: [self window shown]) ifTrue: [self updateFonts]

! !

!DataSetBuilder methodsFor:'startup / release'!

openModal
    "sets the modalOpened flag, so later, 
     there is no need to ask for saving into a class"

    modalOpened := true.

    super openModal


!

openModalOnResourceSpec: aListSpec
    "sets the modalOpened flag, so later, 
     there is no need to ask for saving into a class"

    modalOpened := true.

    super openModalOnResourceSpec: aListSpec


!

postBuildWith:builder

    columnView := self builder componentAt:#columnView.
    columnView labelView enabled:false.

    super postBuildWith:builder.

    (builder componentAt: #labelAndColumns) 
        selectConditionBlock: [:i|self askForItemModification];
        action: [:i|self cancel];
        selection: 1.



! !

!DataSetBuilder methodsFor:'user actions'!

accept
    "accept changes made"

    |column type|

    super accept.

    (column := self selectedColumn) isNil ifTrue: [^self cancel].

    type := (aspects at:#rendererType) value.

    type == #rowSelector ifTrue:[
        #(label width minWidth editorType choices readSelector writeSelector printSelector
          formatString type size height canSelect selectSelector
         ) do:[:aKey|
            (aspects at:aKey) value:nil
        ]
    ].
    aspects keysAndValuesDo:[:aKey :aModel| column perform:(aKey , ':') asSymbol with: aModel value].
    self seqList at:selectedColumnIndex put:(self labelFromColumn:column).
    self updateColumnView.
    self cancel.
    modified := true.

!

cancel
    "remove all changes and reload selected column values"

    self updateInputFields.
    self valueOfEnablingCommitButtons value:false.
    self columnIsNotEditing value: true.
!

doBrowseRowClass
    "browse class of columns spec"

    |cls|

    (cls := self resolveClassNamed) notNil 
        ifTrue: [SystemBrowser openInClass:cls] 
        ifFalse:[self information:'No class defined !!']

    "Modified: / 20.5.1998 / 03:48:04 / cg"
!

doCopy
    "copy selected column to the clipboard"

    |idx|

    (idx := selectedColumnIndex) ~~ 0 
    ifTrue:
    [
        self clipboard: (columns at: idx) deepCopy
    ]
!

doCreateColumn
    "create a new column after selected column or at left (nothing selected)"

    |label list|

    list := self seqList.
    label := 'Column ', (list size + 1) printString.
    columns add:(DataSetColumnSpec label:label selector:nil) afterIndex:selectedColumnIndex.
    self seqList add:label afterIndex:selectedColumnIndex.
    self valueOfEnablingCommitButtons value ifFalse:[self selectedColumnModel value:selectedColumnIndex + 1].
    self cancel.
    self updateColumnView.
    modified := true.

!

doCut
    "remove selected column and put it to the clipboard"

    |idx|

    ((idx := selectedColumnIndex) ~~ 0 and: [self askForItemModification]) 
    ifTrue:
    [
        self selectedColumnModel value:0.
        self clipboard: (columns at: idx).
        columns removeIndex:idx.
        self seqList removeIndex:idx.
        columns size > 0 ifTrue: [self selectedColumnModel value: ((idx - 1) max: 1)].
        self updateColumnView.
        self updateInputFields.
        columns isEmpty ifTrue: [self isColumnSelected value: false].
        self cancel.
        modified := true.
    ]
!

doDefineRowClass
    "launch a dialog to define class and superclass"

    |aspects cls oldClass oldSuper|

    aspects  := IdentityDictionary new.
    oldClass := rowClass.
    oldSuper := rowSuperClass.

    [true] 
    whileTrue:
    [
        rowClass notNil 
        ifTrue:
        [
            (cls := self resolveClassNamed) notNil 
            ifTrue:
            [
                rowSuperClass := cls superclass name asString
            ].
            aspects at:#classNameChannel put:rowClass asValue
        ] 
        ifFalse:
        [
            aspects at:#classNameChannel put:'DSVRow' asValue
        ].

        rowSuperClass notNil 
            ifTrue: [aspects at:#superclassNameChannel put:rowSuperClass asValue] 
            ifFalse:[aspects at:#superclassNameChannel put:'Object' asValue].

        (self openDialogInterface:#defineClassNameSpec withBindings:aspects) 
        ifFalse:
        [
            rowClass := oldClass.
            rowSuperClass := oldSuper.
            ^self
        ].
        rowClass      := ((aspects at:#classNameChannel) value)      withoutSeparators.
        rowSuperClass := ((aspects at:#superclassNameChannel) value) withoutSeparators.

        rowClass size == 0 
        ifTrue:
        [
            rowClass := nil.
            self information:'no valid className'
        ] 
        ifFalse: 
        [
            cls := self resolveClassNamed.

            cls notNil ifTrue:[cls := cls superclass name asString].

            rowSuperClass size == 0 
            ifTrue:
            [        
                cls notNil ifTrue:[
                    rowSuperClass := cls
                ] ifFalse:[
                    rowSuperClass := 'Object'
                ].
                self information: 'set superclassName'
            ] 
            ifFalse:
            [
                (cls isNil or:[rowSuperClass = cls]) ifTrue:[^self].
                self information:('A global named ' , rowClass , ' exists,\' ,
                                  'but is not a subclass of ' , rowSuperClass, '.\\' ,
                                  'Check and try again if that is not what you want.') withCRs.

                rowSuperClass := cls
            ]
        ]
    ]
!

doDelete
    "remove selected column and put it to the clipboard"

    |idx|

    ((idx := selectedColumnIndex) ~~ 0 and: [self askForItemModification]) 
    ifTrue:
    [
        self selectedColumnModel value:0.
        columns removeIndex:idx.
        self seqList removeIndex:idx.
        columns size > 0 ifTrue: [self selectedColumnModel value: ((idx - 1) max: 1)].
        self updateColumnView.
        self updateInputFields.
        columns isEmpty ifTrue: [self isColumnSelected value: false].
        self cancel.
        modified := true.
    ]
!

doGenerateCode
    "generate code for column values"

    |cls superclass|

    rowClass isNil ifTrue:[^self information:'No class defined!!'].
    cls := self resolveClassNamed.

    cls isNil 
    ifTrue:
    [
        superclass := Smalltalk resolveName:rowSuperClass inClass:self class.

        superclass isNil ifTrue:[^self information:'No superclass defined!!'].
        (self confirm:'create ' , rowClass , ' ?') ifFalse:[^self].
        cls := superclass subclass:rowClass asSymbol
                     instanceVariableNames:''
                     classVariableNames:''
                     poolDictionaries:''
                     category:'Applications'.
    ].

    self generateChoicesIn:cls.
    self generateMenuIn:cls.
    self generatePrintSelectorIn:cls.
    self generateReadSelectorIn:cls.
    self generateBackgroundSelectorIn:cls.
    self generateForegroundSelectorIn:cls.
    self generateSelectSelectorIn:cls.
    self generateWriteSelectorIn:cls.
    self generateDoubleClickSelectorIn:cls.
!

doMoveColumn:upOrDown
    "move selected column up or down"

    |idx list label col size|

    (idx := selectedColumnIndex) == 0 ifTrue:[^self].
    list := self seqList.
    size := list size.

    size == 1 ifTrue:[^self].
    selectedColumnIndex := 0.
    label := list at:idx.
    col   := columns at:idx.
    list    removeIndex:idx.
    columns removeIndex:idx.

    upOrDown == #up 
    ifTrue:
    [
        idx == 1 ifTrue:[idx := size]
                ifFalse:[idx := idx - 1]
    ] 
    ifFalse:
    [
        idx == size ifTrue:[idx := 1]
                   ifFalse:[idx := idx + 1]
    ].
    columns add:col   beforeIndex:idx.
    list    add:label beforeIndex:idx.  
    self selectedColumnModel value:idx.
    self updateColumnView.
!

doPaste
    "paste clipboard copy column after selected column or at left (nothing selected)"

    |col lbl|

    self askForItemModification ifFalse: [^nil].
    col := self class clipboard deepCopy.
    lbl := self labelFromColumn:col.

    columns add:col afterIndex:selectedColumnIndex.
    self seqList add:lbl afterIndex:selectedColumnIndex.

    self valueOfEnablingCommitButtons value ifFalse:[
        self selectedColumnModel value:selectedColumnIndex + 1
    ].
    self updateColumnView.
    self updateInputFields.
    modified := true.

!

doPickColumns

    |view cls|

    view := Screen current viewFromUser.
    cls  := view class.

    (cls == DSVColumnView or:[cls == DataSetView or:[cls == DSVLabelView]]) ifTrue:[
        self columns:(view columnView columnDescriptors)
    ]
!

doSave
    |cls dst spc idx category mthd excla code resourceType|

    (columns size ~~ 0 and:[super doSave]) ifFalse:[
        ^ nil
    ].
    cls := self resolveName:specClass.
    dst := columns collect:[:aCol| aCol literalArrayEncoding ].
    spc := WriteStream on:String new.
    UISpecification prettyPrintSpecArray:dst asArray on:spc indent:4.
    spc := spc contents.
    idx := (spc indexOfNonSeparatorStartingAt:1) - 2.

    spc at:idx put:$^.

    "/ if that method already exists, do not overwrite the category

    resourceType := self class resourceType.
    category     := resourceType, ' specs'.

    (mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[
        category := mthd category.
    ].

    excla := Character excla asString.

    code := excla
            , (cls name , ' class methodsFor:' , category storeString)
            , excla , '\\'

            , specSelector , '\'
            , (self class codeGenerationComment replChar:$!! withString:'!!!!')
            , '\\    "\'
            , ('     DataSetBuilder new openOnClass:' , cls name , ' andSelector:#' , specSelector , '\')
            , '    "\'.

    code := code 
            , '\'
            , '    <resource: #', resourceType, '>\\'
            , spc
            , '\'
            , (excla , ' ' , excla)
            , '\\'.

    code := code withCRs.
    (ReadStream on:code) fileIn.

"/    self isStandAlone ifTrue: [self helpTool installHelpSpecsOnClass:self specClass].

    self updateHistory.
    self updateInfoLabel.

    hasSaved := true.
    modified := false.

! !

!DataSetBuilder class methodsFor:'documentation'!

version
    ^ '$Header$'
! !