TabListEditor.st
author Claus Gittinger <cg@exept.de>
Tue, 30 Mar 1999 21:09:38 +0200
changeset 1099 965cfbbf4bf2
parent 1066 5096f66ba82d
child 1145 8d3ca8f7bb71
permissions -rw-r--r--
checkin from browser
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
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   122
'An argument not explicitly used by the tab item.'
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
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   189
    ^
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   190
     
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   191
       #(#FullSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   192
          #window: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   193
           #(#WindowSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   194
              #name: 'Tab Basic'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   195
              #layout: #(#LayoutFrame 463 0 289 0 825 0 514 0)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   196
              #label: 'Tab Basic'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   197
              #min: #(#Point 10 10)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   198
              #max: #(#Point 1280 1024)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   199
              #bounds: #(#Rectangle 463 289 826 515)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   200
              #usePreferredExtent: false
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   201
          )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   202
          #component: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   203
           #(#SpecCollection
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   204
              #collection: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   205
               #(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   206
                 #(#LabelSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   207
                    #name: 'Label'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   208
                    #layout: #(#AlignmentOrigin 98 0 26 0 1 0.5)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   209
                    #label: 'Label:'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   210
                    #resizeForLabel: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   211
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   212
                 #(#InputFieldSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   213
                    #name: 'LabelField'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   214
                    #layout: #(#LayoutFrame 100 0 15 0 -5 1.0 37 0)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   215
                    #activeHelpKey: #label
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   216
                    #model: #label
1066
5096f66ba82d new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents: 883
diff changeset
   217
                              #modifiedChannel: #modifiedChannel
5096f66ba82d new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents: 883
diff changeset
   218
                              #acceptChannel: #acceptChannel
5096f66ba82d new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents: 883
diff changeset
   219
                              #acceptOnLostFocus: true
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   220
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   221
                 #(#CheckBoxSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   222
                    #name: 'TranslateLabel'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   223
                    #layout: #(#LayoutFrame 100 0 40 0 -5 1 66 0)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   224
                    #activeHelpKey: #labelDerivesFromApplication
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   225
                    #model: #translateLabel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   226
                    #label: 'Label derives from Application'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   227
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   228
                 #(#LabelSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   229
                    #name: 'ArgumentLabel'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   230
                    #layout: #(#AlignmentOrigin 98 0 81 0 1 0.5)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   231
                    #label: 'Argument:'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   232
                    #resizeForLabel: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   233
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   234
                 #(#InputFieldSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   235
                    #name: 'ArgumentField'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   236
                    #layout: #(#LayoutFrame 100 0 70 0 -5 1.0 92 0)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   237
                    #activeHelpKey: #argument
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   238
                    #model: #editAgument
1066
5096f66ba82d new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents: 883
diff changeset
   239
                              #modifiedChannel: #modifiedChannel
5096f66ba82d new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents: 883
diff changeset
   240
                              #acceptChannel: #acceptChannel
5096f66ba82d new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents: 883
diff changeset
   241
                              #acceptOnLostFocus: true
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   242
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   243
                 #(#LabelSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   244
                    #name: 'ForegroundLabel'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   245
                    #layout: #(#AlignmentOrigin 98 0 115 0 1 0.5)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   246
                    #label: 'Color:'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   247
                    #adjust: #right
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   248
                    #resizeForLabel: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   249
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   250
                 #(#ColorMenuSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   251
                    #name: 'ForegroundColorMenu'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   252
                    #layout: #(#LayoutFrame 100 0 103 0 -5 1.0 125 0)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   253
                    #activeHelpKey: #color
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   254
                    #model: #labelForegroundColor
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   255
                    #labelsAreColored: false
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   256
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   257
                 #(#CheckBoxSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   258
                    #name: 'CanSelect'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   259
                    #layout: #(#LayoutFrame 100 0 135 0 -5 1 157 0)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   260
                    #activeHelpKey: #canSelect
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   261
                    #model: #enabled
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   262
                    #label: 'Can Select'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   263
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   264
              )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   265
          )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   266
      )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   267
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   268
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   269
windowSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   270
    "This resource specification was automatically generated
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   271
     by the UIPainter of ST/X."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   272
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   273
    "Do not manually edit this!! If it is corrupted,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   274
     the UIPainter may not be able to read the specification."
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   275
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   276
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   277
     UIPainter new openOnClass:TabListEditor andSelector:#windowSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   278
     TabListEditor new openInterface:#windowSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   279
     TabListEditor open
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   280
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   281
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   282
    <resource: #canvas>
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   283
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   284
    ^
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   285
     
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   286
       #(#FullSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   287
          #window: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   288
           #(#WindowSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   289
              #name: 'Tab List Editor'
