author | Claus Gittinger <cg@exept.de> |
Tue, 22 Sep 2009 22:31:26 +0200 | |
changeset 8772 | 85bc7bdd6cea |
parent 8615 | 3407696ae28f |
child 9058 | 83d47c6efdbf |
permissions | -rw-r--r-- |
6179 | 1 |
" |
2 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
5302 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
14 |
ToolApplicationModel subclass:#MultiViewToolApplication |
|
15 |
instanceVariableNames:'workspaces tabList selectedWorkspaceIndexHolder workspaceHolder' |
|
8615 | 16 |
classVariableNames:'DefaultInfoVisible DefaultEditToolBarVisible |
17 |
DefaultToolBarVisible' |
|
5302 | 18 |
poolDictionaries:'' |
19 |
category:'Interface-Smalltalk' |
|
20 |
! |
|
21 |
||
22 |
!MultiViewToolApplication class methodsFor:'documentation'! |
|
23 |
||
6179 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
5302 | 38 |
documentation |
39 |
" |
|
8497 | 40 |
Common code for multiView applications (Workspace, Terminal app and maybe more later) |
5302 | 41 |
|
42 |
[author:] |
|
43 |
Claus Gittinger |
|
44 |
" |
|
45 |
! ! |
|
46 |
||
7824 | 47 |
!MultiViewToolApplication class methodsFor:'defaults'! |
48 |
||
8497 | 49 |
defaultEditToolbarVisible |
50 |
^ DefaultEditToolBarVisible ? false |
|
51 |
||
52 |
"Created: / 14-07-2007 / 16:38:47 / cg" |
|
53 |
! |
|
54 |
||
7824 | 55 |
defaultInfoVisible |
56 |
^ DefaultInfoVisible ? true |
|
57 |
||
58 |
"Created: / 14-07-2007 / 16:38:32 / cg" |
|
59 |
! |
|
60 |
||
61 |
defaultToolbarVisible |
|
62 |
^ DefaultToolBarVisible ? false |
|
63 |
||
64 |
"Created: / 14-07-2007 / 16:38:47 / cg" |
|
65 |
! ! |
|
66 |
||
7650 | 67 |
!MultiViewToolApplication class methodsFor:'image specs'! |
68 |
||
69 |
hideToolBarIcon |
|
70 |
<resource: #programImage> |
|
71 |
||
72 |
^ ToolbarIconLibrary hideToolBarIcon |
|
73 |
||
74 |
"Created: / 18-02-2007 / 14:53:38 / cg" |
|
75 |
! ! |
|
76 |
||
5302 | 77 |
!MultiViewToolApplication class methodsFor:'interface specs'! |
78 |
||
79 |
windowSpec |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
80 |
"This resource specification was automatically generated |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
81 |
by the UIPainter of ST/X." |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
82 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
83 |
"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
|
84 |
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
|
85 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
86 |
" |
7650 | 87 |
UIPainter new openOnClass:MultiViewToolApplication andSelector:#windowSpec |
88 |
MultiViewToolApplication new openInterface:#windowSpec |
|
89 |
MultiViewToolApplication open |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
90 |
" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
91 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
92 |
<resource: #canvas> |
5302 | 93 |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
94 |
^ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
95 |
#(FullSpec |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
96 |
name: windowSpec |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
97 |
window: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
98 |
(WindowSpec |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
99 |
label: 'Workspace' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
100 |
name: 'Workspace' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
101 |
min: (Point 10 10) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
102 |
bounds: (Rectangle 0 0 432 241) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
103 |
menu: mainMenu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
104 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
105 |
component: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
106 |
(SpecCollection |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
107 |
collection: ( |
7650 | 108 |
(ViewSpec |
109 |
name: 'ToolBar' |
|
8231 | 110 |
layout: (LayoutFrame 0 0 0 0 0 1 32 0) |
7650 | 111 |
visibilityChannel: toolBarVisibleHolder |
112 |
component: |
|
113 |
(SpecCollection |
|
114 |
collection: ( |
|
115 |
(ActionButtonSpec |
|
116 |
label: 'hideToolBarIcon' |
|
117 |
name: 'HideToolBarButton' |
|
118 |
layout: (LayoutFrame 0 0 0 0 13 0 0 1) |
|
119 |
activeHelpKey: hideToolBar |
|
120 |
hasCharacterOrientedLabel: false |
|
121 |
translateLabel: true |
|
122 |
model: hideToolbar |
|
123 |
postBuildCallback: hideToolBarButtonCreated: |
|
124 |
) |
|
125 |
(MenuPanelSpec |
|
126 |
name: 'ToolBarMenu' |
|
127 |
layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) |
|
128 |
visibilityChannel: toolBarVisibleHolder |
|
129 |
menu: toolBarMenu |
|
130 |
textDefault: true |
|
131 |
) |
|
132 |
) |
|
133 |
||
134 |
) |
|
135 |
) |
|
8497 | 136 |
(ViewSpec |
137 |
name: 'EditToolBar' |
|
138 |
layout: (LayoutFrame 0 0 32 0 0 1 64 0) |
|
139 |
visibilityChannel: editToolBarVisibleHolder |
|
140 |
component: |
|
141 |
(SpecCollection |
|
142 |
collection: ( |
|
143 |
(ActionButtonSpec |
|
144 |
label: 'hideToolBarIcon' |
|
145 |
name: 'HideEditToolBarButton' |
|
146 |
layout: (LayoutFrame 0 0 0 0 13 0 0 1) |
|
147 |
activeHelpKey: hideToolBar |
|
148 |
hasCharacterOrientedLabel: false |
|
149 |
translateLabel: true |
|
150 |
model: hideEditToolbar |
|
151 |
postBuildCallback: hideToolBarButtonCreated: |
|
152 |
) |
|
153 |
(MenuPanelSpec |
|
154 |
name: 'EditToolBar1' |
|
155 |
layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0) |
|
156 |
visibilityChannel: editToolBarVisibleHolder |
|
157 |
menu: editToolBarMenu |
|
158 |
textDefault: true |
|
159 |
) |
|
160 |
) |
|
161 |
||
162 |
) |
|
163 |
) |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
164 |
(NoteBookViewSpec |
7650 | 165 |
name: 'NoteBook' |
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
166 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
167 |
model: selectedWorkspaceIndexHolder |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
168 |
menu: tabList |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
169 |
useIndex: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
170 |
accessTabMenuAction: tabMenuAt: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
171 |
destroyTabAction: destroyTab: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
172 |
canvas: workspaceHolder |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
173 |
canvasInset: 0 |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
174 |
keepCanvasAlive: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
175 |
tabLevel: 1 |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
176 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
177 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
178 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
179 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
180 |
) |
5302 | 181 |
! ! |
182 |
||
183 |
!MultiViewToolApplication class methodsFor:'menu specs'! |
|
184 |
||
8497 | 185 |
editToolBarMenu |
186 |
"This resource specification was automatically generated |
|
187 |
by the MenuEditor of ST/X." |
|
188 |
||
189 |
"Do not manually edit this!! If it is corrupted, |
|
190 |
the MenuEditor may not be able to read the specification." |
|
191 |
||
192 |
" |
|
193 |
MenuEditor new openOnClass:MultiViewToolApplication andSelector:#toolBarMenu |
|
194 |
(Menu new fromLiteralArrayEncoding:(MultiViewToolApplication toolBarMenu)) startUp |
|
195 |
" |
|
196 |
||
197 |
<resource: #menu> |
|
198 |
||
199 |
^ |
|
200 |
#(Menu |
|
201 |
( |
|
202 |
) |
|
203 |
nil |
|
204 |
nil |
|
205 |
) |
|
206 |
||
207 |
"Modified: / 18-02-2007 / 14:59:21 / cg" |
|
208 |
! |
|
209 |
||
5302 | 210 |
mainMenu |
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
211 |
"This resource specification was automatically generated |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
212 |
by the MenuEditor of ST/X." |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
213 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
214 |
"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
|
215 |
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
|
216 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
217 |
" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
218 |
MenuEditor new openOnClass:MultiViewToolApplication andSelector:#mainMenu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
219 |
(Menu new fromLiteralArrayEncoding:(MultiViewToolApplication mainMenu)) startUp |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
220 |
" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
221 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
222 |
<resource: #menu> |
5302 | 223 |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
224 |
^ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
225 |
#(Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
226 |
( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
227 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
228 |
label: 'File' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
229 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
230 |
submenu: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
231 |
(Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
232 |
( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
233 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
234 |
label: 'New Editor' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
235 |
itemValue: newWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
236 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
237 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
238 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
239 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
240 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
241 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
242 |
label: 'Load File...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
243 |
itemValue: menuLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
244 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
245 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
246 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
247 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
248 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
249 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
250 |
label: 'Save As...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
251 |
itemValue: menuSaveAs |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
252 |
translateLabel: true |
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 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
255 |
enabled: hasMultipleBuffersHolder |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
256 |
label: 'Save all As...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
257 |
itemValue: menuSaveAllAs |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
258 |
translateLabel: true |
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: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
262 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
263 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
264 |
label: 'Print...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
265 |
itemValue: menuPrint |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
266 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
267 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
268 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
269 |
label: '-' |
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: 'Exit' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
273 |
itemValue: closeRequest |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
274 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
275 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
276 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
277 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
278 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
279 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
280 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
281 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
282 |
label: 'Buffers' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
283 |
nameKey: Buffer |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
284 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
285 |
submenu: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
286 |
(Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
287 |
( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
288 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
289 |
label: 'Add Buffer' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
290 |
itemValue: addWorkspace |
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: 'Rename...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
298 |
itemValue: renameWorkspace |
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 |
enabled: canRemoveWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
306 |
label: 'Remove Buffer' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
307 |
itemValue: removeWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
308 |
translateLabel: true |
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 |
) |
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 |
nil |
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 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
315 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
316 |
label: 'Edit' |
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 |
enabled: hasSelectionInActiveWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
323 |
label: 'Cut' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
324 |
itemValue: cutSelection |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
325 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
326 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
327 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
328 |
enabled: hasSelectionInActiveWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
329 |
label: 'Copy' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
330 |
itemValue: copySelection |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
331 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
332 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
333 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
334 |
label: 'Paste' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
335 |
itemValue: paste |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
336 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
337 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
338 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
339 |
label: '-' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
340 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
341 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
342 |
label: 'Select All' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
343 |
itemValue: selectAll |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
344 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
345 |
) |
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 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
348 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
349 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
350 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
351 |
(MenuItem |
8500 | 352 |
label: 'View' |
353 |
translateLabel: true |
|
354 |
submenuChannel: viewMenu |
|
355 |
keepLinkedMenu: true |
|
356 |
) |
|
357 |
(MenuItem |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
358 |
label: 'MENU_Help' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
359 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
360 |
startGroup: conditionalRight |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
361 |
submenu: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
362 |
(Menu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
363 |
( |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
364 |
(MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
365 |
label: 'About this Application...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
366 |
itemValue: openAboutThisApplication |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
367 |
translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
368 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
369 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
370 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
371 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
372 |
) |
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 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
375 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
376 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
377 |
) |
5302 | 378 |
! |
379 |
||
380 |
tabMenu |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
381 |
"This resource specification was automatically generated |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
382 |
by the MenuEditor of ST/X." |
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 |
"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
|
385 |
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
|
386 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
387 |
" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
388 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#tabMenu |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
389 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication tabMenu)) startUp |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
390 |
" |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
391 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
392 |
<resource: #menu> |
5302 | 393 |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
394 |
^ |
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: 'Add Tab' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
399 |
#translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
400 |
"/ #triggerOnDown: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
401 |
#value: #addWorkspace |
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 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
404 |
#label: '-' |
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 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
407 |
#label: 'Remove Tab' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
408 |
#translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
409 |
"/ #triggerOnDown: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
410 |
#value: #removeWorkspace: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
411 |
#enabled: #canRemoveWorkspace: |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
412 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
413 |
#(#MenuItem |
8772 | 414 |
#label: 'Remove all other Tabs' |
415 |
#translateLabel: true |
|
416 |
"/ #triggerOnDown: true |
|
417 |
#value: #removeAllWorkspacesExcept: |
|
418 |
#enabled: #canRemoveAllWorkspacesExcept: |
|
419 |
#isVisible: false |
|
420 |
) |
|
421 |
#(#MenuItem |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
422 |
#label: '-' |
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 |
#(#MenuItem |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
425 |
#label: 'Rename...' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
426 |
#translateLabel: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
427 |
"/ #triggerOnDown: true |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
428 |
#value: #renameWorkspace: |
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 |
) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
431 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
432 |
nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
433 |
) |
7650 | 434 |
! |
435 |
||
436 |
toolBarMenu |
|
437 |
"This resource specification was automatically generated |
|
438 |
by the MenuEditor of ST/X." |
|
439 |
||
440 |
"Do not manually edit this!! If it is corrupted, |
|
441 |
the MenuEditor may not be able to read the specification." |
|
442 |
||
443 |
" |
|
444 |
MenuEditor new openOnClass:MultiViewToolApplication andSelector:#toolBarMenu |
|
445 |
(Menu new fromLiteralArrayEncoding:(MultiViewToolApplication toolBarMenu)) startUp |
|
446 |
" |
|
447 |
||
448 |
<resource: #menu> |
|
449 |
||
450 |
^ |
|
451 |
#(Menu |
|
452 |
( |
|
453 |
(MenuItem |
|
454 |
label: '' |
|
455 |
) |
|
456 |
(MenuItem |
|
457 |
"/ activeHelpKey: addWorkspace |
|
458 |
label: 'Add Buffer' |
|
459 |
itemValue: addWorkspace |
|
460 |
translateLabel: true |
|
461 |
isButton: true |
|
462 |
labelImage: (ResourceRetriever ToolbarIconLibrary addBufferIcon) |
|
463 |
) |
|
464 |
) |
|
465 |
nil |
|
466 |
nil |
|
467 |
) |
|
468 |
||
469 |
"Modified: / 18-02-2007 / 14:59:21 / cg" |
|
470 |
! |
|
471 |
||
472 |
viewMenu |
|
473 |
"This resource specification was automatically generated |
|
474 |
by the MenuEditor of ST/X." |
|
475 |
||
476 |
"Do not manually edit this!! If it is corrupted, |
|
477 |
the MenuEditor may not be able to read the specification." |
|
478 |
||
479 |
" |
|
480 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#viewMenu |
|
481 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication viewMenu)) startUp |
|
482 |
" |
|
483 |
||
484 |
<resource: #menu> |
|
485 |
||
486 |
^ |
|
487 |
#(Menu |
|
488 |
( |
|
489 |
(MenuItem |
|
490 |
label: 'Toolbar' |
|
491 |
translateLabel: true |
|
492 |
hideMenuOnActivated: false |
|
493 |
indication: toolBarVisibleHolder |
|
494 |
) |
|
495 |
(MenuItem |
|
8497 | 496 |
label: 'Editor Toolbar' |
497 |
translateLabel: true |
|
498 |
hideMenuOnActivated: false |
|
499 |
indication: editToolBarVisibleHolder |
|
500 |
isVisible: hasEditToolBar |
|
501 |
) |
|
502 |
(MenuItem |
|
7650 | 503 |
label: 'Info' |
504 |
translateLabel: true |
|
505 |
isVisible: false |
|
506 |
hideMenuOnActivated: false |
|
7653
71f20b5aab8d
Do not refer to non-existant aspect
Stefan Vogel <sv@exept.de>
parents:
7650
diff
changeset
|
507 |
indication: infoVisibleHolder |
7650 | 508 |
) |
509 |
) |
|
510 |
nil |
|
511 |
nil |
|
512 |
) |
|
7824 | 513 |
|
514 |
"Modified: / 14-07-2007 / 16:49:04 / cg" |
|
5302 | 515 |
! ! |
516 |
||
517 |
!MultiViewToolApplication class methodsFor:'queries'! |
|
518 |
||
519 |
isVisualStartable |
|
520 |
"return true, if this application can be started via #open. |
|
521 |
(to allow start of a change browser via double-click in the browser)" |
|
522 |
||
5303 | 523 |
self == MultiViewToolApplication ifTrue:[^false]. |
5302 | 524 |
^ super isVisualStartable |
525 |
! ! |
|
526 |
||
527 |
!MultiViewToolApplication methodsFor:'accessing'! |
|
528 |
||
529 |
selectedWorkspace |
|
530 |
|wsIndex| |
|
531 |
||
532 |
workspaces isNil ifTrue:[ |
|
533 |
workspaces := OrderedCollection new. |
|
534 |
]. |
|
535 |
wsIndex := self selectedWorkspaceIndexHolder value. |
|
536 |
wsIndex == 0 ifTrue:[ |
|
537 |
^ nil |
|
538 |
]. |
|
539 |
||
540 |
workspaces size < wsIndex ifTrue:[ |
|
541 |
workspaces grow:wsIndex. |
|
542 |
workspaces at:wsIndex put:(self createWorkspace). |
|
543 |
]. |
|
544 |
^ workspaces at:wsIndex |
|
545 |
! |
|
546 |
||
547 |
tabMenuAt:index |
|
6244 | 548 |
<resource: #programMenu> |
549 |
||
5302 | 550 |
|m i ws| |
551 |
||
552 |
m := self class tabMenu. |
|
553 |
m := m decodeAsLiteralArray. |
|
8772 | 554 |
|
5302 | 555 |
i := m detectItem:[:item | item value == #removeWorkspace:] ifNone:nil. |
556 |
i notNil ifTrue:[ |
|
557 |
i argument:index. |
|
558 |
index ~~ self selectedWorkspaceIndexHolder value ifTrue:[ |
|
8772 | 559 |
"/ for now: if that buffer is modified, do not allow removing. |
5302 | 560 |
"/ (must be brought to front, in order for check-for-modification to work) |
561 |
ws := workspaces at:index. |
|
562 |
(ws isKindOf:ScrollableView) ifTrue:[ |
|
563 |
ws := ws scrolledView |
|
564 |
]. |
|
565 |
((ws isKindOf:TextView) not |
|
566 |
or:[ ws modified ]) |
|
567 |
ifTrue:[ |
|
568 |
i disable |
|
569 |
]. |
|
570 |
]. |
|
571 |
]. |
|
8772 | 572 |
|
573 |
i := m detectItem:[:item | item value == #removeAllWorkspacesExcept:] ifNone:nil. |
|
574 |
i notNil ifTrue:[ |
|
575 |
i argument:index. |
|
576 |
"/ for now: if any buffer is modified, do not allow removing. |
|
577 |
"/ (must be brought to front, in order for check-for-modification to work) |
|
578 |
workspaces doWithIndex:[:wsArg :idx | |
|
579 |
|ws| |
|
580 |
||
581 |
idx ~~ index ifTrue:[ |
|
582 |
ws := wsArg. |
|
583 |
(ws isKindOf:ScrollableView) ifTrue:[ |
|
584 |
ws := ws scrolledView |
|
585 |
]. |
|
586 |
((ws isKindOf:TextView) and:[ ws modified ]) |
|
587 |
ifTrue:[ |
|
588 |
i disable |
|
589 |
]. |
|
590 |
]. |
|
591 |
]. |
|
592 |
]. |
|
593 |
||
5302 | 594 |
i := m detectItem:[:item | item value == #renameWorkspace:] ifNone:nil. |
595 |
i notNil ifTrue:[ |
|
596 |
i argument:index. |
|
597 |
]. |
|
598 |
||
599 |
m findGuiResourcesIn:self. |
|
600 |
^ m |
|
601 |
! |
|
602 |
||
603 |
workspaceHolder |
|
604 |
workspaceHolder isNil ifTrue:[ |
|
605 |
workspaceHolder := ValueHolder with:(self selectedWorkspace). |
|
606 |
]. |
|
607 |
^ workspaceHolder |
|
7852 | 608 |
! |
609 |
||
610 |
workspaces |
|
611 |
^ workspaces |
|
5302 | 612 |
! ! |
613 |
||
614 |
!MultiViewToolApplication methodsFor:'aspects'! |
|
615 |
||
8497 | 616 |
editToolBarVisibleHolder |
617 |
|holder| |
|
618 |
||
619 |
(holder := builder bindingAt:#editToolBarVisibleHolder) isNil ifTrue:[ |
|
620 |
holder := self class defaultEditToolbarVisible asValue. |
|
621 |
builder aspectAt:#editToolBarVisibleHolder put: holder. |
|
622 |
holder addDependent:self. |
|
623 |
]. |
|
624 |
^ holder |
|
625 |
||
626 |
"Created: / 18-02-2007 / 14:43:39 / cg" |
|
627 |
"Modified: / 14-07-2007 / 16:39:55 / cg" |
|
628 |
! |
|
629 |
||
630 |
hasEditToolBar |
|
631 |
^ (self menuFor:#editToolBarMenu) decodeAsLiteralArray hasItems |
|
632 |
! |
|
633 |
||
7650 | 634 |
infoVisibleHolder |
635 |
|holder| |
|
636 |
||
637 |
(holder := builder bindingAt:#infoVisibleHolder) isNil ifTrue:[ |
|
7824 | 638 |
holder := self class defaultInfoVisible asValue. |
7650 | 639 |
builder aspectAt:#infoVisibleHolder put: holder. |
640 |
holder addDependent:self. |
|
641 |
]. |
|
642 |
^ holder |
|
643 |
||
644 |
"Created: / 18-02-2007 / 15:01:05 / cg" |
|
7824 | 645 |
"Modified: / 14-07-2007 / 16:39:20 / cg" |
7650 | 646 |
! |
647 |
||
5302 | 648 |
selectedWorkspaceIndexHolder |
649 |
selectedWorkspaceIndexHolder isNil ifTrue:[ |
|
650 |
selectedWorkspaceIndexHolder := 1 asValue. |
|
651 |
selectedWorkspaceIndexHolder onChangeSend:#workspaceSelectionChanged to:self. |
|
652 |
]. |
|
653 |
^ selectedWorkspaceIndexHolder. |
|
654 |
! |
|
655 |
||
656 |
tabList |
|
657 |
tabList isNil ifTrue:[ |
|
658 |
tabList := List new. |
|
659 |
]. |
|
660 |
^ tabList. |
|
7650 | 661 |
! |
662 |
||
663 |
toolBarVisibleHolder |
|
664 |
|holder| |
|
665 |
||
666 |
(holder := builder bindingAt:#toolBarVisibleHolder) isNil ifTrue:[ |
|
7824 | 667 |
holder := self class defaultToolbarVisible asValue. |
7650 | 668 |
builder aspectAt:#toolBarVisibleHolder put: holder. |
669 |
holder addDependent:self. |
|
670 |
]. |
|
671 |
^ holder |
|
672 |
||
673 |
"Created: / 18-02-2007 / 14:43:39 / cg" |
|
7824 | 674 |
"Modified: / 14-07-2007 / 16:39:55 / cg" |
5302 | 675 |
! ! |
676 |
||
677 |
!MultiViewToolApplication methodsFor:'aspects-queries'! |
|
678 |
||
8772 | 679 |
canRemoveAllWorkspacesExcept:idx |
680 |
^ self tabList size > 1 |
|
681 |
! |
|
682 |
||
5302 | 683 |
canRemoveWorkspace |
684 |
^ self canRemoveWorkspace:(self selectedWorkspaceIndexHolder value) |
|
685 |
! |
|
686 |
||
687 |
canRemoveWorkspace:idx |
|
688 |
^ self tabList size > 1 |
|
689 |
"/ and:[ (self workspacesTextViewAt:(self selectedWorkspaceIndexHolder value)) |
|
690 |
! |
|
691 |
||
692 |
hasMultipleBuffersHolder |
|
693 |
^ [ workspaces size > 1 ] |
|
694 |
! |
|
695 |
||
696 |
hasSelectionInActiveWorkspace |
|
6424 | 697 |
|v| |
698 |
||
699 |
v := self selectedWorkspacesTextView. |
|
700 |
^ v notNil and:[v selectionAsString size > 0] |
|
8528 | 701 |
! |
702 |
||
703 |
hasTextInActiveWorkspace |
|
704 |
|v| |
|
705 |
||
706 |
v := self selectedWorkspacesTextView. |
|
707 |
^ v notNil |
|
708 |
and:[v list notEmptyOrNil |
|
709 |
and:[v list contains:[:l | l notEmptyOrNil]]] |
|
5302 | 710 |
! ! |
711 |
||
7650 | 712 |
!MultiViewToolApplication methodsFor:'change & update'! |
713 |
||
8497 | 714 |
infoVisibilityChanged |
715 |
|visible cFrame bottomOffset| |
|
716 |
||
717 |
visible := self infoVisibleHolder value. |
|
718 |
||
719 |
cFrame := builder findComponentAt:#EditorNoteBook. "/ #CodeView. |
|
720 |
cFrame notNil ifTrue:[ |
|
721 |
visible ifFalse:[ |
|
722 |
bottomOffset := 0. |
|
723 |
] ifTrue:[ |
|
724 |
bottomOffset := -25. |
|
725 |
]. |
|
726 |
cFrame layout bottomOffset:bottomOffset. |
|
727 |
cFrame container notNil ifTrue:[ |
|
728 |
cFrame containerChangedSize. |
|
729 |
]. |
|
730 |
]. |
|
731 |
DefaultInfoVisible := visible |
|
732 |
||
733 |
"Created: / 18-02-2007 / 15:01:55 / cg" |
|
734 |
! |
|
735 |
||
736 |
toolBarVisibilityChanged |
|
737 |
|toolBarVisible editToolBarVisible toolBar editToolBar noteBook topOffset| |
|
738 |
||
739 |
topOffset := 0. |
|
740 |
||
741 |
toolBar := self componentAt:#ToolBar. |
|
742 |
toolBar notNil ifTrue:[ |
|
743 |
toolBarVisible := self toolBarVisibleHolder value. |
|
744 |
DefaultToolBarVisible := toolBarVisible. |
|
745 |
toolBarVisible ifTrue:[ |
|
746 |
topOffset := topOffset + toolBar height. |
|
747 |
] |
|
748 |
]. |
|
749 |
||
750 |
editToolBar := self componentAt:#EditToolBar. |
|
751 |
editToolBar notNil ifTrue:[ |
|
752 |
editToolBar layout |
|
753 |
topOffset:topOffset bottomOffset:(topOffset + editToolBar height). |
|
754 |
"/ force it to recompute its dimension |
|
755 |
editToolBar container notNil ifTrue:[ |
|
756 |
editToolBar containerChangedSize. |
|
757 |
]. |
|
758 |
editToolBarVisible := self editToolBarVisibleHolder value. |
|
759 |
DefaultEditToolBarVisible := editToolBarVisible. |
|
760 |
editToolBarVisible ifTrue:[ |
|
761 |
topOffset := topOffset + editToolBar height. |
|
762 |
] |
|
763 |
]. |
|
764 |
||
765 |
noteBook := self componentAt:#NoteBook. |
|
766 |
noteBook notNil ifTrue:[ |
|
767 |
noteBook layout topOffset:topOffset. |
|
768 |
"/ force it to recompute its dimension |
|
769 |
noteBook container notNil ifTrue:[ |
|
770 |
noteBook containerChangedSize. |
|
771 |
]. |
|
772 |
]. |
|
773 |
||
774 |
"Created: / 18-02-2007 / 14:46:22 / cg" |
|
775 |
! |
|
776 |
||
7650 | 777 |
update:something with:aParameter from:changedObject |
8497 | 778 |
((changedObject == self toolBarVisibleHolder) |
779 |
or:[ changedObject == self editToolBarVisibleHolder ]) ifTrue:[ |
|
7650 | 780 |
self toolBarVisibilityChanged. |
781 |
^ self |
|
782 |
]. |
|
7824 | 783 |
changedObject == self infoVisibleHolder ifTrue:[ |
784 |
self infoVisibilityChanged. |
|
785 |
^ self |
|
786 |
]. |
|
7650 | 787 |
^ super update:something with:aParameter from:changedObject |
788 |
||
7824 | 789 |
"Modified: / 14-07-2007 / 16:46:14 / cg" |
7650 | 790 |
! ! |
791 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
792 |
!MultiViewToolApplication methodsFor:'defaults'! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
793 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
794 |
defaultFileNameForLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
795 |
^ 'file.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
796 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
797 |
"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
|
798 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
799 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
800 |
defaultFileNameForSave |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
801 |
^ 'file.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
802 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
803 |
"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
|
804 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
805 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
806 |
defaultFileNameForSaveAll |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
807 |
^ 'file.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
808 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
809 |
"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
|
810 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
811 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
812 |
defaultPatternLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
813 |
^ '*.txt' |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
814 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
815 |
"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
|
816 |
! ! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
817 |
|
7650 | 818 |
!MultiViewToolApplication methodsFor:'initialization'! |
819 |
||
820 |
hideToolBarButtonCreated:aButton |
|
821 |
aButton passiveLevel:(MenuPanel defaultLevel). |
|
822 |
"/ aButton passiveLevel:1. |
|
823 |
aButton activeLevel:-1. |
|
824 |
aButton backgroundColor:(MenuPanel defaultBackgroundColor). |
|
825 |
||
826 |
"Created: / 18-02-2007 / 14:48:28 / cg" |
|
827 |
! |
|
828 |
||
829 |
postBuildWith:aBuilder |
|
830 |
super postBuildWith:aBuilder. |
|
8497 | 831 |
|
7650 | 832 |
self infoVisibleHolder value ifTrue:[ self infoVisibilityChanged ]. |
8497 | 833 |
(self toolBarVisibleHolder value |
834 |
or:[ self editToolBarVisibleHolder value ]) ifTrue:[ self toolBarVisibilityChanged ]. |
|
7650 | 835 |
|
836 |
"Created: / 18-02-2007 / 15:03:08 / cg" |
|
837 |
! ! |
|
838 |
||
5302 | 839 |
!MultiViewToolApplication methodsFor:'menu-actions'! |
840 |
||
841 |
addWindow:aWindow named:name |
|
842 |
^ self addWindow:aWindow named:name asFirst:false |
|
843 |
! |
|
844 |
||
845 |
addWindow:aWindow named:name asFirst:asFirst |
|
846 |
|tabList wsIndex newSelectedIndex| |
|
847 |
||
848 |
tabList := self tabList. |
|
849 |
wsIndex := tabList size + 1. |
|
850 |
wsIndex == 1 ifTrue:[ |
|
851 |
"/ first - add a name for the first tab |
|
852 |
tabList add:(self window label). "/ 'Workspace'. |
|
853 |
wsIndex := wsIndex + 1. |
|
854 |
]. |
|
855 |
||
856 |
workspaces grow:wsIndex. |
|
857 |
asFirst ifTrue:[ |
|
858 |
tabList addFirst:(name bindWith:wsIndex). |
|
859 |
workspaces replaceFrom:2 to:wsIndex with:workspaces startingAt:1. |
|
860 |
newSelectedIndex := 1. |
|
861 |
] ifFalse:[ |
|
862 |
tabList addLast:(name bindWith:wsIndex). |
|
863 |
newSelectedIndex := wsIndex. |
|
864 |
]. |
|
865 |
workspaces at:newSelectedIndex put:aWindow. |
|
866 |
self selectedWorkspaceIndexHolder value:newSelectedIndex. |
|
867 |
"/ workspaceHolder value:aWindow. |
|
868 |
! |
|
869 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
870 |
addWorkspace |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
871 |
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
|
872 |
! |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
873 |
|
6458 | 874 |
destroyTab:tabIndex |
875 |
self removeWorkspace:tabIndex |
|
876 |
! |
|
877 |
||
8576 | 878 |
doIt |
879 |
|v| |
|
880 |
||
881 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
882 |
v doIt. |
|
883 |
] |
|
884 |
! |
|
885 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
886 |
loadFile:aFileName |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
887 |
self loadFile:aFileName encoding:nil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
888 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
889 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
890 |
loadFile:aFileName encoding:encodingSymbolOrNil |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
891 |
|lbl| |
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 |
lbl := aFileName asFilename withoutSuffix baseName. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
894 |
self loadFile:aFileName encoding:encodingSymbolOrNil label:lbl. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
895 |
! |
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 |
loadFile:aFileName encoding:encodingSymbolOrNil label:label |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
898 |
|file ws| |
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 |
file := aFileName asFilename. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
901 |
ws := self selectedWorkspacesTextView. |
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 |
|contents| |
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 |
contents := file contents. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
906 |
encodingSymbolOrNil notNil ifTrue:[ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
907 |
contents := contents encodeFrom:encodingSymbolOrNil into:#'unicode'. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
908 |
ws externalEncoding:encodingSymbolOrNil. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
909 |
]. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
910 |
ws contents:contents. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
911 |
ws defaultFileNameForFileDialog:file pathName. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
912 |
] on:StreamError do:[:ex| |
8368 | 913 |
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
|
914 |
^ self |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
915 |
]. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
916 |
ws modified:false. |
8033 | 917 |
self setLabel:label. |
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
918 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
919 |
|
7745 | 920 |
loadFile:aFileName label:lbl |
921 |
|encoding| |
|
922 |
||
923 |
encoding := CharacterEncoder guessEncodingOfFile:aFileName. |
|
924 |
(encoding == #'iso8859-1' or:[encoding == #'ascii']) ifTrue:[ |
|
925 |
encoding := nil |
|
926 |
]. |
|
927 |
self loadFile:aFileName encoding:encoding label:lbl. |
|
928 |
||
929 |
"Created: / 15-03-2007 / 11:52:21 / cg" |
|
930 |
! |
|
931 |
||
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
932 |
menuLoad |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
933 |
|file| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
934 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
935 |
(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
|
936 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
937 |
file := Dialog |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
938 |
requestFileName:(resources string:'Load file') |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
939 |
default:(self defaultFileNameForLoad) |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
940 |
pattern:(self defaultPatternLoad). |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
941 |
file size ~~ 0 ifTrue:[ |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
942 |
self loadFile:file |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
943 |
] |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
944 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
945 |
"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
|
946 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
947 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
948 |
menuPrint |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
949 |
|ws| |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
950 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
951 |
ws := self selectedWorkspacesTextView. |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
952 |
ws doPrint |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
953 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
954 |
"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
|
955 |
! |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
956 |
|
5302 | 957 |
menuSaveAllAs |
958 |
self |
|
959 |
askForFile:'Save all Buffers into:' |
|
8196 | 960 |
default:(self defaultFileNameForSaveAll) |
5302 | 961 |
thenDo:[:file :doAppend | |
962 |
|ws append| |
|
963 |
||
964 |
append := doAppend. |
|
965 |
workspaces do:[:subView | |
|
966 |
|ws| |
|
967 |
||
968 |
ws := self workspaceViewOfView:subView. |
|
969 |
ws notNil ifTrue:[ |
|
970 |
ws saveAs:file doAppend:append. |
|
971 |
ws modified:false. |
|
972 |
]. |
|
973 |
append := true. |
|
974 |
]. |
|
975 |
] |
|
976 |
! |
|
977 |
||
978 |
menuSaveAs |
|
979 |
self |
|
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
980 |
askForFile:'Save Buffer into:' |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
981 |
default:(self defaultFileNameForSave) |
5302 | 982 |
thenDo:[:file :doAppend | |
8033 | 983 |
|ws lbl| |
5302 | 984 |
|
985 |
ws := self selectedWorkspacesTextView. |
|
986 |
ws saveAs:file doAppend:doAppend. |
|
987 |
ws modified:false. |
|
8395
3596ebae2d90
changed #defaultFileNameForSave
Claus Gittinger <cg@exept.de>
parents:
8368
diff
changeset
|
988 |
"/ ws defaultFileNameForFileDialog:file asFilename baseName. |
8033 | 989 |
|
990 |
lbl := file asFilename withoutSuffix baseName. |
|
991 |
self setLabel:lbl. |
|
5302 | 992 |
] |
993 |
! |
|
994 |
||
995 |
newWorkspace |
|
6863 | 996 |
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
|
997 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
998 |
"Modified: / 25-10-2006 / 14:39:15 / cg" |
5302 | 999 |
! |
1000 |
||
8576 | 1001 |
printIt |
1002 |
! |
|
1003 |
||
8772 | 1004 |
removeAllWorkspacesExcept:wsIndex |
1005 |
tabList size downTo:wsIndex+1 do:[:idx | |
|
1006 |
self removeWorkspace:idx. |
|
1007 |
]. |
|
1008 |
1 to:wsIndex-1 do:[:idx | |
|
1009 |
self removeWorkspace:1. |
|
1010 |
]. |
|
1011 |
! |
|
1012 |
||
5302 | 1013 |
removeWorkspace |
1014 |
self removeWorkspace:(self selectedWorkspaceIndexHolder value) |
|
1015 |
! |
|
1016 |
||
1017 |
removeWorkspace:wsIndex |
|
1018 |
|tabList newWsIndex| |
|
1019 |
||
1020 |
wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[ |
|
6509 | 1021 |
(self askIfModified:'Text was modified. Remove buffer anyway ?' yesButton:'Remove Buffer') ifFalse:[ |
5302 | 1022 |
^ self |
1023 |
]. |
|
1024 |
]. |
|
1025 |
||
1026 |
tabList := self tabList. |
|
1027 |
||
1028 |
wsIndex == tabList size ifTrue:[ |
|
1029 |
newWsIndex := wsIndex - 1. |
|
1030 |
] ifFalse:[ |
|
1031 |
newWsIndex := wsIndex. |
|
1032 |
]. |
|
1033 |
||
1034 |
tabList removeIndex:wsIndex. |
|
1035 |
(workspaces at:wsIndex) destroy. |
|
1036 |
workspaces removeIndex:wsIndex. |
|
1037 |
||
1038 |
tabList size == 1 ifTrue:[ |
|
1039 |
self window label:(tabList at:1). |
|
1040 |
tabList removeIndex:1 |
|
1041 |
]. |
|
1042 |
||
1043 |
workspaceHolder value:(workspaces at:newWsIndex). |
|
1044 |
self selectedWorkspaceIndexHolder value:newWsIndex. |
|
1045 |
"/ to force change (update workspaceHolder - even if same index) |
|
1046 |
self selectedWorkspaceIndexHolder changed:#value. |
|
1047 |
! |
|
1048 |
||
1049 |
renameWorkspace |
|
1050 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value) |
|
1051 |
! |
|
1052 |
||
1053 |
renameWorkspace:wsIndex |
|
1054 |
|tabList oldName newName| |
|
1055 |
||
1056 |
tabList := self tabList. |
|
1057 |
tabList isEmpty ifTrue:[ |
|
1058 |
oldName := self window label |
|
1059 |
] ifFalse:[ |
|
1060 |
oldName := tabList at:wsIndex. |
|
1061 |
]. |
|
1062 |
newName := Dialog request:(resources string:'New Name for %1:' with:oldName) initialAnswer:oldName. |
|
1063 |
newName size == 0 ifTrue:[ ^ self]. |
|
1064 |
||
1065 |
self renameWorkspace:wsIndex to:newName. |
|
1066 |
! |
|
1067 |
||
1068 |
renameWorkspace:wsIndex to:newName |
|
1069 |
|tabList| |
|
1070 |
||
1071 |
tabList := self tabList. |
|
1072 |
tabList notEmpty ifTrue:[ |
|
1073 |
tabList at:wsIndex put:newName. |
|
1074 |
]. |
|
1075 |
wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[ |
|
1076 |
self window label:newName. |
|
1077 |
]. |
|
1078 |
! ! |
|
1079 |
||
1080 |
!MultiViewToolApplication methodsFor:'menu-actions-editing'! |
|
1081 |
||
1082 |
copySelection |
|
8498 | 1083 |
|v| |
1084 |
||
1085 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1086 |
v copySelection |
|
1087 |
] |
|
5302 | 1088 |
! |
1089 |
||
1090 |
cutSelection |
|
8498 | 1091 |
|v| |
1092 |
||
1093 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1094 |
v cutSelection |
|
1095 |
]. |
|
5302 | 1096 |
! |
1097 |
||
1098 |
paste |
|
8498 | 1099 |
|v| |
1100 |
||
1101 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1102 |
v paste |
|
1103 |
] |
|
5302 | 1104 |
! |
1105 |
||
1106 |
paste:aString |
|
1107 |
self selectedWorkspacesTextView paste:aString. |
|
1108 |
! |
|
1109 |
||
8509 | 1110 |
redo |
1111 |
|v| |
|
1112 |
||
1113 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1114 |
v redo. |
|
1115 |
] |
|
1116 |
! |
|
1117 |
||
8498 | 1118 |
search |
1119 |
|v| |
|
1120 |
||
1121 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1122 |
v search. |
|
1123 |
] |
|
1124 |
! |
|
1125 |
||
5302 | 1126 |
selectAll |
8498 | 1127 |
|v| |
1128 |
||
1129 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1130 |
v selectAll. |
|
1131 |
] |
|
8509 | 1132 |
! |
1133 |
||
1134 |
undo |
|
1135 |
|v| |
|
1136 |
||
1137 |
(v := self selectedWorkspacesTextView) notNil ifTrue:[ |
|
1138 |
v undo. |
|
1139 |
] |
|
5302 | 1140 |
! ! |
1141 |
||
1142 |
!MultiViewToolApplication methodsFor:'private'! |
|
1143 |
||
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1144 |
askForFile:question default:defaultFilename thenDo:aBlock |
5302 | 1145 |
Dialog |
1146 |
requestSaveFileName:(resources string:question) |
|
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1147 |
default:defaultFilename |
5302 | 1148 |
fromDirectory:nil |
1149 |
action:[:fileName | aBlock value:fileName value:false] |
|
1150 |
appendAction:[:fileName | aBlock value:fileName value:true] |
|
1151 |
||
1152 |
"/ |file doAppend| |
|
1153 |
"/ |
|
1154 |
"/ doAppend := false. |
|
1155 |
"/ Dialog aboutToOpenBoxNotificationSignal handle:[:n | |
|
1156 |
"/ |box| |
|
1157 |
"/ |
|
1158 |
"/ box := n parameter. |
|
1159 |
"/ box addButton:(Button label:'Append' action:[doAppend := true. box okPressed]). |
|
1160 |
"/ n proceed. |
|
1161 |
"/ ] do:[ |
|
1162 |
"/ file := Dialog requestFileName:question default:'file.wsp'. |
|
1163 |
"/ ]. |
|
1164 |
"/ file isEmptyOrNil ifFalse:[ |
|
1165 |
"/ aBlock value:file value:doAppend |
|
1166 |
"/ ]. |
|
1167 |
! |
|
1168 |
||
6408
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1169 |
askForFile:question thenDo:aBlock |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1170 |
^ self |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1171 |
askForFile:question default:'file.wsp' thenDo:aBlock |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1172 |
! |
e0f701a20cae
remember last-saved fileName for next default
Claus Gittinger <cg@exept.de>
parents:
6354
diff
changeset
|
1173 |
|
5302 | 1174 |
askIfAnyModified:arg1 yesButton:arg2 |
1175 |
"raise an error: must be redefined in concrete subclass(es)" |
|
1176 |
||
1177 |
^ self subclassResponsibility |
|
1178 |
! |
|
1179 |
||
1180 |
askIfModified:question yesButton:yesButtonText |
|
1181 |
"tell user, that code has been modified - let her confirm" |
|
1182 |
||
1183 |
|textView| |
|
1184 |
||
1185 |
textView := self selectedWorkspace. |
|
1186 |
(self isModifiedWorkspace:textView) ifFalse:[^ true]. |
|
1187 |
||
1188 |
(Dialog |
|
6354 | 1189 |
confirm:(resources stringWithCRs:question) |
6634 | 1190 |
yesLabel:(resources string:yesButtonText) |
1191 |
noLabel:(resources string:'Cancel')) |
|
5302 | 1192 |
ifTrue:[ |
1193 |
"/ reset modified flag so question is asked only once |
|
1194 |
textView modified:false. |
|
1195 |
^ true |
|
1196 |
]. |
|
1197 |
^ false |
|
1198 |
||
1199 |
"Modified: 2.10.1997 / 14:23:47 / stefan" |
|
1200 |
! |
|
1201 |
||
1202 |
createWorkspace |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1203 |
|ws| |
5302 | 1204 |
|
7475
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1205 |
ws := (HVScrollableView for:EditTextView). |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1206 |
^ ws |
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1207 |
|
54b889153fc7
refactored to allow for standAlone multiTab editors
Claus Gittinger <cg@exept.de>
parents:
6863
diff
changeset
|
1208 |
"Modified: / 25-10-2006 / 14:34:19 / cg" |
5302 | 1209 |
! |
1210 |
||
1211 |
isModifiedWorkspace:aView |
|
1212 |
self subclassResponsibility |
|
1213 |
! |
|
1214 |
||
1215 |
selectedWorkspacesTextView |
|
1216 |
^ self workspaceViewOfView:(self selectedWorkspace) |
|
1217 |
! |
|
1218 |
||
8033 | 1219 |
setLabel:label |
1220 |
tabList size > 1 ifTrue:[ |
|
1221 |
tabList at:self selectedWorkspaceIndexHolder value put:label |
|
1222 |
]. |
|
1223 |
self window label:label. |
|
1224 |
! |
|
1225 |
||
5302 | 1226 |
workspaceSelectionChanged |
1227 |
|wsIndex windowLabel v| |
|
1228 |
||
1229 |
"/ self selected |
|
1230 |
self workspaceHolder value:(v := self selectedWorkspace). |
|
1231 |
wsIndex := self selectedWorkspaceIndexHolder value. |
|
1232 |
||
1233 |
wsIndex ~~ 0 ifTrue:[ |
|
1234 |
windowLabel := tabList at:wsIndex ifAbsent:nil. |
|
1235 |
windowLabel notNil ifTrue:[self window label:windowLabel]. |
|
1236 |
]. |
|
1237 |
! |
|
1238 |
||
1239 |
workspaceViewOfView:aView |
|
1240 |
|view| |
|
1241 |
||
1242 |
view := aView. |
|
7663 | 1243 |
|
5302 | 1244 |
(view isScrollWrapper) ifTrue:[ |
1245 |
view := view scrolledView. |
|
1246 |
view isNil ifTrue:[^ nil]. |
|
1247 |
]. |
|
7663 | 1248 |
|
5302 | 1249 |
(view isTextView) ifFalse:[ |
7663 | 1250 |
(view isKindOf:InspectorView) ifTrue:[ |
1251 |
view := view workspace. |
|
1252 |
(view isScrollWrapper) ifTrue:[ |
|
1253 |
view := view scrolledView |
|
1254 |
]. |
|
5302 | 1255 |
]. |
1256 |
]. |
|
7663 | 1257 |
(view isTextView) ifTrue:[^ view]. |
1258 |
^ view allSubViewsDetect:[:v| v name = #Workspace] ifNone:nil. |
|
5302 | 1259 |
! ! |
1260 |
||
7650 | 1261 |
!MultiViewToolApplication methodsFor:'user actions'! |
1262 |
||
8497 | 1263 |
hideEditToolbar |
1264 |
self editToolBarVisibleHolder value:false |
|
1265 |
! |
|
1266 |
||
7650 | 1267 |
hideToolbar |
1268 |
self toolBarVisibleHolder value:false |
|
1269 |
||
1270 |
"Created: / 18-02-2007 / 14:55:54 / cg" |
|
1271 |
! ! |
|
1272 |
||
5302 | 1273 |
!MultiViewToolApplication class methodsFor:'documentation'! |
1274 |
||
1275 |
version |
|
8772 | 1276 |
^ '$Header: /cvs/stx/stx/libtool/MultiViewToolApplication.st,v 1.32 2009-09-22 20:31:26 cg Exp $' |
5302 | 1277 |
! ! |