TabItemEditor.st
author tz
Mon, 02 Feb 1998 18:45:00 +0100
changeset 548 93fea26562c8
parent 546 aac3f3c9383f
child 549 454a490d797f
permissions -rw-r--r--
help texts added
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:]
541
5dc124df04e2 author line in doc.
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
    55
        Claus Atzkern, eXept Software AG
500
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
                )
534
25e349c437d2 info clock removed
tz
parents: 530
diff changeset
   327
                  #(#UISubSpecification
25e349c437d2 info clock removed
tz
parents: 530
diff changeset
   328
                    #'name:' 'infoBarSubSpec'
25e349c437d2 info clock removed
tz
parents: 530
diff changeset
   329
                    #'layout:' #(#LayoutFrame 0 0.0 -22 1 0 1.0 0 1.0)
25e349c437d2 info clock removed
tz
parents: 530
diff changeset
   330
                    #'majorKey:' #ToolApplicationModel
25e349c437d2 info clock removed
tz
parents: 530
diff changeset
   331
                    #'minorKey:' #windowSpecForInfoBar
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   332
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   333
              )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   334
          )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   335
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   336
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   337
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   338
!TabItemEditor class methodsFor:'menu specs'!
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   339
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   340
menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   341
    "this window spec was automatically generated by the ST/X MenuEditor"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   342
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   343
    "do not manually edit this - the builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   344
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   345
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   346
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   347
     MenuEditor new openOnClass:TabItemEditor andSelector:#menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   348
     (Menu new fromLiteralArrayEncoding:(TabItemEditor menu)) startUp
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   349
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   350
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   351
    <resource: #menu>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   352
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   353
    ^
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   354
     
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   355
       #(#Menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   356
          
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   357
           #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   358
             #(#MenuItem
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   359
                #'label:' 'About'
546
aac3f3c9383f help menu item aligned to the right
tz
parents: 541
diff changeset
   360
                #'labelImage:' #(#ResourceRetriever nil #menuIcon)
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   361
                #'submenuChannel:' #menuAbout
7a4749b25748 style revised
tz
parents: 514
diff changeset
   362
            )
7a4749b25748 style revised
tz
parents: 514
diff changeset
   363
             #(#MenuItem
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   364
                #'label:' 'File'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   365
                #'submenu:' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   366
                 #(#Menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   367
                    
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   368
                     #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   369
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   370
                          #'label:' 'New'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   371
                          #'value:' #doNew
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   372
                      )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   373
                       #(#MenuItem
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   374
                          #'label:' '-'
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   375
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   376
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   377
                          #'label:' 'Reload'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   378
                          #'value:' #doReload
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   379
                          #'enabled:' #hasClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   380
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   381
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   382
                          #'label:' '-'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   383
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   384
                       #(#MenuItem
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   385
                          #'label:' 'Save'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   386
                          #'value:' #doInstallSpec
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   387
                          #'enabled:' #isNotModified
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   388
                      )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   389
                       #(#MenuItem
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   390
                          #'label:' '-'
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   391
                      )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   392
                       #(#MenuItem
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   393
                          #'label:' 'Define Class And Selector...'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   394
                          #'value:' #doDefineClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   395
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   396
                       #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   397
                          #'label:' 'Create Aspect Method'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   398
                          #'value:' #doInstallAspect
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   399
                          #'enabled:' #hasClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   400
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   401
                       #(#MenuItem
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   402
                          #'label:' '-'
500
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:' 'Exit'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   406
                          #'value:' #closeRequest
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   407
                          #'enabled:' #isNotModified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   408
                      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   409
                    ) nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   410
                    nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   411
                )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   412
            )
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   413
             #(#MenuItem
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   414
                #'label:' 'Edit'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   415
                #'submenuChannel:' #menuEdit
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   416
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   417
             #(#MenuItem
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   418
                #'label:' 'Add'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   419
                #'submenu:' 
7a4749b25748 style revised
tz
parents: 514
diff changeset
   420
                 #(#Menu
7a4749b25748 style revised
tz
parents: 514
diff changeset
   421
                    
