TabItemEditor.st
author tz
Fri, 30 Jan 1998 14:58:10 +0100
changeset 533 dde823aeca4c
parent 530 badaac1d45e7
child 534 25e349c437d2
permissions -rw-r--r--
supports loading of subspecs
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
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
    16
	instanceVariableNames:'rebuildMode testView className selector aspects listOfTabs
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
    17
		hasChanged selectedIndex'
500
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
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
    81
              #'name:' 'Tab Item Editor'
530
badaac1d45e7 dialog style revised
tz
parents: 526
diff changeset
    82
              #'layout:' #(#LayoutFrame 141 0 424 0 456 0 551 0)
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
    83
              #'label:' 'Tab Item Editor'
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    84
              #'min:' #(#Point 10 10)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    85
              #'max:' #(#Point 1152 900)
530
badaac1d45e7 dialog style revised
tz
parents: 526
diff changeset
    86
              #'bounds:' #(#Rectangle 141 424 457 552)
500
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
               #(
530
badaac1d45e7 dialog style revised
tz
parents: 526
diff changeset
    93
                 #(#FramedBoxSpec
badaac1d45e7 dialog style revised
tz
parents: 526
diff changeset
    94
                    #'name:' 'framedBox1'
badaac1d45e7 dialog style revised
tz
parents: 526
diff changeset
    95
                    #'layout:' #(#LayoutFrame 0 0.0 3 0.0 0 1.0 -33 1.0)
badaac1d45e7 dialog style revised
tz
parents: 526
diff changeset
    96
                    #'label:' 'Define class and selector'
badaac1d45e7 dialog style revised
tz
parents: 526
diff changeset
    97
                    #'labelPosition:' #topLeft
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    98
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
    99
                 #(#LabelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   100
                    #'name:' 'ClassLabel'
530
badaac1d45e7 dialog style revised
tz
parents: 526
diff changeset
   101
                    #'layout:' #(#AlignmentOrigin 58 0.11 37 0 1 0.5)
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   102
                    #'label:' 'Class:'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   103
                    #'adjust:' #right
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   104
                    #'resizeForLabel:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   105
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   106
                 #(#InputFieldSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   107
                    #'name:' 'ClassField'
530
badaac1d45e7 dialog style revised
tz
parents: 526
diff changeset
   108
                    #'layout:' #(#LayoutFrame 62 0.11 26 0 -18 1.0 48 0)
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   109
                    #'tabable:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   110
                    #'model:' #className
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   111
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   112
                 #(#LabelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   113
                    #'name:' 'SelectorLabel'
530
badaac1d45e7 dialog style revised
tz
parents: 526
diff changeset
   114
                    #'layout:' #(#AlignmentOrigin 58 0.11 62 0 1 0.5)
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   115
                    #'label:' 'Selector:'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   116
                    #'adjust:' #right
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   117
                    #'resizeForLabel:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   118
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   119
                 #(#InputFieldSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   120
                    #'name:' 'SelectorField'
