TabListEditor.st
author Claus Gittinger <cg@exept.de>
Sat, 21 Jul 2012 18:58:03 +0200
changeset 2898 c7f6c498df6a
parent 2828 c5afe7613f98
child 3036 a685cbe8ae60
permissions -rw-r--r--
category of:15 methods
tz@739
     1
"
tz@739
     2
 COPYRIGHT (c) 1997 by eXept Software AG
tz@739
     3
              All Rights Reserved
tz@739
     4
tz@739
     5
 This software is furnished under a license and may be used
tz@739
     6
 only in accordance with the terms of that license and with the
tz@739
     7
 inclusion of the above copyright notice. This software may not
tz@739
     8
 be provided or otherwise made available to, or used by, any
tz@739
     9
 other person.  No title to or ownership of the software is
tz@739
    10
 hereby transferred.
tz@739
    11
"
ca@1431
    12
"{ Package: 'stx:libtool2' }"
ca@1373
    13
tz@739
    14
ResourceSpecEditor subclass:#TabListEditor
ca@1373
    15
	instanceVariableNames:'listOfTabs'
tz@739
    16
	classVariableNames:''
tz@739
    17
	poolDictionaries:''
tz@739
    18
	category:'Interface-UIPainter'
tz@739
    19
!
tz@739
    20
tz@739
    21
!TabListEditor class methodsFor:'documentation'!
tz@739
    22
tz@739
    23
copyright
tz@739
    24
"
tz@739
    25
 COPYRIGHT (c) 1997 by eXept Software AG
tz@739
    26
              All Rights Reserved
tz@739
    27
tz@739
    28
 This software is furnished under a license and may be used
tz@739
    29
 only in accordance with the terms of that license and with the
tz@739
    30
 inclusion of the above copyright notice. This software may not
tz@739
    31
 be provided or otherwise made available to, or used by, any
tz@739
    32
 other person.  No title to or ownership of the software is
tz@739
    33
 hereby transferred.
tz@739
    34
"
tz@739
    35
tz@739
    36
tz@739
    37
!
tz@739
    38
tz@739
    39
documentation
tz@739
    40
"
tz@739
    41
    The TabListEditor allows you to create, modify or just inspect
tz@739
    42
    tab lists for tab headers or note books.
tz@739
    43
tz@739
    44
    [start with:]
tz@739
    45
        TabItemEditor open
tz@739
    46
tz@739
    47
    [see also:]
tz@739
    48
        TabItem
tz@739
    49
        TabView
tz@739
    50
        NoteBookView
tz@739
    51
        UIPainter
tz@739
    52
tz@739
    53
    [author:]
tz@739
    54
        Claus Atzkern, eXept Software AG
tz@749
    55
        Thomas Zwick, eXept Software AG
tz@739
    56
"
tz@739
    57
tz@739
    58
tz@739
    59
! !
tz@739
    60
tz@739
    61
!TabListEditor class methodsFor:'instance creation'!
tz@739
    62
tz@739
    63
openModalOnTabList: aTabList
tz@739
    64
    "Open a TabListEditor modal on aTabList"
tz@739
    65
    "self openModalOnTabList: (Array with: (TabItem label: 'Tab Item 1'))"
tz@739
    66
tz@739
    67
    ^self new openModalOnTabList: aTabList
tz@739
    68
tz@739
    69
! !
tz@739
    70
tz@739
    71
!TabListEditor class methodsFor:'accessing'!
tz@739
    72
tz@739
    73
resourceType
tz@739
    74
    "get the type of resource of the method generated by the TabListEditor"
tz@739
    75
tz@739
    76
    ^#tabList
tz@739
    77
tz@739
    78
tz@739
    79
tz@739
    80
tz@739
    81
tz@739
    82
tz@739
    83
! !
tz@739
    84
tz@739
    85
!TabListEditor class methodsFor:'aspects'!
tz@739
    86
tz@739
    87
aspects
tz@739
    88
    "get the aspects for the attributes of the tab list components"
tz@739
    89
tz@739
    90
    ^#(
tz@739
    91
        label
tz@739
    92
        translateLabel
tz@739
    93
        labelForegroundColor
tz@739
    94
        enabled
tz@739
    95
        editAgument
ca@1325
    96
        accessCharacterPosition
ca@1325
    97
        shortcutKey
ca@1373
    98
        activeHelpKey
ca@1373
    99
ca@1373
   100
        majorKey
ca@1373
   101
        minorKey
ca@1373
   102
        createNewBuilder
ca@1373
   103
ca@1373
   104
        hasHorizontalScrollBar
ca@1373
   105
        hasVerticalScrollBar
ca@1373
   106
        miniScrollerHorizontal
ca@1373
   107
        miniScrollerVertical
tz@739
   108
    )
tz@739
   109
tz@739
   110
! !
tz@739
   111
tz@739
   112
!TabListEditor class methodsFor:'help specs'!
tz@739
   113
tz@739
   114
helpSpec
tz@739
   115
    "This resource specification was automatically generated
tz@739
   116
     by the UIHelpTool of ST/X."
tz@739
   117
tz@739
   118
    "Do not manually edit this!! If it is corrupted,
tz@739
   119
     the UIHelpTool may not be able to read the specification."
tz@739
   120
tz@739
   121
    "
tz@739
   122
     UIHelpTool openOnClass:TabListEditor    
tz@739
   123
    "
tz@739
   124
tz@739
   125
    <resource: #help>
tz@739
   126
ca@1845
   127
    ^ super helpSpec addPairsFrom:#(
tz@739
   128
tz@739
   129
#addTabItem
tz@739
   130
'Adds a new tab item.'
tz@739
   131
cg@2346
   132
#applicationProvidesLabel
cg@2346
   133
'If on, the label''s string is a selector returning a string or bitmap image, which is used as logo in the tab item.'
cg@2346
   134
ca@1373
   135
#autoHideScrollBars
ca@1373
   136
'ScrollBars should be made invisible dynamically, if there is nothing to scroll.'
tz@739
   137
ca@1845
   138
#basicTab
ca@1845
   139
'Define the basic attributes.'
ca@1845
   140
tz@739
   141
#canSelect
tz@739
   142
'Turns on/off whether the tab item is selectable.'
tz@739
   143
ca@1845
   144
#canvasTab
ca@1845
   145
'Define an application, which is started if the tab is pressed the first time.'
ca@1845
   146
ca@1845
   147
#color
ca@1845
   148
'Defines the foreground color of the label. The default color derives from the style sheet.'
ca@1845
   149
ca@1373
   150
#createNewBuilder
ca@1373
   151
'Create a new builder for the application; the application use its own aspects.'
ca@1373
   152
ca@1845
   153
#detailTab
ca@1845
   154
'Define the optional/specific attributes.'
ca@1845
   155
ca@1845
   156
#detailsAccelerator
ca@1845
   157
'Key to be pressed to select the tab item from the keyboard (accelerator key).'
ca@1845
   158
ca@1845
   159
#detailsAccessCharaterPosition
ca@1845
   160
'Index of the access character position of the textual label (optional).'
ca@1845
   161
ca@1845
   162
#detailsArgument
ca@1845
   163
'An optional argument stored with the tab item.'
tz@739
   164
tz@739
   165
#fileCreateAspectMethod
tz@739
   166
'Creates the aspect method for the tab list.'
tz@739
   167
tz@739
   168
#fileLoad
tz@739
   169
'Opens a dialog for selecting and loading a tab list spec from a class.'
tz@739
   170
tz@739
   171
#fileNew
tz@739
   172
'Creates a new tab list.'
tz@739
   173
tz@739
   174
#fileSave
tz@739
   175
'Saves current tab list.'
tz@739
   176
ca@1373
   177
#horizontalMiniScroller
ca@1373
   178
'Use a mini-scroller as horizontal scrollbar.'
ca@1373
   179
ca@1845
   180
#horizontalScroller
ca@1845
   181
'Enable horizontal scrollability.'
ca@1373
   182
tz@739
   183
#label
tz@739
   184
'Label of the tab item.'
tz@739
   185
ca@1845
   186
#majorKey
ca@1845
   187
'Name of the class to be started (application if empty); or app-selector returning application instance.'
ca@1373
   188
ca@1845
   189
#minorKey
ca@1845
   190
'Message sent to the class which returns the window specification (default: #windowSpec).'
ca@1373
   191
tz@739
   192
#testPreview
tz@739
   193
'Turns on/off preview of the tab list.'
tz@739
   194
cg@2346
   195
#translateLabel
cg@2346
   196
'If on, the label is translated using the applications language resources.'
cg@2346
   197
ca@1845
   198
#verticalMiniScroller
ca@1845
   199
'Use a mini-scroller as vertical scrollbar.'
ca@1845
   200
ca@1845
   201
#verticalScroller
ca@1845
   202
'Enable vertical scrollability.'
ca@1845
   203
tz@739
   204
)
tz@739
   205
! !
tz@739
   206
tz@739
   207
!TabListEditor class methodsFor:'image specs'!
tz@739
   208
tz@739
   209
newTabItemIcon
tz@739
   210
    "This resource specification was automatically generated
tz@739
   211
     by the ImageEditor of ST/X."
tz@739
   212
tz@739
   213
    "Do not manually edit this!!!! If it is corrupted,
tz@739
   214
     the ImageEditor may not be able to read the specification."
tz@739
   215
tz@739
   216
    "
tz@739
   217
     ImageEditor openOnClass:self andSelector:#newTabItemIcon
tz@739
   218
    "
tz@739
   219
tz@739
   220
    <resource: #image>
tz@739
   221
tz@739
   222
    ^Icon
tz@739
   223
        constantNamed:#'TabListEditor newTabItemIcon'
ca@1431
   224
        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]
ca@1431
   225
! !
tz@739
   226
tz@739
   227
!TabListEditor class methodsFor:'interface specs'!
tz@739
   228
ca@1373
   229
basicSpec
tz@739
   230
    "This resource specification was automatically generated
tz@739
   231
     by the UIPainter of ST/X."
tz@739
   232
tz@739
   233
    "Do not manually edit this!! If it is corrupted,
tz@739
   234
     the UIPainter may not be able to read the specification."