7a4749b25748 style revised
tz
parents: 514
diff changeset
   422
                     #(
7a4749b25748 style revised
tz
parents: 514
diff changeset
   423
                       #(#MenuItem
7a4749b25748 style revised
tz
parents: 514
diff changeset
   424
                          #'label:' 'Tab Item'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   425
                          #'labelImage:' #(#ResourceRetriever nil #newLabelIcon 'Tab Item')
7a4749b25748 style revised
tz
parents: 514
diff changeset
   426
                      )
7a4749b25748 style revised
tz
parents: 514
diff changeset
   427
                    ) nil
7a4749b25748 style revised
tz
parents: 514
diff changeset
   428
                    nil
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
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   432
                #'label:' 'History'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   433
                #'submenuChannel:' #menuHistory
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   434
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   435
             #(#MenuItem
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   436
                #'label:' 'Help'
546
aac3f3c9383f help menu item aligned to the right
tz
parents: 541
diff changeset
   437
                #'startGroup:' #right
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   438
                #'submenuChannel:' #menuHelp
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   439
            )
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   440
          ) nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   441
          nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   442
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   443
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   444
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   445
menuEdit
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   446
    "this window spec was automatically generated by the ST/X MenuEditor"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   447
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   448
    "do not manually edit this - the builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   449
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   450
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   451
    "
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   452
     MenuEditor new openOnClass:TabItemEditor andSelector:#menuEdit
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   453
     (Menu new fromLiteralArrayEncoding:(TabItemEditor menuEdit)) startUp
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   454
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   455
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   456
    <resource: #menu>
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
     
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   460
       #(#Menu
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   461
          
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   462
           #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   463
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   464
                #'label:' 'Cut'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   465
                #'value:' #doCutTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   466
                #'enabled:' #isColumnSelected
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   467
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   468
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   469
                #'label:' 'Copy'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   470
                #'value:' #doCopyTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   471
                #'enabled:' #isColumnSelected
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   472
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   473
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   474
                #'label:' 'Paste'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   475
                #'value:' #doPasteTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   476
                #'enabled:' #valueOfHavingClipboard
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   477
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   478
             #(#MenuItem
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   479
                #'label:' '-'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   480
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   481
             #(#MenuItem
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   482
                #'label:' 'Move Up'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   483
                #'value:' #'doMoveTabUpOrDown:'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   484
                #'enabled:' #canMoveTabUpOrDown
7a4749b25748 style revised
tz
parents: 514
diff changeset
   485
                #'argument:' #up
7a4749b25748 style revised
tz
parents: 514
diff changeset
   486
                #'labelImage:' #(#ResourceRetriever #ToolApplicationModel #upIcon 'Move Up')
7a4749b25748 style revised
tz
parents: 514
diff changeset
   487
            )
7a4749b25748 style revised
tz
parents: 514
diff changeset
   488
             #(#MenuItem