530
badaac1d45e7 dialog style revised
tz
parents: 526
diff changeset
   121
                    #'layout:' #(#LayoutFrame 62 0.11 51 0 -18 1.0 73 0)
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   122
                    #'tabable:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   123
                    #'model:' #selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   124
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   125
                 #(#UISubSpecification
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   126
                    #'name:' 'CommitPanel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   127
                    #'layout:' #(#LayoutFrame 0 0.0 -29 1 0 1.0 -5 1)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   128
                    #'majorKey:' #ToolApplicationModel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   129
                    #'minorKey:' #windowSpecForCommitWithoutChannels
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   130
                )
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
tabSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   137
    "this window spec was automatically generated by the ST/X UIPainter"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   138
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   139
    "do not manually edit this - the painter/builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   140
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   141
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   142
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   143
     UIPainter new openOnClass:TabItemEditor andSelector:#tabSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   144
     TabItemEditor new openInterface:#tabSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   145
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   146
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   147
    <resource: #canvas>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   148
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   149
    ^
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   150
     
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   151
       #(#FullSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   152
          #'window:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   153
           #(#WindowSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   154
              #'name:' 'Tab Basic'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   155
              #'layout:' #(#LayoutFrame 219 0 193 0 506 0 397 0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   156
              #'label:' 'Tab Basic'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   157
              #'min:' #(#Point 10 10)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   158
              #'max:' #(#Point 1280 1024)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   159
              #'bounds:' #(#Rectangle 219 193 507 398)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   160
              #'usePreferredExtent:' false
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   161
          )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   162
          #'component:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   163
           #(#SpecCollection
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   164
              #'collection:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   165
               #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   166
                 #(#LabelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   167
                    #'name:' 'Label'
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   168
                    #'layout:' #(#AlignmentOrigin 73 0 34 0 1 0.5)
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   169
                    #'label:' 'Label:'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   170
                    #'resizeForLabel:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   171
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   172
                 #(#InputFieldSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   173
                    #'name:' 'LabelField'
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   174
                    #'layout:' #(#LayoutFrame 75 0 24 0 -4 1.0 46 0)
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   175
                    #'activeHelpKey:' #label
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   176
                    #'model:' #label
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   177
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   178
                 #(#CheckBoxSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   179
                    #'name:' 'TranslateLabel'
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   180
                    #'layout:' #(#LayoutOrigin 71 0 49 0)
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   181
                    #'activeHelpKey:' #translateLabel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   182
                    #'model:' #translateLabel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   183
                    #'label:' 'Label derives from Application'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   184
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   185
                 #(#ColorMenuSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   186
                    #'name:' 'ForegroundColorMenu'
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   187
                    #'layout:' #(#LayoutFrame 75 0 104 0 -4 1.0 126 0)
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   188
                    #'activeHelpKey:' #foregroundColor
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   189
                    #'model:' #labelForegroundColor
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   190
                    #'labelsAreColored:' false
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   191
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   192
                 #(#LabelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   193
                    #'name:' 'ForegroundLabel'
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   194
                    #'layout:' #(#AlignmentOrigin 73 0 116 0 1 0.5)
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   195
                    #'label:' 'Color:'
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   196
                    #'adjust:' #right
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   197
                    #'resizeForLabel:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   198
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   199
                 #(#CheckBoxSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   200
                    #'name:' 'CanSelect'
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   201
                    #'layout:' #(#LayoutFrame 34 0 157 0 153 0 179 0)
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   202
                    #'model:' #enabled
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   203
                    #'label:' 'Can Select'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   204
                )
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
windowSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   211
    "this window spec was automatically generated by the ST/X UIPainter"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   212
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   213
    "do not manually edit this - the painter/builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   214
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   215
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   216
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   217
     UIPainter new openOnClass:TabItemEditor andSelector:#windowSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   218
     TabItemEditor new openInterface:#windowSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   219
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   220
    "TabItemEditor open"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   221
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   222
    <resource: #canvas>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   223
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   224
    ^
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   225
     
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   226
       #(#FullSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   227
          #'window:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   228
           #(#WindowSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   229
              #'name:' 'TabItem Editor'
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   230
              #'layout:' #(#LayoutFrame 512 0 124 0 980 0 452 0)
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   231
              #'label:' 'TabItem Editor'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   232
              #'min:' #(#Point 10 10)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   233
              #'max:' #(#Point 1152 900)
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   234
              #'bounds:' #(#Rectangle 512 124 981 453)
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   235
              #'menu:' #menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   236
              #'usePreferredExtent:' false
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   237
          )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   238
          #'component:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   239
           #(#SpecCollection
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   240
              #'collection:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   241
               #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   242
                 #(#MenuPanelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   243
                    #'name:' 'menuToolbarView'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   244
                    #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 34 0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   245
                    #'menu:' #menuToolbar
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   246
                    #'showSeparatingLines:' true
500
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
                                   #(
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   272
                                     #(#ViewSpec
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   273
                                        #'name:' 'TestView'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   274
                                        #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   275
                                        #'component:' 
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   276
                                         #(#SpecCollection
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   277
                                            #'collection:' 
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   278
                                             #(
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   279
                                               #(#TabViewSpec
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   280
                                                  #'name:' 'TestTabsView'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   281
                                                  #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 0.5)
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   282
                                              )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   283
                                            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   284
                                        )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   285
                                    )
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   286
                                     #(#SubCanvasSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   287
                                        #'name:' 'specCanvas'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   288
                                        #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -30 1.0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   289
                                        #'specHolder:' #specChannel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   290
                                    )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   291
                                     #(#HorizontalPanelViewSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   292
                                        #'name:' 'modifyPanel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   293
                                        #'layout:' #(#LayoutFrame 0 0.0 -30 1.0 0 1.0 0 1.0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   294
                                        #'component:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   295
                                         #(#SpecCollection
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   296
                                            #'collection:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   297
                                             #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   298
                                               #(#ActionButtonSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   299
                                                  #'name:' 'cancelButton'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   300
                                                  #'label:' 'Cancel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   301
                                                  #'model:' #cancel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   302
                                                  #'enableChannel:' #modifiedChannel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   303
                                                  #'extent:' #(#Point 168 24)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   304
                                              )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   305
                                               #(#ActionButtonSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   306
                                                  #'name:' 'acceptButton'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   307
                                                  #'label:' 'OK'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   308
                                                  #'model:' #accept
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   309
                                                  #'enableChannel:' #modifiedChannel
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   310
                                                  #'extent:' #(#Point 169 24)
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   311
                                              )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   312
                                            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   313
                                        )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   314
                                        #'horizontalLayout:' #fitSpace
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   315
                                        #'verticalLayout:' #fitSpace
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   316
                                        #'horizontalSpace:' 3
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   317
                                        #'verticalSpace:' 3
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   318
                                    )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   319
                                  )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   320
                              )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   321
                              #'borderWidth:' 1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   322
                          )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   323
                        )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   324
                    )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   325
                    #'handles:' #(#Any 0.259875 1.0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   326
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   327
                 #(#LabelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   328
                    #'name:' 'infoLabel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   329
                    #'layout:' #(#LayoutFrame 0 0.0 -22 1 -80 1.0 0 1.0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   330
                    #'labelChannel:' #valueOfInfoLabel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   331
                    #'level:' 1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   332
                    #'adjust:' #left
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   333
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   334
                 #(#LabelSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   335
                    #'name:' 'timeLabel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   336
                    #'layout:' #(#LayoutFrame -80 1 -22 1 0 1.0 0 1.0)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   337
                    #'labelChannel:' #valueOfTimeLabel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   338
                    #'level:' 1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   339
                    #'adjust:' #right
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   340
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   341
              )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   342
          )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   343
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   344
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   345
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   346
!TabItemEditor class methodsFor:'menu specs'!
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   347
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   348
menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   349
    "this window spec was automatically generated by the ST/X MenuEditor"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   350
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   351
    "do not manually edit this - the builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   352
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   353
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   354
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   355
     MenuEditor new openOnClass:TabItemEditor andSelector:#menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   356
     (Menu new fromLiteralArrayEncoding:(TabItemEditor menu)) startUp
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   357
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   358
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   359
    <resource: #menu>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   360
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   361
    ^
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   362
     
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   363
       #(#Menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   364
          
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   365
           #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   366
             #(#MenuItem
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   367
                #'label:' 'About'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   368
                #'labelImage:' #(#ResourceRetriever nil #icon)
