TabListEditor.st
author Claus Gittinger <cg@exept.de>
Mon, 10 Jan 2000 17:03:20 +0100
changeset 1289 76e5acce57a6
parent 1245 fd0127c25b66
child 1325 a7c38b60f2fb
permissions -rw-r--r--
use new SCMUtilities class
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
     1
"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
cc3413fc1afb initial checkin
tz
parents:
diff changeset
     3
              All Rights Reserved
cc3413fc1afb initial checkin
tz
parents:
diff changeset
     4
cc3413fc1afb initial checkin
tz
parents:
diff changeset
     5
 This software is furnished under a license and may be used
cc3413fc1afb initial checkin
tz
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
cc3413fc1afb initial checkin
tz
parents:
diff changeset
     7
 inclusion of the above copyright notice. This software may not
cc3413fc1afb initial checkin
tz
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
cc3413fc1afb initial checkin
tz
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    10
 hereby transferred.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    11
"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    12
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    13
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    14
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    15
ResourceSpecEditor subclass:#TabListEditor
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    16
	instanceVariableNames:'rebuildMode testView listOfTabs selectedIndex'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    17
	classVariableNames:''
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    18
	poolDictionaries:''
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    19
	category:'Interface-UIPainter'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    20
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    21
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    22
!TabListEditor class methodsFor:'documentation'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    23
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    24
copyright
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    25
"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    26
 COPYRIGHT (c) 1997 by eXept Software AG
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    27
              All Rights Reserved
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    28
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    29
 This software is furnished under a license and may be used
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    30
 only in accordance with the terms of that license and with the
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    31
 inclusion of the above copyright notice. This software may not
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    32
 be provided or otherwise made available to, or used by, any
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    33
 other person.  No title to or ownership of the software is
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    34
 hereby transferred.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    35
"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    36
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    37
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    38
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    39
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    40
documentation
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    41
"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    42
    The TabListEditor allows you to create, modify or just inspect
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    43
    tab lists for tab headers or note books.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    44
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    45
    [start with:]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    46
        TabItemEditor open
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    47
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    48
    [see also:]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    49
        TabItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    50
        TabView
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    51
        NoteBookView
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    52
        UIPainter
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    53
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    54
    [author:]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    55
        Claus Atzkern, eXept Software AG
749
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
    56
        Thomas Zwick, eXept Software AG
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    57
"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    58
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    59
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    60
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    61
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    62
!TabListEditor class methodsFor:'instance creation'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    63
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    64
openModalOnTabList: aTabList
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    65
    "Open a TabListEditor modal on aTabList"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    66
    "self openModalOnTabList: (Array with: (TabItem label: 'Tab Item 1'))"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    67
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    68
    ^self new openModalOnTabList: aTabList
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    69
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    70
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    71
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    72
!TabListEditor class methodsFor:'accessing'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    73
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    74
resourceType
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    75
    "get the type of resource of the method generated by the TabListEditor"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    76
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    77
    ^#tabList
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    78
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    79
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    80
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    81
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    82
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    83
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    84
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    85
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    86
!TabListEditor class methodsFor:'aspects'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    87
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    88
aspects
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    89
    "get the aspects for the attributes of the tab list components"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    90
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    91
    ^#(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    92
        label
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    93
        translateLabel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    94
        labelForegroundColor
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    95
        enabled
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    96
        editAgument
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    97
    )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    98
