TabListEditor.st
author Claus Gittinger <cg@exept.de>
Wed, 29 Jul 2009 20:02:02 +0200
changeset 2570 4e663bc64364
parent 2432 294274f5e342
child 2667 6cf6c1523e0c
permissions -rw-r--r--
changed #requestPackage
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)
cg@1183
   676
          #max: #(#Point 1152 900)
ca@1375
   677
          #bounds: #(#Rectangle 596 292 1132 661)
cg@1183
   678
          #menu: #menu
cg@1183
   679
        )
cg@1183
   680
        #component: 
cg@1183
   681
       #(#SpecCollection
cg@1183
   682
          #collection: #(
cg@1183
   683
           #(#MenuPanelSpec
cg@1183
   684
              #name: 'menuToolbarView'
cg@1183
   685
              #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 34 0)
cg@1183
   686
              #menu: #menuToolbar
cg@1183
   687
              #showSeparatingLines: true
cg@1183
   688
            )
cg@1183
   689
           #(#VariableHorizontalPanelSpec
cg@1183
   690
              #name: 'VariablePanel'
cg@1183
   691
              #layout: #(#LayoutFrame 0 0.0 36 0.0 0 1.0 -26 1.0)
cg@1183
   692
              #component: 
cg@1183
   693
             #(#SpecCollection
cg@1183
   694
                #collection: #(
ca@1373
   695
                 #(#SelectionInListModelViewSpec
ca@1373
   696
                    #attributes: 
ca@1373
   697
                   #(#vpext
ca@1373
   698
                      
ca@1373
   699
                     #(#Array
ca@1374
   700
                        #Array #Array
ca@1374
   701
                        #Array #Array
ca@1375
   702
                        #Array #Point
ca@1375
   703
                        0.264414 1.0
ca@1373
   704
                      )
ca@1373
   705
                    )
ca@1373
   706
                    #name: 'ListOfLabels'
ca@1373
   707
                    #tabable: true
cg@1183
   708
                    #model: #selectionHolder
cg@1183
   709
                    #menu: #menuEdit
cg@1183
   710
                    #hasHorizontalScrollBar: true
cg@1183
   711
                    #hasVerticalScrollBar: true
cg@1183
   712
                    #miniScrollerHorizontal: true
ca@1373
   713
                    #listModel: #listOfTabs
ca@1373
   714
                    #highlightMode: #line
ca@1373
   715
                    #selectConditionSelector: #askForItemModification
cg@1183
   716
                  )
cg@1183
   717
                 #(#ViewSpec
cg@1183
   718
                    #name: 'SpecView'
cg@1183
   719
                    #level: -1
tz@739
   720
                    #component: 
cg@1183
   721
                   #(#SpecCollection
cg@1183
   722
                      #collection: #(
ca@1373
   723
                       #(#NoteBookViewSpec
ca@1373
   724
                          #name: 'NoteBook'
cg@1183
   725
                          #layout: #(#LayoutFrame 1 0.0 0 0.0 0 1.0 -30 1.0)
ca@1375
   726
                          #enableChannel: #hasSelectionHolder
ca@1374
   727
                          #tabable: true
ca@1373
   728
                          #model: #noteBookModel
ca@1373
   729
                          #menu: #noteBookTabList
ca@1373
   730
                          #useIndex: true
ca@1373
   731
                          #keepCanvasAlive: true
cg@1183
   732
                        )
cg@1183
   733
                       #(#UISubSpecification
cg@1183
   734
                          #name: 'subSpec'
cg@1183
   735
                          #layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1)
cg@1183
   736
                          #majorKey: #ToolApplicationModel
cg@1183
   737
                          #minorKey: #windowSpecForCommit
cg@1183
   738
                        )
ca@1373
   739
                       #(#NoteBookViewSpec
ca@1373
   740
                          #name: 'TestNoteBook'
ca@1373
   741
                          #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
ca@1373
   742
                          #visibilityChannel: #testMode
ca@1374
   743
                          #tabable: true
ca@1373
   744
                          #menu: #testItemList
ca@1373
   745
                          #useIndex: true
ca@1373
   746
                        )
cg@1183
   747
                       )
