MultiViewToolApplication.st
author Claus Gittinger <cg@exept.de>
Fri, 15 Jun 2018 04:00:37 +0200
changeset 18220 d1ebaddf1100
parent 17896 8369fe890ec9
child 18351 f6c68b4220d3
permissions -rw-r--r--
#UI_ENHANCEMENT by cg class: Tools::CheckinInfoDialog class changed: #windowSpec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6179
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
     1
"
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
     2
 COPYRIGHT (c) 2004 by eXept Software AG
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
     3
              All Rights Reserved
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
     4
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
     5
 This software is furnished under a license and may be used
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
     6
 only in accordance with the terms of that license and with the
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
     8
 be provided or otherwise made available to, or used by, any
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
     9
 other person.  No title to or ownership of the software is
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    10
 hereby transferred.
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    11
"
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libtool' }"
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
15407
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
    14
"{ NameSpace: Smalltalk }"
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
    15
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
ToolApplicationModel subclass:#MultiViewToolApplication
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:'workspaces tabList selectedWorkspaceIndexHolder workspaceHolder'
8615
3407696ae28f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8576
diff changeset
    18
	classVariableNames:'DefaultInfoVisible DefaultEditToolBarVisible
3407696ae28f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8576
diff changeset
    19
		DefaultToolBarVisible'
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	poolDictionaries:''
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	category:'Interface-Smalltalk'
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!MultiViewToolApplication class methodsFor:'documentation'!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
6179
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    26
copyright
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    27
"
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    28
 COPYRIGHT (c) 2004 by eXept Software AG
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    29
              All Rights Reserved
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    30
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    31
 This software is furnished under a license and may be used
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    32
 only in accordance with the terms of that license and with the
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    34
 be provided or otherwise made available to, or used by, any
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    35
 other person.  No title to or ownership of the software is
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    36
 hereby transferred.
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    37
"
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    38
!
182d948dcf05 copyright
Claus Gittinger <cg@exept.de>
parents: 5303
diff changeset
    39
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
documentation
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
8497
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
    42
    Common code for multiView applications (Workspace, Terminal app and maybe more later)
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    [author:]
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
        Claus Gittinger
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
"
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
! !
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
7824
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    49
!MultiViewToolApplication class methodsFor:'defaults'!
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    50
8497
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
    51
defaultEditToolbarVisible
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
    52
    ^ DefaultEditToolBarVisible ? false
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
    53
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
    54
    "Created: / 14-07-2007 / 16:38:47 / cg"
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
    55
!
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
    56
7824
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    57
defaultInfoVisible
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    58
    ^ DefaultInfoVisible ? true
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    59
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    60
    "Created: / 14-07-2007 / 16:38:32 / cg"
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    61
!
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    62
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    63
defaultToolbarVisible
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    64
    ^ DefaultToolBarVisible ? false
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    65
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    66
    "Created: / 14-07-2007 / 16:38:47 / cg"
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    67
! !
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
    68
9143
Claus Gittinger <cg@exept.de>
parents: 9058
diff changeset
    69
!MultiViewToolApplication class methodsFor:'help specs'!
Claus Gittinger <cg@exept.de>
parents: 9058
diff changeset
    70
17896
8369fe890ec9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17742
diff changeset
    71
helpSpec
9143
Claus Gittinger <cg@exept.de>
parents: 9058
diff changeset
    72
    <resource: #help>
Claus Gittinger <cg@exept.de>
parents: 9058
diff changeset
    73
17896
8369fe890ec9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17742
diff changeset
    74
    ^ super helpSpec addPairsFrom:#(
9143
Claus Gittinger <cg@exept.de>
parents: 9058
diff changeset
    75
10221
f3fcf030f6b4 useless code removed
Claus Gittinger <cg@exept.de>
parents: 9694
diff changeset
    76
#addWorkspace
f3fcf030f6b4 useless code removed
Claus Gittinger <cg@exept.de>
parents: 9694
diff changeset
    77
'Add another page (tab)'
f3fcf030f6b4 useless code removed
Claus Gittinger <cg@exept.de>
parents: 9694
diff changeset
    78
9143
Claus Gittinger <cg@exept.de>
parents: 9058
diff changeset
    79
#hideToolBar
12482
e801a369d243 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 11727
diff changeset
    80
'Hide the toolbar. Show again via the "View"-menu'
9143
Claus Gittinger <cg@exept.de>
parents: 9058
diff changeset
    81
Claus Gittinger <cg@exept.de>
parents: 9058
diff changeset
    82
#hideEditToolBar
12482
e801a369d243 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 11727
diff changeset
    83
'Hide the edit-toolbar. Show again via the "View"-menu'
9143
Claus Gittinger <cg@exept.de>
parents: 9058
diff changeset
    84
Claus Gittinger <cg@exept.de>
parents: 9058
diff changeset
    85
)
10221
f3fcf030f6b4 useless code removed
Claus Gittinger <cg@exept.de>
parents: 9694
diff changeset
    86
f3fcf030f6b4 useless code removed
Claus Gittinger <cg@exept.de>
parents: 9694
diff changeset
    87
    "Modified: / 06-07-2011 / 18:08:57 / cg"
9143
Claus Gittinger <cg@exept.de>
parents: 9058
diff changeset
    88
! !
Claus Gittinger <cg@exept.de>
parents: 9058
diff changeset
    89
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
    90
!MultiViewToolApplication class methodsFor:'image specs'!
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
    91
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
    92
hideToolBarIcon
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
    93
    <resource: #programImage>
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
    94
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
    95
    ^ ToolbarIconLibrary hideToolBarIcon
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
    96
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
    97
    "Created: / 18-02-2007 / 14:53:38 / cg"
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
    98
! !
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
    99
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
!MultiViewToolApplication class methodsFor:'interface specs'!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
windowSpec
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   103
    "This resource specification was automatically generated
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   104
     by the UIPainter of ST/X."
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   105
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   106
    "Do not manually edit this!! If it is corrupted,
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   107
     the UIPainter may not be able to read the specification."
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   108
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   109
    "
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   110
     UIPainter new openOnClass:MultiViewToolApplication andSelector:#windowSpec
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   111
     MultiViewToolApplication new openInterface:#windowSpec
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   112
     MultiViewToolApplication open
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   113
    "
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   114
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   115
    <resource: #canvas>
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   117
    ^ 
17742
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   118
    #(FullSpec
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   119
       name: windowSpec
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   120
       uuid: '3b15ca06-c5a3-11e7-82f7-c42c033b4871'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   121
       window: 
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   122
      (WindowSpec
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   123
         label: 'Workspace'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   124
         name: 'Workspace'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   125
         uuid: '3b15ceca-c5a3-11e7-82f7-c42c033b4871'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   126
         min: (Point 10 10)
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   127
         bounds: (Rectangle 0 0 640 480)
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   128
         menu: mainMenu
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   129
       )
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   130
       component: 
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   131
      (SpecCollection
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   132
         collection: (
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   133
          (ViewSpec
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   134
             name: 'ToolBar'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   135
             layout: (LayoutFrame 0 0 0 0 0 1 32 0)
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   136
             uuid: '3b15d230-c5a3-11e7-82f7-c42c033b4871'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   137
             visibilityChannel: toolBarVisibleHolder
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   138
             component: 
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   139
            (SpecCollection
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   140
               collection: (
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   141
                (ActionButtonSpec
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   142
                   label: 'hideToolBarIcon'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   143
                   name: 'HideToolBarButton'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   144
                   layout: (LayoutFrame 0 0 0 0 13 0 0 1)
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   145
                   activeHelpKey: hideToolBar
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   146
                   uuid: '3b15d460-c5a3-11e7-82f7-c42c033b4871'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   147
                   hasCharacterOrientedLabel: false
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   148
                   translateLabel: true
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   149
                   model: hideToolbar
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   150
                   postBuildCallback: hideToolBarButtonCreated:
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   151
                 )
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   152
                (MenuPanelSpec
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   153
                   name: 'ToolBarMenu'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   154
                   layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0)
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   155
                   uuid: '3b15d79e-c5a3-11e7-82f7-c42c033b4871'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   156
                   visibilityChannel: toolBarVisibleHolder
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   157
                   menu: toolBarMenu
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   158
                   textDefault: true
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   159
                 )
17742
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   160
                )
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   161
              
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   162
             )
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   163
           )
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   164
          (ViewSpec
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   165
             name: 'EditToolBar'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   166
             layout: (LayoutFrame 0 0 32 0 0 1 64 0)
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   167
             uuid: '3b15da32-c5a3-11e7-82f7-c42c033b4871'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   168
             visibilityChannel: editToolBarVisibleHolder
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   169
             component: 
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   170
            (SpecCollection
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   171
               collection: (
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   172
                (ActionButtonSpec
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   173
                   label: 'hideToolBarIcon'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   174
                   name: 'HideEditToolBarButton'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   175
                   layout: (LayoutFrame 0 0 0 0 13 0 0 1)
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   176
                   activeHelpKey: hideEditToolBar
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   177
                   uuid: '3b15dba4-c5a3-11e7-82f7-c42c033b4871'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   178
                   hasCharacterOrientedLabel: false
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   179
                   translateLabel: true
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   180
                   model: hideEditToolbar
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   181
                   postBuildCallback: hideToolBarButtonCreated:
8497
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   182
                 )
17742
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   183
                (MenuPanelSpec
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   184
                   name: 'EditToolBar1'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   185
                   layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0)
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   186
                   uuid: '3b15ddb6-c5a3-11e7-82f7-c42c033b4871'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   187
                   visibilityChannel: editToolBarVisibleHolder
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   188
                   menu: editToolBarMenu
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   189
                   textDefault: true
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   190
                 )
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   191
                )
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   192
              
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   193
             )
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   194
           )
