3154
|
1 |
"{ Package: 'stx:libtool' }"
|
|
2 |
|
|
3 |
ToolApplicationModel subclass:#WorkspaceApplication
|
3193
|
4 |
instanceVariableNames:'workspaces tabList selectedWorkspaceIndexHolder workspaceHolder'
|
3154
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Interface-Smalltalk'
|
|
8 |
!
|
|
9 |
|
3191
|
10 |
!WorkspaceApplication class methodsFor:'documentation'!
|
|
11 |
|
|
12 |
documentation
|
|
13 |
"
|
|
14 |
A simple wrapper around a WorkSpace-View, adding a pullDown menu.
|
|
15 |
|
|
16 |
[author:]
|
|
17 |
Claus Gittinger
|
|
18 |
"
|
|
19 |
! !
|
3154
|
20 |
|
|
21 |
!WorkspaceApplication class methodsFor:'interface specs'!
|
|
22 |
|
|
23 |
windowSpec
|
|
24 |
"This resource specification was automatically generated
|
|
25 |
by the UIPainter of ST/X."
|
|
26 |
|
|
27 |
"Do not manually edit this!! If it is corrupted,
|
|
28 |
the UIPainter may not be able to read the specification."
|
|
29 |
|
|
30 |
"
|
|
31 |
UIPainter new openOnClass:WorkspaceApplication andSelector:#windowSpec
|
|
32 |
WorkspaceApplication new openInterface:#windowSpec
|
|
33 |
WorkspaceApplication open
|
|
34 |
"
|
|
35 |
|
|
36 |
<resource: #canvas>
|
|
37 |
|
|
38 |
^
|
|
39 |
#(#FullSpec
|
|
40 |
#name: #windowSpec
|
|
41 |
#window:
|
|
42 |
#(#WindowSpec
|
|
43 |
#label: 'Workspace'
|
|
44 |
#name: 'Workspace'
|
|
45 |
#min: #(#Point 10 10)
|
|
46 |
#max: #(#Point 1024 768)
|
3193
|
47 |
#bounds: #(#Rectangle 16 46 448 287)
|
3154
|
48 |
#menu: #mainMenu
|
|
49 |
)
|
|
50 |
#component:
|
|
51 |
#(#SpecCollection
|
|
52 |
#collection: #(
|
|
53 |
#(#ArbitraryComponentSpec
|
|
54 |
#name: 'WorkspaceView'
|
|
55 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
56 |
#hasHorizontalScrollBar: true
|
|
57 |
#hasVerticalScrollBar: true
|
|
58 |
#miniScrollerVertical: false
|
|
59 |
#hasBorder: false
|
|
60 |
#component: #Workspace
|
|
61 |
)
|
3193
|
62 |
#(#NoteBookViewSpec
|
|
63 |
#name: 'NoteBook1'
|
|
64 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
65 |
#model: #selectedWorkspaceIndexHolder
|
|
66 |
#menu: #tabList
|
|
67 |
#useIndex: true
|
|
68 |
#accessTabMenuAction: #tabMenuAt:
|
|
69 |
#canvas: #workspaceHolder
|
|
70 |
#canvasInset: 0
|
|
71 |
#canvasFrameLevel: 0
|
|
72 |
#keepCanvasAlive: true
|
|
73 |
#tabLevel: 2
|
|
74 |
)
|
3154
|
75 |
)
|
|
76 |
|
|
77 |
)
|
|
78 |
)
|
|
79 |
! !
|
|
80 |
|
|
81 |
!WorkspaceApplication class methodsFor:'menu specs'!
|
|
82 |
|
|
83 |
mainMenu
|
|
84 |
"This resource specification was automatically generated
|
|
85 |
by the MenuEditor of ST/X."
|
|
86 |
|
|
87 |
"Do not manually edit this!! If it is corrupted,
|
|
88 |
the MenuEditor may not be able to read the specification."
|
|
89 |
|
|
90 |
"
|
|
91 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#mainMenu
|
|
92 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication mainMenu)) startUp
|
|
93 |
"
|
|
94 |
|
|
95 |
<resource: #menu>
|
|
96 |
|
|
97 |
^
|
|
98 |
#(#Menu
|
|
99 |
#(
|
|
100 |
#(#MenuItem
|
|
101 |
#label: 'File'
|
|
102 |
#translateLabel: true
|
|
103 |
#submenu:
|
|
104 |
#(#Menu
|
|
105 |
#(
|
|
106 |
#(#MenuItem
|
|
107 |
#label: 'New'
|
|
108 |
#translateLabel: true
|
3193
|
109 |
#isVisible: false
|
3154
|
110 |
#value: #menuNew
|
|
111 |
)
|
|
112 |
#(#MenuItem
|
|
113 |
#label: '-'
|
|
114 |
#isVisible: false
|
|
115 |
)
|
|
116 |
#(#MenuItem
|
|
117 |
#label: 'Load File...'
|
|
118 |
#translateLabel: true
|
|
119 |
#value: #menuLoad
|
|
120 |
)
|
|
121 |
#(#MenuItem
|
|
122 |
#label: '-'
|
|
123 |
)
|
|
124 |
#(#MenuItem
|
|
125 |
#label: 'Save As...'
|
|
126 |
#translateLabel: true
|
|
127 |
#value: #menuSaveAs
|
|
128 |
)
|
|
129 |
#(#MenuItem
|
|
130 |
#label: '-'
|
|
131 |
)
|
|
132 |
#(#MenuItem
|
|
133 |
#label: 'Exit'
|
|
134 |
#translateLabel: true
|
|
135 |
#value: #closeRequest
|
|
136 |
)
|
|
137 |
)
|
|
138 |
nil
|
|
139 |
nil
|
|
140 |
)
|
|
141 |
)
|
|
142 |
#(#MenuItem
|
3193
|
143 |
#label: 'Workspace'
|
|
144 |
#translateLabel: true
|
|
145 |
#nameKey: #Workspace
|
|
146 |
#submenu:
|
|
147 |
#(#Menu
|
|
148 |
#(
|
|
149 |
#(#MenuItem
|
|
150 |
#label: 'Add'
|
|
151 |
#translateLabel: true
|
|
152 |
#triggerOnDown: true
|
|
153 |
#value: #addWorkspace
|
|
154 |
)
|
|
155 |
#(#MenuItem
|
|
156 |
#label: 'Rename...'
|
|
157 |
#translateLabel: true
|
|
158 |
#triggerOnDown: true
|
|
159 |
#value: #renameWorkspace
|
|
160 |
)
|
|
161 |
#(#MenuItem
|
|
162 |
#label: '-'
|
|
163 |
)
|
|
164 |
#(#MenuItem
|
|
165 |
#label: 'Remove'
|
|
166 |
#translateLabel: true
|
|
167 |
#triggerOnDown: true
|
|
168 |
#value: #removeWorkspace
|
|
169 |
#enabled: #canRemoveWorkspace
|
|
170 |
)
|
|
171 |
)
|
|
172 |
nil
|
|
173 |
nil
|
|
174 |
)
|
|
175 |
)
|
|
176 |
#(#MenuItem
|
3154
|
177 |
#label: 'Edit'
|
|
178 |
#translateLabel: true
|
|
179 |
#submenu:
|
|
180 |
#(#Menu
|
|
181 |
#(
|
|
182 |
#(#MenuItem
|
|
183 |
#label: 'Copy'
|
|
184 |
#translateLabel: true
|
|
185 |
#value: #copySelection
|
|
186 |
)
|
|
187 |
#(#MenuItem
|
|
188 |
#label: 'Cut'
|
|
189 |
#translateLabel: true
|
|
190 |
#value: #cutSelection
|
|
191 |
)
|
|
192 |
#(#MenuItem
|
|
193 |
#label: 'Paste'
|
|
194 |
#translateLabel: true
|
|
195 |
#value: #paste
|
|
196 |
)
|
|
197 |
)
|
|
198 |
nil
|
|
199 |
nil
|
|
200 |
)
|
|
201 |
)
|
|
202 |
#(#MenuItem
|
|
203 |
#label: 'Smalltalk'
|
|
204 |
#translateLabel: true
|
|
205 |
#submenu:
|
|
206 |
#(#Menu
|
|
207 |
#(
|
|
208 |
#(#MenuItem
|
|
209 |
#label: 'DoIt'
|
|
210 |
#translateLabel: true
|
|
211 |
#value: #doIt
|
|
212 |
)
|
|
213 |
#(#MenuItem
|
|
214 |
#label: 'PrintIt'
|
|
215 |
#translateLabel: true
|
|
216 |
#value: #printIt
|
|
217 |
)
|
|
218 |
#(#MenuItem
|
|
219 |
#label: 'InspectIt'
|
|
220 |
#translateLabel: true
|
|
221 |
#value: #inspectIt
|
|
222 |
)
|
|
223 |
#(#MenuItem
|
|
224 |
#label: '-'
|
|
225 |
)
|
|
226 |
#(#MenuItem
|
|
227 |
#label: 'Browse'
|
|
228 |
#translateLabel: true
|
|
229 |
#value: #browseIt
|
|
230 |
)
|
|
231 |
)
|
|
232 |
nil
|
|
233 |
nil
|
|
234 |
)
|
|
235 |
)
|
|
236 |
#(#MenuItem
|
|
237 |
#label: 'Help'
|
|
238 |
#translateLabel: true
|
|
239 |
#startGroup: #right
|
|
240 |
#submenu:
|
|
241 |
#(#Menu
|
|
242 |
#(
|
|
243 |
#(#MenuItem
|
|
244 |
#label: 'Documentation'
|
|
245 |
#translateLabel: true
|
|
246 |
#value: #openDocumentation
|
|
247 |
)
|
|
248 |
#(#MenuItem
|
|
249 |
#label: '-'
|
|
250 |
)
|
|
251 |
#(#MenuItem
|
|
252 |
#label: 'About this Application'
|
|
253 |
#translateLabel: true
|
|
254 |
#value: #openAboutThisApplication
|
|
255 |
)
|
|
256 |
)
|
|
257 |
nil
|
|
258 |
nil
|
|
259 |
)
|
|
260 |
)
|
|
261 |
)
|
|
262 |
nil
|
|
263 |
nil
|
|
264 |
)
|
3193
|
265 |
!
|
|
266 |
|
|
267 |
tabMenu
|
|
268 |
"This resource specification was automatically generated
|
|
269 |
by the MenuEditor of ST/X."
|
|
270 |
|
|
271 |
"Do not manually edit this!! If it is corrupted,
|
|
272 |
the MenuEditor may not be able to read the specification."
|
|
273 |
|
|
274 |
"
|
|
275 |
MenuEditor new openOnClass:WorkspaceApplication andSelector:#tabMenu
|
|
276 |
(Menu new fromLiteralArrayEncoding:(WorkspaceApplication tabMenu)) startUp
|
|
277 |
"
|
|
278 |
|
|
279 |
<resource: #menu>
|
|
280 |
|
|
281 |
^
|
|
282 |
#(#Menu
|
|
283 |
#(
|
|
284 |
#(#MenuItem
|
|
285 |
#label: 'Add'
|
|
286 |
#translateLabel: true
|
|
287 |
#triggerOnDown: true
|
|
288 |
#value: #addWorkspace
|
|
289 |
)
|
|
290 |
#(#MenuItem
|
|
291 |
#label: 'Rename...'
|
|
292 |
#translateLabel: true
|
|
293 |
#triggerOnDown: true
|
|
294 |
#value: #renameWorkspace:
|
|
295 |
)
|
|
296 |
#(#MenuItem
|
|
297 |
#label: '-'
|
|
298 |
)
|
|
299 |
#(#MenuItem
|
|
300 |
#label: 'Remove'
|
|
301 |
#translateLabel: true
|
|
302 |
#triggerOnDown: true
|
|
303 |
#value: #removeWorkspace:
|
|
304 |
#enabled: #canRemoveWorkspace:
|
|
305 |
)
|
|
306 |
)
|
|
307 |
nil
|
|
308 |
nil
|
|
309 |
)
|
3154
|
310 |
! !
|
|
311 |
|
|
312 |
!WorkspaceApplication methodsFor:'accessing'!
|
|
313 |
|
3193
|
314 |
selectedWorkspace
|
|
315 |
|wsIndex|
|
|
316 |
|
|
317 |
workspaces isNil ifTrue:[
|
|
318 |
workspaces := OrderedCollection new.
|
|
319 |
].
|
|
320 |
wsIndex := self selectedWorkspaceIndexHolder value.
|
|
321 |
wsIndex == 0 ifTrue:[
|
|
322 |
^ nil
|
|
323 |
].
|
|
324 |
|
|
325 |
workspaces size < wsIndex ifTrue:[
|
|
326 |
workspaces grow:wsIndex.
|
|
327 |
workspaces at:wsIndex put:(HVScrollableView for:Workspace).
|
|
328 |
].
|
|
329 |
^ workspaces at:wsIndex
|
|
330 |
!
|
|
331 |
|
|
332 |
tabMenuAt:index
|
3196
|
333 |
|m i ws|
|
3193
|
334 |
|
|
335 |
m := self class tabMenu.
|
|
336 |
m := m decodeAsLiteralArray.
|
|
337 |
i := m detectItem:[:item | item value == #removeWorkspace:] ifNone:nil.
|
|
338 |
i notNil ifTrue:[
|
|
339 |
i argument:index.
|
|
340 |
index ~~ self selectedWorkspaceIndexHolder value ifTrue:[
|
|
341 |
"/ for now: if that buffer is modified,
|
|
342 |
"/ do not allow removing.
|
|
343 |
"/ (must be brought to front, in order for check-for-modification to work)
|
3196
|
344 |
ws := workspaces at:index.
|
|
345 |
(ws isKindOf:ScrollableView) ifTrue:[
|
|
346 |
ws := ws scrolledView
|
|
347 |
].
|
|
348 |
((ws isKindOf:TextView) not
|
|
349 |
or:[ ws modified ])
|
|
350 |
ifTrue:[
|
3193
|
351 |
i disable
|
|
352 |
].
|
|
353 |
].
|
|
354 |
].
|
|
355 |
i := m detectItem:[:item | item value == #renameWorkspace:] ifNone:nil.
|
|
356 |
i notNil ifTrue:[
|
|
357 |
i argument:index.
|
|
358 |
].
|
|
359 |
|
|
360 |
m findGuiResourcesIn:self.
|
|
361 |
^ m
|
|
362 |
!
|
|
363 |
|
|
364 |
workspaceHolder
|
|
365 |
workspaceHolder isNil ifTrue:[
|
|
366 |
workspaceHolder := ValueHolder with:(self selectedWorkspace)..
|
|
367 |
].
|
|
368 |
^ workspaceHolder
|
|
369 |
! !
|
|
370 |
|
|
371 |
!WorkspaceApplication methodsFor:'aspects'!
|
|
372 |
|
|
373 |
selectedWorkspaceIndexHolder
|
|
374 |
selectedWorkspaceIndexHolder isNil ifTrue:[
|
|
375 |
selectedWorkspaceIndexHolder := 1 asValue.
|
|
376 |
selectedWorkspaceIndexHolder onChangeSend:#workspaceSelectionChanged to:self.
|
|
377 |
].
|
|
378 |
^ selectedWorkspaceIndexHolder.
|
|
379 |
!
|
|
380 |
|
|
381 |
tabList
|
|
382 |
tabList isNil ifTrue:[
|
|
383 |
tabList := List new.
|
|
384 |
].
|
|
385 |
^ tabList.
|
|
386 |
! !
|
|
387 |
|
|
388 |
!WorkspaceApplication methodsFor:'aspects - queries'!
|
|
389 |
|
|
390 |
canRemoveWorkspace
|
|
391 |
^ self tabList size > 1
|
3154
|
392 |
! !
|
|
393 |
|
|
394 |
!WorkspaceApplication methodsFor:'initialization & release'!
|
|
395 |
|
|
396 |
closeRequest
|
3193
|
397 |
(self askIfModified:'Text was modified. Close anyway ?' yesButton:'Close') ifFalse:[
|
3154
|
398 |
^ self
|
|
399 |
].
|
|
400 |
|
|
401 |
^ super closeRequest
|
|
402 |
! !
|
|
403 |
|
|
404 |
!WorkspaceApplication methodsFor:'menu actions'!
|
|
405 |
|
3196
|
406 |
addWindow:aWindow named:name
|
3193
|
407 |
|tabList wsIndex|
|
|
408 |
|
|
409 |
tabList := self tabList.
|
|
410 |
wsIndex := tabList size + 1.
|
|
411 |
wsIndex == 1 ifTrue:[
|
|
412 |
"/ first - add a name for the first tab
|
|
413 |
tabList add:(self window label). "/ 'Workspace'.
|
|
414 |
wsIndex := wsIndex + 1.
|
|
415 |
].
|
|
416 |
|
3196
|
417 |
tabList add:(name bindWith:wsIndex).
|
3193
|
418 |
workspaces grow:wsIndex.
|
3196
|
419 |
workspaces at:wsIndex put:aWindow.
|
3193
|
420 |
self selectedWorkspaceIndexHolder value:wsIndex
|
|
421 |
!
|
|
422 |
|
3196
|
423 |
addWorkspace
|
|
424 |
self addWindow:(HVScrollableView for:Workspace) named:'Workspace%1'
|
|
425 |
!
|
|
426 |
|
3198
|
427 |
basicInspectIt
|
|
428 |
self inspectIt:true
|
|
429 |
!
|
|
430 |
|
3154
|
431 |
browseIt
|
3198
|
432 |
self selectedWorkspacesTextView browseIt
|
3154
|
433 |
!
|
|
434 |
|
|
435 |
copySelection
|
3198
|
436 |
self selectedWorkspacesTextView copySelection
|
3154
|
437 |
!
|
|
438 |
|
|
439 |
cutSelection
|
3198
|
440 |
self selectedWorkspacesTextView cutSelection
|
3154
|
441 |
!
|
|
442 |
|
|
443 |
doIt
|
3198
|
444 |
self selectedWorkspacesTextView doIt
|
3154
|
445 |
!
|
|
446 |
|
|
447 |
inspectIt
|
3198
|
448 |
self inspectIt:false
|
|
449 |
!
|
|
450 |
|
|
451 |
inspectIt:basic
|
3196
|
452 |
|ws obj v|
|
|
453 |
|
3198
|
454 |
ws := self selectedWorkspacesTextView.
|
3196
|
455 |
ws
|
|
456 |
do:(ws selection)
|
|
457 |
withValueDo:[:result |
|
|
458 |
| cls |
|
|
459 |
|
3198
|
460 |
basic ifFalse:[
|
|
461 |
cls := result inspectorClass.
|
|
462 |
].
|
3196
|
463 |
cls isNil ifTrue:[
|
|
464 |
cls := InspectorView
|
|
465 |
].
|
|
466 |
v := cls new.
|
|
467 |
v inspect:result.
|
3198
|
468 |
v allowFollow:true.
|
3196
|
469 |
self addWindow:v named:'Inspecting: ' , result classNameWithArticle.
|
|
470 |
]
|
|
471 |
|
|
472 |
"/ self selectedWorkspace inspectIt
|
3154
|
473 |
!
|
|
474 |
|
|
475 |
menuLoad
|
3193
|
476 |
|file ws|
|
3154
|
477 |
|
3193
|
478 |
(self askIfModified:'Text was modified. Load anyway ?' yesButton:'Load') ifFalse:[ ^ self].
|
|
479 |
|
3154
|
480 |
file := Dialog requestFileName:'Load file:'.
|
|
481 |
file size > 0 ifTrue:[
|
3198
|
482 |
(ws := self selectedWorkspacesTextView) contents:file asFilename contentsOfEntireFile.
|
3193
|
483 |
ws modified:false.
|
3154
|
484 |
]
|
|
485 |
!
|
|
486 |
|
|
487 |
menuSaveAs
|
3193
|
488 |
|file ws|
|
3154
|
489 |
|
3193
|
490 |
file := Dialog requestFileName:'Save file:' default:'file.wsp'.
|
3154
|
491 |
file size > 0 ifTrue:[
|
3198
|
492 |
(ws := self selectedWorkspacesTextView) saveAs:file.
|
3193
|
493 |
ws modified:false.
|
3154
|
494 |
]
|
|
495 |
!
|
|
496 |
|
|
497 |
openDocumentation
|
|
498 |
"opens the documentation file"
|
|
499 |
|
|
500 |
self openHTMLDocument: 'tools/misc/TOP.html#WORKSPACE'
|
|
501 |
!
|
|
502 |
|
|
503 |
paste
|
3198
|
504 |
self selectedWorkspacesTextView paste
|
3154
|
505 |
!
|
|
506 |
|
|
507 |
printIt
|
3198
|
508 |
self selectedWorkspacesTextView printIt
|
3193
|
509 |
!
|
|
510 |
|
|
511 |
removeWorkspace
|
|
512 |
self removeWorkspace:(self selectedWorkspaceIndexHolder value)
|
|
513 |
!
|
|
514 |
|
|
515 |
removeWorkspace:wsIndex
|
|
516 |
|tabList newWsIndex|
|
|
517 |
|
|
518 |
wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[
|
|
519 |
(self askIfModified:'Text was modified. Remove anyway ?' yesButton:'Remove') ifFalse:[
|
|
520 |
^ self
|
|
521 |
].
|
|
522 |
].
|
|
523 |
|
|
524 |
tabList := self tabList.
|
|
525 |
|
|
526 |
wsIndex == tabList size ifTrue:[
|
|
527 |
newWsIndex := wsIndex - 1.
|
|
528 |
] ifFalse:[
|
|
529 |
newWsIndex := wsIndex.
|
|
530 |
].
|
|
531 |
|
|
532 |
tabList removeIndex:wsIndex.
|
|
533 |
(workspaces at:wsIndex) destroy.
|
|
534 |
workspaces removeIndex:wsIndex.
|
|
535 |
|
|
536 |
tabList size == 1 ifTrue:[
|
|
537 |
self window label:(tabList at:1).
|
|
538 |
tabList removeIndex:1
|
|
539 |
].
|
|
540 |
|
|
541 |
self selectedWorkspaceIndexHolder value:newWsIndex.
|
|
542 |
"/ to force change (update workspaceHolder - even if same index)
|
|
543 |
self selectedWorkspaceIndexHolder changed:#value.
|
|
544 |
!
|
|
545 |
|
|
546 |
renameWorkspace
|
|
547 |
self renameWorkspace:(self selectedWorkspaceIndexHolder value)
|
|
548 |
!
|
|
549 |
|
|
550 |
renameWorkspace:wsIndex
|
|
551 |
|tabList oldName newName|
|
|
552 |
|
|
553 |
tabList := self tabList.
|
|
554 |
tabList isEmpty ifTrue:[
|
|
555 |
oldName := self window label
|
|
556 |
] ifFalse:[
|
|
557 |
oldName := tabList at:wsIndex.
|
|
558 |
].
|
|
559 |
newName := Dialog request:(resources string:'New Name for %1:' with:oldName) initialAnswer:oldName.
|
|
560 |
newName size == 0 ifTrue:[ ^ self].
|
|
561 |
|
|
562 |
tabList notEmpty ifTrue:[
|
|
563 |
tabList at:wsIndex put:newName.
|
|
564 |
].
|
|
565 |
wsIndex == self selectedWorkspaceIndexHolder value ifTrue:[
|
|
566 |
self window label:newName.
|
|
567 |
].
|
3154
|
568 |
! !
|
|
569 |
|
|
570 |
!WorkspaceApplication methodsFor:'private'!
|
|
571 |
|
|
572 |
askIfModified:question yesButton:yesButtonText
|
|
573 |
"tell user, that code has been modified - let her confirm"
|
|
574 |
|
|
575 |
|textView|
|
|
576 |
|
3193
|
577 |
textView := self selectedWorkspace.
|
3196
|
578 |
(textView isKindOf:ScrollableView) ifTrue:[
|
|
579 |
textView := textView scrolledView
|
|
580 |
].
|
|
581 |
(textView isKindOf:TextView) ifFalse:[
|
|
582 |
^ true
|
|
583 |
].
|
|
584 |
(textView modified not
|
|
585 |
or:[textView contentsWasSaved
|
|
586 |
or:[textView contents withoutSeparators isEmpty]]) ifTrue:[
|
3154
|
587 |
^ true
|
|
588 |
].
|
|
589 |
(Dialog
|
|
590 |
confirm:(resources string:question) withCRs
|
|
591 |
yesLabel:(resources at:yesButtonText)
|
|
592 |
noLabel:(resources at:'Cancel'))
|
|
593 |
ifTrue:[
|
|
594 |
"/ reset modified flag so question is asked only once
|
|
595 |
textView modified:false.
|
|
596 |
^ true
|
|
597 |
].
|
|
598 |
^ false
|
|
599 |
|
|
600 |
"Modified: 2.10.1997 / 14:23:47 / stefan"
|
3193
|
601 |
!
|
|
602 |
|
3198
|
603 |
selectedWorkspacesTextView
|
|
604 |
|textView|
|
|
605 |
|
|
606 |
textView := self selectedWorkspace.
|
|
607 |
(textView isKindOf:ScrollableView) ifTrue:[
|
|
608 |
textView := textView scrolledView
|
|
609 |
].
|
|
610 |
(textView isKindOf:TextView) ifTrue:[
|
|
611 |
^ textView
|
|
612 |
].
|
|
613 |
^ textView workspace
|
|
614 |
!
|
|
615 |
|
3193
|
616 |
workspaceSelectionChanged
|
|
617 |
|wsIndex windowLabel|
|
|
618 |
|
|
619 |
"/ self selected
|
|
620 |
self workspaceHolder value:(self selectedWorkspace).
|
|
621 |
wsIndex := self selectedWorkspaceIndexHolder value.
|
|
622 |
|
|
623 |
wsIndex ~~ 0 ifTrue:[
|
|
624 |
windowLabel := tabList at:wsIndex ifAbsent:nil.
|
|
625 |
windowLabel notNil ifTrue:[self window label:windowLabel].
|
|
626 |
].
|
3154
|
627 |
! !
|
|
628 |
|
|
629 |
!WorkspaceApplication class methodsFor:'documentation'!
|
|
630 |
|
|
631 |
version
|
3198
|
632 |
^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.7 2001-09-25 12:44:36 cg Exp $'
|
3154
|
633 |
! !
|