7a4749b25748 style revised
tz
parents: 514
diff changeset
   369
                #'submenuChannel:' #menuAbout
7a4749b25748 style revised
tz
parents: 514
diff changeset
   370
            )
7a4749b25748 style revised
tz
parents: 514
diff changeset
   371
             #(#MenuItem
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   372
                #'label:' 'File'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   373
                #'submenu:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   374
                 #(#Menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   375
                    
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:' 'New'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   379
                          #'value:' #doNew
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   380
                      )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   381
                       #(#MenuItem
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   382
                          #'label:' '-'
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   383
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   384
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   385
                          #'label:' 'Reload'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   386
                          #'value:' #doReload
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   387
                          #'enabled:' #hasClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   388
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   389
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   390
                          #'label:' '-'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   391
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   392
                       #(#MenuItem
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   393
                          #'label:' 'Save'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   394
                          #'value:' #doInstallSpec
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   395
                          #'enabled:' #isNotModified
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   396
                      )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   397
                       #(#MenuItem
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   398
                          #'label:' '-'
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   399
                      )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   400
                       #(#MenuItem
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   401
                          #'label:' 'Define Class And Selector...'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   402
                          #'value:' #doDefineClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   403
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   404
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   405
                          #'label:' 'Create Aspect Method'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   406
                          #'value:' #doInstallAspect
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   407
                          #'enabled:' #hasClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   408
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   409
                       #(#MenuItem
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   410
                          #'label:' '-'
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   411
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   412
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   413
                          #'label:' 'Exit'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   414
                          #'value:' #closeRequest
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   415
                          #'enabled:' #isNotModified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   416
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   417
                    ) nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   418
                    nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   419
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   420
            )
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   421
             #(#MenuItem
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   422
                #'label:' 'Edit'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   423
                #'submenuChannel:' #menuEdit
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   424
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   425
             #(#MenuItem
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   426
                #'label:' 'Add'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   427
                #'submenu:' 
7a4749b25748 style revised
tz
parents: 514
diff changeset
   428
                 #(#Menu
7a4749b25748 style revised
tz
parents: 514
diff changeset
   429
                    
7a4749b25748 style revised
tz
parents: 514
diff changeset
   430
                     #(
7a4749b25748 style revised
tz
parents: 514
diff changeset
   431
                       #(#MenuItem
7a4749b25748 style revised
tz
parents: 514
diff changeset
   432
                          #'label:' 'Tab Item'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   433
                          #'labelImage:' #(#ResourceRetriever nil #newLabelIcon 'Tab Item')
7a4749b25748 style revised
tz
parents: 514
diff changeset
   434
                      )
7a4749b25748 style revised
tz
parents: 514
diff changeset
   435
                    ) nil
7a4749b25748 style revised
tz
parents: 514
diff changeset
   436
                    nil
7a4749b25748 style revised
tz
parents: 514
diff changeset
   437
                )
7a4749b25748 style revised
tz
parents: 514
diff changeset
   438
            )