cg@1183
   748
                     
tz@739
   749
                    )
cg@1183
   750
                  )
cg@1183
   751
                 )
cg@1183
   752
               
tz@739
   753
              )
ca@1373
   754
              #handles: #(#Any 0.24053 1.0)
cg@1183
   755
            )
cg@1183
   756
           #(#UISubSpecification
cg@1183
   757
              #name: 'infoBarSubSpec'
cg@1183
   758
              #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
cg@1183
   759
              #majorKey: #ToolApplicationModel
cg@1183
   760
              #minorKey: #windowSpecForInfoBar
cg@1183
   761
            )
cg@1183
   762
           )
cg@1183
   763
         
cg@1183
   764
        )
tz@739
   765
      )
tz@739
   766
! !
tz@739
   767
ca@1373
   768
!TabListEditor class methodsFor:'list specs'!
ca@1373
   769
ca@1373
   770
noteBookTabList
ca@1373
   771
    "This resource specification was automatically generated
ca@1373
   772
     by the TabListEditor of ST/X."
ca@1373
   773
ca@1373
   774
    "Do not manually edit this!! If it is corrupted,
ca@1373
   775
     the TabListEditor may not be able to read the specification."
ca@1373
   776
ca@1373
   777
    "
ca@1373
   778
     TabListEditor new openOnClass:TabListEditor andSelector:#noteBookTabList
ca@1373
   779
    "
ca@1373
   780
ca@1373
   781
    <resource: #tabList>
ca@1373
   782
ca@1373
   783
    ^     #(
ca@1373
   784
       #(#TabItem
ca@1373
   785
          #label: 'Basic'
ca@1373
   786
          #activeHelpKey: #basicTab
ca@1373
   787
          #minorKey: #basicSpec
ca@1373
   788
        )
ca@1373
   789
       #(#TabItem
ca@1373
   790
          #label: 'Details'
ca@1373
   791
          #activeHelpKey: #detailTab
ca@1373
   792
          #minorKey: #detailSpec
ca@1373
   793
        )
ca@1373
   794
       #(#TabItem
ca@1373
   795
          #label: 'Canvas'
ca@1373
   796
          #activeHelpKey: #canvasTab
ca@1373
   797
          #minorKey: #canvasSpec
ca@1373
   798
        )
ca@1373
   799
       )
ca@1373
   800
     
ca@1373
   801
      collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]
ca@1373
   802
! !
ca@1373
   803
tz@739
   804
!TabListEditor class methodsFor:'menu specs'!
tz@739
   805
tz@739
   806
menu
tz@739
   807
    "This resource specification was automatically generated
tz@739
   808
     by the MenuEditor of ST/X."
tz@739
   809
tz@739
   810
    "Do not manually edit this!! If it is corrupted,
tz@739
   811
     the MenuEditor may not be able to read the specification."
tz@739
   812
tz@739
   813
    "
tz@739
   814
     MenuEditor new openOnClass:TabListEditor andSelector:#menu
tz@739
   815
     (Menu new fromLiteralArrayEncoding:(TabListEditor menu)) startUp
tz@739
   816
    "
tz@739
   817
tz@739
   818
    <resource: #menu>
tz@739
   819
tz@739
   820
    ^
tz@739
   821
     
tz@739
   822
       #(#Menu
tz@739
   823
          
tz@739
   824
           #(
tz@739
   825
             #(#MenuItem
tz@739
   826
                #label: 'About'
tz@739
   827
                #activeHelpKey: #about
tz@739
   828
                #labelImage: #(#ResourceRetriever nil #menuIcon)
tz@739
   829
                #submenuChannel: #menuAbout
tz@739
   830
            )
tz@739
   831
             #(#MenuItem
tz@739
   832
                #label: 'File'
tz@739
   833
                #activeHelpKey: #file
tz@739
   834
                #submenu: 
tz@739
   835
                 #(#Menu
tz@739
   836
                    
tz@739
   837
                     #(
tz@739
   838
                       #(#MenuItem
tz@739
   839
                          #label: 'New'
tz@739
   840
                          #value: #doNew
tz@739
   841
                          #activeHelpKey: #fileNew
tz@739
   842
                      )
