TabItemEditor.st
author ca
Wed, 28 Jan 1998 15:05:27 +0100
changeset 500 c18c7621f8e9
child 514 5ac07e96e448
permissions -rw-r--r--
initial checkin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
     1
"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
     3
              All Rights Reserved
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
     4
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
     5
 This software is furnished under a license and may be used
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    10
 hereby transferred.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    11
"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    12
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    13
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    14
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    15
ToolApplicationModel subclass:#TabItemEditor
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    16
	instanceVariableNames:'rebuildMode className selector aspects listOfTabs hasChanged
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    17
		selectedIndex'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    18
	classVariableNames:''
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    19
	poolDictionaries:''
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    20
	category:'Interface-UIPainter'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    21
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    22
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    23
!TabItemEditor class methodsFor:'documentation'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    24
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    25
copyright
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    26
"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    27
 COPYRIGHT (c) 1997 by eXept Software AG
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    28
              All Rights Reserved
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    29
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    30
 This software is furnished under a license and may be used
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    35
 hereby transferred.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    36
"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    37
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    38
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    39
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    40
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    41
documentation
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    42
"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    43
    create and modify or inspect a list of tabs
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    44
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    45
    [start with:]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    46
        TabItemEditor open
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    47
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    48
    [see also:]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    49
        TabItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    50
        TabView
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    51
        NoteBookView
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    52
        UIPainter
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    53
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    54
    [author:]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    55
        Claus Atzkern
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    56
"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    57
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    58
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    59
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    60
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    61
!TabItemEditor class methodsFor:'interface specs'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    62
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    63
nameAndSelectorSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    64
    "this window spec was automatically generated by the ST/X UIPainter"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    65
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    66
    "do not manually edit this - the painter/builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    67
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    68
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    69
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    70
     UIPainter new openOnClass:TabItemEditor andSelector:#nameAndSelectorSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    71
     TabItemEditor new openInterface:#nameAndSelectorSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    72
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    73
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    74
    <resource: #canvas>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    75
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    76
    ^
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    77
     
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    78
       #(#FullSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    79
          #'window:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    80
           #(#WindowSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    81
              #'name:' 'Class & Selector'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    82
              #'layout:' #(#LayoutFrame 219 0 193 0 584 0 319 0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    83
              #'label:' 'Class & Selector'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    84
              #'min:' #(#Point 10 10)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    85
              #'max:' #(#Point 1152 900)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    86
              #'bounds:' #(#Rectangle 219 193 585 320)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    87
              #'usePreferredExtent:' false
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    88
          )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    89
          #'component:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    90
           #(#SpecCollection
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    91
              #'collection:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    92
               #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    93
                 #(#LabelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    94
                    #'name:' 'DefineClassAndSelector'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    95
                    #'layout:' #(#Point 2 10)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    96
                    #'label:' 'Define Class And Selector'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    97
                    #'adjust:' #left
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    98
                    #'resizeForLabel:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    99
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   100
                 #(#LabelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   101
                    #'name:' 'ClassLabel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   102
                    #'layout:' #(#AlignmentOrigin 50 0.11 51 0 1 0.5)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   103
                    #'label:' 'Class:'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   104
                    #'adjust:' #right
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   105
                    #'resizeForLabel:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   106
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   107
                 #(#InputFieldSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   108
                    #'name:' 'ClassField'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   109
                    #'layout:' #(#LayoutFrame 51 0.11 39 0 -2 1.0 61 0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   110
                    #'tabable:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   111
                    #'model:' #className
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   112
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   113
                 #(#LabelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   114
                    #'name:' 'SelectorLabel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   115
                    #'layout:' #(#AlignmentOrigin 50 0.11 74 0 1 0.5)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   116
                    #'label:' 'Selector:'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   117
                    #'adjust:' #right
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   118
                    #'resizeForLabel:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   119
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   120
                 #(#InputFieldSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   121
                    #'name:' 'SelectorField'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   122
                    #'layout:' #(#LayoutFrame 51 0.11 64 0 -2 1.0 86 0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   123
                    #'tabable:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   124
                    #'model:' #selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   125
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   126
                 #(#UISubSpecification
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   127
                    #'name:' 'CommitPanel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   128
                    #'layout:' #(#LayoutFrame 0 0.0 -29 1 0 1.0 -5 1)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   129
                    #'majorKey:' #ToolApplicationModel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   130
                    #'minorKey:' #windowSpecForCommitWithoutChannels
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   131
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   132
              )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   133
          )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   134
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   135
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   136
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   137
tabSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   138
    "this window spec was automatically generated by the ST/X UIPainter"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   139
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   140
    "do not manually edit this - the painter/builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   141
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   142
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   143
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   144
     UIPainter new openOnClass:TabItemEditor andSelector:#tabSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   145
     TabItemEditor new openInterface:#tabSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   146
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   147
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   148
    <resource: #canvas>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   149
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   150
    ^
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   151
     
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   152
       #(#FullSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   153
          #'window:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   154
           #(#WindowSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   155
              #'name:' 'Tab Basic'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   156
              #'layout:' #(#LayoutFrame 219 0 193 0 506 0 397 0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   157
              #'label:' 'Tab Basic'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   158
              #'min:' #(#Point 10 10)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   159
              #'max:' #(#Point 1280 1024)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   160
              #'bounds:' #(#Rectangle 219 193 507 398)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   161
              #'usePreferredExtent:' false
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   162
          )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   163
          #'component:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   164
           #(#SpecCollection
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   165
              #'collection:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   166
               #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   167
                 #(#LabelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   168
                    #'name:' 'Label'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   169
                    #'layout:' #(#AlignmentOrigin 63 0 34 0 1 0.5)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   170
                    #'label:' 'Label:'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   171
                    #'resizeForLabel:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   172
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   173
                 #(#InputFieldSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   174
                    #'name:' 'LabelField'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   175
                    #'layout:' #(#LayoutFrame 66 0 24 0 -4 1.0 46 0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   176
                    #'activeHelpKey:' #label
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   177
                    #'model:' #label
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   178
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   179
                 #(#CheckBoxSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   180
                    #'name:' 'TranslateLabel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   181
                    #'layout:' #(#LayoutOrigin 63 0 49 0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   182
                    #'activeHelpKey:' #translateLabel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   183
                    #'model:' #translateLabel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   184
                    #'label:' 'Label derives from Application'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   185
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   186
                 #(#ColorMenuSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   187
                    #'name:' 'ForegroundColorMenu'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   188
                    #'layout:' #(#LayoutFrame 94 0 104 0 -4 1.0 126 0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   189
                    #'activeHelpKey:' #foregroundColor
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   190
                    #'model:' #labelForegroundColor
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   191
                    #'labelsAreColored:' false
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   192
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   193
                 #(#LabelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   194
                    #'name:' 'ForegroundLabel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   195
                    #'layout:' #(#AlignmentOrigin 92 0 116 0 1 0.5)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   196
                    #'label:' 'Foreground:'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   197
                    #'adjust:' #right
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   198
                    #'resizeForLabel:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   199
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   200
                 #(#CheckBoxSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   201
                    #'name:' 'CanSelect'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   202
                    #'layout:' #(#LayoutFrame 15 0 171 0 134 0 193 0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   203
                    #'model:' #enabled
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   204
                    #'label:' 'Can Select'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   205
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   206
              )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   207
          )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   208
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   209
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   210
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   211
windowSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   212
    "this window spec was automatically generated by the ST/X UIPainter"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   213
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   214
    "do not manually edit this - the painter/builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   215
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   216
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   217
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   218
     UIPainter new openOnClass:TabItemEditor andSelector:#windowSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   219
     TabItemEditor new openInterface:#windowSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   220
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   221
    "TabItemEditor open"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   222
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   223
    <resource: #canvas>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   224
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   225
    ^
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   226
     
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   227
       #(#FullSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   228
          #'window:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   229
           #(#WindowSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   230
              #'name:' 'TabItem Editor'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   231
              #'layout:' #(#LayoutFrame 219 0 193 0 687 0 521 0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   232
              #'label:' 'TabItem Editor'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   233
              #'min:' #(#Point 10 10)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   234
              #'max:' #(#Point 1152 900)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   235
              #'bounds:' #(#Rectangle 219 193 688 522)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   236
              #'menu:' #menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   237
              #'usePreferredExtent:' false
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   238
          )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   239
          #'component:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   240
           #(#SpecCollection
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   241
              #'collection:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   242
               #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   243
                 #(#MenuPanelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   244
                    #'name:' 'menuToolbarView'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   245
                    #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 34 0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   246
                    #'menu:' #menuToolbar
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   247
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   248
                 #(#VariableHorizontalPanelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   249
                    #'name:' 'VariablePanel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   250
                    #'layout:' #(#LayoutFrame 0 0.0 36 0.0 0 1.0 -22 1.0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   251
                    #'component:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   252
                     #(#SpecCollection
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   253
                        #'collection:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   254
                         #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   255
                           #(#SequenceViewSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   256
                              #'name:' 'columnView'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   257
                              #'enableChannel:' #isNotModified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   258
                              #'model:' #selectionHolder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   259
                              #'menu:' #menuEdit
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   260
                              #'hasHorizontalScrollBar:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   261
                              #'hasVerticalScrollBar:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   262
                              #'miniScrollerHorizontal:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   263
                              #'useIndex:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   264
                              #'sequenceList:' #listOfLabels
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   265
                          )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   266
                           #(#ViewSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   267
                              #'name:' 'specView'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   268
                              #'component:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   269
                               #(#SpecCollection
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   270
                                  #'collection:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   271
                                   #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   272
                                     #(#SubCanvasSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   273
                                        #'name:' 'specCanvas'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   274
                                        #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -30 1.0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   275
                                        #'specHolder:' #specChannel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   276
                                    )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   277
                                     #(#HorizontalPanelViewSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   278
                                        #'name:' 'modifyPanel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   279
                                        #'layout:' #(#LayoutFrame 0 0.0 -30 1.0 0 1.0 0 1.0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   280
                                        #'component:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   281
                                         #(#SpecCollection
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   282
                                            #'collection:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   283
                                             #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   284
                                               #(#ActionButtonSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   285
                                                  #'name:' 'cancelButton'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   286
                                                  #'label:' 'Cancel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   287
                                                  #'model:' #cancel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   288
                                                  #'enableChannel:' #modifiedChannel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   289
                                                  #'extent:' #(#Point 168 24)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   290
                                              )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   291
                                               #(#ActionButtonSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   292
                                                  #'name:' 'acceptButton'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   293
                                                  #'label:' 'OK'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   294
                                                  #'model:' #accept
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   295
                                                  #'enableChannel:' #modifiedChannel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   296
                                                  #'extent:' #(#Point 168 24)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   297
                                              )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   298
                                            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   299
                                        )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   300
                                        #'horizontalLayout:' #fitSpace
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   301
                                        #'verticalLayout:' #fitSpace
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   302
                                        #'horizontalSpace:' 3
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   303
                                        #'verticalSpace:' 3
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   304
                                    )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   305
                                  )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   306
                              )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   307
                              #'borderWidth:' 1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   308
                          )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   309
                        )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   310
                    )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   311
                    #'handles:' #(#Any 0.259875 1.0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   312
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   313
                 #(#LabelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   314
                    #'name:' 'infoLabel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   315
                    #'layout:' #(#LayoutFrame 0 0.0 -22 1 -80 1.0 0 1.0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   316
                    #'labelChannel:' #valueOfInfoLabel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   317
                    #'level:' 1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   318
                    #'adjust:' #left
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   319
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   320
                 #(#LabelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   321
                    #'name:' 'timeLabel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   322
                    #'layout:' #(#LayoutFrame -80 1 -22 1 0 1.0 0 1.0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   323
                    #'labelChannel:' #valueOfTimeLabel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   324
                    #'level:' 1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   325
                    #'adjust:' #right
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   326
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   327
              )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   328
          )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   329
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   330
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   331
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   332
!TabItemEditor class methodsFor:'menus'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   333
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   334
menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   335
    "this window spec was automatically generated by the ST/X MenuEditor"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   336
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   337
    "do not manually edit this - the builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   338
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   339
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   340
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   341
     MenuEditor new openOnClass:TabItemEditor andSelector:#menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   342
     (Menu new fromLiteralArrayEncoding:(TabItemEditor menu)) startUp
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   343
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   344
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   345
    <resource: #menu>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   346
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   347
    ^
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   348
     
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   349
       #(#Menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   350
          
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   351
           #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   352
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   353
                #'label:' 'File'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   354
                #'submenu:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   355
                 #(#Menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   356
                    
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   357
                     #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   358
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   359
                          #'label:' 'New'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   360
                          #'value:' #doNew
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   361
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   362
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   363
                          #'label:' 'Reload'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   364
                          #'value:' #doReload
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   365
                          #'enabled:' #hasClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   366
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   367
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   368
                          #'label:' '-'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   369
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   370
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   371
                          #'label:' 'Define Class And Selector...'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   372
                          #'value:' #doDefineClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   373
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   374
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   375
                          #'label:' '-'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   376
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   377
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   378
                          #'label:' 'Create Aspect Method'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   379
                          #'value:' #doInstallAspect
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   380
                          #'enabled:' #hasClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   381
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   382
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   383
                          #'label:' '-'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   384
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   385
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   386
                          #'label:' 'Exit'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   387
                          #'value:' #closeRequest
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   388
                          #'enabled:' #isNotModified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   389
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   390
                    ) nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   391
                    nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   392
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   393
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   394
          ) nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   395
          nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   396
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   397
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   398
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   399
menuEdit
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   400
    "this window spec was automatically generated by the ST/X MenuEditor"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   401
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   402
    "do not manually edit this - the builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   403
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   404
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   405
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   406
     MenuEditor new openOnClass:self andSelector:#menuEdit
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   407
     (Menu new fromLiteralArrayEncoding:(self menuEdit)) startUp
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   408
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   409
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   410
    <resource: #menu>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   411
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   412
    ^
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   413
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   414
       #(#Menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   415
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   416
           #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   417
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   418
                #'label:' 'Cut'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   419
                #'value:' #doCutTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   420
                #'enabled:' #isColumnSelected
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   421
                #'shortcutKeyCharacter:' #Cut
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   422
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   423
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   424
                #'label:' 'Copy'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   425
                #'value:' #doCopyTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   426
                #'enabled:' #isColumnSelected
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   427
                #'shortcutKeyCharacter:' #Copy
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   428
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   429
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   430
                #'label:' 'Paste'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   431
                #'value:' #doPasteTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   432
                #'enabled:' #valueOfHavingClipboard
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   433
                #'shortcutKeyCharacter:' #Paste
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   434
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   435
          ) nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   436
          nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   437
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   438
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   439
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   440
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   441
menuToolbar
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   442
    "this window spec was automatically generated by the ST/X MenuEditor"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   443
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   444
    "do not manually edit this - the builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   445
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   446
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   447
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   448
     MenuEditor new openOnClass:TabItemEditor andSelector:#menuToolbar
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   449
     (Menu new fromLiteralArrayEncoding:(TabItemEditor menuToolbar)) startUp
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   450
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   451
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   452
    <resource: #menu>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   453
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   454
    ^
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   455
     
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   456
       #(#Menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   457
          
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   458
           #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   459
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   460
                #'label:' 'Save'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   461
                #'isButton:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   462
                #'value:' #doInstallSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   463
                #'enabled:' #isNotModified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   464
                #'labelImage:' #(#ResourceRetriever nil #saveIcon)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   465
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   466
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   467
                #'label:' ''
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   468
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   469
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   470
                #'label:' 'createLabel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   471
                #'isButton:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   472
                #'value:' #doCreateTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   473
                #'enabled:' #isNotModified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   474
                #'labelImage:' #(#ResourceRetriever #MenuEditor #menuItemImage)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   475
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   476
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   477
                #'label:' ''
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   478
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   479
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   480
                #'label:' 'Move Tab Up'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   481
                #'isButton:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   482
                #'value:' #'doMoveTabUpOrDown:'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   483
                #'enabled:' #canMoveTabUpOrDown
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   484
                #'argument:' #up
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   485
                #'labelImage:' #(#ResourceRetriever nil #upIcon)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   486
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   487
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   488
                #'label:' 'Move Tab Down'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   489
                #'isButton:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   490
                #'value:' #'doMoveTabUpOrDown:'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   491
                #'enabled:' #canMoveTabUpOrDown
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   492
                #'argument:' #down
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   493
                #'labelImage:' #(#ResourceRetriever nil #downIcon)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   494
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   495
          ) nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   496
          nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   497
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   498
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   499
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   500
!TabItemEditor class methodsFor:'resources'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   501
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   502
newLabelIcon
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   503
    "ImageEditor openOnClass:self andSelector:#newLabelIcon"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   504
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   505
    <resource: #image>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   506
    ^(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(#[17 17 16 0 0 0 0 0 0 17 17 17 17 16 17 17 17 17 17 32 17 17 17 17 16 18 34 34 34 34 48 17 17 17 17 16 18 32 2 32 34 48 17 17 17 17 16 18 2 34 2 2 48 17 17 17 17 16 18 2 34 2 2 48 17 17 17 17 16 18 32 2 32 34 48 17 17 16 17 16 18 34 34 34 34 48 17 17 17 17 16 18 2 34 2 2 48 17 17 17 17 16 18 2 34 2 2 48 17 17 17 17 16 18 2 34 2 2 48 17 17 17 17 16 18 0 2 0 2 48 17 17 17 17 16 18 34 34 34 34 48 17 17 17 17 16 18 34 34 34 34 48 17 17 17 17 16 18 2 2 2 2 48 17 17 17 17 16 18 0 2 0 2 48 17 17 17 17 16 18 2 2 0 2 48 17 17 17 17 16 18 2 2 2 2 48 17 17 17 17 16 18 34 34 34 34 48 17 17 17 17 16 18 34 34 34 34 48 17 17 17 17 16 35 51 51 51 51 48 17 17 17 17 16 0 0 0 0 0 0 17 17]) ; colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color grey:66.9978); add:(Color grey:49.9962); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9992 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9992 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9992); add:(Color red:0.0 green:49.9992 blue:49.9992); add:(Color red:49.9992 green:49.9992 blue:0.0); add:(Color red:49.9992 green:0.0 blue:49.9992); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(#[7 255 192 7 255 192 7 255 192 7 255 192 7 255 192 7 255 192 7 255 192 7 255 192 7 255 195 7 255 192 7 255 192 7 255 192 7 255 192 7 255 195 7 255 193 7 255 192 7 255 195 7 255 192 7 255 195 7 255 192 7 255 192 7 255 193]) ; yourself); yourself
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   507
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   508
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   509
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   510
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   511
!TabItemEditor methodsFor:'accessing'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   512
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   513
className
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   514
    ^ className
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   515
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   516
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   517
selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   518
    ^ selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   519
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   520
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   521
!TabItemEditor methodsFor:'actions'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   522
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   523
accept
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   524
    "accept changes
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   525
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   526
    |label|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   527
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   528
    self modified ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   529
        selectedIndex ~~ 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   530
            rebuildMode := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   531
            label := listOfTabs at:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   532
            hasChanged := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   533
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   534
            aspects keysAndValuesDo:[:aKey :aModel|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   535
                label perform:(aKey , ':') asSymbol with:(aModel value).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   536
            ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   537
            self listOfLabels at:selectedIndex put:(label label).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   538
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   539
            rebuildMode := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   540
        ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   541
        self cancel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   542
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   543
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   544
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   545
cancel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   546
    "cancel all changes
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   547
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   548
    |tab|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   549
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   550
    rebuildMode ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   551
        selectedIndex ~~ 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   552
            tab := listOfTabs at:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   553
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   554
            rebuildMode := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   555
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   556
            aspects keysAndValuesDo:[:aKey :aModel|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   557
                aModel value:(tab perform:aKey)    
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   558
            ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   559
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   560
            rebuildMode := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   561
        ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   562
        self modified:false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   563
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   564
    self canMoveTabUpOrDown value:(selectedIndex ~~ 0 and:[listOfTabs size > 1])
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   565
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   566
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   567
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   568
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   569
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   570
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   571
modified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   572
    "returns true if current tab is modified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   573
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   574
    ^ self modifiedChannel value
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   575
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   576
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   577
modified:aState
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   578
    "change modification state
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   579
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   580
    rebuildMode ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   581
        self modifiedChannel value:aState.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   582
        self isNotModified   value:(aState not).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   583
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   584
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   585
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   586
!TabItemEditor methodsFor:'aspects'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   587
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   588
aspectFor:aKey
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   589
    "returns aspect for a key or nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   590
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   591
    ^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   592
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   593
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   594
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   595
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   596
canMoveTabUpOrDown
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   597
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   598
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   599
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   600
    (holder := builder bindingAt:#canMoveTabUpOrDown) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   601
        builder aspectAt:#canMoveTabUpOrDown put:(holder := false asValue).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   602
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   603
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   604
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   605
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   606
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   607
hasClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   608
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   609
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   610
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   611
    (holder := builder bindingAt:#hasClassAndSelector) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   612
        builder aspectAt:#hasClassAndSelector put:(holder := false asValue).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   613
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   614
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   615
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   616
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   617
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   618
isNotModified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   619
    "returns true if current tab spec is not modified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   620
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   621
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   622
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   623
    (holder := builder bindingAt:#isNotModified) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   624
        builder aspectAt:#isNotModified put:(holder :=  true asValue).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   625
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   626
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   627
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   628
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   629
listOfLabels
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   630
    "returns a holder which keeps the list of tab labels
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   631
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   632
    |list|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   633
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   634
    (list := builder bindingAt:#listOfLabels) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   635
        builder aspectAt:#listOfLabels put:(list :=  List new).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   636
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   637
    ^ list
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   638
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   639
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   640
modifiedChannel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   641
    "channel which is true if the current tab specification is modified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   642
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   643
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   644
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   645
    (holder := builder bindingAt:#modifiedChannel) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   646
        builder aspectAt:#modifiedChannel put:(holder :=  false asValue).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   647
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   648
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   649
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   650
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   651
selectionHolder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   652
    "holder which keeps the current selection
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   653
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   654
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   655
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   656
    (holder := builder bindingAt:#selectionHolder) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   657
        holder := AspectAdaptor new subject:self; forAspect:#selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   658
        builder aspectAt:#selectionHolder put:holder.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   659
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   660
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   661
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   662
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   663
specChannel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   664
    "holder which keeps the current tab specification
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   665
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   666
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   667
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   668
    (holder := builder bindingAt:#specChannel) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   669
        builder aspectAt:#specChannel put:(holder :=  ValueHolder new).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   670
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   671
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   672
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   673
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   674
!TabItemEditor methodsFor:'change & update'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   675
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   676
update:something with:aParameter from:someObject
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   677
    "one of my aspects has changed; update modified channel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   678
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   679
    self modified:true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   680
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   681
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   682
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   683
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   684
!TabItemEditor methodsFor:'selection'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   685
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   686
selectedIndex
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   687
    ^ selectedIndex
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   688
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   689
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   690
selectedIndex:anIndex
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   691
    |s oldSel|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   692
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   693
    oldSel := selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   694
    selectedIndex := anIndex ? 0.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   695
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   696
    selectedIndex == oldSel ifTrue:[^ self].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   697
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   698
    oldSel == 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   699
        self specChannel value:(self class tabSpec)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   700
    ] ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   701
        selectedIndex == 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   702
            self specChannel value:nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   703
        ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   704
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   705
    self cancel.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   706
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   707
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   708
!TabItemEditor methodsFor:'startup / release'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   709
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   710
buildFrom:aClass andSelector:aSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   711
    "build from class and selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   712
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   713
    |spec list validClSl|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   714
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   715
    self doNew.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   716
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   717
    selector  := nil.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   718
    className := self resolveName:aClass.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   719
    validClSl := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   720
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   721
    className notNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   722
        aSelector notNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   723
            validClSl := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   724
            selector  := aSelector asSymbol.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   725
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   726
            (className respondsTo:selector) ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   727
                spec := className perform:selector.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   728
                list := self listOfLabels.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   729
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   730
                spec size ~~ 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   731
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   732
                    rebuildMode := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   733
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   734
                    spec do:[:aTab|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   735
                        list add:aTab label.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   736
                        listOfTabs add:aTab.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   737
                    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   738
                    rebuildMode := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   739
                ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   740
            ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   741
        ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   742
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   743
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   744
    self hasClassAndSelector value:validClSl.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   745
    self modified:false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   746
    hasChanged := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   747
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   748
    listOfTabs notEmpty ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   749
        self selectionHolder value:1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   750
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   751
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   752
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   753
closeRequest
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   754
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   755
    hasChanged ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   756
        ( YesNoBox title:'tab description was modified!!'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   757
                 yesText:'waste it and proceed'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   758
                  noText:'cancel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   759
        ) confirm ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   760
            ^ self
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   761
        ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   762
        hasChanged := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   763
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   764
    super closeRequest.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   765
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   766
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   767
initialize
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   768
    "setup aspects used by column description specifications
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   769
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   770
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   771
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   772
    super initialize.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   773
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   774
    aspects       := IdentityDictionary new.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   775
    listOfTabs    := OrderedCollection new.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   776
    hasChanged    := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   777
    selectedIndex := 0.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   778
    rebuildMode   := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   779
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   780
   #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   781
        label
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   782
        translateLabel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   783
        labelForegroundColor
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   784
        enabled
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   785
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   786
    ) do:[:aKey|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   787
        aspects at:aKey put:(holder := ValueHolder new).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   788
        holder addDependent:self.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   789
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   790
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   791
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   792
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   793
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   794
openModalOnClass:aClass andSelector:aSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   795
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   796
    className := aClass.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   797
    selector  := aSelector.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   798
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   799
    super openInterfaceModal.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   800
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   801
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   802
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   803
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   804
openOnClass:aClass andSelector:aSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   805
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   806
    className := aClass.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   807
    selector  := aSelector.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   808
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   809
    super openInterface.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   810
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   811
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   812
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   813
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   814
postBuildWith:builder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   815
    self buildFrom:className andSelector:selector.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   816
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   817
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   818
!TabItemEditor methodsFor:'user interactions'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   819
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   820
doCopyTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   821
    "copy selected tab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   822
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   823
    selectedIndex ~~ 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   824
        self clipboard:(listOfTabs at:selectedIndex) deepCopy
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   825
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   826
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   827
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   828
doCreateTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   829
    |tab|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   830
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   831
    tab := TabItem label:'label'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   832
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   833
    listOfTabs add:tab afterIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   834
    self listOfLabels add:(tab label) afterIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   835
    hasChanged := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   836
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   837
    selectedIndex == 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   838
        self selectionHolder value:1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   839
    ] ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   840
        self cancel.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   841
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   842
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   843
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   844
doCutTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   845
    "cut selected tab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   846
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   847
    |list index|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   848
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   849
    (index := selectedIndex) ~~ 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   850
        list := self listOfLabels.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   851
        self clipboard:(listOfTabs at:index) deepCopy.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   852
        self selectionHolder value:0.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   853
        listOfTabs removeIndex:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   854
        list removeIndex:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   855
        hasChanged := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   856
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   857
        index > list size ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   858
            index := index - 1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   859
        ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   860
        self selectionHolder value:index
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   861
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   862
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   863
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   864
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   865
doDefineClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   866
    "launch a dialog to define class and selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   867
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   868
    |cls sel bindings|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   869
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   870
    bindings := IdentityDictionary new.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   871
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   872
    [true] whileTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   873
        cls := className notNil ifTrue:[className name] ifFalse:['NewApplication'].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   874
        sel := selector  ? 'tabItemList'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   875
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   876
        bindings at:#className put:cls asValue.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   877
        bindings at:#selector  put:sel asValue.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   878
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   879
        (self openDialogInterface:#nameAndSelectorSpec withBindings:bindings)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   880
        ifFalse:[ ^ self ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   881
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   882
        cls := (bindings at:#className) value withoutSeparators.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   883
        sel := (bindings at:#selector)  value withoutSeparators.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   884
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   885
        (cls := self resolveName:cls) notNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   886
            className := cls.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   887
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   888
            sel notNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   889
                selector := sel asSymbol.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   890
              ^ self hasClassAndSelector value:true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   891
            ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   892
        ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   893
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   894
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   895
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   896
doInstallAspect
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   897
    "generate aspect method
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   898
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   899
    |code|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   900
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   901
    className isNil ifTrue:[ ^ self information:'No valid class defined!!'].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   902
    selector isNil  ifTrue:[ ^ self information:'No selector defined!!'   ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   903
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   904
    (className canUnderstand:selector) ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   905
        "/ method already exists, do not overwrite the method automaticaly
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   906
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   907
        ( YesNoBox title:'method '
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   908
                         , (Text string:('#', selector) emphasis:#bold)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   909
                         , ' already exists'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   910
                 yesText:'overwrite'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   911
                  noText:'cancel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   912
        ) confirm ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   913
            ^ self
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   914
        ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   915
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   916
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   917
    code := '!!' , className name , ' methodsFor:''aspects''!!\\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   918
            selector , '\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   919
            '    "automatically generated by TabItem Editor ..."\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   920
            '\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   921
            '    |list|\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   922
            '\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   923
            '    (list := builder bindingAt:#' , selector , ') isNil ifTrue:[\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   924
            '        builder aspectAt:#' , selector, ' put:(list := self class ', selector, ').\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   925
            '    ].\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   926
            '    ^ list\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   927
            '!! !!\\'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   928
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   929
    (ReadStream on:(code withCRs)) fileIn
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   930
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   931
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   932
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   933
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   934
doInstallSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   935
    "generate code for class and instance
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   936
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   937
    |code spec category mthd|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   938
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   939
    (className isNil or:[selector isNil]) ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   940
        self doDefineClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   941
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   942
    className isNil ifTrue:[ ^ self information:'No valid class defined!!'].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   943
    selector isNil  ifTrue:[ ^ self information:'No selector defined!!'   ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   944
    listOfTabs isEmpty ifTrue:[ ^ self information:'No valid tabs defined!!' ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   945
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   946
    spec  := WriteStream on:String new.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   947
    UISpecification prettyPrintSpecArray:(listOfTabs literalArrayEncoding) on:spec indent:5.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   948
    spec := spec contents.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   949
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   950
    "/ if that method already exists, do not overwrite the category
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   951
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   952
    category := 'interface specs'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   953
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   954
    (mthd := className class compiledMethodAt:selector) notNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   955
        category := mthd category.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   956
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   957
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   958
    code := Character excla asString 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   959
            , className name , ' class methodsFor:' , category storeString
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   960
            , Character excla asString , '\\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   961
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   962
            , selector , '\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   963
            , '    "this window spec was automatically generated by the ST/X TabItemEditor"\\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   964
            , '    "do not manually edit this - the builder may not be able to\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   965
            , '     handle the specification if its corrupted."\\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   966
            , '    "\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   967
            , '     TabItemEditor new openOnClass:' , className name , ' andSelector:#' , selector , '\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   968
            , '    "\'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   969
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   970
    code := code 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   971
            , '\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   972
            , '    <resource: #tabItem>\\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   973
            , '    ^\' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   974
            , '     ', spec, '\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   975
            , '      collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   976
            , '\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   977
            , Character excla asString
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   978
            , ' '
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   979
            , Character excla asString
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   980
            , '\\'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   981
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   982
    code := code withCRs.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   983
    (ReadStream on:code) fileIn.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   984
    hasChanged := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   985
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   986
    (className canUnderstand:selector) ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   987
        (YesNoBox confirm:'install aspect method') ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   988
            self doInstallAspect
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   989
        ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   990
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   991
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   992
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   993
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   994
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   995
doMoveTabUpOrDown:what
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   996
    "step up or down
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   997
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   998
    |tab list index|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   999
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1000
    (selectedIndex ~~ 0 and:[listOfTabs size > 1]) ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1001
        ^ self
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1002
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1003
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1004
    list := self listOfLabels.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1005
    tab  := listOfTabs at:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1006
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1007
    list removeIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1008
    listOfTabs removeIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1009
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1010
    what == #down ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1011
        index := selectedIndex > list size ifTrue:[1]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1012
                                          ifFalse:[selectedIndex + 1]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1013
    ] ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1014
        index := selectedIndex == 1 ifTrue:[list size + 1]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1015
                                   ifFalse:[selectedIndex - 1]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1016
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1017
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1018
    list add:(tab label) beforeIndex:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1019
    listOfTabs add:tab beforeIndex:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1020
    hasChanged  := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1021
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1022
    rebuildMode := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1023
    self selectionHolder value:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1024
    rebuildMode := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1025
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1026
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1027
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1028
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1029
doNew
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1030
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1031
    self modified:false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1032
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1033
    rebuildMode := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1034
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1035
    self selectionHolder value:0.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1036
    self listOfLabels removeAll.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1037
    listOfTabs removeAll.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1038
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1039
    hasChanged  := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1040
    rebuildMode := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1041
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1042
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1043
doPasteTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1044
    "paste a tab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1045
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1046
    |tab|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1047
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1048
    tab := self class clipboard deepCopy.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1049
    listOfTabs add:tab afterIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1050
    self listOfLabels add:(tab label) afterIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1051
    hasChanged := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1052
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1053
    selectedIndex == 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1054
        self selectionHolder value:1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1055
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1056
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1057
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1058
doReload
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1059
    "reload from class and selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1060
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1061
    self buildFrom:className andSelector:selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1062
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1063
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1064
!TabItemEditor class methodsFor:'documentation'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1065
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1066
version
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1067
    ^ '$Header$'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1068
! !