285 !TabItem methodsFor:'accessing canvas'! |
285 !TabItem methodsFor:'accessing canvas'! |
286 |
286 |
287 canvas |
287 canvas |
288 "returns the application or nil |
288 "returns the application or nil |
289 " |
289 " |
290 |view cls wsel ckey builder| |
290 |view cls wsel ckey builder appl| |
291 |
291 |
292 canvas notNil ifTrue:[ |
292 canvas notNil ifTrue:[ |
293 ^ canvas |
293 ^ canvas |
294 ]. |
294 ]. |
|
295 builder := self adornmentAt:#builder. |
295 |
296 |
296 (ckey := self majorKey) notNil ifTrue:[ |
297 (ckey := self majorKey) notNil ifTrue:[ |
297 (cls := Smalltalk resolveName:ckey inClass:self class) isNil ifTrue:[ |
298 (appl := builder application) notNil ifTrue:[ |
298 self majorKey:nil. |
299 (cls := appl resolveName:ckey) isNil ifTrue:[ |
299 ^ nil |
300 canvas := appl perform:ckey ifNotUnderstood:nil |
|
301 ] |
|
302 ] ifFalse:[ |
|
303 cls := Smalltalk resolveName:ckey inClass:self class. |
300 ]. |
304 ]. |
301 canvas := cls new. |
305 |
|
306 canvas isNil ifTrue:[ |
|
307 cls isNil ifTrue:[ |
|
308 self majorKey:nil. |
|
309 ^ nil |
|
310 ]. |
|
311 canvas := cls new. |
|
312 ]. |
302 |
313 |
303 (canvas isKindOf:ApplicationModel) ifTrue:[ |
314 (canvas isKindOf:ApplicationModel) ifTrue:[ |
304 view := SimpleView new. |
315 view := SimpleView new. |
305 wsel := self minorKey ? #windowSpec. |
316 wsel := self minorKey ? #windowSpec. |
306 builder := self adornmentAt:#builder ifAbsent:[ canvas createBuilder. canvas builder ]. |
317 |
|
318 canvas builder notNil ifTrue:[ |
|
319 builder := canvas builder |
|
320 ]. |
|
321 |
|
322 (appl notNil and:[canvas masterApplication isNil]) ifTrue:[ |
|
323 canvas masterApplication:appl |
|
324 ]. |
307 view client:canvas spec:wsel builder:builder. |
325 view client:canvas spec:wsel builder:builder. |
308 canvas window:(self setupCanvasView:view). |
326 canvas window:(self setupCanvasView:view). |
309 ] ifFalse:[ |
327 ] ifFalse:[ |
310 canvas := self setupCanvasView:canvas |
328 canvas := self setupCanvasView:canvas |
311 ]. |
329 ]. |
534 setAttributesWithBuilder:aBuilder |
552 setAttributesWithBuilder:aBuilder |
535 "setup attributes dependent on the builder |
553 "setup attributes dependent on the builder |
536 " |
554 " |
537 |appl key builder | |
555 |appl key builder | |
538 |
556 |
539 self createNewBuilder ifFalse:[builder := aBuilder]. |
557 builder := self createNewBuilder ifTrue:[UIBuilder new] ifFalse:[aBuilder]. |
540 self adornmentAt:#builder put:builder. |
558 self adornmentAt:#builder put:builder. |
541 |
559 |
542 (self translateLabel and:[label isString]) ifTrue:[ |
560 (self translateLabel and:[label isString]) ifTrue:[ |
543 rawLabel := aBuilder labelFor:(label asSymbol). |
561 rawLabel := aBuilder labelFor:(label asSymbol). |
544 ]. |
562 ]. |
549 |
567 |
550 (aBuilder isEditing or:[(appl := aBuilder application) isNil]) ifFalse:[ |
568 (aBuilder isEditing or:[(appl := aBuilder application) isNil]) ifFalse:[ |
551 (key := self activeHelpKey) notNil ifTrue:[ |
569 (key := self activeHelpKey) notNil ifTrue:[ |
552 activeHelpText := appl helpTextForKey:key. |
570 activeHelpText := appl helpTextForKey:key. |
553 ]. |
571 ]. |
554 |
572 builder application isNil ifTrue:[ |
|
573 builder application:appl |
|
574 ]. |
|
575 |
555 (self majorKey isNil and:[(key := self minorKey) notNil]) ifTrue:[ |
576 (self majorKey isNil and:[(key := self minorKey) notNil]) ifTrue:[ |
556 canvas := SimpleView new. |
577 canvas := SimpleView new. |
557 canvas client:appl spec:key. |
578 canvas client:appl spec:key builder:builder. |
558 canvas := self setupCanvasView:canvas. |
579 canvas := self setupCanvasView:canvas. |
559 ] |
580 ] |
560 ]. |
581 ]. |
561 |
582 |
562 ! |
583 ! |