tz@739
   843
                       #(#MenuItem
tz@739
   844
                          #label: '-'
tz@739
   845
                      )
tz@739
   846
                       #(#MenuItem
tz@739
   847
                          #label: 'Load...'
tz@739
   848
                          #translateLabel: true
tz@739
   849
                          #value: #doLoad
tz@739
   850
                          #activeHelpKey: #fileLoad
tz@739
   851
                      )
tz@739
   852
                       #(#MenuItem
tz@739
   853
                          #label: '-'
tz@739
   854
                      )
tz@739
   855
                       #(#MenuItem
tz@739
   856
                          #label: 'Save'
tz@739
   857
                          #value: #doSave
tz@739
   858
                          #activeHelpKey: #fileSave
tz@739
   859
                      )
tz@739
   860
                       #(#MenuItem
tz@739
   861
                          #label: 'Save As...'
tz@739
   862
                          #value: #doSaveAs
tz@739
   863
                          #activeHelpKey: #fileSave
tz@739
   864
                      )
tz@739
   865
                       #(#MenuItem
tz@739
   866
                          #label: '-'
tz@739
   867
                      )
tz@739
   868
                       #(#MenuItem
tz@739
   869
                          #label: 'Browse Class'
tz@739
   870
                          #value: #doBrowseClass
tz@739
   871
                          #activeHelpKey: #fileBrowseClass
tz@739
   872
                      )
tz@739
   873
                       #(#MenuItem
tz@739
   874
                          #label: '-'
tz@739
   875
                      )
tz@739
   876
                       #(#MenuItem
tz@739
   877
                          #label: 'Exit'
tz@739
   878
                          #value: #closeRequest
tz@739
   879
                          #activeHelpKey: #fileExit
tz@739
   880
                      )
tz@739
   881
                    ) nil
tz@739
   882
                    nil
tz@739
   883
                )
tz@739
   884
            )
tz@739
   885
             #(#MenuItem
tz@739
   886
                #label: 'Edit'
tz@739
   887
                #activeHelpKey: #edit
tz@739
   888
                #submenuChannel: #menuEdit
tz@739
   889
            )
tz@739
   890
             #(#MenuItem
tz@739
   891
                #label: 'Add'
tz@739
   892
                #activeHelpKey: #add
tz@739
   893
                #submenu: 
tz@739
   894
                 #(#Menu
tz@739
   895
                    
tz@739
   896
                     #(
tz@739
   897
                       #(#MenuItem
tz@739
   898
                          #label: 'Tab Item'
ca@1373
   899
                          #value: #doCreate
tz@739
   900
                          #activeHelpKey: #addTabItem
tz@739
   901
                          #labelImage: #(#ResourceRetriever nil #newTabItemIcon 'Tab Item')
tz@739
   902
                      )
tz@739
   903
                    ) nil
tz@739
   904
                    nil
tz@739
   905
                )
tz@739
   906
            )
tz@739
   907
             #(#MenuItem
tz@739
   908
                #label: 'Generate'
tz@739
   909
                #activeHelpKey: #add
tz@739
   910
                #submenu: 
tz@739
   911
                 #(#Menu
tz@739
   912
                    
tz@739
   913
                     #(
tz@739
   914
                       #(#MenuItem
tz@739
   915
                          #label: 'Aspect Method'
tz@739
   916
                          #value: #doGenerateAspectMethod
tz@739
   917
                          #activeHelpKey: #fileCreateAspectMethod
tz@739
   918
                          #enabled: #hasClassAndSelector
tz@739
   919
                      )
tz@739
   920
                    ) nil
tz@739
   921
                    nil
tz@739
   922
                )
tz@739
   923
            )
tz@739
   924
             #(#MenuItem
tz@739
   925
                #label: 'Test'
tz@739
   926
                #activeHelpKey: #test
tz@739
   927
                #submenu: 
tz@739
   928
                 #(#Menu
tz@739
   929
                    
tz@739
   930
                     #(
tz@739
   931
                       #(#MenuItem
tz@739
   932
                          #label: 'Preview'
tz@739
   933
                          #activeHelpKey: #testPreview
ca@1373
   934
                          #enabled: #canToggleTestMode