cc3413fc1afb initial checkin
tz
parents:
diff changeset
    99
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   100
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   101
!TabListEditor class methodsFor:'help specs'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   102
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   103
helpSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   104
    "This resource specification was automatically generated
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   105
     by the UIHelpTool of ST/X."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   106
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   107
    "Do not manually edit this!! If it is corrupted,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   108
     the UIHelpTool may not be able to read the specification."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   109
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   110
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   111
     UIHelpTool openOnClass:TabListEditor    
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   112
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   113
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   114
    <resource: #help>
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   115
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   116
    ^super helpSpec addPairsFrom:#(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   117
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   118
#addTabItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   119
'Adds a new tab item.'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   120
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   121
#argument
1183
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   122
'An optional argument stored with the tab item.'
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   123
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   124
#canSelect
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   125
'Turns on/off whether the tab item is selectable.'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   126
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   127
#color
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   128
'Defines the foreground color of the label. The default color derives from the style sheet.'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   129
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   130
#fileCreateAspectMethod
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   131
'Creates the aspect method for the tab list.'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   132
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   133
#fileLoad
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   134
'Opens a dialog for selecting and loading a tab list spec from a class.'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   135
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   136
#fileNew
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   137
'Creates a new tab list.'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   138
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   139
#fileSave
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   140
'Saves current tab list.'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   141
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   142
#label
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   143
'Label of the tab item.'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   144
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   145
#labelDerivesFromApplication
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   146
'If turned on, the label''s string is a selector returning a string or bitmap image, which is used as logo in the tab item.'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   147
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   148
#testPreview
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   149
'Turns on/off preview of the tab list.'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   150
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   151
)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   152
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   153
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   154
!TabListEditor class methodsFor:'image specs'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   155
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   156
newTabItemIcon
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   157
    "This resource specification was automatically generated
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   158
     by the ImageEditor of ST/X."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   159
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   160
    "Do not manually edit this!!!! If it is corrupted,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   161
     the ImageEditor may not be able to read the specification."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   162
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   163
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   164
     ImageEditor openOnClass:self andSelector:#newTabItemIcon
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   165
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   166
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   167
    <resource: #image>
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   168
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   169
    ^Icon
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   170
        constantNamed:#'TabListEditor newTabItemIcon'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   171
        ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'U@@@@EUPUEUUVEUPUF**+EUPUF**+EUPUF**+EUP@F**+@@@EV***UV@F*****+@F KNC*+NF(("H*+@F((BC +EF(("H*+@F(("C*+MF*****+@F"@ H*K@F"""(LK@F"" ("K@F"""(*K@F"" H*K@F*****+HK??????@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 127 127]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'G?<@G?<@G?<@G?<@G?<@???<???<???<???????<???<???<???<???????=???<???????<???????<???<???=') ; yourself); yourself]! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   172
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   173
!TabListEditor class methodsFor:'interface specs'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   174
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   175
tabSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   176
    "This resource specification was automatically generated
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   177
     by the UIPainter of ST/X."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   178
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   179
    "Do not manually edit this!! If it is corrupted,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   180
     the UIPainter may not be able to read the specification."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   181
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   182
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   183
     UIPainter new openOnClass:TabListEditor andSelector:#tabSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   184
     TabListEditor new openInterface:#tabSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   185
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   186
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   187
    <resource: #canvas>
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   188
1183
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   189
    ^ 
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   190
     #(#FullSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   191
        #name: #tabSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   192
        #window: 
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   193
       #(#WindowSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   194
          #label: 'Tab Basic'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   195
          #name: 'Tab Basic'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   196
          #layout: #(#LayoutFrame 220 0 200 0 634 0 425 0)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   197
          #min: #(#Point 10 10)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   198
          #max: #(#Point 1280 1024)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   199
          #bounds: #(#Rectangle 220 200 635 426)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   200
        )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   201
        #component: 
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   202
       #(#SpecCollection
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   203
          #collection: #(
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   204
           #(#LabelSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   205
              #label: 'Label:'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   206
              #name: 'Label'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   207
              #layout: #(#AlignmentOrigin 98 0 26 0 1 0.5)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   208
              #resizeForLabel: true
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   209
            )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   210
           #(#InputFieldSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   211
              #name: 'LabelField'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   212
              #layout: #(#LayoutFrame 100 0 15 0 -5 1.0 37 0)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   213
              #activeHelpKey: #label
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   214
              #model: #label
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   215
              #acceptOnLostFocus: true
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   216
              #acceptChannel: #acceptChannel
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   217
              #modifiedChannel: #modifiedChannel
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   218
              #acceptOnPointerLeave: false
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   219
            )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   220
           #(#CheckBoxSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   221
              #label: 'Application provides translation '
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   222
              #name: 'TranslateLabel'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   223
              #layout: #(#LayoutFrame 59 0 45 0 -8 1 71 0)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   224
              #activeHelpKey: #labelDerivesFromApplication
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   225
              #model: #translateLabel
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   226
            )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   227
           #(#LabelSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   228
              #label: 'Argument:'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   229
              #name: 'ArgumentLabel'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   230
              #layout: #(#AlignmentOrigin 98 0 182 0 1 0.5)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   231
              #resizeForLabel: true
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   232
            )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   233
           #(#InputFieldSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   234
              #name: 'ArgumentField'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   235
              #layout: #(#LayoutFrame 100 0 171 0 -5 1.0 193 0)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   236
              #activeHelpKey: #argument
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   237
              #model: #editAgument
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   238
              #acceptOnLostFocus: true
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   239
              #acceptChannel: #acceptChannel
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   240
              #modifiedChannel: #modifiedChannel
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   241
              #acceptOnPointerLeave: false
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   242
            )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   243
           #(#LabelSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   244
              #label: 'Color:'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   245
              #name: 'ForegroundLabel'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   246
              #layout: #(#AlignmentOrigin 98 0 91 0 1 0.5)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   247
              #resizeForLabel: true
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   248
              #adjust: #right
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   249
            )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   250
           #(#ColorMenuSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   251
              #name: 'ForegroundColorMenu'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   252
              #layout: #(#LayoutFrame 100 0 79 0 -5 1.0 101 0)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   253
              #activeHelpKey: #color
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   254
              #model: #labelForegroundColor
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   255
              #labelsAreColored: false
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   256
            )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   257
           #(#CheckBoxSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   258
              #label: 'Can Select'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   259
              #name: 'CanSelect'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   260
              #layout: #(#LayoutFrame 59 0 110 0 -8 1 132 0)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   261
              #activeHelpKey: #canSelect
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   262
              #model: #enabled
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   263
            )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   264
           )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   265
         
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   266
        )
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   267
      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   268
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   269
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   270
windowSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   271
    "This resource specification was automatically generated
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   272
     by the UIPainter of ST/X."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   273
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   274
    "Do not manually edit this!! If it is corrupted,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   275
     the UIPainter may not be able to read the specification."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   276
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   277
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   278
     UIPainter new openOnClass:TabListEditor andSelector:#windowSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   279
     TabListEditor new openInterface:#windowSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   280
     TabListEditor open
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   281
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   282
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   283
    <resource: #canvas>
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   284
1183
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   285
    ^ 
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   286
     #(#FullSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   287
        #name: #windowSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   288
        #window: 
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   289
       #(#WindowSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   290
          #label: 'Tab List Editor'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   291
          #name: 'Tab List Editor'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   292
          #layout: #(#LayoutFrame 58 0 290 0 659 0 707 0)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   293
          #min: #(#Point 440 280)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   294
          #max: #(#Point 1152 900)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   295
          #bounds: #(#Rectangle 58 290 660 708)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   296
          #menu: #menu
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   297
        )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   298
        #component: 
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   299
       #(#SpecCollection
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   300
          #collection: #(
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   301
           #(#MenuPanelSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   302
              #name: 'menuToolbarView'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   303
              #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 34 0)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   304
              #menu: #menuToolbar
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   305
              #showSeparatingLines: true
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   306
            )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   307
           #(#VariableHorizontalPanelSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   308
              #name: 'VariablePanel'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   309
              #layout: #(#LayoutFrame 0 0.0 36 0.0 0 1.0 -26 1.0)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   310
              #handles: #(#Any 0.259875 1.0)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   311
              #component: 
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   312
             #(#SpecCollection
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   313
                #collection: #(
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   314
                 #(#SequenceViewSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   315
                    #name: 'ColumnView'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   316
                    #model: #selectionHolder
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   317
                    #menu: #menuEdit
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   318
                    #hasHorizontalScrollBar: true
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   319
                    #hasVerticalScrollBar: true
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   320
                    #miniScrollerHorizontal: true
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   321
                    #useIndex: true
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   322
                    #sequenceList: #listOfLabels
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   323
                  )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   324
                 #(#ViewSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   325
                    #name: 'SpecView'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   326
                    #level: -1
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   327
                    #component: 