7a4749b25748 style revised
tz
parents: 514
diff changeset
   489
                #'label:' 'Move Down'
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:' #down
7a4749b25748 style revised
tz
parents: 514
diff changeset
   493
                #'labelImage:' #(#ResourceRetriever #ToolApplicationModel #downIcon 'Move Down')
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   494
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   495
          ) nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   496
          nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   497
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   498
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   499
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   500
menuToolbar
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   501
    "this window spec was automatically generated by the ST/X MenuEditor"
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   502
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   503
    "do not manually edit this - the builder may not be able to
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   504
     handle the specification if its corrupted."
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   505
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   506
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   507
     MenuEditor new openOnClass:TabItemEditor andSelector:#menuToolbar
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   508
     (Menu new fromLiteralArrayEncoding:(TabItemEditor menuToolbar)) startUp
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   509
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   510
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   511
    <resource: #menu>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   512
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   513
    ^
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   514
     
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   515
       #(#Menu
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   516
          
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   517
           #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   518
             #(#MenuItem
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   519
                #'label:' 'Test'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   520
                #'isButton:' true
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   521
                #'value:' #doTest
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   522
                #'labelImage:' #(#ResourceRetriever #UIPainter #startIcon)
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   523
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   524
             #(#MenuItem
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   525
                #'label:' ''
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   526
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   527
             #(#MenuItem
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   528
                #'label:' 'New'
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   529
                #'isButton:' true
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   530
                #'value:' #doNew
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   531
                #'labelImage:' #(#ResourceRetriever nil #newIcon)
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   532
            )
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   533
             #(#MenuItem
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   534
                #'label:' 'Save'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   535
                #'isButton:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   536
                #'value:' #doInstallSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   537
                #'enabled:' #isNotModified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   538
                #'labelImage:' #(#ResourceRetriever nil #saveIcon)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   539
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   540
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   541
                #'label:' ''
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   542
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   543
             #(#MenuItem
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   544
                #'label:' 'Create Label'
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   545
                #'isButton:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   546
                #'value:' #doCreateTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   547
                #'enabled:' #isNotModified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   548
                #'labelImage:' #(#ResourceRetriever #MenuEditor #menuItemImage)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   549
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   550
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   551
                #'label:' ''
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   552
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   553
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   554
                #'label:' 'Move Tab Up'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   555
                #'isButton:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   556
                #'value:' #'doMoveTabUpOrDown:'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   557
                #'enabled:' #canMoveTabUpOrDown
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   558
                #'argument:' #up
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   559
                #'labelImage:' #(#ResourceRetriever nil #upIcon)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   560
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   561
             #(#MenuItem
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   562
                #'label:' 'Move Tab Down'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   563
                #'isButton:' true
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   564
                #'value:' #'doMoveTabUpOrDown:'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   565
                #'enabled:' #canMoveTabUpOrDown
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   566
                #'argument:' #down
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   567
                #'labelImage:' #(#ResourceRetriever nil #downIcon)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   568
            )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   569
          ) nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   570
          nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   571
      )
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   572
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   573
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   574
!TabItemEditor class methodsFor:'resources'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   575
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   576
newLabelIcon
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   577
    "Generated by the Image Editor"
7a4749b25748 style revised
tz
parents: 514
diff changeset
   578
    "
7a4749b25748 style revised
tz
parents: 514
diff changeset
   579
    ImageEditor openOnClass:self andSelector:#newLabelIcon
7a4749b25748 style revised
tz
parents: 514
diff changeset
   580
    "
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   581
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   582
    <resource: #image>
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   583
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   584
    ^Icon
