TabListEditor.st
author Patrik Svestka <patrik.svestka@gmail.com>
Wed, 14 Nov 2018 12:07:51 +0100
branchjv
changeset 3630 5e718e0a754e
parent 3330 76129ae4dadd
permissions -rw-r--r--
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present

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