tz@739
   235
tz@739
   236
    "
ca@1373
   237
     UIPainter new openOnClass:TabListEditor andSelector:#basicSpec
ca@1373
   238
     TabListEditor new openInterface:#basicSpec
tz@739
   239
    "
tz@739
   240
tz@739
   241
    <resource: #canvas>
tz@739
   242
cg@1183
   243
    ^ 
cg@1876
   244
     #(FullSpec
cg@1876
   245
        name: basicSpec
cg@1876
   246
        window: 
cg@1876
   247
       (WindowSpec
cg@1876
   248
          label: 'Basic'
cg@1876
   249
          name: 'Basic'
cg@1876
   250
          min: (Point 10 10)
cg@1876
   251
          max: (Point 1280 1024)
cg@2346
   252
          bounds: (Rectangle 0 0 429 240)
cg@1183
   253
        )
cg@1876
   254
        component: 
cg@1876
   255
       (SpecCollection
cg@1876
   256
          collection: (
cg@1876
   257
           (LabelSpec
cg@1876
   258
              label: 'Label:'
cg@1876
   259
              name: 'labelLabel'
cg@1876
   260
              layout: (AlignmentOrigin 98 0 26 0 1 0.5)
cg@1876
   261
              translateLabel: true
cg@1876
   262
              resizeForLabel: true
cg@1183
   263
            )
cg@1876
   264
           (InputFieldSpec
cg@1876
   265
              name: 'label'
cg@1876
   266
              layout: (LayoutFrame 100 0 15 0 -5 1.0 37 0)
cg@1876
   267
              activeHelpKey: label
cg@1876
   268
              tabable: true
cg@1876
   269
              model: label
cg@1876
   270
              group: inputGroup
cg@1876
   271
              immediateAccept: true
cg@1876
   272
              acceptOnReturn: false
cg@1876
   273
              acceptOnTab: false
cg@1876
   274
              acceptOnLostFocus: false
cg@1876
   275
              acceptChannel: acceptChannel
cg@1876
   276
              modifiedChannel: modifiedChannel
cg@1876
   277
              acceptOnPointerLeave: false
ca@1325
   278
            )
cg@1876
   279
           (LabelSpec
cg@1876
   280
              label: 'Accelerator:'
cg@1876
   281
              name: 'shortcutKeyLabel'
cg@1876
   282
              layout: (AlignmentOrigin 98 0 55 0 1 0.5)
cg@1876
   283
              translateLabel: true
cg@1876
   284
              resizeForLabel: true
ca@1325
   285
            )
cg@1876
   286
           (InputFieldSpec
cg@1876
   287
              name: 'shortcutKey'
cg@1876
   288
              layout: (LayoutFrame 100 0 44 0 -5 1.0 66 0)
cg@1876
   289
              activeHelpKey: detailsAccelerator
cg@1876
   290
              tabable: true
cg@1876
   291
              model: shortcutKey
cg@1876
   292
              group: inputGroup
cg@1876
   293
              type: symbolOrNil
cg@1876
   294
              immediateAccept: true
cg@1876
   295
              acceptOnReturn: false
cg@1876
   296
              acceptOnTab: false
cg@1876
   297
              acceptOnLostFocus: false
cg@1876
   298
              acceptChannel: acceptChannel
cg@1876
   299
              modifiedChannel: modifiedChannel
cg@1876
   300
              acceptOnPointerLeave: false
ca@1325
   301
            )
cg@1876
   302
           (LabelSpec
cg@1876
   303
              label: 'Argument:'
cg@1876
   304
              name: 'editAgumentLabel'
cg@1876
   305
              layout: (AlignmentOrigin 98 0 84 0 1 0.5)
cg@1876
   306
              translateLabel: true
cg@1876
   307
              resizeForLabel: true
ca@1325
   308
            )
cg@1876
   309
           (InputFieldSpec
cg@1876
   310
              name: 'editAgument'
cg@1876
   311
              layout: (LayoutFrame 100 0 73 0 -5 1.0 95 0)
cg@1876
   312
              activeHelpKey: detailsArgument
cg@1876
   313
              tabable: true
cg@1876
   314
              model: editAgument
cg@1876
   315
              group: inputGroup
cg@1876
   316
              immediateAccept: true
cg@1876
   317
              acceptOnReturn: false
cg@1876
   318
              acceptOnTab: false
cg@1876
   319
              acceptOnLostFocus: false
cg@1876
   320
              acceptChannel: acceptChannel
cg@1876
   321
              modifiedChannel: modifiedChannel
cg@1876
   322
              acceptOnPointerLeave: false
ca@1325
   323
            )
cg@1876
   324
           (LabelSpec
cg@1876
   325
              label: 'Access Character Position:'
cg@1876
   326
              name: 'accessCharacterPositionLabel'
cg@1876
   327
              layout: (AlignmentOrigin 275 0 113 0 1 0.5)
cg@1876
   328
              translateLabel: true
cg@1876
   329
              resizeForLabel: true
ca@1325
   330
            )
cg@1876
   331
           (InputFieldSpec
cg@1876
   332
              name: 'accessCharacterPosition'
cg@1876
   333
              layout: (LayoutFrame 278 0 103 0 -5 1.0 125 0)
cg@1876
   334
              activeHelpKey: detailsAccessCharaterPosition
cg@1876
   335
              tabable: true
cg@1876
   336
              model: accessCharacterPosition
cg@1876
   337
              group: inputGroup
cg@1876
   338
              type: number
cg@1876
   339
              immediateAccept: true
cg@1876
   340
              acceptOnReturn: false
cg@1876
   341
              acceptOnTab: false
cg@1876
   342
              acceptOnLostFocus: false
cg@1876
   343
              acceptChannel: acceptChannel
cg@1876
   344
              modifiedChannel: modifiedChannel
cg@1876
   345
              acceptOnPointerLeave: false
cg@1183
   346
            )
cg@1876
   347
           (CheckBoxSpec
cg@2346
   348
              label: 'Translate Label '
cg@1876
   349
              name: 'translateLabel'
cg@2346
   350
              layout: (LayoutFrame 96 0 135 0 308 0 161 0)
cg@2346
   351
              activeHelpKey: translateLabel
cg@1876
   352
              tabable: true
cg@1876
   353
              model: translateLabel
cg@1876
   354
              translateLabel: true
cg@1183
   355
            )
cg@2346
   356
           (CheckBoxSpec
cg@2346
   357
              label: 'Application Provides Label '
cg@2346
   358
              name: 'CheckBox1'
cg@2346
   359
              layout: (LayoutFrame 96 0 161 0 308 0 187 0)
cg@2346
   360
              activeHelpKey: applicationProvidesLabel
cg@2346
   361
              tabable: true
cg@2346
   362
              model: applicationProvidesLabel
cg@2346
   363
              translateLabel: true
cg@2346
   364
            )
cg@1876
   365
           (LabelSpec
cg@1876
   366
              label: 'Help Key:'
cg@1876
   367
              name: 'activeHelp'
cg@2346
   368
              layout: (AlignmentOrigin 98 0 203 0 1 0.5)
cg@1876
   369
              translateLabel: true
cg@1876
   370
              resizeForLabel: true
ca@1373
   371
            )
cg@1876
   372
           (InputFieldSpec
cg@1876
   373
              name: 'activeHelpKey'
cg@2346
   374
              layout: (LayoutFrame 100 0 192 0 -5 1.0 214 0)
cg@1876
   375
              activeHelpKey: label
cg@1876
   376
              tabable: true
cg@1876
   377
              model: activeHelpKey
cg@1876
   378
              group: inputGroup
cg@1876
   379
              type: symbolOrNil
cg@1876
   380
              immediateAccept: true
cg@1876
   381
              acceptOnReturn: false
cg@1876
   382
              acceptOnTab: false
cg@1876
   383
              acceptOnLostFocus: false
cg@1876
   384
              acceptChannel: acceptChannel
cg@1876
   385
              modifiedChannel: modifiedChannel
cg@1876
   386
              acceptOnPointerLeave: false
ca@1373
   387
            )
ca@1373
   388
           )
ca@1373
   389
         
ca@1373
   390
        )
ca@1373
   391
      )
ca@1373
   392
!
ca@1373
   393
ca@1373
   394
canvasSpec
ca@1373
   395
    "This resource specification was automatically generated
ca@1373
   396
     by the UIPainter of ST/X."
ca@1373
   397
ca@1373
   398
    "Do not manually edit this!! If it is corrupted,
ca@1373
   399
     the UIPainter may not be able to read the specification."
ca@1373
   400
ca@1373
   401
    "
ca@1373
   402
     UIPainter new openOnClass:TabListEditor andSelector:#canvasSpec
ca@1373
   403
     TabListEditor new openInterface:#canvasSpec
ca@1373
   404
    "
ca@1373
   405
ca@1373
   406
    <resource: #canvas>
ca@1373
   407
ca@1373
   408
    ^ 
ca@1845
   409
     #(FullSpec
ca@1845
   410
        name: canvasSpec
ca@1845
   411
        window: 
ca@1845
   412
       (WindowSpec
ca@1845
   413
          label: 'Canvas'
ca@1845
   414
          name: 'Canvas'
ca@1845
   415
          min: (Point 10 10)
ca@1845
   416
          max: (Point 1280 1024)
ca@1845
   417
          bounds: (Rectangle 0 0 383 220)
ca@1373
   418
        )
ca@1845
   419
        component: 