749
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
   290
              #layout: #(#LayoutFrame 117 0 340 0 586 0 669 0)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   291
              #label: 'Tab List Editor'
749
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
   292
              #min: #(#Point 440 280)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   293
              #max: #(#Point 1152 900)
749
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
   294
              #bounds: #(#Rectangle 117 340 587 670)
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   295
              #menu: #menu
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   296
              #usePreferredExtent: false
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   297
          )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   298
          #component: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   299
           #(#SpecCollection
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   300
              #collection: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   301
               #(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   302
                 #(#MenuPanelSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   303
                    #name: 'menuToolbarView'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   304
                    #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 34 0)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   305
                    #menu: #menuToolbar
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   306
                    #showSeparatingLines: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   307
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   308
                 #(#VariableHorizontalPanelSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   309
                    #name: 'VariablePanel'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   310
                    #layout: #(#LayoutFrame 0 0.0 36 0.0 0 1.0 -26 1.0)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   311
                    #component: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   312
                     #(#SpecCollection
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   313
                        #collection: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   314
                         #(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   315
                           #(#SequenceViewSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   316
                              #name: 'ColumnView'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   317
                              #model: #selectionHolder
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   318
                              #menu: #menuEdit
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   319
                              #hasHorizontalScrollBar: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   320
                              #hasVerticalScrollBar: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   321
                              #miniScrollerHorizontal: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   322
                              #useIndex: true
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   323
                              #sequenceList: #listOfLabels
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   324
                          )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   325
                           #(#ViewSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   326
                              #name: 'SpecView'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   327
                              #component: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   328
                               #(#SpecCollection
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   329
                                  #collection: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   330
                                   #(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   331
                                     #(#ViewSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   332
                                        #name: 'TestView'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   333
                                        #layout: #(#LayoutFrame 1 0.0 0 0.0 0 1.0 0 1.0)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   334
                                        #component: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   335
                                         #(#SpecCollection
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   336
                                            #collection: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   337
                                             #(
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   338
                                               #(#TabViewSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   339
                                                  #name: 'TestTabsView'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   340
                                                  #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 0.5)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   341
                                              )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   342
                                            )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   343
                                        )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   344
                                    )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   345
                                     #(#SubCanvasSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   346
                                        #name: 'specCanvas'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   347
                                        #layout: #(#LayoutFrame 1 0.0 0 0.0 0 1.0 -30 1.0)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   348
                                        #specHolder: #specChannel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   349
                                    )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   350
                                     #(#UISubSpecification
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   351
                                        #name: 'subSpec'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   352
                                        #layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   353
                                        #majorKey: #ToolApplicationModel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   354
                                        #minorKey: #windowSpecForCommit
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   355
                                    )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   356
                                  )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   357
                              )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   358
                              #level: -1
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   359
                          )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   360
                        )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   361
                    )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   362
                    #handles: #(#Any 0.259875 1.0)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   363
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   364
                 #(#UISubSpecification
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   365
                    #name: 'infoBarSubSpec'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   366
                    #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   367
                    #majorKey: #ToolApplicationModel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   368
                    #minorKey: #windowSpecForInfoBar
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   369
                )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   370
              )
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   371
          )
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
    |list|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   743
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   744
    (list := builder bindingAt:#listOfLabels) isNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   745
        builder aspectAt:#listOfLabels put:(list :=  List new).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   746
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   747
    ^ list
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   748
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   749
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   750
selectionHolder
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   751
    "holder which keeps the current selection
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   752
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   753
    |holder|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   754
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   755
    (holder := builder bindingAt:#selectionHolder) isNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   756
        holder := AspectAdaptor new subject:self; forAspect:#selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   757
        builder aspectAt:#selectionHolder put:holder.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   758
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   759
    ^ holder
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   760
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   761
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   762
specChannel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   763
    "holder which keeps the current tab specification
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   764
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   765
    |holder|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   766
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   767
    (holder := builder bindingAt:#specChannel) isNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   768
        builder aspectAt:#specChannel put:(holder :=  ValueHolder new).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   769
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   770
    ^ holder
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   771
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   772
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   773
testMode
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   774
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   775
    |holder|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   776
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   777
    (holder := builder bindingAt:#testMode) isNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   778
        builder aspectAt:#testMode put:(holder := false asValue).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   779
        holder addDependent: self
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   780
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   781
    ^ holder
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   782
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   783
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   784
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   785
!TabListEditor methodsFor:'building'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   786
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   787
buildFromClass:aClass andSelector:aSelector
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   788
    "build from class and selector
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   789
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   790
    |cls spec list|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   791
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   792
    self testMode value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   793
    self selectionHolder value:0.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   794
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   795
    "if opened on a tab list"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   796
    (aClass isNil and: [aSelector isNil and: [listOfTabs size > 0]]) 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   797
    ifTrue: 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   798
    [
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   799
        listOfTabs notEmpty ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   800
            self selectionHolder value:1
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   801
        ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   802
        ^nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   803
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   804
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   805
    self listOfLabels removeAll.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   806
    listOfTabs removeAll.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   807
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   808
    testView notNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   809
        testView lower
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   810
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   811
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   812
    rebuildMode := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   813
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   814
    self canShowTestMode value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   815
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   816
    cls := self resolveName:aClass.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   817
    specSelector := aSelector.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   818
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   819
    cls notNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   820
        specSelector notNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   821
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   822
            (cls respondsTo:specSelector) ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   823
                spec := cls perform:specSelector.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   824
                list := self listOfLabels.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   825
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   826
                spec size ~~ 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   827
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   828
                    rebuildMode := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   829
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   830
                    spec do:[:aTab|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   831
                        list add:aTab label.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   832
                        listOfTabs add:aTab.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   833
                    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   834
                    rebuildMode := false.          
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   835
                    self addToHistory:(cls name, ' ', specSelector) -> #loadFromMessage:                        
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   836
                ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   837
            ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   838
        ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   839
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   840
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   841
    modified := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   842
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   843
    listOfTabs notEmpty ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   844
        self selectionHolder value:1
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   845
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   846
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   847
    self updateInfoLabel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   848
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   849
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   850
buildFromResourceSpec: aListSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   851
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   852
    self buildFromTabList: aListSpec
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   853
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   854
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   855
buildFromTabList: aTabList
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   856
    "build from a aTabList"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   857
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   858
    rebuildMode := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   859
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   860
    self selectionHolder value: nil.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   861
    self listOfLabels removeAll.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   862
    listOfTabs removeAll.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   863
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   864
    aTabList do:[:aTabItem|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   865
        listOfTabs add: aTabItem.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   866
        self listOfLabels add: aTabItem label
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   867
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   868
    rebuildMode := false.          
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   869
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   870
    modified := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   871
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   872
    listOfTabs notEmpty ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   873
        self selectionHolder value:1
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   874
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   875
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   876
    self updateInfoLabel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   877
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   878
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   879
!TabListEditor methodsFor:'change & update'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   880
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   881
update:something with:aParameter from:someObject
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   882
    "one of my aspects has changed; update modified channel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   883
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   884
    super update:something with:aParameter from:someObject.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   885
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   886
    someObject = self testMode
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   887
    ifTrue:
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   888
    [              
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   889
        someObject value
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   890
            ifTrue: [self doTest]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   891
            ifFalse:[testView lower. self selectionHolder value:1].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   892
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   893
        self updateInfoLabel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   894
    ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   895
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   896
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   897
!TabListEditor methodsFor:'help'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   898
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   899
defaultInfoLabel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   900
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   901
    ^self testMode value
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   902
        ifTrue:  ['Test mode']
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   903
        ifFalse: [super defaultInfoLabel]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   904
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   905
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   906
!TabListEditor methodsFor:'selection'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   907
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   908
selectedIndex
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   909
    ^ selectedIndex
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   910
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   911
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   912
selectedIndex:anIndex
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   913
    |s oldSel|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   914
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   915
    self listOfLabels notEmpty ifTrue: [self canShowTestMode value: true].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   916
    anIndex notNil ifTrue: [self testMode value: false].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   917
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   918
    oldSel := selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   919
    selectedIndex := anIndex ? 0.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   920
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   921
    selectedIndex == oldSel ifTrue:[^ self].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   922
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   923
    oldSel == 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   924
        self specChannel value:(self class tabSpec)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   925
    ] ifFalse:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   926
        selectedIndex == 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   927
            self specChannel value:nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   928
        ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   929
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   930
    self cancel.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   931
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   932
    testView notNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   933
        testView lower.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   934
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   935
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   936
    self valueOfCanCut value: (anIndex ~~ 0).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   937
    self valueOfCanCopy value: (anIndex ~~ 0).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   938
    self valueOfCanPaste.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   939
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   940
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   941
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   942
!TabListEditor methodsFor:'startup / release'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   943
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   944
initialize
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   945
    "setup aspects used by column description specifications
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   946
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   947
    |holder|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   948
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   949
    super initialize.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   950
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   951
    listOfTabs    := OrderedCollection new.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   952
    selectedIndex := 0.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   953
    rebuildMode   := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   954
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   955
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   956
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   957
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   958
openModalOnTabList: aTabList
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   959
    "build a tab list from aTabList and open it modal"
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   960
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   961
    super openModalOnResourceSpec: aTabList
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   962
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   963
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   964
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   965
postBuildWith:builder
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   966
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   967
    super postBuildWith:builder.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   968
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   969
    testView := builder componentAt:#TestView.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   970
    (builder componentAt:#ColumnView) selectConditionBlock: [:i|self askForItemModification].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   971
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   972
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   973
!TabListEditor methodsFor:'user actions'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   974
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   975
accept
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   976
    "accept changes
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   977
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   978
    |label|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   979
1066
5096f66ba82d new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents: 883
diff changeset
   980
    self acceptChannel value:true.      "/ toggle to force inputFields to accept
5096f66ba82d new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents: 883
diff changeset
   981
    self acceptChannel value:false.    
5096f66ba82d new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents: 883
diff changeset
   982
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   983
    selectedIndex ~~ 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   984
        rebuildMode := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   985
        label := listOfTabs at:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   986
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   987
        aspects keysAndValuesDo:[:aKey :aModel|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   988
            label perform:(aKey , ':') asSymbol with:(aModel value).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   989
        ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   990
        self listOfLabels at:selectedIndex put:(label label).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   991
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   992
        rebuildMode := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   993
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   994
    self cancel.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   995
    modified := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   996
    self valueOfEnablingCommitButtons value: false
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   997
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   998
cc3413fc1afb initial checkin
tz
parents:
diff changeset
   999
cancel
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1000
    "cancel all changes
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1001
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1002
    |tab|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1003
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1004
    selectedIndex ~~ 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1005
        tab := listOfTabs at:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1006
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1007
        rebuildMode := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1008
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1009
        aspects keysAndValuesDo:[:aKey :aModel|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1010
            aModel value:(tab perform:aKey)    
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1011
        ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1012
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1013
        rebuildMode := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1014
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1015
    self canMoveTabItemUpOrDown value:(selectedIndex ~~ 0 and:[listOfTabs size > 1]).
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1016
    self valueOfEnablingCommitButtons value: false
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1017
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1018
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1019
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1020
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1021
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1022
doCopy
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1023
    "copy selected tab
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1024
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1025
    selectedIndex ~~ 0 ifTrue:[
749
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
  1026
        self clipboard:(listOfTabs at:selectedIndex) deepCopy.
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
  1027
        self updateAllToolInstances.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1028
    ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1029
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1030
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1031
doCreateTabItem
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1032
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1033
    |tab|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1034
    self testMode value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1035
    tab := TabItem label:'Tab Item ', (listOfTabs size + 1) printString.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1036
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1037
    listOfTabs add:tab afterIndex:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1038
    self listOfLabels add:(tab label) afterIndex:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1039
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1040
    selectedIndex == 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1041
        self selectionHolder value:1
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1042
    ] ifFalse:[    
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1043
        self selectionHolder value:selectedIndex + 1.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1044
        self cancel.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1045
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1046
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1047
    modified := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1048
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1049
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1050
doCut
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1051
    "cut selected tab
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1052
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1053
    |list index|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1054
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1055
    (index := selectedIndex) ~~ 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1056
        self testMode value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1057
        list := self listOfLabels.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1058
        self clipboard:(listOfTabs at:index) deepCopy.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1059
        self selectionHolder value:0.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1060
        listOfTabs removeIndex:index.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1061
        list removeIndex:index.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1062
        index > list size ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1063
            index := index - 1
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1064
        ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1065
        self selectionHolder value:index.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1066
        self listOfLabels isEmpty ifTrue: [self canShowTestMode value: false].
749
8f8767c6f32f update other instances if clipboarding
tz
parents: 739
diff changeset
  1067
        self updateAllToolInstances.
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1068
        modified := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1069
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1070
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1071
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1072
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1073
doDelete
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1074
    "delete selected tab
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1075
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1076
    |list index|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1077
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1078
    (index := selectedIndex) ~~ 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1079
        self testMode value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1080
        list := self listOfLabels.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1081
        self selectionHolder value:0.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1082
        listOfTabs removeIndex:index.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1083
        list removeIndex:index.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1084
        index > list size ifTrue:[index := index - 1].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1085
        self selectionHolder value:index.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1086
        self listOfLabels isEmpty ifTrue: [self canShowTestMode value: false].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1087
        modified := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1088
    ].       
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1089
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1090
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1091
doGenerateAspectMethod
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1092
    "generate aspect method
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1093
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1094
    |cls code|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1095
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1096
    (specClass notNil and:[specSelector notNil])
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1097
    ifFalse:
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1098
    [
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1099
        ^self information:'No class and selector defined!!'   
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1100
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1101
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1102
    cls := self resolveName: specClass.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1103
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1104
    (cls canUnderstand:specSelector) ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1105
        "/ method already exists, do not overwrite the method automaticaly
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1106
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1107
        ( YesNoBox title:'method '
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1108
                         , (Text string:('#', specSelector) emphasis:#bold)
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1109
                         , ' already exists!!'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1110
                 yesText:'overwrite'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1111
                  noText:'cancel'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1112
        ) confirm ifFalse:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1113
            ^ self
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1114
        ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1115
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1116
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1117
    code := '!!' , cls name , ' methodsFor:''aspects''!!\\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1118
            specSelector , '\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1119
            '    "Generated by the TabListEditor"\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1120
            '\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1121
            '    |list|\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1122
            '\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1123
            '    (list := builder bindingAt:#' , specSelector , ') isNil ifTrue:[\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1124
            '        builder aspectAt:#' , specSelector, ' put:(list := self class ', specSelector, ').\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1125
            '    ].\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1126
            '    ^ list\' ,
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1127
            '!! !!\\'.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1128
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1129
    (ReadStream on:(code withCRs)) fileIn
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1130
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1131
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1132
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1133
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1134
doMoveTabUpOrDown:what
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1135
    "step up or down
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1136
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1137
    |tab list index|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1138
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1139
    (selectedIndex ~~ 0 and:[listOfTabs size > 1]) ifFalse:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1140
        ^ self
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1141
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1142
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1143
    list := self listOfLabels.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1144
    tab  := listOfTabs at:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1145
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1146
    list removeIndex:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1147
    listOfTabs removeIndex:selectedIndex.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1148
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1149
    what == #down ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1150
        index := selectedIndex > list size ifTrue:[1]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1151
                                          ifFalse:[selectedIndex + 1]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1152
    ] ifFalse:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1153
        index := selectedIndex == 1 ifTrue:[list size + 1]
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
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1157
    list add:(tab label) beforeIndex:index.
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
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1171
    |tab|
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
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1178
    selectedIndex == 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1179
        self selectionHolder value:1
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1180
    ] ifFalse:[    
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1181
        self selectionHolder value:selectedIndex + 1.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1182
        self cancel.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1183
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1184
      
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1185
    modified  := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1186
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1187
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1188
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1189
doSave
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1190
    "generate code for class and instance
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1191
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1192
    |cls code spec category mthd|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1193
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1194
    (specClass notNil and:[specSelector notNil])
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1195
    ifFalse:
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1196
    [
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1197
        ^self doSaveAs
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1198
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1199
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1200
    cls := self resolveName: specClass.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1201
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1202
    listOfTabs isEmpty ifTrue:[^self information:'No tab list defined!!'].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1203
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1204
    spec  := WriteStream on:String new.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1205
    UISpecification prettyPrintSpecArray:(listOfTabs literalArrayEncoding) on:spec indent:5.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1206
    spec := spec contents.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1207
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1208
    "/ if that method already exists, do not overwrite the category
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1209
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1210
    category := 'list specs'.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1211
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1212
    (mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1213
        category := mthd category.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1214
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1215
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1216
    code := Character excla asString 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1217
            , cls name , ' class methodsFor:' , category storeString
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1218
            , Character excla asString , '\\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1219
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1220
            , specSelector , '\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1221
            , (self class codeGenerationComment replChar:$!! withString:'!!!!')
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1222
            , '\\    "\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1223
            , '     TabListEditor new openOnClass:' , cls name , ' andSelector:#' , specSelector , '\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1224
            , '    "\'.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1225
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1226
    code := code 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1227
            , '\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1228
            , '    <resource: #tabList>\\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1229
            , '    ^' 
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1230
            , '     ', spec, '\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1231
            , '      collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1232
            , '\'
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1233
            , Character excla asString
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1234
            , ' '
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1235
            , Character excla asString
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1236
            , '\'.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1237
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1238
    code := code withCRs.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1239
    (ReadStream on:code) fileIn.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1240
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1241
    (cls canUnderstand:specSelector) ifFalse:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1242
        (YesNoBox confirm:'Generate aspect method?') ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1243
            self doGenerateAspectMethod
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1244
        ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1245
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1246
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1247
    self addToHistory:(cls name, ' ', specSelector) -> #loadFromMessage:.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1248
    modified  := false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1249
    hasSaved  := true.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1250
!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1251
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1252
doTest
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1253
    "run a test
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1254
    "
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1255
    |tabView list|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1256
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1257
    self selectionHolder value:nil.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1258
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1259
    listOfTabs size ~~ 0 ifTrue:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1260
        list := listOfTabs collect:[:aTab||t|
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1261
            t := aTab copy.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1262
            t setAttributesFromClass:specClass.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1263
            t
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1264
        ]
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1265
    ] ifFalse:[
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1266
        list := nil
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1267
    ].
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1268
    tabView  := builder componentAt:#TestTabsView.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1269
    tabView list:list.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1270
    testView raise.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1271
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1272
    self valueOfCanCut value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1273
    self valueOfCanCopy value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1274
    self valueOfCanPaste value: false.
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1275
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1276
! !
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1277
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1278
!TabListEditor class methodsFor:'documentation'!
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1279
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1280
version
1066
5096f66ba82d new inputField accept/modified behavior
Claus Gittinger <cg@exept.de>
parents: 883
diff changeset
  1281
    ^ '$Header$'
739
cc3413fc1afb initial checkin
tz
parents:
diff changeset
  1282
! !