7a4749b25748 style revised
tz
parents: 514
diff changeset
   439
             #(#MenuItem
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   440
                #'label:' 'History'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   441
                #'submenuChannel:' #menuHistory
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   442
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   443
             #(#MenuItem
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   444
                #'label:' 'Help'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   445
                #'submenuChannel:' #menuHelp
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   446
            )
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   447
          ) nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   448
          nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   449
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   450
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   451
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   452
menuEdit
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   453
    "this window spec was automatically generated by the ST/X MenuEditor"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   454
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   455
    "do not manually edit this - the builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   456
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   457
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   458
    "
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   459
     MenuEditor new openOnClass:TabItemEditor andSelector:#menuEdit
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   460
     (Menu new fromLiteralArrayEncoding:(TabItemEditor menuEdit)) startUp
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   461
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   462
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   463
    <resource: #menu>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   464
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   465
    ^
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   466
     
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   467
       #(#Menu
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   468
          
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   469
           #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   470
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   471
                #'label:' 'Cut'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   472
                #'value:' #doCutTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   473
                #'enabled:' #isColumnSelected
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   474
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   475
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   476
                #'label:' 'Copy'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   477
                #'value:' #doCopyTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   478
                #'enabled:' #isColumnSelected
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   479
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   480
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   481
                #'label:' 'Paste'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   482
                #'value:' #doPasteTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   483
                #'enabled:' #valueOfHavingClipboard
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   484
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   485
             #(#MenuItem
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   486
                #'label:' '-'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   487
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   488
             #(#MenuItem
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   489
                #'label:' 'Move Up'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   490
                #'value:' #'doMoveTabUpOrDown:'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   491
                #'enabled:' #canMoveTabUpOrDown
7a4749b25748 style revised
tz
parents: 514
diff changeset
   492
                #'argument:' #up
7a4749b25748 style revised
tz
parents: 514
diff changeset
   493
                #'labelImage:' #(#ResourceRetriever #ToolApplicationModel #upIcon 'Move Up')
7a4749b25748 style revised
tz
parents: 514
diff changeset
   494
            )
7a4749b25748 style revised
tz
parents: 514
diff changeset
   495
             #(#MenuItem
7a4749b25748 style revised
tz
parents: 514
diff changeset
   496
                #'label:' 'Move Down'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   497
                #'value:' #'doMoveTabUpOrDown:'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   498
                #'enabled:' #canMoveTabUpOrDown
7a4749b25748 style revised
tz
parents: 514
diff changeset
   499
                #'argument:' #down
7a4749b25748 style revised
tz
parents: 514
diff changeset
   500
                #'labelImage:' #(#ResourceRetriever #ToolApplicationModel #downIcon 'Move Down')
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   501
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   502
          ) nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   503
          nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   504
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   505
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   506
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   507
menuToolbar
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   508
    "this window spec was automatically generated by the ST/X MenuEditor"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   509
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   510
    "do not manually edit this - the builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   511
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   512
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   513
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   514
     MenuEditor new openOnClass:TabItemEditor andSelector:#menuToolbar
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   515
     (Menu new fromLiteralArrayEncoding:(TabItemEditor menuToolbar)) startUp
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   516
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   517
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   518
    <resource: #menu>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   519
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   520
    ^
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   521
     
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   522
       #(#Menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   523
          
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   524
           #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   525
             #(#MenuItem
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   526
                #'label:' 'Test'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   527
                #'isButton:' true
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   528
                #'value:' #doTest
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   529
                #'labelImage:' #(#ResourceRetriever #UIPainter #startIcon)
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   530
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   531
             #(#MenuItem
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   532
                #'label:' ''
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   533
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   534
             #(#MenuItem
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   535
                #'label:' 'New'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   536
                #'isButton:' true
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   537
                #'value:' #doNew
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   538
                #'labelImage:' #(#ResourceRetriever nil #newIcon)
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   539
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   540
             #(#MenuItem
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   541
                #'label:' 'Save'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   542
                #'isButton:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   543
                #'value:' #doInstallSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   544
                #'enabled:' #isNotModified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   545
                #'labelImage:' #(#ResourceRetriever nil #saveIcon)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   546
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   547
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   548
                #'label:' ''
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   549
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   550
             #(#MenuItem
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   551
                #'label:' 'Create Label'
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   552
                #'isButton:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   553
                #'value:' #doCreateTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   554
                #'enabled:' #isNotModified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   555
                #'labelImage:' #(#ResourceRetriever #MenuEditor #menuItemImage)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   556
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   557
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   558
                #'label:' ''
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   559
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   560
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   561
                #'label:' 'Move Tab Up'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   562
                #'isButton:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   563
                #'value:' #'doMoveTabUpOrDown:'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   564
                #'enabled:' #canMoveTabUpOrDown
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   565
                #'argument:' #up
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   566
                #'labelImage:' #(#ResourceRetriever nil #upIcon)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   567
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   568
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   569
                #'label:' 'Move Tab Down'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   570
                #'isButton:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   571
                #'value:' #'doMoveTabUpOrDown:'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   572
                #'enabled:' #canMoveTabUpOrDown
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   573
                #'argument:' #down
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   574
                #'labelImage:' #(#ResourceRetriever nil #downIcon)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   575
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   576
          ) nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   577
          nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   578
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   579
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   580
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   581
!TabItemEditor class methodsFor:'resources'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   582
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   583
newLabelIcon
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   584
    "Generated by the Image Editor"