tz@739
   935
                          #indication: #testMode
tz@739
   936
                      )
tz@739
   937
                    ) nil
tz@739
   938
                    nil
tz@739
   939
                )
tz@739
   940
            )
tz@739
   941
             #(#MenuItem
tz@749
   942
                #label: 'History'
tz@749
   943
                #activeHelpKey: #history
tz@749
   944
                #submenuChannel: #menuHistory
tz@749
   945
            )
tz@749
   946
             #(#MenuItem
tz@739
   947
                #label: 'Help'
tz@739
   948
                #startGroup: #right
tz@739
   949
                #activeHelpKey: #help
tz@739
   950
                #submenuChannel: #menuHelp
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
ca@1374
  1267
    aTabList do:[:aTabItem| listOfTabs add: aTabItem ].
cg@1972
  1268
    self clearModified.
ca@1374
  1269
    listOfTabs notEmpty ifTrue:[ self selection:1 ].
cg@1972
  1270
!
tz@739
  1271
cg@1972
  1272
loadFromClass:aClass andSelector:aSelector
cg@1972
  1273
    "build from class and selector"
cg@1972
  1274
cg@1972
  1275
    |cls spec|
cg@1972
  1276
cg@1972
  1277
    self assert:(aClass isNil or:[aClass isClass]).
cg@1972
  1278
cg@1972
  1279
    self testMode value: false.
cg@1972
  1280
    self selection:0.
cg@1972
  1281
cg@1972
  1282
    "if opened on a tab list"
cg@1972
  1283
    (aClass isNil and: [aSelector isNil and: [listOfTabs size > 0]]) ifFalse:[
cg@1972
  1284
        listOfTabs removeAll.
cg@1972
  1285
cg@1972
  1286
        cls := aClass isBehavior ifTrue:[ aClass ] ifFalse:[ self resolveName:aClass].
cg@1972
  1287
        specSelector := aSelector.
cg@1972
  1288
cg@1972
  1289
        cls notNil ifTrue:[
cg@1972
  1290
            specSelector notNil ifTrue:[
cg@1972
  1291
cg@1972
  1292
                (cls respondsTo: aSelector) ifTrue:[ 
cg@1972
  1293
                    spec := cls perform: aSelector.
cg@1972
  1294
                ].
cg@1972
  1295
                spec size ~~ 0 ifTrue:[
cg@1972
  1296
                    spec do:[:aTab|
cg@1972
  1297
                        listOfTabs add:aTab.
cg@1972
  1298
                    ].
cg@1972
  1299
                    self addHistoryEntryForClass:cls selector:specSelector.
cg@1972
  1300
                ]
cg@1972
  1301
            ]
cg@1972
  1302
        ].
cg@1972
  1303
cg@1972
  1304
        self clearModified.
cg@1972
  1305
    ].
cg@1972
  1306
    listOfTabs notEmpty ifTrue:[ self selection:1 ].
tz@739
  1307
! !
tz@739
  1308
tz@739
  1309
!TabListEditor methodsFor:'change & update'!
tz@739
  1310
tz@739
  1311
update:something with:aParameter from:someObject
tz@739
  1312
    "one of my aspects has changed; update modified channel
tz@739
  1313
    "
ca@1374
  1314
    |list|
tz@739
  1315
ca@1373
  1316
    someObject = self selectionHolder ifTrue:[
ca@1373
  1317
        ^ self selectionChanged
ca@1373
  1318
    ].
tz@739
  1319
ca@1373
  1320
    someObject = self testMode ifFalse:[              
ca@1373
  1321
        ^ super update:something with:aParameter from:someObject.
ca@1373
  1322
    ].
ca@1373
  1323
ca@1373
  1324
    someObject value ifTrue:[
ca@1375
  1325
        self noteBookModel value:0.
ca@1375
  1326
ca@1374
  1327
        listOfTabs notEmpty ifTrue:[
ca@1373
  1328
            list := listOfTabs collect:[:aTab| |tab|
ca@1373
  1329
                tab := aTab copy.
ca@1373
  1330
                tab setAttributesFromClass:specClass.
ca@1373
  1331
                tab
ca@1374
  1332
            ]
ca@1374
  1333
        ].
ca@1374
  1334
        self selection:0.
ca@1373
  1335
    ].