ca@1845
   420
       (SpecCollection
ca@1845
   421
          collection: (
ca@1845
   422
           (LabelSpec
ca@1845
   423
              label: 'Class Name / Major Key:'
ca@1845
   424
              name: 'majorKeyLabel'
ca@1845
   425
              layout: (AlignmentOrigin 160 0 26 0 1 0.5)
ca@1845
   426
              activeHelpKey: majorKey
ca@1845
   427
              translateLabel: true
ca@1845
   428
              resizeForLabel: true
ca@1373
   429
            )
ca@1845
   430
           (InputFieldSpec
ca@1845
   431
              name: 'majorKeyField'
ca@1845
   432
              layout: (LayoutFrame 161 0 15 0 -5 1.0 37 0)
ca@1845
   433
              activeHelpKey: majorKey
ca@1845
   434
              tabable: true
ca@1845
   435
              model: majorKey
ca@1845
   436
              group: inputGroup
ca@1845
   437
              type: symbolOrNil
ca@1845
   438
              immediateAccept: true
ca@1845
   439
              acceptOnReturn: false
ca@1845
   440
              acceptOnTab: false
ca@1845
   441
              acceptOnLostFocus: false
ca@1845
   442
              modifiedChannel: modifiedChannel
ca@1845
   443
              acceptOnPointerLeave: false
ca@1373
   444
            )
ca@1845
   445
           (LabelSpec
ca@1845
   446
              label: 'Selector / Minor Key:'
ca@1845
   447
              name: 'minorKeyLabel'
ca@1845
   448
              layout: (AlignmentOrigin 160 0 55 0 1 0.5)
ca@1845
   449
              translateLabel: true
ca@1845
   450
              resizeForLabel: true
ca@1373
   451
            )
ca@1845
   452
           (InputFieldSpec
ca@1845
   453
              name: 'minorKeyField'
ca@1845
   454
              layout: (LayoutFrame 161 0 44 0 -5 1.0 66 0)
ca@1845
   455
              activeHelpKey: majorKey
ca@1845
   456
              tabable: true
ca@1845
   457
              model: minorKey
ca@1845
   458
              group: inputGroup
ca@1845
   459
              type: symbolOrNil
ca@1845
   460
              immediateAccept: true
ca@1845
   461
              acceptOnReturn: false
ca@1845
   462
              acceptOnTab: false
ca@1845
   463
              acceptOnLostFocus: false
ca@1845
   464
              modifiedChannel: modifiedChannel
ca@1845
   465
              acceptOnPointerLeave: false
ca@1373
   466
            )
ca@1845
   467
           (FramedBoxSpec
ca@1845
   468
              label: 'Scroll Bars'
ca@1845
   469
              name: 'FramedBox'
ca@1860
   470
              layout: (LayoutFrame 0 0.0 119 0.0 0 1.0 218 0)
ca@1845
   471
              labelPosition: topLeft
cg@1876
   472
              translateLabel: true
ca@1845
   473
              component: 
ca@1845
   474
             (SpecCollection
ca@1845
   475
                collection: (
ca@1845
   476
                 (HorizontalPanelViewSpec
ca@1845
   477
                    name: 'HorizontalPanel1'
ca@1845
   478
                    layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
ca@1845
   479
                    horizontalLayout: fitSpace
ca@1845
   480
                    verticalLayout: fitSpace
ca@1845
   481
                    horizontalSpace: 3
ca@1845
   482
                    verticalSpace: 3
ca@1845
   483
                    component: 
ca@1845
   484
                   (SpecCollection
ca@1845
   485
                      collection: (
ca@1845
   486
                       (ViewSpec
ca@1845
   487
                          name: 'Box1'
ca@1845
   488
                          component: 
ca@1845
   489
                         (SpecCollection
ca@1845
   490
                            collection: (
ca@1845
   491
                             (CheckBoxSpec
ca@1845
   492
                                label: 'Vertical'
ca@1845
   493
                                name: 'verticalScrollBarCheckBox'
ca@1845
   494
                                layout: (LayoutFrame 0 0.0 3 0 0 1.0 27 0)
ca@1845
   495
                                activeHelpKey: verticalScroller
ca@1845
   496
                                tabable: true
ca@1845
   497
                                model: hasVerticalScrollBar
ca@1845
   498
                                translateLabel: true
ca@1373
   499
                              )
ca@1845
   500
                             (CheckBoxSpec
ca@1845
   501
                                label: 'Mini'
ca@1845
   502
                                name: 'miniScrollerVerticalCheckBox'
ca@1845
   503
                                layout: (LayoutFrame 0 0.0 32 0 0 1.0 56 0)
ca@1845
   504
                                activeHelpKey: verticalMiniScroller
ca@1845
   505
                                tabable: true
ca@1845
   506
                                model: miniScrollerVertical
ca@1845
   507
                                translateLabel: true
ca@1373
   508
                              )
ca@1373
   509
                             )
ca@1373
   510
                           
ca@1373
   511
                          )
ca@1845
   512
                          useDefaultExtent: true
ca@1373
   513
                        )
ca@1845
   514
                       (ViewSpec
ca@1845
   515
                          name: 'Box2'
ca@1845
   516
                          component: 
ca@1845
   517
                         (SpecCollection
ca@1845
   518
                            collection: (
ca@1845
   519
                             (CheckBoxSpec
ca@1845
   520
                                label: 'Horizontal'
ca@1845
   521
                                name: 'horizontalScrollBarCheckBox'
ca@1845
   522
                                layout: (LayoutFrame 0 0.0 3 0 0 1.0 27 0)
ca@1845
   523
                                activeHelpKey: horizontalScroller
ca@1845
   524
                                tabable: true
ca@1845
   525
                                model: hasHorizontalScrollBar
ca@1845
   526
                                translateLabel: true
ca@1373
   527
                              )
ca@1845
   528
                             (CheckBoxSpec
ca@1845
   529
                                label: 'Mini'
ca@1845
   530
                                name: 'miniScrollerHorizontalCheckBox'
ca@1845
   531
                                layout: (LayoutFrame 0 0.0 32 0 0 1.0 56 0)
ca@1845
   532
                                activeHelpKey: horizontalMiniScroller
ca@1845
   533
                                tabable: true
ca@1845
   534
                                model: miniScrollerHorizontal
ca@1845
   535
                                translateLabel: true
ca@1373
   536
                              )
ca@1373
   537
                             )
ca@1373
   538
                           
ca@1373
   539
                          )
cg@1876
   540
                          extent: (Point 113 61)
ca@1373
   541
                        )
ca@1845
   542
                       (ViewSpec
ca@1845
   543
                          name: 'Box3'
ca@1845
   544
                          component: 
ca@1845
   545
                         (SpecCollection
ca@1845
   546
                            collection: (
ca@1845
   547
                             (LabelSpec
ca@1845
   548
                                label: 'Auto Hide:'
ca@1845
   549
                                name: 'Label1'
ca@1845
   550
                                layout: (LayoutFrame 0 0.0 6 0 0 1.0 23 0)
ca@1845
   551
                                translateLabel: true
ca@1845
   552
                                resizeForLabel: true
ca@1845
   553
                                adjust: left
ca@1373
   554
                              )
ca@1845
   555
                             (PopUpListSpec
ca@1845
   556
                                label: 'Default'
ca@1845
   557
                                name: 'PopUpList1'
ca@1845
   558
                                layout: (LayoutFrame 0 0.0 32 0 0 1.0 54 0)
ca@1845
   559
                                activeHelpKey: autoHideScrollBars
ca@1845
   560
                                tabable: true
ca@1845
   561
                                model: autoHideScrollBars
ca@1845
   562
                                menu: 
ca@1845
   563
                               (Default
ca@1845
   564
                                  On Off
ca@1373
   565
                                )
ca@1845
   566
                                useIndex: true
ca@1373
   567
                              )
ca@1373
   568
                             )
ca@1373
   569
                           
ca@1373
   570
                          )
cg@1876
   571
                          extent: (Point 113 61)
ca@1373
   572
                        )
ca@1373
   573
                       )
ca@1373
   574
                     
ca@1373
   575
                    )
ca@1373
   576
                  )
ca@1373
   577
                 )
ca@1373
   578
               
ca@1373
   579
              )
ca@1373
   580
            )
ca@1845
   581
           (CheckBoxSpec
ca@1845
   582
              label: 'Create New Builder'
ca@1845
   583
              name: 'createNewBuilder'
ca@1845
   584
              layout: (Point 161 75)
ca@1845
   585
              activeHelpKey: createNewBuilder
ca@1845
   586
              model: createNewBuilder
ca@1845
   587
              translateLabel: true
ca@1373
   588
            )
ca@1373
   589
           )
ca@1373
   590
         
ca@1373
   591
        )
ca@1373
   592
      )
ca@1373
   593
!
ca@1373
   594
ca@1373
   595
detailSpec
ca@1373
   596
    "This resource specification was automatically generated
ca@1373
   597
     by the UIPainter of ST/X."
ca@1373
   598
ca@1373
   599
    "Do not manually edit this!! If it is corrupted,
ca@1373
   600
     the UIPainter may not be able to read the specification."
ca@1373
   601
ca@1373
   602
    "
ca@1373
   603
     UIPainter new openOnClass:TabListEditor andSelector:#detailSpec
ca@1373
   604
     TabListEditor new openInterface:#detailSpec
ca@1373
   605
    "
ca@1373
   606
ca@1373
   607
    <resource: #canvas>
ca@1373
   608
ca@1373
   609
    ^ 
cg@1876
   610
     #(FullSpec
cg@1876
   611
        name: detailSpec
cg@1876
   612
        window: 
cg@1876
   613
       (WindowSpec
cg@1876
   614
          label: 'Details'
cg@1876
   615
          name: 'Details'
cg@1876
   616
          min: (Point 10 10)
cg@1876
   617
          max: (Point 1280 1024)
cg@1876
   618
          bounds: (Rectangle 0 0 358 107)
ca@1373
   619
        )
cg@1876
   620
        component: 
cg@1876
   621
       (SpecCollection
cg@1876
   622
          collection: (
cg@1876
   623
           (CheckBoxSpec
cg@1876
   624
              label: 'Can Select'
cg@1876
   625
              name: 'enabled'
cg@1876
   626
              layout: (Point 46 14)
cg@1876
   627
              activeHelpKey: canSelect
cg@1876
   628
              tabable: true
cg@1876
   629
              model: enabled
cg@1876
   630
              translateLabel: true
cg@1183
   631
            )
cg@1876
   632
           (LabelSpec
cg@1876
   633
              label: 'Color:'
cg@1876
   634
              name: 'ForegroundLabel'
cg@1876
   635
              layout: (AlignmentOrigin 46 0 62 0 1 0.5)
cg@1876
   636
              translateLabel: true
cg@1876
   637
              resizeForLabel: true
cg@1876
   638
              adjust: right
cg@1183
   639
            )
cg@1876
   640
           (ColorMenuSpec
cg@1876
   641
              name: 'ForegroundColorMenu'
cg@1876
   642
              layout: (LayoutFrame 48 0 50 0 -10 1.0 72 0)
cg@1876
   643
              activeHelpKey: color
cg@1876
   644
              model: labelForegroundColor
cg@1876
   645
              labelsAreColored: false
cg@1183
   646
            )
cg@1183
   647
           )
cg@1183
   648
         
cg@1183
   649
        )