1183
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   328
                   #(#SpecCollection
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   329
                      #collection: #(
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   330
                       #(#ViewSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   331
                          #name: 'TestView'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   332
                          #layout: #(#LayoutFrame 1 0.0 0 0.0 0 1.0 0 1.0)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   333
                          #component: 
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   334
                         #(#SpecCollection
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   335
                            #collection: #(
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   336
                             #(#TabViewSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   337
                                #name: 'TestTabsView'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   338
                                #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 0.5)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   339
                              )
1183
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   340
                             )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   341
                           
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   342
                          )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   343
                        )
1183
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   344
                       #(#SubCanvasSpec
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   345
                          #name: 'specCanvas'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   346
                          #layout: #(#LayoutFrame 1 0.0 0 0.0 0 1.0 -30 1.0)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   347
                          #specHolder: #specChannel
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   348
                        )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   349
                       #(#UISubSpecification
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   350
                          #name: 'subSpec'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   351
                          #layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   352
                          #majorKey: #ToolApplicationModel
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   353
                          #minorKey: #windowSpecForCommit
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   354
                        )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   355
                       )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   356
                     
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   357
                    )
1183
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   358
                  )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   359
                 )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   360
               
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   361
              )
1183
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   362
            )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   363
           #(#UISubSpecification
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   364
              #name: 'infoBarSubSpec'
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   365
              #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   366
              #majorKey: #ToolApplicationModel
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   367
              #minorKey: #windowSpecForInfoBar
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   368
            )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   369
           )
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   370
         
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   371
        )
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   372
      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   373
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   374
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   375
!TabListEditor class methodsFor:'menu specs'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   376
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   377
menu
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   378
    "This resource specification was automatically generated
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   379
     by the MenuEditor of ST/X."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   380
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   381
    "Do not manually edit this!! If it is corrupted,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   382
     the MenuEditor may not be able to read the specification."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   383
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   384
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   385
     MenuEditor new openOnClass:TabListEditor andSelector:#menu
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   386
     (Menu new fromLiteralArrayEncoding:(TabListEditor menu)) startUp
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   387
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   388
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   389
    <resource: #menu>
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   390
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   391
    ^
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   392
     
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   393
       #(#Menu
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   394
          
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   395
           #(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   396
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   397
                #label: 'About'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   398
                #activeHelpKey: #about
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   399
                #labelImage: #(#ResourceRetriever nil #menuIcon)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   400
                #submenuChannel: #menuAbout
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   401
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   402
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   403
                #label: 'File'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   404
                #activeHelpKey: #file
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   405
                #submenu: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   406
                 #(#Menu
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   407
                    
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   408
                     #(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   409
                       #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   410
                          #label: 'New'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   411
                          #value: #doNew
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   412
                          #activeHelpKey: #fileNew
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   413
                      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   414
                       #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   415
                          #label: '-'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   416
                      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   417
                       #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   418
                          #label: 'Load...'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   419
                          #translateLabel: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   420
                          #value: #doLoad
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   421
                          #activeHelpKey: #fileLoad
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   422
                      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   423
                       #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   424
                          #label: '-'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   425
                      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   426
                       #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   427
                          #label: 'Save'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   428
                          #value: #doSave
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   429
                          #activeHelpKey: #fileSave
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   430
                      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   431
                       #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   432
                          #label: 'Save As...'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   433
                          #value: #doSaveAs
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   434
                          #activeHelpKey: #fileSave
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   435
                      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   436
                       #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   437
                          #label: '-'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   438
                      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   439
                       #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   440
                          #label: 'Browse Class'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   441
                          #value: #doBrowseClass
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   442
                          #activeHelpKey: #fileBrowseClass
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   443
                      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   444
                       #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   445
                          #label: '-'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   446
                      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   447
                       #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   448
                          #label: 'Exit'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   449
                          #value: #closeRequest
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   450
                          #activeHelpKey: #fileExit
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   451
                      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   452
                    ) nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   453
                    nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   454
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   455
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   456
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   457
                #label: 'Edit'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   458
                #activeHelpKey: #edit
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   459
                #submenuChannel: #menuEdit
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   460
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   461
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   462
                #label: 'Add'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   463
                #activeHelpKey: #add
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   464
                #submenu: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   465
                 #(#Menu
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   466
                    
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   467
                     #(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   468
                       #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   469
                          #label: 'Tab Item'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   470
                          #value: #doCreateTabItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   471
                          #activeHelpKey: #addTabItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   472
                          #labelImage: #(#ResourceRetriever nil #newTabItemIcon 'Tab Item')
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   473
                      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   474
                    ) nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   475
                    nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   476
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   477
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   478
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   479
                #label: 'Generate'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   480
                #activeHelpKey: #add
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   481
                #submenu: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   482
                 #(#Menu
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   483
                    
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   484
                     #(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   485
                       #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   486
                          #label: 'Aspect Method'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   487
                          #value: #doGenerateAspectMethod
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   488
                          #activeHelpKey: #fileCreateAspectMethod
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   489
                          #enabled: #hasClassAndSelector
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   490
                      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   491
                    ) nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   492
                    nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   493
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   494
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   495
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   496
                #label: 'Test'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   497
                #activeHelpKey: #test
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   498
                #submenu: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   499
                 #(#Menu
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   500
                    
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   501
                     #(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   502
                       #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   503
                          #label: 'Preview'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   504
                          #activeHelpKey: #testPreview
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   505
                          #enabled: #canShowTestMode
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   506
                          #indication: #testMode
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   507
                      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   508
                    ) nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   509
                    nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   510
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   511
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   512
             #(#MenuItem