ca@1373
  1336
    self testItemList value:list.
ca@1373
  1337
    self updateInfoLabel.
ca@1373
  1338
tz@739
  1339
! !
tz@739
  1340
ca@1373
  1341
!TabListEditor methodsFor:'queries'!
tz@739
  1342
ca@1373
  1343
canToggleTestMode
sv@2281
  1344
    "checks whether testMode button is enabled"
sv@2281
  1345
ca@1373
  1346
    self testMode value ifTrue:[
ca@1373
  1347
        ^ true
ca@1373
  1348
    ].
tz@739
  1349
sv@2281
  1350
    self enablingCommitButtonsHolder value ifFalse:[
ca@1373
  1351
        ^ listOfTabs notEmpty
ca@1373
  1352
    ].
ca@1373
  1353
    ^ false
tz@739
  1354
! !
tz@739
  1355
tz@739
  1356
!TabListEditor methodsFor:'selection'!
tz@739
  1357
ca@1373
  1358
selectedElement
ca@1373
  1359
    |idx tab|
ca@1373
  1360
ca@1373
  1361
    idx := self selection.
ca@1373
  1362
ca@1373
  1363
    idx ~~ 0 ifTrue:[
ca@1373
  1364
        (tab := listOfTabs at:idx ifAbsent:nil) notNil ifTrue:[
ca@1373
  1365
            ^ tab
ca@1373
  1366
        ].
ca@1373
  1367
        self selection:0
ca@1373
  1368
    ].
ca@1373
  1369
    ^ nil
tz@739
  1370
!
tz@739
  1371
ca@1373
  1372
selection
ca@1373
  1373
    ^ self selectionHolder value ? 0
ca@1373
  1374
!
tz@739
  1375
ca@1373
  1376
selection:anIndex
ca@1373
  1377
    self selectionHolder value:(anIndex ? 0).
ca@1373
  1378
!
tz@739
  1379
ca@1373
  1380
selectionChanged
ca@1373
  1381
    |noteBookModel hasSelection|
tz@739
  1382
ca@1373
  1383
    hasSelection  := self selection ~~ 0.
ca@1373
  1384
    noteBookModel := self noteBookModel.
tz@739
  1385
ca@1373
  1386
    hasSelection ifTrue:[
ca@1373
  1387
        self testMode value:false.
ca@1373
  1388
        noteBookModel value == 0 ifTrue:[noteBookModel value:1]
tz@739
  1389
    ] ifFalse:[
ca@1373
  1390
        noteBookModel value:0
tz@739
  1391
    ].
tz@739
  1392
    self cancel.
ca@1374
  1393
    self hasSelectionHolder value:hasSelection.
sv@2281
  1394
    self canPasteHolder.
ca@1373
  1395
!
tz@739
  1396
ca@1373
  1397
setSelection:anIndex
ca@1374
  1398
    |index|
ca@1374
  1399
ca@1374
  1400
    index := anIndex ? 0.
ca@1374
  1401
    self selectionHolder value:index withoutNotifying:self
tz@739
  1402
! !
tz@739
  1403
tz@739
  1404
!TabListEditor methodsFor:'startup / release'!
tz@739
  1405
tz@739
  1406
initialize
tz@739
  1407
    "setup aspects used by column description specifications
tz@739
  1408
    "
tz@739
  1409
    super initialize.
ca@1373
  1410
    listOfTabs := List new.
tz@739
  1411
!
tz@739
  1412
tz@739
  1413
openModalOnTabList: aTabList
tz@739
  1414
    "build a tab list from aTabList and open it modal"
tz@739
  1415
tz@739
  1416
    super openModalOnResourceSpec: aTabList
tz@739
  1417
tz@739
  1418
! !
tz@739
  1419
tz@739
  1420
!TabListEditor methodsFor:'user actions'!
tz@739
  1421
tz@739
  1422
accept
tz@739
  1423
    "accept changes
tz@739
  1424
    "
ca@1373
  1425
    |tab idx asb|
tz@739
  1426