7a4749b25748 style revised
tz
parents: 514
diff changeset
   585
        constantNamed:#'TabItemEditor newLabelIcon'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   586
        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
   587
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   588
!TabItemEditor methodsFor:'accessing'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   589
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   590
className
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   591
    ^ className
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   592
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   593
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   594
didInstall
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   595
    ^ hasChanged not
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   596
!
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   597
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   598
selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   599
    ^ selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   600
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   601
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   602
!TabItemEditor methodsFor:'actions'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   603
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   604
accept
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   605
    "accept changes
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   606
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   607
    |label|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   608
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   609
    self modified ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   610
        selectedIndex ~~ 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   611
            rebuildMode := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   612
            label := listOfTabs at:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   613
            hasChanged := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   614
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   615
            aspects keysAndValuesDo:[:aKey :aModel|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   616
                label perform:(aKey , ':') asSymbol with:(aModel value).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   617
            ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   618
            self listOfLabels at:selectedIndex put:(label label).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   619
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   620
            rebuildMode := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   621
        ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   622
        self cancel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   623
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   624
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   625
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   626
cancel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   627
    "cancel all changes
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   628
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   629
    |tab|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   630
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   631
    rebuildMode ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   632
        selectedIndex ~~ 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   633
            tab := listOfTabs at:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   634
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   635
            rebuildMode := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   636
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   637
            aspects keysAndValuesDo:[:aKey :aModel|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   638
                aModel value:(tab perform:aKey)    
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   639
            ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   640
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   641
            rebuildMode := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   642
        ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   643
        self modified:false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   644
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   645
    self canMoveTabUpOrDown value:(selectedIndex ~~ 0 and:[listOfTabs size > 1])
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   646
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   647
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   648
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   649
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   650
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   651
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   652
modified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   653
    "returns true if current tab is modified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   654
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   655
    ^ self modifiedChannel value
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   656
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   657
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   658
modified:aState
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   659
    "change modification state
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   660
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   661
    rebuildMode ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   662
        self modifiedChannel value:aState.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   663
        self isNotModified   value:(aState not).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   664
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   665
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   666
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   667
!TabItemEditor methodsFor:'aspects'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   668
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   669
aspectFor:aKey
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   670
    "returns aspect for a key or nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   671
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   672
    ^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   673
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   674
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   675
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   676
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   677
canMoveTabUpOrDown
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   678
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   679
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   680
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   681
    (holder := builder bindingAt:#canMoveTabUpOrDown) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   682
        builder aspectAt:#canMoveTabUpOrDown put:(holder := false asValue).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   683
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   684
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   685
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   686
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   687
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   688
hasClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   689
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   690
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   691
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   692
    (holder := builder bindingAt:#hasClassAndSelector) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   693
        builder aspectAt:#hasClassAndSelector put:(holder := false asValue).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   694
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   695
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   696
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   697
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   698
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   699
isNotModified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   700
    "returns true if current tab spec is not modified
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
    (holder := builder bindingAt:#isNotModified) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   705
        builder aspectAt:#isNotModified put:(holder :=  true asValue).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   706
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   707
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   708
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   709
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   710
listOfLabels
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   711
    "returns a holder which keeps the list of tab labels
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   712
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   713
    |list|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   714
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   715
    (list := builder bindingAt:#listOfLabels) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   716
        builder aspectAt:#listOfLabels put:(list :=  List new).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   717
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   718
    ^ list
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   719
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   720
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   721
modifiedChannel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   722
    "channel which is true if the current tab specification is modified
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   723
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   724
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   725
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   726
    (holder := builder bindingAt:#modifiedChannel) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   727
        builder aspectAt:#modifiedChannel put:(holder :=  false asValue).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   728
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   729
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   730
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   731
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   732
selectionHolder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   733
    "holder which keeps the current selection
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   734
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   735
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   736
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   737
    (holder := builder bindingAt:#selectionHolder) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   738
        holder := AspectAdaptor new subject:self; forAspect:#selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   739
        builder aspectAt:#selectionHolder put:holder.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   740
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   741
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   742
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   743
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   744
specChannel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   745
    "holder which keeps the current tab specification
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   746
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   747
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   748
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   749
    (holder := builder bindingAt:#specChannel) isNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   750
        builder aspectAt:#specChannel put:(holder :=  ValueHolder new).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   751
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   752
    ^ holder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   753
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   754
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   755
!TabItemEditor methodsFor:'building'!
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   756
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   757
buildFrom:aClass andSelector:aSelector
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   758
    "build from class and selector
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   759
    "
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   760
    |spec list validClSl|
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   761
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   762
    self doNew.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   763
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   764
    selector  := nil.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   765
    className := self resolveName:aClass.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   766
    validClSl := false.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   767
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   768
    className notNil ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   769
        aSelector notNil ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   770
            validClSl := true.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   771
            selector  := aSelector asSymbol.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   772
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   773
            (className respondsTo:selector) ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   774
                spec := className perform:selector.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   775
                list := self listOfLabels.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   776
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   777
                spec size ~~ 0 ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   778
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   779
                    rebuildMode := true.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   780
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   781
                    spec do:[:aTab|
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   782
                        list add:aTab label.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   783
                        listOfTabs add:aTab.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   784
                    ].
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   785
                    rebuildMode := false.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   786
                    self addToHistory:(className name, ' ', selector) -> #loadFromMessage:                        
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   787
                ]
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   788
            ]
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   789
        ]
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   790
    ].
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   791
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   792
    self hasClassAndSelector value:validClSl.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   793
    self modified:false.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   794
    hasChanged := false.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   795
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   796
    listOfTabs notEmpty ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   797
        self selectionHolder value:1
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   798
    ].
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   799
!
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   800
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   801
loadFromMessage:aMessage
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   802
    "load tabs from class and selector derived from history
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   803
    "
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   804
    |msg cls|
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   805
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   806
    aMessage notNil ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   807
        msg := aMessage asCollectionOfWords.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   808
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   809
        (msg size == 2 and:[(cls := self resolveName:(msg at:1)) notNil]) ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   810
            self buildFrom:cls andSelector:((msg at:2) asSymbol)
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   811
        ]
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   812
    ]
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   813
! !
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   814
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   815
!TabItemEditor methodsFor:'change & update'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   816
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   817
update:something with:aParameter from:someObject
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   818
    "one of my aspects has changed; update modified channel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   819
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   820
    self modified:true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   821
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   822
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   823
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   824
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   825
!TabItemEditor methodsFor:'selection'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   826
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   827
selectedIndex
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   828
    ^ selectedIndex
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   829
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   830
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   831
selectedIndex:anIndex
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   832
    |s oldSel|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   833
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   834
    oldSel := selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   835
    selectedIndex := anIndex ? 0.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   836
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   837
    selectedIndex == oldSel ifTrue:[^ self].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   838
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   839
    oldSel == 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   840
        self specChannel value:(self class tabSpec)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   841
    ] ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   842
        selectedIndex == 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   843
            self specChannel value:nil
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   844
        ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   845
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   846
    self cancel.
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   847
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   848
    testView notNil ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   849
        testView lower
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   850
    ]
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   851
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   852
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   853
!TabItemEditor methodsFor:'startup / release'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   854
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   855
closeRequest
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   856
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   857
    hasChanged ifTrue:[
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
   858
        ( YesNoBox title:'Tab spec was modified!!'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   859
                 yesText:'Waste it and proceed'
7a4749b25748 style revised
tz
parents: 514
diff changeset
   860
                  noText:'Cancel'
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   861
        ) confirm ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   862
            ^ self
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   863
        ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   864
        hasChanged := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   865
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   866
    super closeRequest.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   867
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   868
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   869
initialize
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   870
    "setup aspects used by column description specifications
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   871
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   872
    |holder|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   873
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   874
    super initialize.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   875
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   876
    aspects       := IdentityDictionary new.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   877
    listOfTabs    := OrderedCollection new.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   878
    hasChanged    := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   879
    selectedIndex := 0.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   880
    rebuildMode   := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   881
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   882
   #(
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   883
        label
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   884
        translateLabel
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   885
        labelForegroundColor
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   886
        enabled
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   887
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   888
    ) do:[:aKey|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   889
        aspects at:aKey put:(holder := ValueHolder new).
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   890
        holder addDependent:self.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   891
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   892
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   893
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   894
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   895
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   896
openModalOnClass:aClass andSelector:aSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   897
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   898
    className := aClass.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   899
    selector  := aSelector.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   900
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   901
    super openInterfaceModal.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   902
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   903
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   904
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   905
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   906
openOnClass:aClass andSelector:aSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   907
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   908
    className := aClass.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   909
    selector  := aSelector.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   910
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   911
    super openInterface.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   912
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   913
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   914
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   915
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   916
postBuildWith:builder
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   917
    self buildFrom:className andSelector:selector.
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   918
    testView := builder componentAt:#TestView.
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   919
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   920
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   921
!TabItemEditor methodsFor:'user interactions'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   922
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   923
doCopyTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   924
    "copy selected tab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   925
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   926
    selectedIndex ~~ 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   927
        self clipboard:(listOfTabs at:selectedIndex) deepCopy
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   928
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   929
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   930
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   931
doCreateTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   932
    |tab|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   933
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   934
    tab := TabItem label:'label'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   935
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   936
    listOfTabs add:tab afterIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   937
    self listOfLabels add:(tab label) afterIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   938
    hasChanged := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   939
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   940
    selectedIndex == 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   941
        self selectionHolder value:1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   942
    ] ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   943
        self cancel.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   944
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   945
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   946
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   947
doCutTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   948
    "cut selected tab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   949
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   950
    |list index|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   951
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   952
    (index := selectedIndex) ~~ 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   953
        list := self listOfLabels.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   954
        self clipboard:(listOfTabs at:index) deepCopy.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   955
        self selectionHolder value:0.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   956
        listOfTabs removeIndex:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   957
        list removeIndex:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   958
        hasChanged := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   959
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   960
        index > list size ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   961
            index := index - 1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   962
        ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   963
        self selectionHolder value:index
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   964
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   965
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   966
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   967
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   968
doDefineClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   969
    "launch a dialog to define class and selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   970
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   971
    |cls sel bindings|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   972
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   973
    bindings := IdentityDictionary new.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   974
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   975
    [true] whileTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   976
        cls := className notNil ifTrue:[className name] ifFalse:['NewApplication'].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   977
        sel := selector  ? 'tabItemList'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   978
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   979
        bindings at:#className put:cls asValue.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   980
        bindings at:#selector  put:sel asValue.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   981
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   982
        (self openDialogInterface:#nameAndSelectorSpec withBindings:bindings)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   983
        ifFalse:[ ^ self ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   984
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   985
        cls := (bindings at:#className) value withoutSeparators.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   986
        sel := (bindings at:#selector)  value withoutSeparators.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   987
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   988
        (cls := self resolveName:cls) notNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   989
            className := cls.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   990
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   991
            sel notNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   992
                selector := sel asSymbol.
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   993
                self hasClassAndSelector value:true.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   994
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   995
                listOfTabs size == 0 ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   996
                    self buildFrom:className andSelector:selector
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   997
                ].
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
   998
                ^ self
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
   999
            ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1000
        ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1001
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1002
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1003
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1004
doInstallAspect
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1005
    "generate aspect method
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1006
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1007
    |code|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1008
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1009
    className isNil ifTrue:[ ^ self information:'No valid class defined!!'].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1010
    selector isNil  ifTrue:[ ^ self information:'No selector defined!!'   ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1011
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1012
    (className canUnderstand:selector) ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1013
        "/ method already exists, do not overwrite the method automaticaly
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1014
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1015
        ( YesNoBox title:'method '
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1016
                         , (Text string:('#', selector) emphasis:#bold)
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1017
                         , ' already exists'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1018
                 yesText:'overwrite'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1019
                  noText:'cancel'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1020
        ) confirm ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1021
            ^ self
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1022
        ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1023
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1024
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1025
    code := '!!' , className name , ' methodsFor:''aspects''!!\\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1026
            selector , '\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1027
            '    "automatically generated by TabItem Editor ..."\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1028
            '\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1029
            '    |list|\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1030
            '\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1031
            '    (list := builder bindingAt:#' , selector , ') isNil ifTrue:[\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1032
            '        builder aspectAt:#' , selector, ' put:(list := self class ', selector, ').\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1033
            '    ].\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1034
            '    ^ list\' ,
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1035
            '!! !!\\'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1036
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1037
    (ReadStream on:(code withCRs)) fileIn
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1038
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1039
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1040
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1041
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1042
doInstallSpec
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1043
    "generate code for class and instance
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1044
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1045
    |code spec category mthd|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1046
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1047
    (className isNil or:[selector isNil]) ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1048
        self doDefineClassAndSelector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1049
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1050
    className isNil ifTrue:[ ^ self information:'No valid class defined!!'].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1051
    selector isNil  ifTrue:[ ^ self information:'No selector defined!!'   ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1052
    listOfTabs isEmpty ifTrue:[ ^ self information:'No valid tabs defined!!' ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1053
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1054
    spec  := WriteStream on:String new.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1055
    UISpecification prettyPrintSpecArray:(listOfTabs literalArrayEncoding) on:spec indent:5.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1056
    spec := spec contents.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1057
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1058
    "/ if that method already exists, do not overwrite the category
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1059
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1060
    category := 'interface specs'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1061
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1062
    (mthd := className class compiledMethodAt:selector) notNil ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1063
        category := mthd category.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1064
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1065
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1066
    code := Character excla asString 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1067
            , className name , ' class methodsFor:' , category storeString
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1068
            , Character excla asString , '\\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1069
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1070
            , selector , '\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1071
            , '    "this window spec was automatically generated by the ST/X TabItemEditor"\\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1072
            , '    "do not manually edit this - the builder may not be able to\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1073
            , '     handle the specification if its corrupted."\\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1074
            , '    "\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1075
            , '     TabItemEditor new openOnClass:' , className name , ' andSelector:#' , selector , '\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1076
            , '    "\'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1077
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1078
    code := code 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1079
            , '\'
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
  1080
            , '    <resource: #tabList>\\'
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1081
            , '    ^\' 
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1082
            , '     ', spec, '\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1083
            , '      collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1084
            , '\'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1085
            , Character excla asString
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1086
            , ' '
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1087
            , Character excla asString
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1088
            , '\\'.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1089
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1090
    code := code withCRs.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1091
    (ReadStream on:code) fileIn.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1092
    hasChanged := false.
526
7a4749b25748 style revised
tz
parents: 514
diff changeset
  1093
    self addToHistory:(className name, ' ', selector) -> #loadFromMessage:.
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1094
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1095
    (className canUnderstand:selector) ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1096
        (YesNoBox confirm:'install aspect method') ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1097
            self doInstallAspect
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1098
        ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1099
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1100
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1101
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1102
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1103
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1104
doMoveTabUpOrDown:what
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1105
    "step up or down
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1106
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1107
    |tab list index|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1108
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1109
    (selectedIndex ~~ 0 and:[listOfTabs size > 1]) ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1110
        ^ self
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1111
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1112
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1113
    list := self listOfLabels.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1114
    tab  := listOfTabs at:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1115
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1116
    list removeIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1117
    listOfTabs removeIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1118
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1119
    what == #down ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1120
        index := selectedIndex > list size ifTrue:[1]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1121
                                          ifFalse:[selectedIndex + 1]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1122
    ] ifFalse:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1123
        index := selectedIndex == 1 ifTrue:[list size + 1]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1124
                                   ifFalse:[selectedIndex - 1]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1125
    ].
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1126
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1127
    list add:(tab label) beforeIndex:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1128
    listOfTabs add:tab beforeIndex:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1129
    hasChanged  := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1130
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1131
    rebuildMode := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1132
    self selectionHolder value:index.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1133
    rebuildMode := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1134
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1135
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1136
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1137
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1138
doNew
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1139
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1140
    self modified:false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1141
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1142
    rebuildMode := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1143
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1144
    self selectionHolder value:0.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1145
    self listOfLabels removeAll.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1146
    listOfTabs removeAll.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1147
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1148
    testView notNil ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1149
        testView lower
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1150
    ].
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1151
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1152
    hasChanged  := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1153
    rebuildMode := false.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1154
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1155
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1156
doPasteTab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1157
    "paste a tab
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1158
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1159
    |tab|
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1160
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1161
    tab := self class clipboard deepCopy.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1162
    listOfTabs add:tab afterIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1163
    self listOfLabels add:(tab label) afterIndex:selectedIndex.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1164
    hasChanged := true.
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1165
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1166
    selectedIndex == 0 ifTrue:[
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1167
        self selectionHolder value:1
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1168
    ]
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1169
!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1170
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1171
doReload
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1172
    "reload from class and selector
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1173
    "
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1174
    self buildFrom:className andSelector:selector
514
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1175
!
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1176
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1177
doTest
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1178
    "run a test
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1179
    "
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1180
    |tabView list|
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1181
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1182
    self selectionHolder value:nil.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1183
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1184
    listOfTabs size ~~ 0 ifTrue:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1185
        list := listOfTabs collect:[:aTab||t|
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1186
            t := aTab copy.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1187
            t setAttributesFromClass:className.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1188
            t
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1189
        ]
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1190
    ] ifFalse:[
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1191
        list := nil
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1192
    ].
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1193
    tabView  := builder componentAt:#TestTabsView.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1194
    tabView list:list.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1195
    testView raise.
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1196
5ac07e96e448 support of UIPainter
ca
parents: 500
diff changeset
  1197
500
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1198
! !
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1199
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1200
!TabItemEditor class methodsFor:'documentation'!
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1201
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1202
version
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1203
    ^ '$Header$'
c18c7621f8e9 initial checkin
ca
parents:
diff changeset
  1204
! !