tz@739
   650
      )
tz@739
   651
!
tz@739
   652
tz@739
   653
windowSpec
tz@739
   654
    "This resource specification was automatically generated
tz@739
   655
     by the UIPainter of ST/X."
tz@739
   656
tz@739
   657
    "Do not manually edit this!! If it is corrupted,
tz@739
   658
     the UIPainter may not be able to read the specification."
tz@739
   659
tz@739
   660
    "
tz@739
   661
     UIPainter new openOnClass:TabListEditor andSelector:#windowSpec
tz@739
   662
     TabListEditor new openInterface:#windowSpec
tz@739
   663
     TabListEditor open
tz@739
   664
    "
tz@739
   665
tz@739
   666
    <resource: #canvas>
tz@739
   667
cg@1183
   668
    ^ 
cg@1183
   669
     #(#FullSpec
cg@1183
   670
        #name: #windowSpec
cg@1183
   671
        #window: 
cg@1183
   672
       #(#WindowSpec
cg@1183
   673
          #label: 'Tab List Editor'
cg@1183
   674
          #name: 'Tab List Editor'
cg@1183
   675
          #min: #(#Point 440 280)
ca@1375
   676
          #bounds: #(#Rectangle 596 292 1132 661)
cg@1183
   677
          #menu: #menu
cg@1183
   678
        )
cg@1183
   679
        #component: 
cg@1183
   680
       #(#SpecCollection
cg@1183
   681
          #collection: #(
cg@1183
   682
           #(#MenuPanelSpec
cg@1183
   683
              #name: 'menuToolbarView'
cg@1183
   684
              #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 34 0)
cg@1183
   685
              #menu: #menuToolbar
cg@1183
   686
              #showSeparatingLines: true
cg@1183
   687
            )
cg@1183
   688
           #(#VariableHorizontalPanelSpec
cg@1183
   689
              #name: 'VariablePanel'
cg@1183
   690
              #layout: #(#LayoutFrame 0 0.0 36 0.0 0 1.0 -26 1.0)
cg@1183
   691
              #component: 
cg@1183
   692
             #(#SpecCollection
cg@1183
   693
                #collection: #(
ca@1373
   694
                 #(#SelectionInListModelViewSpec
ca@1373
   695
                    #attributes: 
ca@1373
   696
                   #(#vpext
ca@1373
   697
                      
ca@1373
   698
                     #(#Array
ca@1374
   699
                        #Array #Array
ca@1374
   700
                        #Array #Array
ca@1375
   701
                        #Array #Point
ca@1375
   702
                        0.264414 1.0
ca@1373
   703
                      )
ca@1373
   704
                    )
ca@1373
   705
                    #name: 'ListOfLabels'
ca@1373
   706
                    #tabable: true
cg@1183
   707
                    #model: #selectionHolder
cg@1183
   708
                    #menu: #menuEdit
cg@1183
   709
                    #hasHorizontalScrollBar: true
cg@1183
   710
                    #hasVerticalScrollBar: true
cg@1183
   711
                    #miniScrollerHorizontal: true
ca@1373
   712
                    #listModel: #listOfTabs
ca@1373
   713
                    #highlightMode: #line
ca@1373
   714
                    #selectConditionSelector: #askForItemModification
cg@1183
   715
                  )
cg@1183
   716
                 #(#ViewSpec
cg@1183
   717
                    #name: 'SpecView'
cg@1183
   718
                    #level: -1
tz@739
   719
                    #component: 
cg@1183
   720
                   #(#SpecCollection
cg@1183
   721
                      #collection: #(
ca@1373
   722
                       #(#NoteBookViewSpec
ca@1373
   723
                          #name: 'NoteBook'
cg@1183
   724
                          #layout: #(#LayoutFrame 1 0.0 0 0.0 0 1.0 -30 1.0)
ca@1375
   725
                          #enableChannel: #hasSelectionHolder
ca@1374
   726
                          #tabable: true
ca@1373
   727
                          #model: #noteBookModel
ca@1373
   728
                          #menu: #noteBookTabList
ca@1373
   729
                          #useIndex: true
ca@1373
   730
                          #keepCanvasAlive: true
cg@1183
   731
                        )
cg@1183
   732
                       #(#UISubSpecification
cg@1183
   733
                          #name: 'subSpec'
cg@1183
   734
                          #layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1)
cg@1183
   735
                          #majorKey: #ToolApplicationModel
cg@1183
   736
                          #minorKey: #windowSpecForCommit
cg@1183
   737
                        )
ca@1373
   738
                       #(#NoteBookViewSpec
ca@1373
   739
                          #name: 'TestNoteBook'
ca@1373
   740
                          #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
ca@1373
   741
                          #visibilityChannel: #testMode
ca@1374
   742
                          #tabable: true
ca@1373
   743
                          #menu: #testItemList
ca@1373
   744
                          #useIndex: true
ca@1373
   745
                        )
cg@1183
   746
                       )
cg@1183
   747
                     
tz@739
   748
                    )
cg@1183
   749
                  )
cg@1183
   750
                 )
cg@1183
   751
               
tz@739
   752
              )
ca@1373
   753
              #handles: #(#Any 0.24053 1.0)
cg@1183
   754
            )
cg@1183
   755
           #(#UISubSpecification
cg@1183
   756
              #name: 'infoBarSubSpec'
cg@1183
   757
              #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
cg@1183
   758
              #majorKey: #ToolApplicationModel
cg@1183
   759
              #minorKey: #windowSpecForInfoBar
cg@1183
   760
            )
cg@1183
   761
           )
cg@1183
   762
         
cg@1183
   763
        )
tz@739
   764
      )
tz@739
   765
! !
tz@739
   766
ca@1373
   767
!TabListEditor class methodsFor:'list specs'!
ca@1373
   768
ca@1373
   769
noteBookTabList
ca@1373
   770
    "This resource specification was automatically generated
ca@1373
   771
     by the TabListEditor of ST/X."
ca@1373
   772
ca@1373
   773
    "Do not manually edit this!! If it is corrupted,
ca@1373
   774
     the TabListEditor may not be able to read the specification."
ca@1373
   775
ca@1373
   776
    "
ca@1373
   777
     TabListEditor new openOnClass:TabListEditor andSelector:#noteBookTabList
ca@1373
   778
    "
ca@1373
   779
ca@1373
   780
    <resource: #tabList>
ca@1373
   781
ca@1373
   782
    ^     #(
ca@1373
   783
       #(#TabItem
ca@1373
   784
          #label: 'Basic'
ca@1373
   785
          #activeHelpKey: #basicTab
ca@1373
   786
          #minorKey: #basicSpec
ca@1373
   787
        )
ca@1373
   788
       #(#TabItem
ca@1373
   789
          #label: 'Details'
ca@1373
   790
          #activeHelpKey: #detailTab
ca@1373
   791
          #minorKey: #detailSpec
ca@1373
   792
        )
ca@1373
   793
       #(#TabItem
ca@1373
   794
          #label: 'Canvas'
ca@1373
   795
          #activeHelpKey: #canvasTab
ca@1373
   796
          #minorKey: #canvasSpec
ca@1373
   797
        )
ca@1373
   798
       )
ca@1373
   799
     
ca@1373
   800
      collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]
ca@1373
   801
! !
ca@1373
   802
tz@739
   803
!TabListEditor class methodsFor:'menu specs'!
tz@739
   804
tz@739
   805
menu
tz@739
   806
    "This resource specification was automatically generated
tz@739
   807
     by the MenuEditor of ST/X."
tz@739
   808
tz@739
   809
    "Do not manually edit this!! If it is corrupted,
tz@739
   810
     the MenuEditor may not be able to read the specification."
tz@739
   811
tz@739
   812
    "
tz@739
   813
     MenuEditor new openOnClass:TabListEditor andSelector:#menu
tz@739
   814
     (Menu new fromLiteralArrayEncoding:(TabListEditor menu)) startUp
tz@739
   815
    "
tz@739
   816
tz@739
   817
    <resource: #menu>
tz@739
   818
tz@739
   819
    ^
tz@739
   820
     
tz@739
   821
       #(#Menu
tz@739
   822
          
tz@739
   823
           #(
tz@739
   824
             #(#MenuItem
tz@739
   825
                #label: 'About'
tz@739
   826
                #activeHelpKey: #about
tz@739
   827
                #labelImage: #(#ResourceRetriever nil #menuIcon)
tz@739
   828
                #submenuChannel: #menuAbout
tz@739
   829
            )
tz@739
   830
             #(#MenuItem
tz@739
   831
                #label: 'File'
tz@739
   832
                #activeHelpKey: #file
tz@739
   833
                #submenu: 
tz@739
   834
                 #(#Menu
tz@739
   835
                    
tz@739
   836
                     #(
tz@739
   837
                       #(#MenuItem
tz@739
   838
                          #label: 'New'
tz@739
   839
                          #value: #doNew
tz@739
   840
                          #activeHelpKey: #fileNew
tz@739
   841
                      )
tz@739
   842
                       #(#MenuItem
tz@739
   843
                          #label: '-'
tz@739
   844
                      )
tz@739
   845
                       #(#MenuItem
tz@739
   846
                          #label: 'Load...'
tz@739
   847
                          #translateLabel: true
tz@739
   848
                          #value: #doLoad
tz@739
   849
                          #activeHelpKey: #fileLoad
tz@739
   850
                      )
tz@739
   851
                       #(#MenuItem
tz@739
   852
                          #label: '-'
tz@739
   853
                      )
tz@739
   854
                       #(#MenuItem
tz@739
   855
                          #label: 'Save'
tz@739
   856
                          #value: #doSave