ca@1373
  1427
    (tab := self selectedElement) notNil ifTrue:[
ca@1373
  1428
        super accept.
ca@1373
  1429
        aspects keysAndValuesDo:[:k :m| tab perform:(k , ':') asSymbol with:(m value) ].
cg@1066
  1430
ca@1373
  1431
        asb := self autoHideScrollBars value.
ca@1373
  1432
        asb := asb ~~ 1 ifTrue:[asb == 2] ifFalse:[nil].
ca@1373
  1433
        tab autoHideScrollBars:asb.
tz@739
  1434
    ].
tz@739
  1435
    self cancel.
ca@1373
  1436
!
ca@1373
  1437
ca@1373
  1438
addTab:aTab
ca@1373
  1439
    |idx|
ca@1373
  1440
ca@1373
  1441
    aTab notNil ifTrue:[
ca@1373
  1442
        self testMode value: false.
ca@1373
  1443
ca@1373
  1444
        (idx := self selection) == 0 ifTrue:[
ca@1373
  1445
            listOfTabs add:aTab.
ca@1373
  1446
            self selection:(listOfTabs size).
ca@1373
  1447
        ] ifFalse:[
ca@1373
  1448
            listOfTabs add:aTab afterIndex:idx
ca@1373
  1449
        ].
cg@1972
  1450
        self setModified.
ca@1373
  1451
    ].
tz@739
  1452
!
tz@739
  1453
tz@739
  1454
cancel
sv@2281
  1455
    "cancel all changes"
sv@2281
  1456
ca@1373
  1457
    |tab idx asb|
tz@739
  1458
ca@1373
  1459
    (     (idx := self selection) ~~ 0
ca@1373
  1460
     and:[(tab := self selectedElement) notNil]
ca@1373
  1461
    ) ifTrue:[
ca@1373
  1462
        aspects keysAndValuesDo:[:k :m| m value:(tab perform:k) ].
ca@1373
  1463
        listOfTabs at:idx put:tab.
tz@739
  1464
ca@1373
  1465
        asb := tab autoHideScrollBars.
ca@1373
  1466
        asb notNil ifTrue:[asb := asb == true ifTrue:[2] ifFalse:[3]]
ca@1373
  1467
                  ifFalse:[asb := 1].
tz@739
  1468
ca@1373
  1469
        self autoHideScrollBars value:asb.
tz@739
  1470
    ].
ca@1373
  1471
    self canMoveTabItemUpOrDown value:(listOfTabs size > 1 and:[idx ~~ 0]).
sv@2281
  1472
    self enablingCommitButtonsHolder value: false
tz@739
  1473
!
tz@739
  1474
tz@739
  1475
doCopy
tz@739
  1476
    "copy selected tab
tz@739
  1477
    "
ca@1373
  1478
    |tab|
ca@1373
  1479
ca@1373
  1480
    (tab := self selectedElement) notNil ifTrue:[
ca@1373
  1481
        self clipboard:tab.
tz@749
  1482
        self updateAllToolInstances.
tz@739
  1483
    ]
tz@739
  1484
!
tz@739
  1485
ca@1373
  1486
doCreate
ca@1373
  1487
    self addTab:(TabItem label:'TAB').
tz@739
  1488
!
tz@739
  1489
tz@739
  1490
doCut
ca@1373
  1491
    "cut the selected tab; put to pasteBuffer
tz@739
  1492
    "
ca@1373
  1493
    |tab|
tz@739
  1494
ca@1373
  1495
    (tab := self selectedElement) notNil ifTrue:[
ca@1373
  1496
        self clipboard:tab.
ca@1373
  1497
        self doDelete.
tz@739
  1498
    ].
tz@739
  1499
tz@739
  1500
!
tz@739
  1501
tz@739
  1502
doDelete
tz@739
  1503
    "delete selected tab
tz@739
  1504
    "
ca@1374
  1505
    |index size|
tz@739
  1506