749
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
   513
                #label: 'History'
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
   514
                #activeHelpKey: #history
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
   515
                #submenuChannel: #menuHistory
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
   516
            )
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
   517
             #(#MenuItem
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   518
                #label: 'Help'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   519
                #startGroup: #right
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   520
                #activeHelpKey: #help
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   521
                #submenuChannel: #menuHelp
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   522
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   523
          ) nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   524
          nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   525
      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   526
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   527
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   528
menuEdit
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   529
    "This resource specification was automatically generated
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   530
     by the MenuEditor of ST/X."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   531
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   532
    "Do not manually edit this!! If it is corrupted,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   533
     the MenuEditor may not be able to read the specification."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   534
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   535
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   536
     MenuEditor new openOnClass:TabListEditor andSelector:#menuEdit
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   537
     (Menu new fromLiteralArrayEncoding:(TabListEditor menuEdit)) startUp
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   538
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   539
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   540
    <resource: #menu>
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   541
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   542
    ^
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   543
     
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   544
       #(#Menu
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   545
          
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   546
           #(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   547
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   548
                #label: 'Cut'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   549
                #value: #doCut
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   550
                #activeHelpKey: #editCut
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   551
                #enabled: #valueOfCanCut
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   552
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   553
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   554
                #label: 'Copy'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   555
                #value: #doCopy
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   556
                #activeHelpKey: #editCopy
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   557
                #enabled: #valueOfCanCopy
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   558
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   559
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   560
                #label: 'Paste'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   561
                #value: #doPaste
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   562
                #activeHelpKey: #editPaste
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   563
                #enabled: #valueOfCanPaste
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   564
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   565
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   566
                #label: 'Delete'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   567
                #value: #doDelete
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   568
                #activeHelpKey: #editPaste
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   569
                #enabled: #valueOfCanCut
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   570
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   571
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   572
                #label: '-'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   573
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   574
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   575
                #label: 'Move Up'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   576
                #value: #doMoveTabUpOrDown:
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   577
                #activeHelpKey: #editMoveUp
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   578
                #enabled: #canMoveTabItemUpOrDown
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   579
                #argument: #up
883
10afc79658a6 images moved to class Icon
tz
parents: 749
diff changeset
   580
                #labelImage: #(#ResourceRetriever #Icon #upIcon 'Move Up')
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   581
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   582
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   583
                #label: 'Move Down'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   584
                #value: #doMoveTabUpOrDown:
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   585
                #activeHelpKey: #editMoveDown
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   586
                #enabled: #canMoveTabItemUpOrDown
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   587
                #argument: #down
883
10afc79658a6 images moved to class Icon
tz
parents: 749
diff changeset
   588
                #labelImage: #(#ResourceRetriever #Icon #downIcon 'Move Down')
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   589
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   590
          ) nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   591
          nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   592
      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   593
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   594
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   595
menuToolbar
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   596
    "This resource specification was automatically generated
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   597
     by the MenuEditor of ST/X."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   598
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   599
    "Do not manually edit this!! If it is corrupted,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   600
     the MenuEditor may not be able to read the specification."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   601
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   602
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   603
     MenuEditor new openOnClass:TabListEditor andSelector:#menuToolbar
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   604
     (Menu new fromLiteralArrayEncoding:(TabListEditor menuToolbar)) startUp
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   605
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   606
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   607
    <resource: #menu>
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   608
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   609
    ^
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   610
     
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   611
       #(#Menu
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   612
          
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   613
           #(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   614
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   615
                #label: 'New'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   616
                #isButton: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   617
                #value: #doNew
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   618
                #activeHelpKey: #fileNew
883
10afc79658a6 images moved to class Icon
tz
parents: 749
diff changeset
   619
                #labelImage: #(#ResourceRetriever #Icon #newIcon)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   620
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   621
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   622
                #label: 'Load'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   623
                #isButton: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   624
                #value: #doLoad
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   625
                #activeHelpKey: #fileLoad
883
10afc79658a6 images moved to class Icon
tz
parents: 749
diff changeset
   626
                #labelImage: #(#ResourceRetriever #Icon #loadIcon)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   627
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   628
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   629
                #label: 'Save'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   630
                #isButton: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   631
                #value: #doSave
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   632
                #activeHelpKey: #fileSave