tz@739
   857
                          #activeHelpKey: #fileSave
tz@739
   858
                      )
tz@739
   859
                       #(#MenuItem
tz@739
   860
                          #label: 'Save As...'
tz@739
   861
                          #value: #doSaveAs
tz@739
   862
                          #activeHelpKey: #fileSave
tz@739
   863
                      )
tz@739
   864
                       #(#MenuItem
tz@739
   865
                          #label: '-'
tz@739
   866
                      )
tz@739
   867
                       #(#MenuItem
tz@739
   868
                          #label: 'Browse Class'
tz@739
   869
                          #value: #doBrowseClass
tz@739
   870
                          #activeHelpKey: #fileBrowseClass
tz@739
   871
                      )
tz@739
   872
                       #(#MenuItem
tz@739
   873
                          #label: '-'
tz@739
   874
                      )
tz@739
   875
                       #(#MenuItem
tz@739
   876
                          #label: 'Exit'
tz@739
   877
                          #value: #closeRequest
tz@739
   878
                          #activeHelpKey: #fileExit
tz@739
   879
                      )
tz@739
   880
                    ) nil
tz@739
   881
                    nil
tz@739
   882
                )
tz@739
   883
            )
tz@739
   884
             #(#MenuItem
tz@739
   885
                #label: 'Edit'
tz@739
   886
                #activeHelpKey: #edit
tz@739
   887
                #submenuChannel: #menuEdit
tz@739
   888
            )
tz@739
   889
             #(#MenuItem
tz@739
   890
                #label: 'Add'
tz@739
   891
                #activeHelpKey: #add
tz@739
   892
                #submenu: 
tz@739
   893
                 #(#Menu
tz@739
   894
                    
tz@739
   895
                     #(
tz@739
   896
                       #(#MenuItem
tz@739
   897
                          #label: 'Tab Item'
ca@1373
   898
                          #value: #doCreate
tz@739
   899
                          #activeHelpKey: #addTabItem
tz@739
   900
                          #labelImage: #(#ResourceRetriever nil #newTabItemIcon 'Tab Item')
tz@739
   901
                      )
tz@739
   902
                    ) nil
tz@739
   903
                    nil
tz@739
   904
                )
tz@739
   905
            )
tz@739
   906
             #(#MenuItem
tz@739
   907
                #label: 'Generate'
tz@739
   908
                #activeHelpKey: #add
tz@739
   909
                #submenu: 
tz@739
   910
                 #(#Menu
tz@739
   911
                    
tz@739
   912
                     #(
tz@739
   913
                       #(#MenuItem
tz@739
   914
                          #label: 'Aspect Method'
tz@739
   915
                          #value: #doGenerateAspectMethod
tz@739
   916
                          #activeHelpKey: #fileCreateAspectMethod
tz@739
   917
                          #enabled: #hasClassAndSelector
tz@739
   918
                      )
tz@739
   919
                    ) nil
tz@739
   920
                    nil
tz@739
   921
                )
tz@739
   922
            )
tz@739
   923
             #(#MenuItem
tz@739
   924
                #label: 'Test'
tz@739
   925
                #activeHelpKey: #test
tz@739
   926
                #submenu: 
tz@739
   927
                 #(#Menu
tz@739
   928
                    
tz@739
   929
                     #(
tz@739
   930
                       #(#MenuItem
tz@739
   931
                          #label: 'Preview'
tz@739
   932
                          #activeHelpKey: #testPreview
ca@1373
   933
                          #enabled: #canToggleTestMode
tz@739
   934
                          #indication: #testMode
tz@739
   935
                      )
tz@739
   936
                    ) nil
tz@739
   937
                    nil
tz@739
   938
                )
tz@739
   939
            )
tz@739
   940
             #(#MenuItem
tz@749
   941
                #label: 'History'
tz@749
   942
                #activeHelpKey: #history
tz@749
   943
                #submenuChannel: #menuHistory
tz@749
   944
            )
tz@749
   945
             #(#MenuItem
cg@2667
   946
                label: 'MENU_Help'
tz@739
   947
                #startGroup: #right
tz@739
   948
                #activeHelpKey: #help
tz@739
   949
                #submenuChannel: #menuHelp
cg@2667
   950
                startGroup: conditionalRight
tz@739
   951
            )
tz@739
   952
          ) nil
tz@739
   953
          nil
tz@739
   954
      )
tz@739
   955
!
tz@739
   956
tz@739
   957
menuEdit
tz@739
   958
    "This resource specification was automatically generated
tz@739
   959
     by the MenuEditor of ST/X."
tz@739
   960
tz@739
   961
    "Do not manually edit this!! If it is corrupted,
tz@739
   962
     the MenuEditor may not be able to read the specification."
tz@739
   963
tz@739
   964
    "
tz@739
   965
     MenuEditor new openOnClass:TabListEditor andSelector:#menuEdit
tz@739
   966
     (Menu new fromLiteralArrayEncoding:(TabListEditor menuEdit)) startUp
tz@739
   967
    "
tz@739
   968
tz@739
   969
    <resource: #menu>
tz@739
   970
ca@1374
   971
    ^ 
ca@1374
   972
     #(#Menu
ca@1374
   973
        #(
ca@1374
   974
         #(#MenuItem
ca@1374
   975
            #label: 'Cut'
ca@1374
   976
            #value: #doCut
ca@1374
   977
            #activeHelpKey: #editCut
ca@1374
   978
            #enabled: #hasSelectionHolder
ca@1374
   979
          )
ca@1374
   980
         #(#MenuItem
ca@1374
   981
            #label: 'Copy'
ca@1374
   982
            #value: #doCopy
ca@1374
   983
            #activeHelpKey: #editCopy
ca@1374
   984
            #enabled: #hasSelectionHolder
ca@1374
   985
          )
ca@1374
   986
         #(#MenuItem
ca@1374
   987
            #label: 'Paste'
ca@1374
   988
            #value: #doPaste
ca@1374
   989
            #activeHelpKey: #editPaste
sv@2383
   990
            #enabled: #canPasteHolder
ca@1374
   991
          )
ca@1374
   992
         #(#MenuItem
ca@1374
   993
            #label: 'Delete'
ca@1374
   994
            #value: #doDelete
ca@1374
   995
            #activeHelpKey: #editPaste
ca@1374
   996
            #enabled: #hasSelectionHolder
ca@1374
   997
          )
ca@1374
   998
         #(#MenuItem
ca@1374
   999
            #label: '-'
ca@1374
  1000
          )
ca@1374
  1001
         #(#MenuItem
ca@1374
  1002
            #label: 'Move Up'
ca@1374
  1003
            #value: #doMoveTabUpOrDown:
ca@1374
  1004
            #activeHelpKey: #editMoveUp
ca@1374
  1005
            #enabled: #canMoveTabItemUpOrDown
ca@1374
  1006
            #argument: #up
ca@1374
  1007
            #labelImage: #(#ResourceRetriever #Icon #upIcon 'Move Up')
ca@1374
  1008
          )
ca@1374
  1009
         #(#MenuItem
ca@1374
  1010
            #label: 'Move Down'
ca@1374
  1011
            #value: #doMoveTabUpOrDown:
ca@1374
  1012
            #activeHelpKey: #editMoveDown
ca@1374
  1013
            #enabled: #canMoveTabItemUpOrDown
ca@1374
  1014
            #argument: #down
ca@1374
  1015
            #labelImage: #(#ResourceRetriever #Icon #downIcon 'Move Down')
ca@1374
  1016
          )
ca@1374
  1017
         #(#MenuItem
ca@1374
  1018
            #label: '-'
ca@1374
  1019
            #isVisible: #hiddenAccelerator
ca@1374
  1020
          )
ca@1374
  1021
         #(#MenuItem
ca@1374
  1022
            #label: 'Accept'
ca@1374
  1023
            #translateLabel: true
ca@1374
  1024
            #isVisible: #hiddenAccelerator
ca@1374
  1025
            #value: #accept
sv@2432
  1026
            #enabled: #enablingCommitButtonsHolder
ca@1374
  1027
          )
ca@1374
  1028
         )
ca@1374
  1029
        nil
ca@1374
  1030
        nil
tz@739
  1031
      )
tz@739
  1032
!
tz@739
  1033
tz@739
  1034
menuToolbar
tz@739
  1035
    "This resource specification was automatically generated
tz@739
  1036
     by the MenuEditor of ST/X."
tz@739
  1037
tz@739
  1038
    "Do not manually edit this!! If it is corrupted,
tz@739
  1039
     the MenuEditor may not be able to read the specification."
tz@739
  1040
tz@739
  1041
    "
tz@739
  1042
     MenuEditor new openOnClass:TabListEditor andSelector:#menuToolbar
tz@739
  1043
     (Menu new fromLiteralArrayEncoding:(TabListEditor menuToolbar)) startUp
tz@739
  1044
    "
tz@739
  1045
tz@739
  1046
    <resource: #menu>
tz@739
  1047
ca@1373
  1048
    ^ 
cg@1909
  1049
     #(Menu