ca@1373
  1507
    (index := self selection) ~~ 0 ifTrue:[
tz@739
  1508
        self testMode value: false.
ca@1374
  1509
ca@1374
  1510
        (size := listOfTabs size) == 1 ifTrue:[
ca@1374
  1511
            self selection:0
ca@1374
  1512
        ] ifFalse:[
ca@1374
  1513
            self setSelection:0
ca@1374
  1514
        ].
tz@739
  1515
        listOfTabs removeIndex:index.
ca@1374
  1516
        index < size ifFalse:[
ca@1374
  1517
            index := index - 1
ca@1374
  1518
        ].
ca@1373
  1519
        self selection:index.
ca@1373
  1520
        self updateAllToolInstances.
cg@1972
  1521
        self setModified.
tz@739
  1522
    ].       
tz@739
  1523
!
tz@739
  1524
tz@739
  1525
doGenerateAspectMethod
tz@739
  1526
    "generate aspect method
tz@739
  1527
    "
tz@739
  1528
    |cls code|
tz@739
  1529
tz@739
  1530
    (specClass notNil and:[specSelector notNil])
tz@739
  1531
    ifFalse:
tz@739
  1532
    [
tz@739
  1533
        ^self information:'No class and selector defined!!'   
tz@739
  1534
    ].
tz@739
  1535
tz@739
  1536
    cls := self resolveName: specClass.
tz@739
  1537
tz@739
  1538
    (cls canUnderstand:specSelector) ifTrue:[
tz@739
  1539
        "/ method already exists, do not overwrite the method automaticaly
tz@739
  1540
tz@739
  1541
        ( YesNoBox title:'method '
tz@739
  1542
                         , (Text string:('#', specSelector) emphasis:#bold)
tz@739
  1543
                         , ' already exists!!'
tz@739
  1544
                 yesText:'overwrite'
tz@739
  1545
                  noText:'cancel'
tz@739
  1546
        ) confirm ifFalse:[
tz@739
  1547
            ^ self
tz@739
  1548
        ]
tz@739
  1549
    ].
tz@739
  1550
tz@739
  1551
    code := '!!' , cls name , ' methodsFor:''aspects''!!\\' ,
tz@739
  1552
            specSelector , '\' ,
tz@739
  1553
            '    "Generated by the TabListEditor"\' ,
tz@739
  1554
            '\' ,
tz@739
  1555
            '    |list|\' ,
tz@739
  1556
            '\' ,
tz@739
  1557
            '    (list := builder bindingAt:#' , specSelector , ') isNil ifTrue:[\' ,
tz@739
  1558
            '        builder aspectAt:#' , specSelector, ' put:(list := self class ', specSelector, ').\' ,
tz@739
  1559
            '    ].\' ,
tz@739
  1560
            '    ^ list\' ,
tz@739
  1561
            '!! !!\\'.
tz@739
  1562
tz@739
  1563
    (ReadStream on:(code withCRs)) fileIn
tz@739
  1564
tz@739
  1565
tz@739
  1566
!
tz@739
  1567
tz@739
  1568
doMoveTabUpOrDown:what
tz@739
  1569
    "step up or down
tz@739
  1570
    "
ca@1373
  1571
    |tab idx sz|
tz@739
  1572
ca@1373
  1573
    (listOfTabs size > 1 and:[(idx := self selection) ~~ 0]) ifFalse:[
tz@739
  1574
        ^ self
tz@739
  1575
    ].
tz@739
  1576
ca@1373
  1577
    (tab := listOfTabs at:idx ifAbsent:nil) isNil ifTrue:[
ca@1373
  1578
        ^ self selection:0
ca@1373
  1579
    ].
tz@739
  1580
ca@1373
  1581
    self setSelection:0.
ca@1373
  1582
    listOfTabs removeIndex:idx.
tz@739
  1583
ca@1373
  1584
    sz := listOfTabs size.
cg@1145
  1585
tz@739
  1586
    what == #down ifTrue:[
ca@1373
  1587
        idx := idx > sz ifTrue:[1] ifFalse:[idx + 1]
tz@739
  1588
    ] ifFalse:[
ca@1373
  1589
        idx := idx == 1 ifTrue:[sz + 1] ifFalse:[idx - 1]
tz@739
  1590
    ].
tz@739
  1591
ca@1373
  1592
    listOfTabs add:tab beforeIndex:idx.
ca@1373
  1593
    self setSelection:idx.
cg@1972
  1594
    self setModified.