17742
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   195
          (NoteBookViewSpec
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   196
             name: 'NoteBook'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   197
             layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   198
             uuid: '3b15df78-c5a3-11e7-82f7-c42c033b4871'
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   199
             model: selectedWorkspaceIndexHolder
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   200
             menu: tabList
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   201
             useIndex: true
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   202
             accessTabMenuAction: tabMenuAt:
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   203
             translateLabel: true
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   204
             destroyTabAction: destroyTab:
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   205
             canvas: workspaceHolder
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   206
             canvasInset: 0
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   207
             keepCanvasAlive: true
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   208
             tabLevel: 1
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   209
           )
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   210
          )
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   211
        
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   212
       )
09512290ed17 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17198
diff changeset
   213
     )
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
! !
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
!MultiViewToolApplication class methodsFor:'menu specs'!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
8497
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   218
editToolBarMenu
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   219
    "This resource specification was automatically generated
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   220
     by the MenuEditor of ST/X."
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   221
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   222
    "Do not manually edit this!! If it is corrupted,
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   223
     the MenuEditor may not be able to read the specification."
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   224
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   225
    "
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   226
     MenuEditor new openOnClass:MultiViewToolApplication andSelector:#toolBarMenu
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   227
     (Menu new fromLiteralArrayEncoding:(MultiViewToolApplication toolBarMenu)) startUp
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   228
    "
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   229
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   230
    <resource: #menu>
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   231
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   232
    ^ 
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   233
     #(Menu
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   234
        (
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   235
         )
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   236
        nil
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   237
        nil
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   238
      )
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   239
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   240
    "Modified: / 18-02-2007 / 14:59:21 / cg"
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   241
!
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   242
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
mainMenu
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   244
    "This resource specification was automatically generated
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   245
     by the MenuEditor of ST/X."
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   246
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   247
    "Do not manually edit this!! If it is corrupted,
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   248
     the MenuEditor may not be able to read the specification."
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   249
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   250
    "
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   251
     MenuEditor new openOnClass:MultiViewToolApplication andSelector:#mainMenu
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   252
     (Menu new fromLiteralArrayEncoding:(MultiViewToolApplication mainMenu)) startUp
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   253
    "
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   254
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   255
    <resource: #menu>
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   257
    ^ 
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   258
     #(Menu
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   259
        (
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   260
         (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   261
            label: 'File'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   262
            translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   263
            submenu: 
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   264
           (Menu
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   265
              (
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   266
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   267
                  label: 'New Editor'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   268
                  itemValue: newWorkspace
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   269
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   270
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   271
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   272
                  label: '-'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   273
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   274
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   275
                  label: 'Load File...'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   276
                  itemValue: menuLoad
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   277
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   278
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   279
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   280
                  label: '-'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   281
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   282
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   283
                  label: 'Save As...'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   284
                  itemValue: menuSaveAs
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   285
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   286
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   287
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   288
                  enabled: hasMultipleBuffersHolder
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   289
                  label: 'Save all As...'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   290
                  itemValue: menuSaveAllAs
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   291
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   292
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   293
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   294
                  label: '-'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   295
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   296
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   297
                  label: 'Print...'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   298
                  itemValue: menuPrint
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   299
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   300
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   301
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   302
                  label: '-'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   303
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   304
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   305
                  label: 'Exit'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   306
                  itemValue: closeRequest
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   307
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   308
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   309
               )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   310
              nil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   311
              nil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   312
            )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   313
          )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   314
         (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   315
            label: 'Buffers'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   316
            nameKey: Buffer
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   317
            translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   318
            submenu: 
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   319
           (Menu
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   320
              (
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   321
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   322
                  label: 'Add Buffer'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   323
                  itemValue: addWorkspace
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   324
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   325
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   326
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   327
                  label: '-'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   328
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   329
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   330
                  label: 'Rename...'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   331
                  itemValue: renameWorkspace
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   332
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   333
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   334
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   335
                  label: '-'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   336
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   337
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   338
                  enabled: canRemoveWorkspace
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   339
                  label: 'Remove Buffer'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   340
                  itemValue: removeWorkspace
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   341
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   342
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   343
               )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   344
              nil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   345
              nil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   346
            )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   347
          )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   348
         (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   349
            label: 'Edit'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   350
            translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   351
            submenu: 
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   352
           (Menu
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   353
              (
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   354
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   355
                  enabled: hasSelectionInActiveWorkspace
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   356
                  label: 'Cut'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   357
                  itemValue: cutSelection
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   358
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   359
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   360
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   361
                  enabled: hasSelectionInActiveWorkspace
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   362
                  label: 'Copy'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   363
                  itemValue: copySelection
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   364
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   365
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   366
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   367
                  label: 'Paste'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   368
                  itemValue: paste
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   369
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   370
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   371
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   372
                  label: '-'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   373
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   374
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   375
                  label: 'Select All'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   376
                  itemValue: selectAll
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   377
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   378
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   379
               )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   380
              nil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   381
              nil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   382
            )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   383
          )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   384
         (MenuItem
8500
1a3066fb8ed7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8498
diff changeset
   385
            label: 'View'
1a3066fb8ed7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8498
diff changeset
   386
            translateLabel: true
1a3066fb8ed7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8498
diff changeset
   387
            submenuChannel: viewMenu
1a3066fb8ed7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8498
diff changeset
   388
            keepLinkedMenu: true
1a3066fb8ed7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8498
diff changeset
   389
          )
1a3066fb8ed7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8498
diff changeset
   390
         (MenuItem
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   391
            label: 'MENU_Help'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   392
            translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   393
            startGroup: conditionalRight
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   394
            submenu: 
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   395
           (Menu
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   396
              (
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   397
               (MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   398
                  label: 'About this Application...'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   399
                  itemValue: openAboutThisApplication
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   400
                  translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   401
                )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   402
               )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   403
              nil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   404
              nil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   405
            )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   406
          )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   407
         )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   408
        nil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   409
        nil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   410
      )
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
tabMenu
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   414
    "This resource specification was automatically generated
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   415
     by the MenuEditor of ST/X."
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   416
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   417
    "Do not manually edit this!! If it is corrupted,
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   418
     the MenuEditor may not be able to read the specification."
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   419
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   420
    "
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   421
     MenuEditor new openOnClass:WorkspaceApplication andSelector:#tabMenu
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   422
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication tabMenu)) startUp
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   423
    "
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   424
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   425
    <resource: #menu>
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   426
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   427
    ^
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   428
     #(#Menu
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   429
        #(
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   430
         #(#MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   431
            #label: 'Add Tab'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   432
            #translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   433
            "/ #triggerOnDown: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   434
            #value: #addWorkspace
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   435
          )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   436
         #(#MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   437
            #label: '-'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   438
          )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   439
         #(#MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   440
            #label: 'Remove Tab'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   441
            #translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   442
            "/ #triggerOnDown: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   443
            #value: #removeWorkspace:
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   444
            #enabled: #canRemoveWorkspace:
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   445
          )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   446
         #(#MenuItem