cg@1909
  1050
        (
cg@1909
  1051
         (MenuItem
cg@1909
  1052
            activeHelpKey: fileNew
cg@1909
  1053
            label: 'New'
cg@1909
  1054
            itemValue: doNew
cg@1909
  1055
            translateLabel: true
cg@1909
  1056
            isButton: true
cg@1909
  1057
            labelImage: (ResourceRetriever ToolbarIconLibrary new22x22Icon)
ca@1373
  1058
          )
cg@1909
  1059
         (MenuItem
cg@1909
  1060
            activeHelpKey: fileLoad
cg@1909
  1061
            label: 'Load'
cg@1909
  1062
            itemValue: doLoad
cg@1909
  1063
            translateLabel: true
cg@1909
  1064
            isButton: true
cg@1909
  1065
            labelImage: (ResourceRetriever ToolbarIconLibrary loadFromMethodIcon)
ca@1373
  1066
          )
cg@1909
  1067
         (MenuItem
cg@1909
  1068
            activeHelpKey: fileSave
cg@1909
  1069
            label: 'Save'
cg@1909
  1070
            itemValue: doSave
cg@1909
  1071
            translateLabel: true
cg@1909
  1072
            isButton: true
cg@1909
  1073
            labelImage: (ResourceRetriever ToolbarIconLibrary saveAsMethodIcon)
ca@1373
  1074
          )
cg@1909
  1075
         (MenuItem
cg@1909
  1076
            label: '-'
ca@1373
  1077
          )
cg@1909
  1078
         (MenuItem
cg@1909
  1079
            activeHelpKey: editCut
cg@1909
  1080
            enabled: hasSelectionHolder
cg@1909
  1081
            label: 'Cut'
cg@1909
  1082
            itemValue: doCut
cg@1909
  1083
            translateLabel: true
cg@1909
  1084
            isButton: true
cg@1909
  1085
            labelImage: (ResourceRetriever ToolbarIconLibrary cutWidgetIcon)
ca@1373
  1086
          )
cg@1909
  1087
         (MenuItem
cg@1909
  1088
            activeHelpKey: editCopy
cg@1909
  1089
            enabled: hasSelectionHolder
cg@1909
  1090
            label: 'Copy'
cg@1909
  1091
            itemValue: doCopy
cg@1909
  1092
            translateLabel: true
cg@1909
  1093
            isButton: true
cg@1909
  1094
            labelImage: (ResourceRetriever ToolbarIconLibrary copyWidgetIcon)
ca@1373
  1095
          )
cg@1909
  1096
         (MenuItem
cg@1909
  1097
            activeHelpKey: editPaste
sv@2383
  1098
            enabled: canPasteHolder
cg@1909
  1099
            label: 'Paste'
cg@1909
  1100
            itemValue: doPaste
cg@1909
  1101
            translateLabel: true
cg@1909
  1102
            isButton: true
cg@1909
  1103
            labelImage: (ResourceRetriever ToolbarIconLibrary pasteWidgetIcon)
ca@1373
  1104
          )
cg@1909
  1105
         (MenuItem
cg@1909
  1106
            activeHelpKey: editDelete
cg@1909
  1107
            enabled: hasSelectionHolder
cg@1909
  1108
            label: 'Delete'
cg@1909
  1109
            itemValue: doDelete
cg@1909
  1110
            translateLabel: true
cg@1909
  1111
            isButton: true
cg@1909
  1112
            isVisible: false
cg@1909
  1113
            labelImage: (ResourceRetriever ToolbarIconLibrary delete22x22Icon)
ca@1373
  1114
          )
cg@1909
  1115
         (MenuItem
cg@1909
  1116
            label: '-'
ca@1373
  1117
          )
cg@1909
  1118
         (MenuItem
cg@1909
  1119
            activeHelpKey: addTabItem
cg@1909
  1120
            label: 'Add Tab Item'
cg@1909
  1121
            itemValue: doCreate
cg@1909
  1122
            translateLabel: true
cg@1909
  1123
            isButton: true
cg@1909
  1124
            labelImage: (ResourceRetriever nil newTabItemIcon)
ca@1373
  1125
          )
cg@1909
  1126
         (MenuItem
cg@1909
  1127
            label: ''
ca@1373
  1128
          )
cg@1909
  1129
         (MenuItem
cg@1909
  1130
            activeHelpKey: editMoveUp
cg@1909
  1131
            enabled: canMoveTabItemUpOrDown
cg@1909
  1132
            label: 'Move Tab Up'
cg@1909
  1133
            itemValue: doMoveTabUpOrDown:
cg@1909
  1134
            translateLabel: true
cg@1909
  1135
            isButton: true
cg@1909
  1136
            startGroup: right
cg@1909
  1137
            labelImage: (ResourceRetriever XPToolbarIconLibrary up22x22Icon)
cg@1909
  1138
            argument: up
ca@1373
  1139
          )
cg@1909
  1140
         (MenuItem
cg@1909
  1141
            activeHelpKey: editMoveDown
cg@1909
  1142
            enabled: canMoveTabItemUpOrDown
cg@1909
  1143
            label: 'Move Tab Down'
cg@1909
  1144
            itemValue: doMoveTabUpOrDown:
cg@1909
  1145
            translateLabel: true
cg@1909
  1146
            isButton: true
cg@1909
  1147
            startGroup: right
cg@1909
  1148
            labelImage: (ResourceRetriever XPToolbarIconLibrary down22x22Icon)
cg@1909
  1149
            argument: down
ca@1373
  1150
          )
ca@1373
  1151
         )
ca@1373
  1152
        nil
ca@1373
  1153
        nil
tz@739
  1154
      )
tz@739
  1155
! !
tz@739
  1156
tz@739
  1157
!TabListEditor methodsFor:'aspects'!
tz@739
  1158
ca@1373
  1159
autoHideScrollBars
ca@1373
  1160
    |holder|
ca@1373
  1161
ca@1373
  1162
    (holder := builder bindingAt:#autoHideScrollBars) isNil ifTrue:[
ca@1373
  1163
        builder aspectAt:#autoHideScrollBars put:(holder := 1 asValue).
ca@1373
  1164
        holder addDependent: self
ca@1373
  1165
    ].
ca@1373
  1166
    ^ holder.
ca@1373
  1167
!
ca@1373
  1168
tz@739
  1169
canMoveTabItemUpOrDown
ca@1373
  1170
    ^ builder booleanValueAspectFor:#canMoveTabItemUpOrDown
ca@1373
  1171
!
ca@1373
  1172
ca@1374
  1173
hasSelectionHolder
ca@1374
  1174
    ^ builder booleanValueAspectFor:#hasSelectionHolder
ca@1374
  1175
!
ca@1374
  1176
ca@1374
  1177
hiddenAccelerator
ca@1374
  1178
    "used to set menu entries with an accelerator not visible to the operator
ca@1374
  1179
    "
ca@1374
  1180
    ^ false
ca@1374
  1181
!
ca@1374
  1182
ca@1326
  1183
inputGroup
ca@1326
  1184
ca@1326
  1185
    |holder|
ca@1326
  1186
ca@1326
  1187
    (holder := builder bindingAt:#inputGroup) isNil ifTrue:[
ca@1326
  1188
        builder aspectAt:#inputGroup put:(holder := EnterFieldGroup new)
ca@1326
  1189
    ].
ca@1326
  1190
    ^ holder.
ca@1326
  1191
ca@1326
  1192
ca@1326
  1193
!
ca@1326
  1194
ca@1373
  1195
listOfTabs
ca@1373
  1196
    ^ listOfTabs
ca@1373
  1197
!
tz@739
  1198
ca@1373
  1199
noteBookModel
ca@1373
  1200
    |holder|
ca@1373
  1201
ca@1373
  1202
    (holder := builder bindingAt:#noteBookModel) isNil ifTrue:[
ca@1373
  1203
        holder := 0 asValue.
ca@1373
  1204
        builder aspectAt:#noteBookModel put:holder.
ca@1373
  1205
    ].
ca@1373
  1206
    ^ holder.
ca@1373
  1207
!
ca@1373
  1208
ca@1373
  1209
noteBookTabList
ca@1373
  1210
    "Generated by the TabListEditor"
ca@1373
  1211
ca@1373
  1212
    |list|
ca@1373
  1213
ca@1373
  1214
    (list := builder bindingAt:#noteBookTabList) isNil ifTrue:[
ca@1373
  1215
        builder aspectAt:#noteBookTabList put:(list := self class noteBookTabList).
ca@1373
  1216
    ].
ca@1373
  1217
    ^ list
tz@739
  1218
!
tz@739
  1219
tz@739
  1220
selectionHolder
tz@739
  1221
    "holder which keeps the current selection
tz@739
  1222
    "
tz@739
  1223
    |holder|
tz@739
  1224
tz@739
  1225
    (holder := builder bindingAt:#selectionHolder) isNil ifTrue:[
ca@1373
  1226
        holder := 0 asValue.
tz@739
  1227
        builder aspectAt:#selectionHolder put:holder.
ca@1373
  1228
        holder addDependent:self.
tz@739
  1229
    ].
tz@739
  1230
    ^ holder
tz@739
  1231
!
tz@739
  1232
ca@1373
  1233
testItemList
tz@739
  1234
    |holder|
tz@739
  1235
ca@1373
  1236
    (holder := builder bindingAt:#testItemList) isNil ifTrue:[
ca@1373
  1237
        holder := ValueHolder new.
ca@1373
  1238
        builder aspectAt:#testItemList put:holder.
tz@739
  1239
    ].
ca@1373
  1240
    ^ holder.
tz@739
  1241
!
tz@739
  1242
tz@739
  1243
testMode
tz@739
  1244
tz@739
  1245
    |holder|
tz@739
  1246
tz@739
  1247
    (holder := builder bindingAt:#testMode) isNil ifTrue:[
tz@739
  1248
        builder aspectAt:#testMode put:(holder := false asValue).
tz@739
  1249
        holder addDependent: self
tz@739
  1250
    ].
tz@739
  1251
    ^ holder
tz@739
  1252
tz@739
  1253
! !
tz@739
  1254
tz@739
  1255
!TabListEditor methodsFor:'building'!
tz@739
  1256
ca@1373
  1257
buildFromResourceSpec:aListSpec
ca@1373
  1258
    self buildFromTabList:aListSpec
tz@739
  1259
!
tz@739
  1260
tz@739
  1261
buildFromTabList: aTabList
tz@739
  1262
    "build from a aTabList"
tz@739
  1263
ca@1373
  1264
    self selection:0.
tz@739
  1265
    listOfTabs removeAll.
tz@739
  1266
cg@2819
  1267
    aTabList do:[:aTabItem| 
cg@2819
  1268
        self assert:(aTabItem isKindOf:TabItem).
cg@2819
  1269
        listOfTabs add: aTabItem 
cg@2819
  1270
    ].
cg@1972
  1271
    self clearModified.
ca@1374
  1272
    listOfTabs notEmpty ifTrue:[ self selection:1 ].
cg@2819
  1273
cg@2819
  1274
    "Modified: / 08-11-2010 / 13:57:27 / cg"
cg@1972
  1275
!
tz@739
  1276
cg@1972
  1277
loadFromClass:aClass andSelector:aSelector
cg@1972
  1278
    "build from class and selector"