883
10afc79658a6 images moved to class Icon
tz
parents: 749
diff changeset
   633
                #labelImage: #(#ResourceRetriever #Icon #saveIcon)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   634
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   635
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   636
                #label: ''
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   637
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   638
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   639
                #label: 'Cut'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   640
                #isButton: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   641
                #value: #doCut
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   642
                #activeHelpKey: #editCut
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   643
                #enabled: #valueOfCanCut
883
10afc79658a6 images moved to class Icon
tz
parents: 749
diff changeset
   644
                #labelImage: #(#ResourceRetriever #Icon #cutIcon)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   645
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   646
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   647
                #label: 'Copy'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   648
                #isButton: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   649
                #value: #doCopy
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   650
                #activeHelpKey: #editCopy
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   651
                #enabled: #valueOfCanCopy
883
10afc79658a6 images moved to class Icon
tz
parents: 749
diff changeset
   652
                #labelImage: #(#ResourceRetriever #Icon #copyIcon)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   653
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   654
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   655
                #label: 'Paste'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   656
                #isButton: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   657
                #value: #doPaste
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   658
                #activeHelpKey: #editPaste
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   659
                #enabled: #valueOfCanPaste
883
10afc79658a6 images moved to class Icon
tz
parents: 749
diff changeset
   660
                #labelImage: #(#ResourceRetriever #Icon #pasteIcon)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   661
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   662
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   663
                #label: 'Delete'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   664
                #isButton: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   665
                #value: #doDelete
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   666
                #activeHelpKey: #editDelete
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   667
                #enabled: #valueOfCanCut
883
10afc79658a6 images moved to class Icon
tz
parents: 749
diff changeset
   668
                #labelImage: #(#ResourceRetriever #Icon #deleteIcon)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   669
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   670
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   671
                #label: ''
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   672
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   673
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   674
                #label: 'Add Tab Item'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   675
                #isButton: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   676
                #value: #doCreateTabItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   677
                #activeHelpKey: #addTabItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   678
                #labelImage: #(#ResourceRetriever nil #newTabItemIcon)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   679
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   680
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   681
                #label: ''
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   682
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   683
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   684
                #label: 'Move Tab Up'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   685
                #isButton: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   686
                #value: #doMoveTabUpOrDown:
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   687
                #activeHelpKey: #editMoveUp
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   688
                #enabled: #canMoveTabItemUpOrDown
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   689
                #argument: #up
883
10afc79658a6 images moved to class Icon
tz
parents: 749
diff changeset
   690
                #labelImage: #(#ResourceRetriever #Icon #upIcon)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   691
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   692
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   693
                #label: 'Move Tab Down'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   694
                #isButton: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   695
                #value: #doMoveTabUpOrDown:
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   696
                #activeHelpKey: #editMoveDown
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   697
                #enabled: #canMoveTabItemUpOrDown
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   698
                #argument: #down