tz@739
  1595
!
tz@739
  1596
tz@739
  1597
doPaste
tz@739
  1598
    "paste a tab
tz@739
  1599
    "
ca@1373
  1600
    |tab|
tz@739
  1601
ca@1373
  1602
    ((tab := self class clipboard) notNil and:[tab isKindOf:TabItem]) ifTrue:[
ca@1373
  1603
        self addTab:(tab deepCopy).
ca@1373
  1604
    ]
tz@739
  1605
!
tz@739
  1606
tz@739
  1607
doSave
cg@1972
  1608
    "generate code for class and instance"
cg@1972
  1609
ca@1245
  1610
    |cls code spec category mthd list|
tz@739
  1611
tz@739
  1612
    (specClass notNil and:[specSelector notNil])
tz@739
  1613
    ifFalse:
tz@739
  1614
    [
tz@739
  1615
        ^self doSaveAs
tz@739
  1616
    ].
tz@739
  1617
tz@739
  1618
    cls := self resolveName: specClass.
tz@739
  1619
tz@739
  1620
    listOfTabs isEmpty ifTrue:[^self information:'No tab list defined!!'].
tz@739
  1621
tz@739
  1622
    spec  := WriteStream on:String new.
ca@1245
  1623
    list := Array new:(listOfTabs size).
ca@1245
  1624
    listOfTabs keysAndValuesDo:[:i :el|list at:i put:(el literalArrayEncoding)].
ca@1245
  1625
ca@1245
  1626
    UISpecification prettyPrintSpecArray:list on:spec indent:5.
tz@739
  1627
    spec := spec contents.
tz@739
  1628
tz@739
  1629
    "/ if that method already exists, do not overwrite the category
tz@739
  1630
tz@739
  1631
    category := 'list specs'.
tz@739
  1632
tz@739
  1633
    (mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[
tz@739
  1634
        category := mthd category.
tz@739
  1635
    ].
tz@739
  1636
tz@739
  1637
    code := Character excla asString 
tz@739
  1638
            , cls name , ' class methodsFor:' , category storeString
tz@739
  1639
            , Character excla asString , '\\'
tz@739
  1640
tz@739
  1641
            , specSelector , '\'
tz@739
  1642
            , (self class codeGenerationComment replChar:$!! withString:'!!!!')
tz@739
  1643
            , '\\    "\'
cg@1855
  1644
            , '     TabListEditor new openOnClass: self andSelector:#' , specSelector , '\'
tz@739
  1645
            , '    "\'.
tz@739
  1646
tz@739
  1647
    code := code 
tz@739
  1648
            , '\'
tz@739
  1649
            , '    <resource: #tabList>\\'
tz@739
  1650
            , '    ^' 
tz@739
  1651
            , '     ', spec, '\'
tz@739
  1652
            , '      collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]'
tz@739
  1653
            , '\'
tz@739
  1654
            , Character excla asString
tz@739
  1655
            , ' '
tz@739
  1656
            , Character excla asString
tz@739
  1657
            , '\'.
tz@739
  1658
tz@739
  1659
    code := code withCRs.
tz@739
  1660
    (ReadStream on:code) fileIn.
tz@739
  1661
tz@739
  1662
    (cls canUnderstand:specSelector) ifFalse:[
tz@739
  1663
        (YesNoBox confirm:'Generate aspect method?') ifTrue:[
tz@739
  1664
            self doGenerateAspectMethod
tz@739
  1665
        ]
tz@739
  1666
    ].
tz@739
  1667
cg@1972
  1668
    self addHistoryEntryForClass:cls selector:specSelector.
cg@1972
  1669
    self clearModified.
tz@739
  1670
    hasSaved  := true.
cg@1856
  1671
!
cg@1856
  1672
cg@1856
  1673
openDocumentation
cg@1856
  1674
   self openHTMLDocument:'tools/uipainter/TabListEditor.html'.
tz@739
  1675
! !
tz@739
  1676
tz@739
  1677
!TabListEditor class methodsFor:'documentation'!
tz@739
  1678
tz@739
  1679
version
cg@1066
  1680
    ^ '$Header$'
tz@739
  1681
! !