cg@1972
  1279
cg@1972
  1280
    |cls spec|
cg@1972
  1281
cg@1972
  1282
    self assert:(aClass isNil or:[aClass isClass]).
cg@1972
  1283
cg@1972
  1284
    self testMode value: false.
cg@1972
  1285
    self selection:0.
cg@1972
  1286
cg@1972
  1287
    "if opened on a tab list"
cg@1972
  1288
    (aClass isNil and: [aSelector isNil and: [listOfTabs size > 0]]) ifFalse:[
cg@1972
  1289
        listOfTabs removeAll.
cg@1972
  1290
cg@1972
  1291
        cls := aClass isBehavior ifTrue:[ aClass ] ifFalse:[ self resolveName:aClass].
cg@1972
  1292
        specSelector := aSelector.
cg@1972
  1293
cg@1972
  1294
        cls notNil ifTrue:[
cg@1972
  1295
            specSelector notNil ifTrue:[
cg@1972
  1296
cg@1972
  1297
                (cls respondsTo: aSelector) ifTrue:[ 
cg@1972
  1298
                    spec := cls perform: aSelector.
cg@1972
  1299
                ].
cg@1972
  1300
                spec size ~~ 0 ifTrue:[
cg@2819
  1301
                    spec do:[:aTabOrArray|
cg@2819
  1302
                        |tab|
cg@2819
  1303
cg@2819
  1304
                        aTabOrArray isArray ifTrue:[  
cg@2819
  1305
                            tab := aTabOrArray decodeAsLiteralArray
cg@2819
  1306
                        ] ifFalse:[
cg@2819
  1307
                            tab := aTabOrArray.
cg@2819
  1308
                        ].
cg@2819
  1309
                        self assert:(tab isKindOf:TabItem).
cg@2819
  1310
                        listOfTabs add:tab.
cg@1972
  1311
                    ].
cg@1972
  1312
                    self addHistoryEntryForClass:cls selector:specSelector.
cg@1972
  1313
                ]
cg@1972
  1314
            ]
cg@1972
  1315
        ].
cg@1972
  1316
cg@1972
  1317
        self clearModified.
cg@1972
  1318
    ].
cg@1972
  1319
    listOfTabs notEmpty ifTrue:[ self selection:1 ].
cg@2819
  1320
cg@2819
  1321
    "Modified: / 08-11-2010 / 13:59:09 / cg"
tz@739
  1322
! !
tz@739
  1323
tz@739
  1324
!TabListEditor methodsFor:'change & update'!
tz@739
  1325
tz@739
  1326
update:something with:aParameter from:someObject
tz@739
  1327
    "one of my aspects has changed; update modified channel
tz@739
  1328
    "
ca@1374
  1329
    |list|
tz@739
  1330
ca@1373
  1331
    someObject = self selectionHolder ifTrue:[
ca@1373
  1332
        ^ self selectionChanged
ca@1373
  1333
    ].
tz@739
  1334
ca@1373
  1335
    someObject = self testMode ifFalse:[              
ca@1373
  1336
        ^ super update:something with:aParameter from:someObject.
ca@1373
  1337
    ].
ca@1373
  1338
ca@1373
  1339
    someObject value ifTrue:[
ca@1375
  1340
        self noteBookModel value:0.
ca@1375
  1341
ca@1374
  1342
        listOfTabs notEmpty ifTrue:[
ca@1373
  1343
            list := listOfTabs collect:[:aTab| |tab|
ca@1373
  1344
                tab := aTab copy.
ca@1373
  1345
                tab setAttributesFromClass:specClass.
ca@1373
  1346
                tab
ca@1374
  1347
            ]
ca@1374
  1348
        ].
ca@1374
  1349
        self selection:0.
ca@1373
  1350
    ].
ca@1373
  1351
    self testItemList value:list.
ca@1373
  1352
    self updateInfoLabel.
ca@1373
  1353
tz@739
  1354
! !
tz@739
  1355
ca@1373
  1356
!TabListEditor methodsFor:'queries'!
tz@739
  1357
ca@1373
  1358
canToggleTestMode
sv@2281
  1359
    "checks whether testMode button is enabled"
sv@2281
  1360
ca@1373
  1361
    self testMode value ifTrue:[
ca@1373
  1362
        ^ true
ca@1373
  1363
    ].
tz@739
  1364
sv@2281
  1365
    self enablingCommitButtonsHolder value ifFalse:[
ca@1373
  1366
        ^ listOfTabs notEmpty
ca@1373
  1367
    ].
ca@1373
  1368
    ^ false
tz@739
  1369
! !
tz@739
  1370
tz@739
  1371
!TabListEditor methodsFor:'selection'!
tz@739
  1372
ca@1373
  1373
selectedElement
ca@1373
  1374
    |idx tab|
ca@1373
  1375
ca@1373
  1376
    idx := self selection.
ca@1373
  1377
ca@1373
  1378
    idx ~~ 0 ifTrue:[
ca@1373
  1379
        (tab := listOfTabs at:idx ifAbsent:nil) notNil ifTrue:[
ca@1373
  1380
            ^ tab
ca@1373
  1381
        ].
ca@1373
  1382
        self selection:0
ca@1373
  1383
    ].
ca@1373
  1384
    ^ nil
tz@739
  1385
!
tz@739
  1386
ca@1373
  1387
selection
ca@1373
  1388
    ^ self selectionHolder value ? 0
ca@1373
  1389
!
tz@739
  1390
ca@1373
  1391
selection:anIndex
ca@1373
  1392
    self selectionHolder value:(anIndex ? 0).
ca@1373
  1393
!
tz@739
  1394
ca@1373
  1395
selectionChanged
ca@1373
  1396
    |noteBookModel hasSelection|
tz@739
  1397
ca@1373
  1398
    hasSelection  := self selection ~~ 0.
ca@1373
  1399
    noteBookModel := self noteBookModel.
tz@739
  1400
ca@1373
  1401
    hasSelection ifTrue:[
ca@1373
  1402
        self testMode value:false.
ca@1373
  1403
        noteBookModel value == 0 ifTrue:[noteBookModel value:1]
tz@739
  1404
    ] ifFalse:[
ca@1373
  1405
        noteBookModel value:0
tz@739
  1406
    ].
tz@739
  1407
    self cancel.
ca@1374
  1408
    self hasSelectionHolder value:hasSelection.
sv@2281
  1409
    self canPasteHolder.
ca@1373
  1410
!
tz@739
  1411
ca@1373
  1412
setSelection:anIndex
ca@1374
  1413
    |index|
ca@1374
  1414
ca@1374
  1415
    index := anIndex ? 0.
ca@1374
  1416
    self selectionHolder value:index withoutNotifying:self
tz@739
  1417
! !
tz@739
  1418
tz@739
  1419
!TabListEditor methodsFor:'startup / release'!
tz@739
  1420
tz@739
  1421
initialize
tz@739
  1422
    "setup aspects used by column description specifications
tz@739
  1423
    "
tz@739
  1424
    super initialize.
ca@1373
  1425
    listOfTabs := List new.
tz@739
  1426
!
tz@739
  1427
tz@739
  1428
openModalOnTabList: aTabList
tz@739
  1429
    "build a tab list from aTabList and open it modal"
tz@739
  1430
tz@739
  1431
    super openModalOnResourceSpec: aTabList
tz@739
  1432
tz@739
  1433
! !
tz@739
  1434
tz@739
  1435
!TabListEditor methodsFor:'user actions'!
tz@739
  1436
tz@739
  1437
accept
tz@739
  1438
    "accept changes
tz@739
  1439
    "
ca@1373
  1440
    |tab idx asb|
tz@739
  1441
ca@1373
  1442
    (tab := self selectedElement) notNil ifTrue:[
ca@1373
  1443
        super accept.
ca@1373
  1444
        aspects keysAndValuesDo:[:k :m| tab perform:(k , ':') asSymbol with:(m value) ].
cg@1066
  1445
ca@1373
  1446
        asb := self autoHideScrollBars value.
ca@1373
  1447
        asb := asb ~~ 1 ifTrue:[asb == 2] ifFalse:[nil].
ca@1373
  1448
        tab autoHideScrollBars:asb.
tz@739
  1449
    ].
tz@739
  1450
    self cancel.
ca@1373
  1451
!
ca@1373
  1452
ca@1373
  1453
addTab:aTab
ca@1373
  1454
    |idx|
ca@1373
  1455
ca@1373
  1456
    aTab notNil ifTrue:[
cg@2819
  1457
        self assert:(aTab isKindOf:TabItem).
ca@1373
  1458
        self testMode value: false.
ca@1373
  1459
ca@1373
  1460
        (idx := self selection) == 0 ifTrue:[
ca@1373
  1461
            listOfTabs add:aTab.
ca@1373
  1462
            self selection:(listOfTabs size).
ca@1373
  1463
        ] ifFalse:[
ca@1373
  1464
            listOfTabs add:aTab afterIndex:idx
ca@1373
  1465
        ].
cg@1972
  1466
        self setModified.
ca@1373
  1467
    ].
cg@2819
  1468
cg@2819
  1469
    "Modified: / 08-11-2010 / 13:55:27 / cg"
tz@739
  1470
!
tz@739
  1471
tz@739
  1472
cancel
sv@2281
  1473
    "cancel all changes"
sv@2281
  1474
ca@1373
  1475
    |tab idx asb|
tz@739
  1476
ca@1373
  1477
    (     (idx := self selection) ~~ 0
ca@1373
  1478
     and:[(tab := self selectedElement) notNil]
ca@1373
  1479
    ) ifTrue:[
ca@1373
  1480
        aspects keysAndValuesDo:[:k :m| m value:(tab perform:k) ].
ca@1373
  1481
        listOfTabs at:idx put:tab.
tz@739
  1482
ca@1373
  1483
        asb := tab autoHideScrollBars.
ca@1373
  1484
        asb notNil ifTrue:[asb := asb == true ifTrue:[2] ifFalse:[3]]
ca@1373
  1485
                  ifFalse:[asb := 1].
tz@739
  1486
ca@1373
  1487
        self autoHideScrollBars value:asb.
tz@739
  1488
    ].