8772
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   447
            #label: 'Remove all other Tabs'
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   448
            #translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   449
            "/ #triggerOnDown: true
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   450
            #value: #removeAllWorkspacesExcept:
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   451
            #enabled: #canRemoveAllWorkspacesExcept:
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   452
          )
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   453
         #(#MenuItem
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   454
            #label: '-'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   455
          )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   456
         #(#MenuItem
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   457
            #label: 'Rename...'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   458
            #translateLabel: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   459
            "/ #triggerOnDown: true
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   460
            #value: #renameWorkspace:
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   461
          )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   462
         )
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   463
        nil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   464
        nil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   465
      )
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   466
!
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   467
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   468
toolBarMenu
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   469
    "This resource specification was automatically generated
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   470
     by the MenuEditor of ST/X."
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   471
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   472
    "Do not manually edit this!! If it is corrupted,
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   473
     the MenuEditor may not be able to read the specification."
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   474
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   475
    "
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   476
     MenuEditor new openOnClass:MultiViewToolApplication andSelector:#toolBarMenu
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   477
     (Menu new fromLiteralArrayEncoding:(MultiViewToolApplication toolBarMenu)) startUp
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   478
    "
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   479
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   480
    <resource: #menu>
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   481
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   482
    ^ 
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   483
     #(Menu
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   484
        (
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   485
         (MenuItem
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   486
            label: ''
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   487
          )
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   488
         (MenuItem
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   489
"/            activeHelpKey: addWorkspace
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   490
            label: 'Add Buffer'
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   491
            itemValue: addWorkspace
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   492
            translateLabel: true
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   493
            isButton: true
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   494
            labelImage: (ResourceRetriever ToolbarIconLibrary addBufferIcon)
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   495
          )
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   496
         )
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   497
        nil
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   498
        nil
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   499
      )
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   500
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   501
    "Modified: / 18-02-2007 / 14:59:21 / cg"
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   502
!
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   503
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   504
viewMenu
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   505
    "This resource specification was automatically generated
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   506
     by the MenuEditor of ST/X."
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   507
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   508
    "Do not manually edit this!! If it is corrupted,
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   509
     the MenuEditor may not be able to read the specification."
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   510
14279
9214ed746ffd class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14175
diff changeset
   511
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   512
    "
9058
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
   513
     MenuEditor new openOnClass:MultiViewToolApplication andSelector:#viewMenu
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
   514
     (Menu new fromLiteralArrayEncoding:(MultiViewToolApplication viewMenu)) startUp
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   515
    "
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   516
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   517
    <resource: #menu>
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   518
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   519
    ^ 
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   520
     #(Menu
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   521
        (
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   522
         (MenuItem
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   523
            label: 'Toolbar'
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   524
            hideMenuOnActivated: false
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   525
            indication: toolBarVisibleHolder
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   526
          )
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   527
         (MenuItem
8497
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   528
            label: 'Editor Toolbar'
9058
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
   529
            isVisible: hasEditToolBar
8497
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   530
            hideMenuOnActivated: false
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   531
            indication: editToolBarVisibleHolder
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   532
          )
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   533
         (MenuItem
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   534
            label: 'Info'
9380
346a2a59c410 added: #hasInfoLabel
Claus Gittinger <cg@exept.de>
parents: 9143
diff changeset
   535
            isVisible: hasInfoLabel
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   536
            hideMenuOnActivated: false
7653
71f20b5aab8d Do not refer to non-existant aspect
Stefan Vogel <sv@exept.de>
parents: 7650
diff changeset
   537
            indication: infoVisibleHolder
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   538
          )
9058
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
   539
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
   540
            label: '-'
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
   541
          )
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
   542
         (MenuItem
14279
9214ed746ffd class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14175
diff changeset
   543
            label: 'Font...'
9214ed746ffd class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14175
diff changeset
   544
            itemValue: openFontDialog
9214ed746ffd class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14175
diff changeset
   545
          )
9214ed746ffd class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14175
diff changeset
   546
         (MenuItem
9058
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
   547
            label: 'Settings...'
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
   548
            itemValue: openSettingsDialog
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
   549
          )
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   550
         )
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   551
        nil
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   552
        nil
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   553
      )
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   554
! !
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   555
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
!MultiViewToolApplication class methodsFor:'queries'!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   557
15945
06616f490bf6 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15408
diff changeset
   558
isAbstract
06616f490bf6 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15408
diff changeset
   559
    ^ self == MultiViewToolApplication
06616f490bf6 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15408
diff changeset
   560
!
06616f490bf6 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15408
diff changeset
   561
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   562
isVisualStartable
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   563
    "return true, if this application can be started via #open.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   564
     (to allow start of a change browser via double-click in the browser)"
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   565
5303
fe0d2165b716 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5302
diff changeset
   566
    self == MultiViewToolApplication ifTrue:[^false].
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   567
    ^ super isVisualStartable
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   568
! !
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   569
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   570
!MultiViewToolApplication methodsFor:'accessing'!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   571
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   572
selectedWorkspace
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   573
    |wsIndex|
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   574
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   575
    workspaces isNil ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   576
        workspaces := OrderedCollection new.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   577
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   578
    wsIndex := self selectedWorkspaceIndexHolder value.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   579
    wsIndex == 0 ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   580
        ^ nil
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   581
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   582
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   583
    workspaces size < wsIndex ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   584
        workspaces grow:wsIndex.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   585
        workspaces at:wsIndex put:(self createWorkspace).
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   586
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   587
    ^ workspaces at:wsIndex
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   588
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   589
13858
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   590
selectedWorkspaceApplication
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   591
    "Return an aoplication of selected workspace or nil,
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   592
     is currently selected workspace is not an embedded
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   593
     ApplicationModel"
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   594
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   595
    | ws |
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   596
    ws := self selectedWorkspace.
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   597
    ^(ws notNil and:[ws isApplicationSubView]) ifTrue:[
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   598
        ws application
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   599
    ] ifFalse:[
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   600
        nil
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   601
    ]
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   602
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   603
    "Created: / 11-05-2012 / 09:38:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   604
!
2e691a1ec8b2 merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 12482
diff changeset
   605
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
tabMenuAt:index
6244
548f6707f59c *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 6179
diff changeset
   607
    <resource: #programMenu>
548f6707f59c *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 6179
diff changeset
   608
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   609
    |m i ws|
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   610
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   611
    m := self class tabMenu.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   612
    m := m decodeAsLiteralArray.