7a4749b25748 style revised
tz
parents: 514
diff changeset
   585
    "
7a4749b25748 style revised
tz
parents: 514
diff changeset
   586
    ImageEditor openOnClass:self andSelector:#newLabelIcon
7a4749b25748 style revised
tz
parents: 514
diff changeset
   587
    "
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   588
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   589
    <resource: #image>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   590
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   591
    ^Icon
7a4749b25748 style revised
tz
parents: 514
diff changeset
   592
        constantNamed:#'TabItemEditor newLabelIcon'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   593
        ifAbsentPut:[(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'DQDP@@@@@@@@DQDQDQ@QDQDQDR@QDQDQDAH"H"H"LADQDQDPD"@BHBH0DQDQDQ@R@"HB@#@QDQDQDAHBH HBLADQDQDPD"@BHBH0DQDPDQ@RH"H"H#@QDQDQDAHBH HBLADQDQDPD H"@ H0DQDQDQ@R@"HB@#@QDQDQDAH@@ @BLADQDQDPD"H"H"H0DQDQDQ@RH"H"H#@QDQDQDAHB@ HBLADQDQDPD @B@@H0DQDQDQ@R@ H@@#@QDQDQDAHB@ HBLADQDQDPD"H"H"H0DQDQDQ@RH"H"H#@QDQDQDBL3L3L3LADQDQDP@@@@@@@@DQDb'); 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.9977 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9977 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9977); add:(Color red:0.0 green:49.9977 blue:49.9977); add:(Color red:49.9977 green:49.9977 blue:0.0); add:(Color red:49.9977 green:0.0 blue:49.9977); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'A??@A??@A??@A??@A??@A??@A??@A??@A??CA??@A??@A??@A??@A??CA??AA??@A??CA??@A??CA??@A??@A??A'); yourself); yourself]! !
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   594
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   595
!TabItemEditor methodsFor:'accessing'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   596
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   597
className
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   598
    ^ className
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   599
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   600
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   601
didInstall
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   602
    ^ hasChanged not
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   603
!
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   604
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   605
selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   606
    ^ selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   607
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   608
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   609
!TabItemEditor methodsFor:'actions'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   610
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   611
accept
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   612
    "accept changes
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   613
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   614
    |label|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   615
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   616
    self modified ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   617
        selectedIndex ~~ 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   618
            rebuildMode := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   619
            label := listOfTabs at:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   620
            hasChanged := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   621
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   622
            aspects keysAndValuesDo:[:aKey :aModel|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   623
                label perform:(aKey , ':') asSymbol with:(aModel value).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   624
            ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   625
            self listOfLabels at:selectedIndex put:(label label).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   626
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   627
            rebuildMode := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   628
        ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   629
        self cancel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   630
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   631
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   632
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   633
cancel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   634
    "cancel all changes
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   635
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   636
    |tab|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   637
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   638
    rebuildMode ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   639
        selectedIndex ~~ 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   640
            tab := listOfTabs at:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   641
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   642
            rebuildMode := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   643
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   644
            aspects keysAndValuesDo:[:aKey :aModel|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   645
                aModel value:(tab perform:aKey)    
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   646
            ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   647
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   648
            rebuildMode := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   649
        ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   650
        self modified:false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   651
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   652
    self canMoveTabUpOrDown value:(selectedIndex ~~ 0 and:[listOfTabs size > 1])
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   653
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   654
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   655
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   656
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   657
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   658
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   659
modified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   660
    "returns true if current tab is modified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   661
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   662
    ^ self modifiedChannel value
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   663
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   664
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   665
modified:aState
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   666
    "change modification state
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   667
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   668
    rebuildMode ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   669
        self modifiedChannel value:aState.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   670
        self isNotModified   value:(aState not).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   671
    ]
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:'aspects'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   675
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   676
aspectFor:aKey
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   677
    "returns aspect for a key or nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   678
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   679
    ^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ]
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
canMoveTabUpOrDown
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   685
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   686
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   687
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   688
    (holder := builder bindingAt:#canMoveTabUpOrDown) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   689
        builder aspectAt:#canMoveTabUpOrDown put:(holder := false asValue).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   690
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   691
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   692
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   693
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   694
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   695
hasClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   696
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   697
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   698
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   699
    (holder := builder bindingAt:#hasClassAndSelector) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   700
        builder aspectAt:#hasClassAndSelector put:(holder := false asValue).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   701
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   702
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   703
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   704
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   705
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   706
isNotModified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   707
    "returns true if current tab spec is not modified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   708
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   709
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   710
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   711
    (holder := builder bindingAt:#isNotModified) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   712
        builder aspectAt:#isNotModified put:(holder :=  true asValue).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   713
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   714
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   715
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   716
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   717
listOfLabels
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   718
    "returns a holder which keeps the list of tab labels
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   719
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   720
    |list|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   721
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   722
    (list := builder bindingAt:#listOfLabels) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   723
        builder aspectAt:#listOfLabels put:(list :=  List new).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   724
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   725
    ^ list
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   726
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   727
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   728
modifiedChannel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   729
    "channel which is true if the current tab specification is modified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   730
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   731
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   732
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   733
    (holder := builder bindingAt:#modifiedChannel) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   734
        builder aspectAt:#modifiedChannel put:(holder :=  false asValue).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   735
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   736
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   737
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   738
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   739
selectionHolder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   740
    "holder which keeps the current selection
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   741
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   742
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   743
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   744
    (holder := builder bindingAt:#selectionHolder) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   745
        holder := AspectAdaptor new subject:self; forAspect:#selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   746
        builder aspectAt:#selectionHolder put:holder.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   747
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   748
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   749
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   750
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   751
specChannel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   752
    "holder which keeps the current tab specification
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   753
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   754
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   755
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   756
    (holder := builder bindingAt:#specChannel) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   757
        builder aspectAt:#specChannel put:(holder :=  ValueHolder new).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   758
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   759
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   760
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   761
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   762
!TabItemEditor methodsFor:'building'!
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   763
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   764
buildFrom:aClass andSelector:aSelector
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   765
    "build from class and selector
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   766
    "
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   767
    |spec list validClSl|
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   768
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   769
    self doNew.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   770
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   771
    selector  := nil.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   772
    className := self resolveName:aClass.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   773
    validClSl := false.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   774
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   775
    className notNil ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   776
        aSelector notNil ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   777
            validClSl := true.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   778
            selector  := aSelector asSymbol.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   779
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   780
            (className respondsTo:selector) ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   781
                spec := className perform:selector.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   782
                list := self listOfLabels.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   783
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   784
                spec size ~~ 0 ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   785
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   786
                    rebuildMode := true.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   787
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   788
                    spec do:[:aTab|
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   789
                        list add:aTab label.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   790
                        listOfTabs add:aTab.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   791
                    ].
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   792
                    rebuildMode := false.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   793
                    self addToHistory:(className name, ' ', selector) -> #loadFromMessage:                        
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   794
                ]
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   795
            ]
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   796
        ]
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   797
    ].
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   798
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   799
    self hasClassAndSelector value:validClSl.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   800
    self modified:false.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   801
    hasChanged := false.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   802
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   803
    listOfTabs notEmpty ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   804
        self selectionHolder value:1
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   805
    ].
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   806
!
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   807
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   808
loadFromMessage:aMessage
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   809
    "load tabs from class and selector derived from history
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   810
    "
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   811
    |msg cls|
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   812
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   813
    aMessage notNil ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   814
        msg := aMessage asCollectionOfWords.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   815
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   816
        (msg size == 2 and:[(cls := self resolveName:(msg at:1)) notNil]) ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   817
            self buildFrom:cls andSelector:((msg at:2) asSymbol)
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   818
        ]
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   819
    ]
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   820
! !
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   821
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   822
!TabItemEditor methodsFor:'change & update'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   823
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   824
update:something with:aParameter from:someObject
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   825
    "one of my aspects has changed; update modified channel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   826
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   827
    self modified:true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   828
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   829
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   830
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   831
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   832
!TabItemEditor methodsFor:'selection'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   833
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   834
selectedIndex
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   835
    ^ selectedIndex
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   836
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   837
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   838
selectedIndex:anIndex
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   839
    |s oldSel|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   840
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   841
    oldSel := selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   842
    selectedIndex := anIndex ? 0.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   843
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   844
    selectedIndex == oldSel ifTrue:[^ self].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   845
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   846
    oldSel == 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   847
        self specChannel value:(self class tabSpec)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   848
    ] ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   849
        selectedIndex == 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   850
            self specChannel value:nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   851
        ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   852
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   853
    self cancel.
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   854
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   855
    testView notNil ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   856
        testView lower
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   857
    ]
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   858
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   859
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   860
!TabItemEditor methodsFor:'startup / release'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   861
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   862
closeRequest
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   863
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   864
    hasChanged ifTrue:[
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   865
        ( YesNoBox title:'Tab spec was modified!!'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   866
                 yesText:'Waste it and proceed'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   867
                  noText:'Cancel'
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   868
        ) confirm ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   869
            ^ self
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   870
        ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   871
        hasChanged := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   872
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   873
    super closeRequest.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   874
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   875
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   876
initialize
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   877
    "setup aspects used by column description specifications
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   878
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   879
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   880
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   881
    super initialize.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   882
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   883
    aspects       := IdentityDictionary new.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   884
    listOfTabs    := OrderedCollection new.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   885
    hasChanged    := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   886
    selectedIndex := 0.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   887
    rebuildMode   := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   888
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   889
   #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   890
        label
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   891
        translateLabel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   892
        labelForegroundColor
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   893
        enabled
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   894
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   895
    ) do:[:aKey|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   896
        aspects at:aKey put:(holder := ValueHolder new).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   897
        holder addDependent:self.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   898
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   899
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   900
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   901
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   902
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   903
openModalOnClass:aClass andSelector:aSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   904
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   905
    className := aClass.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   906
    selector  := aSelector.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   907
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   908
    super openInterfaceModal.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   909
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   910
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   911
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   912
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   913
openOnClass:aClass andSelector:aSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   914
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   915
    className := aClass.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   916
    selector  := aSelector.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   917
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   918
    super openInterface.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   919
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   920
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   921
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   922
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   923
postBuildWith:builder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   924
    self buildFrom:className andSelector:selector.
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   925
    testView := builder componentAt:#TestView.
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   926
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   927
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   928
!TabItemEditor methodsFor:'user interactions'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   929
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   930
doCopyTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   931
    "copy selected tab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   932
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   933
    selectedIndex ~~ 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   934
        self clipboard:(listOfTabs at:selectedIndex) deepCopy
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   935
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   936
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   937
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   938
doCreateTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   939
    |tab|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   940
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   941
    tab := TabItem label:'label'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   942
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   943
    listOfTabs add:tab afterIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   944
    self listOfLabels add:(tab label) afterIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   945
    hasChanged := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   946
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   947
    selectedIndex == 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   948
        self selectionHolder value:1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   949
    ] ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   950
        self cancel.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   951
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   952
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   953
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   954
doCutTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   955
    "cut selected tab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   956
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   957
    |list index|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   958
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   959
    (index := selectedIndex) ~~ 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   960
        list := self listOfLabels.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   961
        self clipboard:(listOfTabs at:index) deepCopy.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   962
        self selectionHolder value:0.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   963
        listOfTabs removeIndex:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   964
        list removeIndex:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   965
        hasChanged := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   966
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   967
        index > list size ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   968
            index := index - 1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   969
        ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   970
        self selectionHolder value:index
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   971
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   972
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   973
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   974
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   975
doDefineClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   976
    "launch a dialog to define class and selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   977
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   978
    |cls sel bindings|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   979
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   980
    bindings := IdentityDictionary new.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   981
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   982
    [true] whileTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   983
        cls := className notNil ifTrue:[className name] ifFalse:['NewApplication'].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   984
        sel := selector  ? 'tabItemList'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   985
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   986
        bindings at:#className put:cls asValue.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   987
        bindings at:#selector  put:sel asValue.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   988
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   989
        (self openDialogInterface:#nameAndSelectorSpec withBindings:bindings)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   990
        ifFalse:[ ^ self ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   991
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   992
        cls := (bindings at:#className) value withoutSeparators.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   993
        sel := (bindings at:#selector)  value withoutSeparators.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   994
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   995
        (cls := self resolveName:cls) notNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   996
            className := cls.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   997
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   998
            sel notNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   999
                selector := sel asSymbol.
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1000
                self hasClassAndSelector value:true.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1001
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1002
                listOfTabs size == 0 ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1003
                    self buildFrom:className andSelector:selector
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1004
                ].
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1005
                ^ self
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1006
            ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1007
        ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1008
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1009
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1010
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1011
doInstallAspect
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1012
    "generate aspect method
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1013
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1014
    |code|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1015
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1016
    className isNil ifTrue:[ ^ self information:'No valid class defined!!'].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1017
    selector isNil  ifTrue:[ ^ self information:'No selector defined!!'   ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1018
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1019
    (className canUnderstand:selector) ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1020
        "/ method already exists, do not overwrite the method automaticaly
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1021
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1022
        ( YesNoBox title:'method '
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1023
                         , (Text string:('#', selector) emphasis:#bold)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1024
                         , ' already exists'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1025
                 yesText:'overwrite'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1026
                  noText:'cancel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1027
        ) confirm ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1028
            ^ self
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1029
        ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1030
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1031
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1032
    code := '!!' , className name , ' methodsFor:''aspects''!!\\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1033
            selector , '\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1034
            '    "automatically generated by TabItem Editor ..."\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1035
            '\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1036
            '    |list|\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1037
            '\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1038
            '    (list := builder bindingAt:#' , selector , ') isNil ifTrue:[\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1039
            '        builder aspectAt:#' , selector, ' put:(list := self class ', selector, ').\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1040
            '    ].\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1041
            '    ^ list\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1042
            '!! !!\\'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1043
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1044
    (ReadStream on:(code withCRs)) fileIn
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1045
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1046
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1047
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1048
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1049
doInstallSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1050
    "generate code for class and instance
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1051
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1052
    |code spec category mthd|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1053
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1054
    (className isNil or:[selector isNil]) ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1055
        self doDefineClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1056
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1057
    className isNil ifTrue:[ ^ self information:'No valid class defined!!'].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1058
    selector isNil  ifTrue:[ ^ self information:'No selector defined!!'   ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1059
    listOfTabs isEmpty ifTrue:[ ^ self information:'No valid tabs defined!!' ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1060
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1061
    spec  := WriteStream on:String new.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1062
    UISpecification prettyPrintSpecArray:(listOfTabs literalArrayEncoding) on:spec indent:5.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1063
    spec := spec contents.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1064
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1065
    "/ if that method already exists, do not overwrite the category
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1066
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1067
    category := 'interface specs'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1068
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1069
    (mthd := className class compiledMethodAt:selector) notNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1070
        category := mthd category.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1071
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1072
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1073
    code := Character excla asString 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1074
            , className name , ' class methodsFor:' , category storeString
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1075
            , Character excla asString , '\\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1076
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1077
            , selector , '\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1078
            , '    "this window spec was automatically generated by the ST/X TabItemEditor"\\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1079
            , '    "do not manually edit this - the builder may not be able to\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1080
            , '     handle the specification if its corrupted."\\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1081
            , '    "\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1082
            , '     TabItemEditor new openOnClass:' , className name , ' andSelector:#' , selector , '\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1083
            , '    "\'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1084
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1085
    code := code 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1086
            , '\'
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
  1087
            , '    <resource: #tabList>\\'
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1088
            , '    ^\' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1089
            , '     ', spec, '\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1090
            , '      collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1091
            , '\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1092
            , Character excla asString
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1093
            , ' '
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1094
            , Character excla asString
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1095
            , '\\'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1096
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1097
    code := code withCRs.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1098
    (ReadStream on:code) fileIn.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1099
    hasChanged := false.
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
  1100
    self addToHistory:(className name, ' ', selector) -> #loadFromMessage:.
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1101
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1102
    (className canUnderstand:selector) ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1103
        (YesNoBox confirm:'install aspect method') ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1104
            self doInstallAspect
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1105
        ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1106
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1107
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1108
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1109
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1110
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1111
doMoveTabUpOrDown:what
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1112
    "step up or down
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1113
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1114
    |tab list index|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1115
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1116
    (selectedIndex ~~ 0 and:[listOfTabs size > 1]) ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1117
        ^ self
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1118
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1119
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1120
    list := self listOfLabels.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1121
    tab  := listOfTabs at:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1122
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1123
    list removeIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1124
    listOfTabs removeIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1125
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1126
    what == #down ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1127
        index := selectedIndex > list size ifTrue:[1]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1128
                                          ifFalse:[selectedIndex + 1]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1129
    ] ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1130
        index := selectedIndex == 1 ifTrue:[list size + 1]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1131
                                   ifFalse:[selectedIndex - 1]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1132
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1133
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1134
    list add:(tab label) beforeIndex:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1135
    listOfTabs add:tab beforeIndex:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1136
    hasChanged  := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1137
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1138
    rebuildMode := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1139
    self selectionHolder value:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1140
    rebuildMode := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1141
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1142
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1143
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1144
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1145
doNew
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1146
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1147
    self modified:false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1148
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1149
    rebuildMode := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1150
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1151
    self selectionHolder value:0.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1152
    self listOfLabels removeAll.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1153
    listOfTabs removeAll.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1154
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1155
    testView notNil ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1156
        testView lower
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1157
    ].
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1158
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1159
    hasChanged  := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1160
    rebuildMode := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1161
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1162
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1163
doPasteTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1164
    "paste a tab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1165
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1166
    |tab|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1167
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1168
    tab := self class clipboard deepCopy.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1169
    listOfTabs add:tab afterIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1170
    self listOfLabels add:(tab label) afterIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1171
    hasChanged := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1172
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1173
    selectedIndex == 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1174
        self selectionHolder value:1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1175
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1176
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1177
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1178
doReload
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1179
    "reload from class and selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1180
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1181
    self buildFrom:className andSelector:selector
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1182
!
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1183
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1184
doTest
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1185
    "run a test
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1186
    "
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1187
    |tabView list|
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1188
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1189
    self selectionHolder value:nil.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1190
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1191
    listOfTabs size ~~ 0 ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1192
        list := listOfTabs collect:[:aTab||t|
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1193
            t := aTab copy.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1194
            t setAttributesFromClass:className.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1195
            t
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1196
        ]
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1197
    ] ifFalse:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1198
        list := nil
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1199
    ].
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1200
    tabView  := builder componentAt:#TestTabsView.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1201
    tabView list:list.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1202
    testView raise.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1203
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1204
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1205
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1206
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1207
!TabItemEditor class methodsFor:'documentation'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1208
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1209
version
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1210
    ^ '$Header$'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1211
! !