883
10afc79658a6 images moved to class Icon
tz
parents: 749
diff changeset
   699
                #labelImage: #(#ResourceRetriever #Icon #downIcon)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   700
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   701
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   702
                #label: ''
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   703
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   704
             #(#MenuItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   705
                #label: 'Preview'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   706
                #activeHelpKey: #testPreview
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   707
                #enabled: #canShowTestMode
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   708
                #indication: #testMode
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   709
            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   710
          ) nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   711
          nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   712
      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   713
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   714
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   715
!TabListEditor methodsFor:'aspects'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   716
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   717
canMoveTabItemUpOrDown
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   718
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   719
    |holder|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   720
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   721
    (holder := builder bindingAt:#canMoveTabItemUpOrDown) isNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   722
        builder aspectAt:#canMoveTabItemUpOrDown put:(holder := false asValue).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   723
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   724
    ^ holder
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   725
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   726
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   727
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   728
canShowTestMode
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   729
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   730
    |holder|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   731
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   732
    (holder := builder bindingAt:#canShowTestMode) isNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   733
        builder aspectAt:#canShowTestMode put:(holder := false asValue).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   734
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   735
    ^ holder
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   736
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   737
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   738
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   739
listOfLabels
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   740
    "returns a holder which keeps the list of tab labels
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   741
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   742
1183
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
   743
    ^ builder listAspectFor:#listOfLabels
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   744
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   745
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   746
selectionHolder
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   747
    "holder which keeps the current selection
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   748
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   749
    |holder|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   750
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   751
    (holder := builder bindingAt:#selectionHolder) isNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   752
        holder := AspectAdaptor new subject:self; forAspect:#selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   753
        builder aspectAt:#selectionHolder put:holder.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   754
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   755
    ^ holder
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   756
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   757
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   758
specChannel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   759
    "holder which keeps the current tab specification
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   760
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   761
    |holder|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   762
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   763
    (holder := builder bindingAt:#specChannel) isNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   764
        builder aspectAt:#specChannel put:(holder :=  ValueHolder new).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   765
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   766
    ^ holder
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   767
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   768
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   769
testMode
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   770
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   771
    |holder|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   772
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   773
    (holder := builder bindingAt:#testMode) isNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   774
        builder aspectAt:#testMode put:(holder := false asValue).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   775
        holder addDependent: self
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   776
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   777
    ^ holder
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   778
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   779
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   780
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   781
!TabListEditor methodsFor:'building'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   782
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   783
buildFromClass:aClass andSelector:aSelector
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   784
    "build from class and selector
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   785
    "
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   786
    |cls spec list selectionHolder|
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   787
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   788
    self testMode value: false.
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   789
    (selectionHolder := self selectionHolder) value:0.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   790
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   791
    "if opened on a tab list"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   792
    (aClass isNil and: [aSelector isNil and: [listOfTabs size > 0]]) 
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   793
    ifTrue:[
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   794
        listOfTabs notEmpty ifTrue:[
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   795
            selectionHolder value:1
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   796
        ].
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   797
        ^ nil
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   798
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   799
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   800
    self listOfLabels removeAll.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   801
    listOfTabs removeAll.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   802
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   803
    testView notNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   804
        testView lower
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   805
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   806
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   807
    rebuildMode := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   808
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   809
    self canShowTestMode value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   810
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   811
    cls := self resolveName:aClass.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   812
    specSelector := aSelector.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   813
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   814
    cls notNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   815
        specSelector notNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   816
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   817
            (cls respondsTo:specSelector) ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   818
                spec := cls perform:specSelector.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   819
                list := self listOfLabels.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   820
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   821
                spec size ~~ 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   822
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   823
                    rebuildMode := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   824
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   825
                    spec do:[:aTab|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   826
                        list add:aTab label.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   827
                        listOfTabs add:aTab.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   828
                    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   829
                    rebuildMode := false.          
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   830
                    self addToHistory:(cls name, ' ', specSelector) -> #loadFromMessage:                        
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   831
                ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   832
            ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   833
        ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   834
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   835
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   836
    modified := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   837
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   838
    listOfTabs notEmpty ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   839
        self selectionHolder value:1
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   840
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   841
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   842
    self updateInfoLabel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   843
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   844
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   845
buildFromResourceSpec: aListSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   846
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   847
    self buildFromTabList: aListSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   848
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   849
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   850
buildFromTabList: aTabList
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   851
    "build from a aTabList"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   852
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   853
    |selectionHolder listOfLabels|
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   854
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   855
    rebuildMode := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   856
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   857
    (selectionHolder := self selectionHolder) value: nil.
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   858
    (listOfLabels := self listOfLabels) removeAll.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   859
    listOfTabs removeAll.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   860
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   861
    aTabList do:[:aTabItem|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   862
        listOfTabs add: aTabItem.
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   863
        listOfLabels add: aTabItem label
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   864
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   865
    rebuildMode := false.          
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   866
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   867
    modified := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   868
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   869
    listOfTabs notEmpty ifTrue:[
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   870
        selectionHolder value:1
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   871
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   872
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   873
    self updateInfoLabel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   874
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   875
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   876
!TabListEditor methodsFor:'change & update'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   877
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   878
update:something with:aParameter from:someObject
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   879
    "one of my aspects has changed; update modified channel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   880
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   881
    super update:something with:aParameter from:someObject.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   882
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   883
    someObject = self testMode
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   884
    ifTrue:[              
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   885
        someObject value
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   886
            ifTrue: [self doTest]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   887
            ifFalse:[testView lower. self selectionHolder value:1].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   888
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   889
        self updateInfoLabel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   890
    ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   891
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   892
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   893
!TabListEditor methodsFor:'help'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   894
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   895
defaultInfoLabel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   896
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   897
    ^self testMode value
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   898
        ifTrue:  ['Test mode']
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   899
        ifFalse: [super defaultInfoLabel]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   900
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   901
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   902
!TabListEditor methodsFor:'selection'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   903
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   904
selectedIndex
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   905
    ^ selectedIndex
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   906
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   907
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   908
selectedIndex:anIndex
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   909
    |oldSel specChannel|
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   910
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   911
    self listOfLabels notEmpty ifTrue: [self canShowTestMode value: true].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   912
    anIndex notNil ifTrue: [self testMode value: false].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   913
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   914
    oldSel := selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   915
    selectedIndex := anIndex ? 0.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   916
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   917
    selectedIndex == oldSel ifTrue:[^ self].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   918
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   919
    specChannel := self specChannel.
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   920
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   921
    oldSel == 0 ifTrue:[
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   922
        specChannel value:(self class tabSpec)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   923
    ] ifFalse:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   924
        selectedIndex == 0 ifTrue:[
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   925
            specChannel value:nil
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   926
        ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   927
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   928
    self cancel.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   929
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   930
    testView notNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   931
        testView lower.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   932
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   933
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   934
    self valueOfCanCut value: (anIndex ~~ 0).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   935
    self valueOfCanCopy value: (anIndex ~~ 0).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   936
    self valueOfCanPaste.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   937
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   938
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   939
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   940
!TabListEditor methodsFor:'startup / release'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   941
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   942
initialize
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   943
    "setup aspects used by column description specifications
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   944
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   945
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   946
    super initialize.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   947
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   948
    listOfTabs    := OrderedCollection new.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   949
    selectedIndex := 0.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   950
    rebuildMode   := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   951
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   952
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   953
openModalOnTabList: aTabList
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   954
    "build a tab list from aTabList and open it modal"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   955
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   956
    super openModalOnResourceSpec: aTabList
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   957
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   958
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   959
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   960
postBuildWith:builder
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   961
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   962
    super postBuildWith:builder.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   963
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   964
    testView := builder componentAt:#TestView.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   965
    (builder componentAt:#ColumnView) selectConditionBlock: [:i|self askForItemModification].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   966
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   967
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   968
!TabListEditor methodsFor:'user actions'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   969
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   970
accept
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   971
    "accept changes
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   972
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   973
    |label|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   974
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   975
    self acceptChannel 
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
   976
	value:true; value:false.      "/ toggle to force inputFields to accept
1066
5096f66ba82d new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents: 883
diff changeset
   977
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   978
    selectedIndex ~~ 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   979
        rebuildMode := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   980
        label := listOfTabs at:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   981
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   982
        aspects keysAndValuesDo:[:aKey :aModel|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   983
            label perform:(aKey , ':') asSymbol with:(aModel value).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   984
        ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   985
        self listOfLabels at:selectedIndex put:(label label).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   986
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   987
        rebuildMode := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   988
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   989
    self cancel.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   990
    modified := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   991
    self valueOfEnablingCommitButtons value: false
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   992
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   993
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   994
cancel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   995
    "cancel all changes
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   996
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   997
    |tab|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   998
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   999
    selectedIndex ~~ 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1000
        tab := listOfTabs at:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1001
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1002
        rebuildMode := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1003
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1004
        aspects keysAndValuesDo:[:aKey :aModel|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1005
            aModel value:(tab perform:aKey)    
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1006
        ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1007
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1008
        rebuildMode := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1009
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1010
    self canMoveTabItemUpOrDown value:(selectedIndex ~~ 0 and:[listOfTabs size > 1]).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1011
    self valueOfEnablingCommitButtons value: false
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1012
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1013
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1014
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1015
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1016
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1017
doCopy
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1018
    "copy selected tab
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1019
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1020
    selectedIndex ~~ 0 ifTrue:[
749
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
  1021
        self clipboard:(listOfTabs at:selectedIndex) deepCopy.
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
  1022
        self updateAllToolInstances.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1023
    ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1024
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1025
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1026
doCreateTabItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1027
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1028
    |tab selectionHolder|
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1029
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1030
    self testMode value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1031
    tab := TabItem label:'Tab Item ', (listOfTabs size + 1) printString.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1032
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1033
    listOfTabs add:tab afterIndex:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1034
    self listOfLabels add:(tab label) afterIndex:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1035
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1036
    selectionHolder := self selectionHolder.
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1037
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1038
    selectedIndex == 0 ifTrue:[
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1039
        selectionHolder value:1
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1040
    ] ifFalse:[    
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1041
        selectionHolder value:selectedIndex + 1.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1042
        self cancel.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1043
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1044
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1045
    modified := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1046
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1047
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1048
doCut
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1049
    "cut selected tab
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1050
    "
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1051
    |listOfLabels index selectionHolder|
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1052
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1053
    (index := selectedIndex) ~~ 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1054
        self testMode value: false.
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1055
        listOfLabels := self listOfLabels.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1056
        self clipboard:(listOfTabs at:index) deepCopy.
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1057
        (selectionHolder := self selectionHolder) value:0.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1058
        listOfTabs removeIndex:index.
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1059
        listOfLabels removeIndex:index.
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1060
        index > listOfLabels size ifTrue:[
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1061
            index := index - 1
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1062
        ].
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1063
        selectionHolder value:index.
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1064
        listOfLabels isEmpty ifTrue: [self canShowTestMode value: false].
749
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
  1065
        self updateAllToolInstances.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1066
        modified := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1067
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1068
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1069
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1070
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1071
doDelete
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1072
    "delete selected tab
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1073
    "
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1074
    |listOfLabels index selectionHolder|
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1075
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1076
    (index := selectedIndex) ~~ 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1077
        self testMode value: false.
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1078
        listOfLabels := self listOfLabels.
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1079
        (selectionHolder := self selectionHolder) value:0.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1080
        listOfTabs removeIndex:index.
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1081
        listOfLabels removeIndex:index.
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1082
        index > listOfLabels size ifTrue:[index := index - 1].
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1083
        selectionHolder value:index.
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1084
        listOfLabels isEmpty ifTrue: [self canShowTestMode value: false].
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1085
        modified := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1086
    ].       
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1087
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1088
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1089
doGenerateAspectMethod
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1090
    "generate aspect method
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1091
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1092
    |cls code|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1093
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1094
    (specClass notNil and:[specSelector notNil])
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1095
    ifFalse:
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1096
    [
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1097
        ^self information:'No class and selector defined!!'   
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1098
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1099
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1100
    cls := self resolveName: specClass.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1101
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1102
    (cls canUnderstand:specSelector) ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1103
        "/ method already exists, do not overwrite the method automaticaly
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1104
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1105
        ( YesNoBox title:'method '
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1106
                         , (Text string:('#', specSelector) emphasis:#bold)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1107
                         , ' already exists!!'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1108
                 yesText:'overwrite'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1109
                  noText:'cancel'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1110
        ) confirm ifFalse:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1111
            ^ self
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1112
        ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1113
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1114
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1115
    code := '!!' , cls name , ' methodsFor:''aspects''!!\\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1116
            specSelector , '\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1117
            '    "Generated by the TabListEditor"\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1118
            '\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1119
            '    |list|\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1120
            '\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1121
            '    (list := builder bindingAt:#' , specSelector , ') isNil ifTrue:[\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1122
            '        builder aspectAt:#' , specSelector, ' put:(list := self class ', specSelector, ').\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1123
            '    ].\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1124
            '    ^ list\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1125
            '!! !!\\'.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1126
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1127
    (ReadStream on:(code withCRs)) fileIn
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1128
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1129
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1130
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1131
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1132
doMoveTabUpOrDown:what
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1133
    "step up or down
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1134
    "
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1135
    |tab listOfLabels index nLabels|
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1136
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1137
    (selectedIndex ~~ 0 and:[listOfTabs size > 1]) ifFalse:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1138
        ^ self
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1139
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1140
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1141
    listOfLabels := self listOfLabels.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1142
    tab  := listOfTabs at:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1143
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1144
    listOfLabels removeIndex:selectedIndex.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1145
    listOfTabs removeIndex:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1146
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1147
    nLabels := listOfLabels size.
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1148
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1149
    what == #down ifTrue:[
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1150
        index := selectedIndex > nLabels ifTrue:[1]
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1151
                                         ifFalse:[selectedIndex + 1]
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1152
    ] ifFalse:[
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1153
        index := selectedIndex == 1 ifTrue:[nLabels + 1]
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1154
                                   ifFalse:[selectedIndex - 1]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1155
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1156
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1157
    listOfLabels add:(tab label) beforeIndex:index.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1158
    listOfTabs add:tab beforeIndex:index.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1159
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1160
    rebuildMode := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1161
    self selectionHolder value:index.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1162
    rebuildMode := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1163
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1164
    modified := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1165
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1166
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1167
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1168
doPaste
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1169
    "paste a tab
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1170
    "
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1171
    |tab selectionHolder|
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1172
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1173
    self testMode value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1174
    (tab := self class clipboard deepCopy) isNil ifTrue: [^nil].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1175
    listOfTabs add:tab afterIndex:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1176
    self listOfLabels add:(tab label) afterIndex:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1177
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1178
    selectionHolder := self selectionHolder.
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1179
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1180
    selectedIndex == 0 ifTrue:[
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1181
        selectionHolder value:1
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1182
    ] ifFalse:[    
1145
8d3ca8f7bb71 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  1183
        selectionHolder value:selectedIndex + 1.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1184
        self cancel.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1185
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1186
      
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1187
    modified  := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1188
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1189
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1190
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1191
doSave
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1192
    "generate code for class and instance
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1193
    "
1245
fd0127c25b66 encoding & decoding
ca
parents: 1183
diff changeset
  1194
    |cls code spec category mthd list|
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1195
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1196
    (specClass notNil and:[specSelector notNil])
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1197
    ifFalse:
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1198
    [
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1199
        ^self doSaveAs
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1200
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1201
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1202
    cls := self resolveName: specClass.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1203
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1204
    listOfTabs isEmpty ifTrue:[^self information:'No tab list defined!!'].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1205
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1206
    spec  := WriteStream on:String new.
1245
fd0127c25b66 encoding & decoding
ca
parents: 1183
diff changeset
  1207
    list := Array new:(listOfTabs size).
fd0127c25b66 encoding & decoding
ca
parents: 1183
diff changeset
  1208
    listOfTabs keysAndValuesDo:[:i :el|list at:i put:(el literalArrayEncoding)].
fd0127c25b66 encoding & decoding
ca
parents: 1183
diff changeset
  1209
fd0127c25b66 encoding & decoding
ca
parents: 1183
diff changeset
  1210
    UISpecification prettyPrintSpecArray:list on:spec indent:5.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1211
    spec := spec contents.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1212
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1213
    "/ if that method already exists, do not overwrite the category
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1214
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1215
    category := 'list specs'.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1216
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1217
    (mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1218
        category := mthd category.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1219
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1220
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1221
    code := Character excla asString 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1222
            , cls name , ' class methodsFor:' , category storeString
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1223
            , Character excla asString , '\\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1224
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1225
            , specSelector , '\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1226
            , (self class codeGenerationComment replChar:$!! withString:'!!!!')
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1227
            , '\\    "\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1228
            , '     TabListEditor new openOnClass:' , cls name , ' andSelector:#' , specSelector , '\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1229
            , '    "\'.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1230
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1231
    code := code 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1232
            , '\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1233
            , '    <resource: #tabList>\\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1234
            , '    ^' 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1235
            , '     ', spec, '\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1236
            , '      collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1237
            , '\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1238
            , Character excla asString
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1239
            , ' '
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1240
            , Character excla asString
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1241
            , '\'.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1242
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1243
    code := code withCRs.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1244
    (ReadStream on:code) fileIn.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1245
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1246
    (cls canUnderstand:specSelector) ifFalse:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1247
        (YesNoBox confirm:'Generate aspect method?') ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1248
            self doGenerateAspectMethod
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1249
        ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1250
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1251
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1252
    self addToHistory:(cls name, ' ', specSelector) -> #loadFromMessage:.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1253
    modified  := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1254
    hasSaved  := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1255
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1256
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1257
doTest
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1258
    "run a test
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1259
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1260
    |tabView list|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1261
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1262
    self selectionHolder value:nil.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1263
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1264
    listOfTabs size ~~ 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1265
        list := listOfTabs collect:[:aTab||t|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1266
            t := aTab copy.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1267
            t setAttributesFromClass:specClass.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1268
            t
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1269
        ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1270
    ] ifFalse:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1271
        list := nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1272
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1273
    tabView  := builder componentAt:#TestTabsView.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1274
    tabView list:list.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1275
    testView raise.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1276
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1277
    self valueOfCanCut value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1278
    self valueOfCanCopy value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1279
    self valueOfCanPaste value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1280
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1281
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1282
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1283
!TabListEditor class methodsFor:'documentation'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1284
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1285
version
1066
5096f66ba82d new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents: 883
diff changeset
  1286
    ^ '$Header$'
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1287
! !