8772
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   613
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   614
    i := m detectItem:[:item | item value == #removeWorkspace:] ifNone:nil.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   615
    i notNil ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   616
        i argument:index.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   617
        index ~~ self selectedWorkspaceIndexHolder value ifTrue:[
8772
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   618
            "/ for now: if that buffer is modified, do not allow removing.
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   619
            "/ (must be brought to front, in order for check-for-modification to work)
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   620
            ws := workspaces at:index.
11727
667a6bfb5c64 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 11626
diff changeset
   621
            ws isScrollWrapper ifTrue:[
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   622
                ws := ws scrolledView
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   623
            ].
11727
667a6bfb5c64 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 11626
diff changeset
   624
            (ws isTextView not
667a6bfb5c64 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 11626
diff changeset
   625
             or:[ ws modified ]) ifTrue:[
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   626
                i disable
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   627
            ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   628
        ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   629
    ].
8772
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   630
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   631
    i := m detectItem:[:item | item value == #removeAllWorkspacesExcept:] ifNone:nil.
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   632
    i notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   633
        i argument:index.
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   634
        "/ for now: if any buffer is modified, do not allow removing.
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   635
        "/ (must be brought to front, in order for check-for-modification to work)
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   636
        workspaces doWithIndex:[:wsArg :idx |
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   637
            |ws|
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   638
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   639
            idx ~~ index ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   640
                ws := wsArg.
11727
667a6bfb5c64 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 11626
diff changeset
   641
                ws isScrollWrapper ifTrue:[
8772
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   642
                    ws := ws scrolledView
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   643
                ].
11727
667a6bfb5c64 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 11626
diff changeset
   644
                (ws isTextView and:[ ws modified ]) ifTrue:[
8772
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   645
                    i disable
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   646
                ].
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   647
            ].
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   648
        ].
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   649
    ].
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   650
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   651
    i := m detectItem:[:item | item value == #renameWorkspace:] ifNone:nil.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   652
    i notNil ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   653
        i argument:index.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   654
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   655
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   656
    m findGuiResourcesIn:self.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   657
    ^ m
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   658
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   659
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   660
workspaceHolder
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   661
    workspaceHolder isNil ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   662
        workspaceHolder := ValueHolder with:(self selectedWorkspace).
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   663
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   664
    ^ workspaceHolder
7852
1cd1001247d9 *** empty log message ***
ab
parents: 7824
diff changeset
   665
!
1cd1001247d9 *** empty log message ***
ab
parents: 7824
diff changeset
   666
1cd1001247d9 *** empty log message ***
ab
parents: 7824
diff changeset
   667
workspaces
1cd1001247d9 *** empty log message ***
ab
parents: 7824
diff changeset
   668
    ^ workspaces
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   669
! !
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   670
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   671
!MultiViewToolApplication methodsFor:'aspects'!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   672
8497
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   673
editToolBarVisibleHolder
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   674
    |holder|
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   675
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   676
    (holder := builder bindingAt:#editToolBarVisibleHolder) isNil ifTrue:[
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   677
        holder := self class defaultEditToolbarVisible asValue.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   678
        builder aspectAt:#editToolBarVisibleHolder put: holder.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   679
        holder addDependent:self.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   680
    ].
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   681
    ^ holder
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   682
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   683
    "Created: / 18-02-2007 / 14:43:39 / cg"
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   684
    "Modified: / 14-07-2007 / 16:39:55 / cg"
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   685
!
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   686
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   687
hasEditToolBar
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   688
    ^ (self menuFor:#editToolBarMenu) decodeAsLiteralArray hasItems 
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   689
!
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   690
9380
346a2a59c410 added: #hasInfoLabel
Claus Gittinger <cg@exept.de>
parents: 9143
diff changeset
   691
hasInfoLabel
346a2a59c410 added: #hasInfoLabel
Claus Gittinger <cg@exept.de>
parents: 9143
diff changeset
   692
    ^ false
346a2a59c410 added: #hasInfoLabel
Claus Gittinger <cg@exept.de>
parents: 9143
diff changeset
   693
!
346a2a59c410 added: #hasInfoLabel
Claus Gittinger <cg@exept.de>
parents: 9143
diff changeset
   694
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   695
infoVisibleHolder
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   696
    |holder|
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   697
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   698
    (holder := builder bindingAt:#infoVisibleHolder) isNil ifTrue:[
7824
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
   699
        holder := self class defaultInfoVisible asValue.
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   700
        builder aspectAt:#infoVisibleHolder put: holder.
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   701
        holder addDependent:self.
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   702
    ].
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   703
    ^ holder
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   704
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   705
    "Created: / 18-02-2007 / 15:01:05 / cg"
7824
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
   706
    "Modified: / 14-07-2007 / 16:39:20 / cg"
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   707
!
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   708
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   709
selectedWorkspaceIndexHolder
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   710
    selectedWorkspaceIndexHolder isNil ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   711
        selectedWorkspaceIndexHolder := 1 asValue.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   712
        selectedWorkspaceIndexHolder onChangeSend:#workspaceSelectionChanged to:self.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   713
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   714
    ^ selectedWorkspaceIndexHolder.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   715
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   716
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   717
tabList
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   718
    tabList isNil ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   719
        tabList := List new.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   720
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   721
    ^ tabList.
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   722
!
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   723
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   724
toolBarVisibleHolder
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   725
    |holder|
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   726
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   727
    (holder := builder bindingAt:#toolBarVisibleHolder) isNil ifTrue:[
7824
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
   728
        holder := self class defaultToolbarVisible asValue.
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   729
        builder aspectAt:#toolBarVisibleHolder put: holder.
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   730
        holder addDependent:self.
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   731
    ].
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   732
    ^ holder
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   733
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   734
    "Created: / 18-02-2007 / 14:43:39 / cg"
7824
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
   735
    "Modified: / 14-07-2007 / 16:39:55 / cg"
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   736
! !
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   737
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   738
!MultiViewToolApplication methodsFor:'aspects-queries'!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   739
8772
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   740
canRemoveAllWorkspacesExcept:idx
15408
ff62d43d5a1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 15407
diff changeset
   741
    ^ [ self tabList size > 1 ]
8772
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   742
!
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
   743
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   744
canRemoveWorkspace
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   745
    ^ self canRemoveWorkspace:(self selectedWorkspaceIndexHolder value)
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   746
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   747
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   748
canRemoveWorkspace:idx
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   749
    ^ self tabList size > 1
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   750
"/       and:[ (self workspacesTextViewAt:(self selectedWorkspaceIndexHolder value))
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   751
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   752
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   753
hasMultipleBuffersHolder
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   754
    ^ [ workspaces size > 1 ]
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   755
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   756
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   757
hasSelectionInActiveWorkspace
6424
57dbbc6ff912 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6408
diff changeset
   758
    |v|
57dbbc6ff912 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6408
diff changeset
   759
57dbbc6ff912 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6408
diff changeset
   760
    v := self selectedWorkspacesTextView.
57dbbc6ff912 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6408
diff changeset
   761
    ^ v notNil and:[v selectionAsString size > 0]
8528
cfb56a882e81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8509
diff changeset
   762
!
cfb56a882e81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8509
diff changeset
   763
17198
551129abfddb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 15945
diff changeset
   764
hasSelectionInActiveWorkspaceAndEditorIsNotReadonly
551129abfddb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 15945
diff changeset
   765
    |v|
551129abfddb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 15945
diff changeset
   766
551129abfddb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 15945
diff changeset
   767
    v := self selectedWorkspacesTextView.
551129abfddb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 15945
diff changeset
   768
    ^ v notNil and:[v enabled and:[v selectionAsString size > 0]]
551129abfddb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 15945
diff changeset
   769
!
551129abfddb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 15945
diff changeset
   770
8528
cfb56a882e81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8509
diff changeset
   771
hasTextInActiveWorkspace
cfb56a882e81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8509
diff changeset
   772
    |v|
cfb56a882e81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8509
diff changeset
   773
cfb56a882e81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8509
diff changeset
   774
    v := self selectedWorkspacesTextView.
cfb56a882e81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8509
diff changeset
   775
    ^ v notNil 
cfb56a882e81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8509
diff changeset
   776
      and:[v list notEmptyOrNil 
cfb56a882e81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8509
diff changeset
   777
      and:[v list contains:[:l | l notEmptyOrNil]]] 
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   778
! !
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   779
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   780
!MultiViewToolApplication methodsFor:'change & update'!
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   781
8497
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   782
infoVisibilityChanged
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   783
    |visible cFrame bottomOffset|
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   784
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   785
    visible := self infoVisibleHolder value.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   786
9380
346a2a59c410 added: #hasInfoLabel
Claus Gittinger <cg@exept.de>
parents: 9143
diff changeset
   787
    cFrame := builder findComponentAt:#NoteBook. "/ #CodeView.
8497
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   788
    cFrame notNil ifTrue:[    
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   789
        visible ifFalse:[
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   790
            bottomOffset := 0.   
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   791
        ] ifTrue:[
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   792
            bottomOffset := -25.   
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   793
        ].
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   794
        cFrame layout bottomOffset:bottomOffset.   
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   795
        cFrame container notNil ifTrue:[
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   796
            cFrame containerChangedSize.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   797
        ].
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   798
    ].
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   799
    DefaultInfoVisible := visible
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   800
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   801
    "Created: / 18-02-2007 / 15:01:55 / cg"
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   802
!
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   803
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   804
toolBarVisibilityChanged
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   805
    |toolBarVisible editToolBarVisible toolBar editToolBar noteBook topOffset|
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   806
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   807
    topOffset := 0.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   808
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   809
    toolBar := self componentAt:#ToolBar.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   810
    toolBar notNil ifTrue:[
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   811
        toolBarVisible := self toolBarVisibleHolder value.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   812
        DefaultToolBarVisible := toolBarVisible.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   813
        toolBarVisible ifTrue:[
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   814
            topOffset := topOffset + toolBar height.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   815
        ]
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   816
    ].
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   817
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   818
    editToolBar := self componentAt:#EditToolBar.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   819
    editToolBar notNil ifTrue:[
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   820
        editToolBar layout 
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   821
            topOffset:topOffset bottomOffset:(topOffset + editToolBar height).
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   822
        "/ force it to recompute its dimension
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   823
        editToolBar container notNil ifTrue:[
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   824
            editToolBar containerChangedSize.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   825
        ].
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   826
        editToolBarVisible := self editToolBarVisibleHolder value.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   827
        DefaultEditToolBarVisible := editToolBarVisible.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   828
        editToolBarVisible ifTrue:[
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   829
            topOffset := topOffset + editToolBar height.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   830
        ]
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   831
    ].
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   832
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   833
    noteBook := self componentAt:#NoteBook.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   834
    noteBook notNil ifTrue:[
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   835
        noteBook layout topOffset:topOffset.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   836
        "/ force it to recompute its dimension
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   837
        noteBook container notNil ifTrue:[
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   838
            noteBook containerChangedSize.
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   839
        ].
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   840
    ].
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   841
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   842
    "Created: / 18-02-2007 / 14:46:22 / cg"
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   843
!
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   844
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   845
update:something with:aParameter from:changedObject
8497
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   846
    ((changedObject == self toolBarVisibleHolder)
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   847
    or:[ changedObject == self editToolBarVisibleHolder ]) ifTrue:[
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   848
        self toolBarVisibilityChanged.
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   849
        ^ self
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   850
    ].
7824
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
   851
    changedObject == self infoVisibleHolder ifTrue:[
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
   852
        self infoVisibilityChanged.
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
   853
        ^ self
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
   854
    ].
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   855
    ^ super update:something with:aParameter from:changedObject
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   856
7824
09995d9a889d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7745
diff changeset
   857
    "Modified: / 14-07-2007 / 16:46:14 / cg"
14175
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   858
!
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   859
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   860
windowLabelPrefix
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   861
    |nm|
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   862
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   863
    nm := self class nameWithoutPrefix.
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   864
    (nm endsWith:'Application') ifTrue:[
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   865
        nm := nm copyButLast:'Application' size
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   866
    ].
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   867
    ^ nm
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   868
!
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   869
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   870
workspaceSelectionChanged
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   871
    |wsIndex windowLabel v prefix|
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   872
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   873
    "/ self selected
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   874
    self workspaceHolder value:(v := self selectedWorkspace).
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   875
    wsIndex := self selectedWorkspaceIndexHolder value.
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   876
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   877
    wsIndex ~~ 0 ifTrue:[
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   878
        prefix := self windowLabelPrefix.
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   879
        windowLabel := tabList at:wsIndex ifAbsent:nil.
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   880
        windowLabel notNil ifTrue:[self window label:prefix,': ',windowLabel].
61dceb4984c4 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 13858
diff changeset
   881
    ].
15408
ff62d43d5a1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 15407
diff changeset
   882
ff62d43d5a1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 15407
diff changeset
   883
    v notNil ifTrue:[ v takeFocusWhenMapped:true ]
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   884
! !
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   885
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   886
!MultiViewToolApplication methodsFor:'defaults'!
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   887
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   888
defaultFileNameForLoad
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   889
   ^ 'file.txt'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   890
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   891
    "Created: / 25-10-2006 / 14:56:19 / cg"
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   892
!
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   893
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   894
defaultFileNameForSave
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   895
    ^ 'file.txt'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   896
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   897
    "Modified: / 25-10-2006 / 14:54:13 / cg"
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   898
!
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   899
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   900
defaultFileNameForSaveAll
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   901
   ^ 'file.txt'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   902
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   903
    "Modified: / 25-10-2006 / 14:55:50 / cg"
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   904
!
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   905
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   906
defaultPatternLoad
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   907
   ^ '*.txt'
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   908
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   909
    "Created: / 25-10-2006 / 14:57:18 / cg"
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   910
! !
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   911
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   912
!MultiViewToolApplication methodsFor:'initialization'!
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   913
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   914
hideToolBarButtonCreated:aButton
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   915
    aButton passiveLevel:(MenuPanel defaultLevel). 
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   916
"/    aButton passiveLevel:1.
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   917
    aButton activeLevel:-1.
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   918
    aButton backgroundColor:(MenuPanel defaultBackgroundColor).
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   919
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   920
    "Created: / 18-02-2007 / 14:48:28 / cg"
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   921
!
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   922
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   923
postBuildWith:aBuilder
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   924
    super postBuildWith:aBuilder.
8497
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   925
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   926
    self infoVisibleHolder value ifTrue:[ self infoVisibilityChanged ].
8497
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   927
    (self toolBarVisibleHolder value 
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
   928
    or:[ self editToolBarVisibleHolder value ]) ifTrue:[ self toolBarVisibilityChanged ].
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   929
9694
eb3dff842677 changed:
Claus Gittinger <cg@exept.de>
parents: 9664
diff changeset
   930
    self workspaceSelectionChanged.
eb3dff842677 changed:
Claus Gittinger <cg@exept.de>
parents: 9664
diff changeset
   931
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   932
    "Created: / 18-02-2007 / 15:03:08 / cg"
9694
eb3dff842677 changed:
Claus Gittinger <cg@exept.de>
parents: 9664
diff changeset
   933
    "Modified: / 22-01-2011 / 11:46:35 / cg"
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   934
! !
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
   935
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   936
!MultiViewToolApplication methodsFor:'menu-actions'!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   937
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   938
addWindow:aWindow named:name
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   939
    ^ self addWindow:aWindow named:name asFirst:false
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   940
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   941
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   942
addWindow:aWindow named:name asFirst:asFirst
14805
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   943
    ^ self addWindow:aWindow named:name tabIcon:nil asFirst:asFirst
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   944
!
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   945
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   946
addWindow:aWindow named:name tabIcon:iconOrNil
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   947
    ^ self addWindow:aWindow named:name tabIcon:iconOrNil asFirst:false
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   948
!
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   949
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   950
addWindow:aWindow named:name tabIcon:iconOrNil asFirst:asFirst
15407
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
   951
    |tabList tabItem wsIndex newSelectedIndex initialFocusView|
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   952
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   953
    tabList := self tabList.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   954
    wsIndex := tabList size + 1.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   955
    wsIndex == 1 ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   956
        "/ first - add a name for the first tab
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   957
        tabList add:(self window label). "/ 'Workspace'.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   958
        wsIndex := wsIndex + 1.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   959
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   960
14805
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   961
    tabItem := name bindWith:wsIndex.
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   962
    iconOrNil notNil ifTrue:[
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   963
        tabItem := LabelAndIcon icon:iconOrNil string:tabItem.
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   964
    ].
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   965
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   966
    workspaces grow:wsIndex.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   967
    asFirst ifTrue:[
14805
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   968
        tabList addFirst:tabItem.
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   969
        workspaces replaceFrom:2 to:wsIndex with:workspaces startingAt:1.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   970
        newSelectedIndex := 1.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   971
    ] ifFalse:[
14805
3e0fc4db20cf class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14557
diff changeset
   972
        tabList addLast:tabItem.
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   973
        newSelectedIndex := wsIndex.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   974
    ].
9664
a4a6072afcf8 changed:
Claus Gittinger <cg@exept.de>
parents: 9636
diff changeset
   975
15407
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
   976
    (aWindow isKeyboardConsumer) ifTrue:[
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
   977
        initialFocusView := aWindow.
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
   978
    ] ifFalse:[
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
   979
        (aWindow scrolledView isKeyboardConsumer) ifTrue:[
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
   980
            initialFocusView := aWindow scrolledView
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
   981
        ] ifFalse:[
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
   982
            initialFocusView := aWindow scrolledView allSubViewsDetect:[:v | v isKeyboardConsumer] ifNone:nil.
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
   983
        ]
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
   984
    ].
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
   985
    (initialFocusView notNil "and:[w isKeyboardConsumer]") ifTrue:[
7c5e7b454c1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14805
diff changeset
   986
        initialFocusView takeFocusWhenMapped:true.
9664
a4a6072afcf8 changed:
Claus Gittinger <cg@exept.de>
parents: 9636
diff changeset
   987
    ].
a4a6072afcf8 changed:
Claus Gittinger <cg@exept.de>
parents: 9636
diff changeset
   988
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   989
    workspaces at:newSelectedIndex put:aWindow.
9694
eb3dff842677 changed:
Claus Gittinger <cg@exept.de>
parents: 9664
diff changeset
   990
    self selectedWorkspaceIndexHolder value:newSelectedIndex.
eb3dff842677 changed:
Claus Gittinger <cg@exept.de>
parents: 9664
diff changeset
   991
    self workspaceSelectionChanged.
eb3dff842677 changed:
Claus Gittinger <cg@exept.de>
parents: 9664
diff changeset
   992
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   993
"/    workspaceHolder value:aWindow.
9664
a4a6072afcf8 changed:
Claus Gittinger <cg@exept.de>
parents: 9636
diff changeset
   994
9694
eb3dff842677 changed:
Claus Gittinger <cg@exept.de>
parents: 9664
diff changeset
   995
    "Modified: / 22-01-2011 / 12:02:59 / cg"
10252
6bc6fc141f49 Merged with JV's branch
vrany
parents: 10221
diff changeset
   996
    "Modified: / 11-06-2011 / 00:05:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   997
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   998
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
   999
addWorkspace
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1000
    self addWindow:(self createWorkspace) named:'Workspace%1'
6408
e0f701a20cae remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents: 6354
diff changeset
  1001
!
e0f701a20cae remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents: 6354
diff changeset
  1002
6458
abf7db73fa79 destroy tabs
Claus Gittinger <cg@exept.de>
parents: 6424
diff changeset
  1003
destroyTab:tabIndex
abf7db73fa79 destroy tabs
Claus Gittinger <cg@exept.de>
parents: 6424
diff changeset
  1004
    self removeWorkspace:tabIndex
abf7db73fa79 destroy tabs
Claus Gittinger <cg@exept.de>
parents: 6424
diff changeset
  1005
!
abf7db73fa79 destroy tabs
Claus Gittinger <cg@exept.de>
parents: 6424
diff changeset
  1006
8576
d8906424444d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8528
diff changeset
  1007
doIt
d8906424444d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8528
diff changeset
  1008
    |v|
d8906424444d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8528
diff changeset
  1009
d8906424444d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8528
diff changeset
  1010
    (v := self selectedWorkspacesTextView) notNil ifTrue:[
d8906424444d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8528
diff changeset
  1011
        v doIt.
d8906424444d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8528
diff changeset
  1012
    ]
d8906424444d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8528
diff changeset
  1013
!
d8906424444d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8528
diff changeset
  1014
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1015
loadFile:aFileName 
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1016
    self loadFile:aFileName encoding:nil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1017
!
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1018
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1019
loadFile:aFileName encoding:encodingSymbolOrNil
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1020
    |lbl|
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1021
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1022
    lbl := aFileName asFilename withoutSuffix baseName.
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1023
    self loadFile:aFileName encoding:encodingSymbolOrNil label:lbl.
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1024
!
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1025
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1026
loadFile:aFileName encoding:encodingSymbolOrNil label:label
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1027
    |file ws|
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1028
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1029
    file := aFileName asFilename.
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1030
    ws := self selectedWorkspacesTextView.
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1031
    [
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1032
        |contents|
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1033
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1034
        contents := file contents.
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1035
        encodingSymbolOrNil notNil ifTrue:[
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1036
            contents := contents encodeFrom:encodingSymbolOrNil into:#'unicode'.
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1037
            ws externalEncoding:encodingSymbolOrNil.
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1038
        ].
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1039
        ws contents:contents.
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1040
        ws defaultFileNameForFileDialog:file pathName.
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1041
    ] on:StreamError do:[:ex|
8368
fd864b68c591 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8231
diff changeset
  1042
        Dialog warn:(resources stringWithCRs:'Cannot open "%1":\\%2' with:file asString with:ex description).
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1043
        ^ self
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1044
    ].
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1045
    ws modified:false.
8033
233d210c526a label handling after load
Claus Gittinger <cg@exept.de>
parents: 7852
diff changeset
  1046
    self setLabel:label.
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1047
!
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1048
7745
de4f256227cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7663
diff changeset
  1049
loadFile:aFileName label:lbl
de4f256227cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7663
diff changeset
  1050
    |encoding|
de4f256227cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7663
diff changeset
  1051
de4f256227cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7663
diff changeset
  1052
    encoding := CharacterEncoder guessEncodingOfFile:aFileName.
de4f256227cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7663
diff changeset
  1053
    (encoding == #'iso8859-1' or:[encoding == #'ascii']) ifTrue:[
de4f256227cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7663
diff changeset
  1054
        encoding := nil
de4f256227cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7663
diff changeset
  1055
    ].
de4f256227cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7663
diff changeset
  1056
    self loadFile:aFileName encoding:encoding label:lbl.
de4f256227cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7663
diff changeset
  1057
de4f256227cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7663
diff changeset
  1058
    "Created: / 15-03-2007 / 11:52:21 / cg"
de4f256227cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7663
diff changeset
  1059
!
de4f256227cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7663
diff changeset
  1060
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1061
menuLoad
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1062
    |file|
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1063
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1064
    (self askIfModified:'Text was modified. Load anyway ?' yesButton:'Load') ifFalse:[ ^ self].
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1065
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1066
    file := Dialog 
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1067
                requestFileName:(resources string:'Load file') 
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1068
                default:(self defaultFileNameForLoad) 
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1069
                pattern:(self defaultPatternLoad).
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1070
    file size ~~ 0 ifTrue:[
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1071
        self loadFile:file
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1072
    ]
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1073
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1074
    "Modified: / 25-10-2006 / 14:57:34 / cg"
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1075
!
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1076
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1077
menuPrint
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1078
    |ws|
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1079
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1080
    ws := self selectedWorkspacesTextView.
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1081
    ws doPrint
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1082
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1083
    "Created: / 25-10-2006 / 15:01:51 / cg"
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1084
!
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1085
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1086
menuSaveAllAs
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1087
    self 
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1088
        askForFile:'Save all Buffers into:' 
8196
29ed5a2bf16d fixed saveAll
Claus Gittinger <cg@exept.de>
parents: 8033
diff changeset
  1089
        default:(self defaultFileNameForSaveAll)
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1090
        thenDo:[:file :doAppend |
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1091
            |ws append|
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1092
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1093
            append := doAppend.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1094
            workspaces do:[:subView |
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1095
                |ws|
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1096
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1097
                ws := self workspaceViewOfView:subView.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1098
                ws notNil ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1099
                    ws saveAs:file doAppend:append.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1100
                    ws modified:false.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1101
                ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1102
                append := true.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1103
            ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1104
        ]
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1105
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1107
menuSaveAs
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1108
    self 
6408
e0f701a20cae remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents: 6354
diff changeset
  1109
        askForFile:'Save Buffer into:'
e0f701a20cae remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents: 6354
diff changeset
  1110
        default:(self defaultFileNameForSave)
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1111
        thenDo:[:file :doAppend |
8033
233d210c526a label handling after load
Claus Gittinger <cg@exept.de>
parents: 7852
diff changeset
  1112
            |ws lbl|
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1113
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1114
            ws := self selectedWorkspacesTextView.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1115
            ws saveAs:file doAppend:doAppend.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1116
            ws modified:false.
8395
3596ebae2d90 changed #defaultFileNameForSave
Claus Gittinger <cg@exept.de>
parents: 8368
diff changeset
  1117
            "/ ws defaultFileNameForFileDialog:file asFilename baseName.
8033
233d210c526a label handling after load
Claus Gittinger <cg@exept.de>
parents: 7852
diff changeset
  1118
233d210c526a label handling after load
Claus Gittinger <cg@exept.de>
parents: 7852
diff changeset
  1119
            lbl := file asFilename withoutSuffix baseName.
233d210c526a label handling after load
Claus Gittinger <cg@exept.de>
parents: 7852
diff changeset
  1120
            self setLabel:lbl.
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1121
        ]
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1122
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1123
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1124
newWorkspace
6863
4e2e267622eb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6634
diff changeset
  1125
    self class new openWithExtent:(self builder window extent).
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1126
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1127
    "Modified: / 25-10-2006 / 14:39:15 / cg"
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1128
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1129
14279
9214ed746ffd class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14175
diff changeset
  1130
openFontDialog
9214ed746ffd class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14175
diff changeset
  1131
    self selectedWorkspace changeFont
9214ed746ffd class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14175
diff changeset
  1132
!
9214ed746ffd class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14175
diff changeset
  1133
9058
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1134
openSTXDocumentation
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1135
    "opens the top documentation file"
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1136
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1137
    self openHTMLDocument: 'TOP.html'
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1138
!
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1139
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1140
openSettingsDialog
14557
f2fbe336969a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14279
diff changeset
  1141
    |settingsList|
9058
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1142
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1143
    settingsList := 
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1144
        #(
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1145
           #('Keyboard Mappings'    #'AbstractSettingsApplication::KbdMappingSettingsAppl'          )
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1146
"/           #('Debugger'             #'AbstractSettingsApplication::DebuggerSettingsAppl'            )
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1147
           #('Editor'               #'AbstractSettingsApplication::EditSettingsAppl'                )
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1148
"/           #('Syntax Color'         #'AbstractSettingsApplication::SyntaxColorSettingsAppl'         )
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1149
"/           #('Code Format'          #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl'    )
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1150
        ).
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1151
14557
f2fbe336969a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14279
diff changeset
  1152
    SettingsDialog 
f2fbe336969a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14279
diff changeset
  1153
        openWithList:settingsList 
f2fbe336969a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 14279
diff changeset
  1154
        label:(resources string:'Settings').
9058
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1155
!
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1156
8576
d8906424444d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8528
diff changeset
  1157
printIt
d8906424444d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8528
diff changeset
  1158
!
d8906424444d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8528
diff changeset
  1159
8772
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
  1160
removeAllWorkspacesExcept:wsIndex
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
  1161
    tabList size downTo:wsIndex+1 do:[:idx |
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
  1162
        self removeWorkspace:idx.
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
  1163
    ].
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
  1164
    1 to:wsIndex-1 do:[:idx |
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
  1165
        self removeWorkspace:1.
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
  1166
    ].
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
  1167
!
Claus Gittinger <cg@exept.de>
parents: 8615
diff changeset
  1168
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1169
removeWorkspace
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1170
    self removeWorkspace:(self selectedWorkspaceIndexHolder value)
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1171
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1172
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1173
removeWorkspace:wsIndex
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1174
    |tabList newWsIndex|
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1175
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1176
    wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[
6509
bcaae26df254 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6458
diff changeset
  1177
        (self askIfModified:'Text was modified. Remove buffer anyway ?' yesButton:'Remove Buffer') ifFalse:[
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1178
            ^ self
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1179
        ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1180
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1181
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1182
    tabList := self tabList.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1183
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1184
    wsIndex == tabList size ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1185
        newWsIndex := wsIndex - 1.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1186
    ] ifFalse:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1187
        newWsIndex := wsIndex.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1188
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1189
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1190
    tabList removeIndex:wsIndex.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1191
    (workspaces at:wsIndex) destroy.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1192
    workspaces removeIndex:wsIndex.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1193
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1194
    tabList size == 1 ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1195
        self window label:(tabList at:1).
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1196
        tabList removeIndex:1
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1197
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1198
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1199
    workspaceHolder value:(workspaces at:newWsIndex).
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1200
    self selectedWorkspaceIndexHolder value:newWsIndex.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1201
    "/ to force change (update workspaceHolder - even if same index)
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1202
    self selectedWorkspaceIndexHolder changed:#value.   
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1203
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1204
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1205
renameWorkspace
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1206
    self renameWorkspace:(self selectedWorkspaceIndexHolder value)
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1207
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1208
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1209
renameWorkspace:wsIndex
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1210
    |tabList oldName newName|
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1211
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1212
    tabList := self tabList.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1213
    tabList isEmpty ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1214
        oldName := self window label
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1215
    ] ifFalse:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1216
        oldName := tabList at:wsIndex.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1217
    ].
11626
fb8ca9aad4a3 changed: #renameWorkspace:
Claus Gittinger <cg@exept.de>
parents: 11482
diff changeset
  1218
    newName := Dialog request:(resources string:'New Name for "%1":' with:oldName) initialAnswer:oldName.
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1219
    newName size == 0 ifTrue:[ ^ self].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1220
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1221
    self renameWorkspace:wsIndex to:newName.
11626
fb8ca9aad4a3 changed: #renameWorkspace:
Claus Gittinger <cg@exept.de>
parents: 11482
diff changeset
  1222
fb8ca9aad4a3 changed: #renameWorkspace:
Claus Gittinger <cg@exept.de>
parents: 11482
diff changeset
  1223
    "Modified: / 20-07-2012 / 10:21:29 / cg"
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1224
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1225
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1226
renameWorkspace:wsIndex to:newName
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1227
    |tabList|
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1228
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1229
    tabList := self tabList.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1230
    tabList notEmpty ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1231
        tabList at:wsIndex put:newName.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1232
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1233
    wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1234
        self window label:newName.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1235
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1236
! !
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1237
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1238
!MultiViewToolApplication methodsFor:'menu-actions-editing'!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1239
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1240
copySelection
8498
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1241
    |v|
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1242
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1243
    (v := self selectedWorkspacesTextView) notNil ifTrue:[
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1244
        v copySelection
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1245
    ]
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1246
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1247
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1248
cutSelection
8498
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1249
    |v|
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1250
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1251
    (v := self selectedWorkspacesTextView) notNil ifTrue:[
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1252
        v cutSelection
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1253
    ].
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1254
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1255
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1256
paste
8498
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1257
    |v|
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1258
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1259
    (v := self selectedWorkspacesTextView) notNil ifTrue:[
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1260
        v paste
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1261
    ]
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1262
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1263
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1264
paste:aString
9634
c09155118873 changed: #paste:
Claus Gittinger <cg@exept.de>
parents: 9633
diff changeset
  1265
    |v|
9633
cbd9b7c06f28 changed: #paste:
Claus Gittinger <cg@exept.de>
parents: 9380
diff changeset
  1266
9634
c09155118873 changed: #paste:
Claus Gittinger <cg@exept.de>
parents: 9633
diff changeset
  1267
    v := (workspaceHolder value) ? (self selectedWorkspacesTextView).
11482
e945c7253f9b changed: #paste:
Stefan Vogel <sv@exept.de>
parents: 10252
diff changeset
  1268
    [
e945c7253f9b changed: #paste:
Stefan Vogel <sv@exept.de>
parents: 10252
diff changeset
  1269
        v perform:#paste: with:aString.
e945c7253f9b changed: #paste:
Stefan Vogel <sv@exept.de>
parents: 10252
diff changeset
  1270
    ] on:MessageNotUnderstood do:[:ex|
e945c7253f9b changed: #paste:
Stefan Vogel <sv@exept.de>
parents: 10252
diff changeset
  1271
        "special code, to catch exeception sent from a scrolled view,
e945c7253f9b changed: #paste:
Stefan Vogel <sv@exept.de>
parents: 10252
diff changeset
  1272
         which has a different receiver tha v"
e945c7253f9b changed: #paste:
Stefan Vogel <sv@exept.de>
parents: 10252
diff changeset
  1273
        (ex selector ~~ #paste:) ifTrue:[
e945c7253f9b changed: #paste:
Stefan Vogel <sv@exept.de>
parents: 10252
diff changeset
  1274
            ex reject.
e945c7253f9b changed: #paste:
Stefan Vogel <sv@exept.de>
parents: 10252
diff changeset
  1275
        ].
e945c7253f9b changed: #paste:
Stefan Vogel <sv@exept.de>
parents: 10252
diff changeset
  1276
        "else ignore it"
e945c7253f9b changed: #paste:
Stefan Vogel <sv@exept.de>
parents: 10252
diff changeset
  1277
    ].
9634
c09155118873 changed: #paste:
Claus Gittinger <cg@exept.de>
parents: 9633
diff changeset
  1278
9636
8593b50b09dc changed: #paste:
Claus Gittinger <cg@exept.de>
parents: 9634
diff changeset
  1279
    "Modified: / 16-11-2010 / 15:27:39 / cg"
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1280
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1281
8509
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1282
redo
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1283
    |v|
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1284
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1285
    (v := self selectedWorkspacesTextView) notNil ifTrue:[
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1286
        v redo.
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1287
    ]
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1288
!
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1289
8498
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1290
search
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1291
    |v|
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1292
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1293
    (v := self selectedWorkspacesTextView) notNil ifTrue:[
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1294
        v search.
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1295
    ]
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1296
!
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1297
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1298
selectAll
8498
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1299
    |v|
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1300
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1301
    (v := self selectedWorkspacesTextView) notNil ifTrue:[
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1302
        v selectAll.
3f0be0fbfbec support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8497
diff changeset
  1303
    ]
8509
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1304
!
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1305
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1306
undo
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1307
    |v|
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1308
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1309
    (v := self selectedWorkspacesTextView) notNil ifTrue:[
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1310
        v undo.
2b395fdbab78 more editMenu stuff
Claus Gittinger <cg@exept.de>
parents: 8507
diff changeset
  1311
    ]
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1312
! !
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1313
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1314
!MultiViewToolApplication methodsFor:'private'!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1315
6408
e0f701a20cae remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents: 6354
diff changeset
  1316
askForFile:question default:defaultFilename thenDo:aBlock
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1317
    Dialog
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1318
        requestSaveFileName:(resources string:question) 
6408
e0f701a20cae remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents: 6354
diff changeset
  1319
        default:defaultFilename 
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1320
        fromDirectory:nil 
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1321
        action:[:fileName | aBlock value:fileName value:false] 
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1322
        appendAction:[:fileName | aBlock value:fileName value:true]
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1323
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1324
"/    |file doAppend|
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1325
"/
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1326
"/    doAppend := false.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1327
"/    Dialog aboutToOpenBoxNotificationSignal handle:[:n |
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1328
"/        |box|
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1329
"/
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1330
"/        box := n parameter.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1331
"/        box addButton:(Button label:'Append' action:[doAppend := true. box okPressed]).
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1332
"/        n proceed.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1333
"/    ] do:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1334
"/        file := Dialog requestFileName:question default:'file.wsp'. 
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1335
"/    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1336
"/    file isEmptyOrNil ifFalse:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1337
"/        aBlock value:file value:doAppend
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1338
"/    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1339
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1340
6408
e0f701a20cae remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents: 6354
diff changeset
  1341
askForFile:question thenDo:aBlock
e0f701a20cae remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents: 6354
diff changeset
  1342
    ^ self
e0f701a20cae remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents: 6354
diff changeset
  1343
        askForFile:question default:'file.wsp' thenDo:aBlock
e0f701a20cae remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents: 6354
diff changeset
  1344
!
e0f701a20cae remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents: 6354
diff changeset
  1345
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1346
askIfAnyModified:arg1 yesButton:arg2 
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1347
    "raise an error: must be redefined in concrete subclass(es)"
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1348
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1349
    ^ self subclassResponsibility
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1350
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1351
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1352
askIfModified:question yesButton:yesButtonText
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1353
    "tell user, that code has been modified - let her confirm"
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1354
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1355
    |textView|
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1356
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1357
    textView := self selectedWorkspace.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1358
    (self isModifiedWorkspace:textView) ifFalse:[^ true].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1359
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1360
    (Dialog 
6354
08a483e3beda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6244
diff changeset
  1361
        confirm:(resources stringWithCRs:question)
6634
a94d8a07247d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6509
diff changeset
  1362
        yesLabel:(resources string:yesButtonText)
a94d8a07247d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6509
diff changeset
  1363
        noLabel:(resources string:'Cancel'))
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1364
    ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1365
        "/ reset modified flag so question is asked only once
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1366
        textView modified:false.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1367
        ^ true
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1368
    ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1369
    ^ false
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1370
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1371
    "Modified: 2.10.1997 / 14:23:47 / stefan"
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1372
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1373
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1374
createWorkspace
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1375
    |ws|
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1376
7475
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1377
    ws := (HVScrollableView for:EditTextView).
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1378
    ^ ws
54b889153fc7 refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  1379
9664
a4a6072afcf8 changed:
Claus Gittinger <cg@exept.de>
parents: 9636
diff changeset
  1380
    "Modified: / 09-12-2010 / 10:55:25 / cg"
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1381
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1382
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1383
isModifiedWorkspace:aView
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1384
    self subclassResponsibility
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1385
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1386
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1387
selectedWorkspacesTextView
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1388
    ^ self workspaceViewOfView:(self selectedWorkspace)
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1389
!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1390
8033
233d210c526a label handling after load
Claus Gittinger <cg@exept.de>
parents: 7852
diff changeset
  1391
setLabel:label
233d210c526a label handling after load
Claus Gittinger <cg@exept.de>
parents: 7852
diff changeset
  1392
    tabList size > 1 ifTrue:[
233d210c526a label handling after load
Claus Gittinger <cg@exept.de>
parents: 7852
diff changeset
  1393
        tabList at:self selectedWorkspaceIndexHolder value put:label
233d210c526a label handling after load
Claus Gittinger <cg@exept.de>
parents: 7852
diff changeset
  1394
    ].
233d210c526a label handling after load
Claus Gittinger <cg@exept.de>
parents: 7852
diff changeset
  1395
    self window label:label.
233d210c526a label handling after load
Claus Gittinger <cg@exept.de>
parents: 7852
diff changeset
  1396
!
233d210c526a label handling after load
Claus Gittinger <cg@exept.de>
parents: 7852
diff changeset
  1397
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1398
workspaceViewOfView:aView
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1399
    |view|
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1400
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1401
    view := aView.
7663
c11efe4cbcf3 care for eval workspace
Claus Gittinger <cg@exept.de>
parents: 7653
diff changeset
  1402
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1403
    (view isScrollWrapper) ifTrue:[
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1404
        view := view scrolledView.
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1405
        view isNil ifTrue:[^ nil].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1406
    ].
7663
c11efe4cbcf3 care for eval workspace
Claus Gittinger <cg@exept.de>
parents: 7653
diff changeset
  1407
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1408
    (view isTextView) ifFalse:[
7663
c11efe4cbcf3 care for eval workspace
Claus Gittinger <cg@exept.de>
parents: 7653
diff changeset
  1409
        (view isKindOf:InspectorView) ifTrue:[
c11efe4cbcf3 care for eval workspace
Claus Gittinger <cg@exept.de>
parents: 7653
diff changeset
  1410
            view := view workspace.
c11efe4cbcf3 care for eval workspace
Claus Gittinger <cg@exept.de>
parents: 7653
diff changeset
  1411
            (view isScrollWrapper) ifTrue:[
c11efe4cbcf3 care for eval workspace
Claus Gittinger <cg@exept.de>
parents: 7653
diff changeset
  1412
                view := view scrolledView
c11efe4cbcf3 care for eval workspace
Claus Gittinger <cg@exept.de>
parents: 7653
diff changeset
  1413
            ].
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1414
        ].
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1415
    ].
7663
c11efe4cbcf3 care for eval workspace
Claus Gittinger <cg@exept.de>
parents: 7653
diff changeset
  1416
    (view isTextView) ifTrue:[^ view].
c11efe4cbcf3 care for eval workspace
Claus Gittinger <cg@exept.de>
parents: 7653
diff changeset
  1417
    ^ view allSubViewsDetect:[:v| v name = #Workspace] ifNone:nil.
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1418
! !
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1419
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
  1420
!MultiViewToolApplication methodsFor:'user actions'!
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
  1421
8497
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
  1422
hideEditToolbar
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
  1423
    self editToolBarVisibleHolder value:false
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
  1424
!
08a96ef8a3c4 support an edit-ops-toolbar
Claus Gittinger <cg@exept.de>
parents: 8395
diff changeset
  1425
7650
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
  1426
hideToolbar
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
  1427
    self toolBarVisibleHolder value:false
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
  1428
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
  1429
    "Created: / 18-02-2007 / 14:55:54 / cg"
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
  1430
! !
12fcca896ba0 workspaceApp refactored
Claus Gittinger <cg@exept.de>
parents: 7475
diff changeset
  1431
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1432
!MultiViewToolApplication class methodsFor:'documentation'!
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1433
15408
ff62d43d5a1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 15407
diff changeset
  1434
version
15945
06616f490bf6 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15408
diff changeset
  1435
    ^ '$Header$'
15408
ff62d43d5a1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 15407
diff changeset
  1436
!
ff62d43d5a1a class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 15407
diff changeset
  1437
9058
Claus Gittinger <cg@exept.de>
parents: 8772
diff changeset
  1438
version_CVS
15945
06616f490bf6 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15408
diff changeset
  1439
    ^ '$Header$'
5302
615a0020e15c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1440
! !
12482
e801a369d243 class: MultiViewToolApplication
Claus Gittinger <cg@exept.de>
parents: 11727
diff changeset
  1441