ca@1373
  1489
    self canMoveTabItemUpOrDown value:(listOfTabs size > 1 and:[idx ~~ 0]).
sv@2281
  1490
    self enablingCommitButtonsHolder value: false
tz@739
  1491
!
tz@739
  1492
tz@739
  1493
doCopy
tz@739
  1494
    "copy selected tab
tz@739
  1495
    "
ca@1373
  1496
    |tab|
ca@1373
  1497
ca@1373
  1498
    (tab := self selectedElement) notNil ifTrue:[
ca@1373
  1499
        self clipboard:tab.
tz@749
  1500
        self updateAllToolInstances.
tz@739
  1501
    ]
tz@739
  1502
!
tz@739
  1503
ca@1373
  1504
doCreate
ca@1373
  1505
    self addTab:(TabItem label:'TAB').
tz@739
  1506
!
tz@739
  1507
tz@739
  1508
doCut
ca@1373
  1509
    "cut the selected tab; put to pasteBuffer
tz@739
  1510
    "
ca@1373
  1511
    |tab|
tz@739
  1512
ca@1373
  1513
    (tab := self selectedElement) notNil ifTrue:[
ca@1373
  1514
        self clipboard:tab.
ca@1373
  1515
        self doDelete.
tz@739
  1516
    ].
tz@739
  1517
tz@739
  1518
!
tz@739
  1519
tz@739
  1520
doDelete
tz@739
  1521
    "delete selected tab
tz@739
  1522
    "
ca@1374
  1523
    |index size|
tz@739
  1524
ca@1373
  1525
    (index := self selection) ~~ 0 ifTrue:[
tz@739
  1526
        self testMode value: false.
ca@1374
  1527
ca@1374
  1528
        (size := listOfTabs size) == 1 ifTrue:[
ca@1374
  1529
            self selection:0
ca@1374
  1530
        ] ifFalse:[
ca@1374
  1531
            self setSelection:0
ca@1374
  1532
        ].
tz@739
  1533
        listOfTabs removeIndex:index.
ca@1374
  1534
        index < size ifFalse:[
ca@1374
  1535
            index := index - 1
ca@1374
  1536
        ].
ca@1373
  1537
        self selection:index.
ca@1373
  1538
        self updateAllToolInstances.
cg@1972
  1539
        self setModified.
tz@739
  1540
    ].       
tz@739
  1541
!
tz@739
  1542
tz@739
  1543
doGenerateAspectMethod
tz@739
  1544
    "generate aspect method
tz@739
  1545
    "
tz@739
  1546
    |cls code|
tz@739
  1547
tz@739
  1548
    (specClass notNil and:[specSelector notNil])
tz@739
  1549
    ifFalse:
tz@739
  1550
    [
tz@739
  1551
        ^self information:'No class and selector defined!!'   
tz@739
  1552
    ].
tz@739
  1553
tz@739
  1554
    cls := self resolveName: specClass.
tz@739
  1555
tz@739
  1556
    (cls canUnderstand:specSelector) ifTrue:[
tz@739
  1557
        "/ method already exists, do not overwrite the method automaticaly
tz@739
  1558
tz@739
  1559
        ( YesNoBox title:'method '
tz@739
  1560
                         , (Text string:('#', specSelector) emphasis:#bold)
tz@739
  1561
                         , ' already exists!!'
tz@739
  1562
                 yesText:'overwrite'
tz@739
  1563
                  noText:'cancel'
tz@739
  1564
        ) confirm ifFalse:[
tz@739
  1565
            ^ self
tz@739
  1566
        ]
tz@739
  1567
    ].
tz@739
  1568
tz@739
  1569
    code := '!!' , cls name , ' methodsFor:''aspects''!!\\' ,
tz@739
  1570
            specSelector , '\' ,
tz@739
  1571
            '    "Generated by the TabListEditor"\' ,
tz@739
  1572
            '\' ,
tz@739
  1573
            '    |list|\' ,
tz@739
  1574
            '\' ,
tz@739
  1575
            '    (list := builder bindingAt:#' , specSelector , ') isNil ifTrue:[\' ,
tz@739
  1576
            '        builder aspectAt:#' , specSelector, ' put:(list := self class ', specSelector, ').\' ,
tz@739
  1577
            '    ].\' ,
tz@739
  1578
            '    ^ list\' ,
tz@739
  1579
            '!! !!\\'.
tz@739
  1580
tz@739
  1581
    (ReadStream on:(code withCRs)) fileIn
tz@739
  1582
tz@739
  1583
tz@739
  1584
!
tz@739
  1585
tz@739
  1586
doMoveTabUpOrDown:what
tz@739
  1587
    "step up or down
tz@739
  1588
    "
ca@1373
  1589
    |tab idx sz|
tz@739
  1590
ca@1373
  1591
    (listOfTabs size > 1 and:[(idx := self selection) ~~ 0]) ifFalse:[
tz@739
  1592
        ^ self
tz@739
  1593
    ].
tz@739
  1594
ca@1373
  1595
    (tab := listOfTabs at:idx ifAbsent:nil) isNil ifTrue:[
ca@1373
  1596
        ^ self selection:0
ca@1373
  1597
    ].
tz@739
  1598
ca@1373
  1599
    self setSelection:0.
ca@1373
  1600
    listOfTabs removeIndex:idx.
tz@739
  1601
ca@1373
  1602
    sz := listOfTabs size.
cg@1145
  1603
tz@739
  1604
    what == #down ifTrue:[
ca@1373
  1605
        idx := idx > sz ifTrue:[1] ifFalse:[idx + 1]
tz@739
  1606
    ] ifFalse:[
ca@1373
  1607
        idx := idx == 1 ifTrue:[sz + 1] ifFalse:[idx - 1]
tz@739
  1608
    ].
tz@739
  1609
ca@1373
  1610
    listOfTabs add:tab beforeIndex:idx.
ca@1373
  1611
    self setSelection:idx.
cg@1972
  1612
    self setModified.
tz@739
  1613
!
tz@739
  1614
tz@739
  1615
doPaste
tz@739
  1616
    "paste a tab
tz@739
  1617
    "
ca@1373
  1618
    |tab|
tz@739
  1619
ca@1373
  1620
    ((tab := self class clipboard) notNil and:[tab isKindOf:TabItem]) ifTrue:[
ca@1373
  1621
        self addTab:(tab deepCopy).
ca@1373
  1622
    ]
tz@739
  1623
!
tz@739
  1624
tz@739
  1625
doSave
cg@1972
  1626
    "generate code for class and instance"
cg@1972
  1627
ca@1245
  1628
    |cls code spec category mthd list|
tz@739
  1629
tz@739
  1630
    (specClass notNil and:[specSelector notNil])
tz@739
  1631
    ifFalse:
tz@739
  1632
    [
tz@739
  1633
        ^self doSaveAs
tz@739
  1634
    ].
tz@739
  1635
tz@739
  1636
    cls := self resolveName: specClass.
tz@739
  1637
tz@739
  1638
    listOfTabs isEmpty ifTrue:[^self information:'No tab list defined!!'].
tz@739
  1639
tz@739
  1640
    spec  := WriteStream on:String new.
ca@1245
  1641
    list := Array new:(listOfTabs size).
ca@1245
  1642
    listOfTabs keysAndValuesDo:[:i :el|list at:i put:(el literalArrayEncoding)].
ca@1245
  1643
ca@1245
  1644
    UISpecification prettyPrintSpecArray:list on:spec indent:5.
tz@739
  1645
    spec := spec contents.
tz@739
  1646
tz@739
  1647
    "/ if that method already exists, do not overwrite the category
tz@739
  1648
tz@739
  1649
    category := 'list specs'.
tz@739
  1650
tz@739
  1651
    (mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[
tz@739
  1652
        category := mthd category.
tz@739
  1653
    ].
tz@739
  1654
tz@739
  1655
    code := Character excla asString 
tz@739
  1656
            , cls name , ' class methodsFor:' , category storeString
tz@739
  1657
            , Character excla asString , '\\'
tz@739
  1658
tz@739
  1659
            , specSelector , '\'
tz@739
  1660
            , (self class codeGenerationComment replChar:$!! withString:'!!!!')
tz@739
  1661
            , '\\    "\'
cg@1855
  1662
            , '     TabListEditor new openOnClass: self andSelector:#' , specSelector , '\'
tz@739
  1663
            , '    "\'.
tz@739
  1664
tz@739
  1665
    code := code 
tz@739
  1666
            , '\'
tz@739
  1667
            , '    <resource: #tabList>\\'
tz@739
  1668
            , '    ^' 
tz@739
  1669
            , '     ', spec, '\'
tz@739
  1670
            , '      collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]'
tz@739
  1671
            , '\'
tz@739
  1672
            , Character excla asString
tz@739
  1673
            , ' '
tz@739
  1674
            , Character excla asString
tz@739
  1675
            , '\'.
tz@739
  1676
tz@739
  1677
    code := code withCRs.
tz@739
  1678
    (ReadStream on:code) fileIn.
tz@739
  1679
tz@739
  1680
    (cls canUnderstand:specSelector) ifFalse:[
cg@2828
  1681
        (YesNoBox confirm:(resources string:'Generate aspect method for tabList (#%1)?' with:specSelector)) ifTrue:[
tz@739
  1682
            self doGenerateAspectMethod
tz@739
  1683
        ]
tz@739
  1684
    ].
tz@739
  1685
cg@1972
  1686
    self addHistoryEntryForClass:cls selector:specSelector.
cg@1972
  1687
    self clearModified.
tz@739
  1688
    hasSaved  := true.
cg@1856
  1689
!
cg@1856
  1690
cg@1856
  1691
openDocumentation
cg@1856
  1692
   self openHTMLDocument:'tools/uipainter/TabListEditor.html'.
tz@739
  1693
! !
tz@739
  1694
tz@739
  1695
!TabListEditor class methodsFor:'documentation'!
tz@739
  1696
tz@739
  1697
version
cg@1066
  1698
    ^ '$Header$'
cg@2667
  1699
!
cg@2667
  1700
cg@2667
  1701
version_CVS
cg@2667
  1702
    ^ '$Header$'
tz@739
  1703
! !