WindowBuilder.st
author Claus Gittinger <cg@exept.de>
Thu, 25 Apr 1996 18:32:07 +0200
changeset 221 ea942fe5dc04
parent 176 3890e2b312e0
child 223 b65dc250db8d
permissions -rw-r--r--
documentation

"
 COPYRIGHT (c) 1995 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

Object subclass:#WindowBuilder
	 instanceVariableNames:'topView application bindings aspects focusSequence'
	 classVariableNames:''
	 poolDictionaries:''
	 category:'Interface-Support-UI'
!

!WindowBuilder class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1995 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

documentation
"
    a no-op class, for systems which do not use the UIBuilder.
    Concrete subclasses know how to create a view (with components) from
    some interface spec. Currently, an experimantal version of UIBuilder exists,
    and more may be added in the future (for example, to parse different UI
    specs - thinking of motifs UIL specs etc).
"
! !

!WindowBuilder methodsFor:'accessing'!

application
    ^ application
!

application:anApplicationModel
    application := anApplicationModel
!

aspectAt:aSymbol
    aspects isNil ifTrue:[^ nil].
    ^ aspects at:aSymbol ifAbsent:nil
!

aspectAt:aSymbol put:aModel
    aspects isNil ifTrue:[
	aspects := IdentityDictionary new
    ].
    ^ aspects at:aSymbol put:aModel
!

bindings
    ^ bindings
!

bindings:aDictionary
    bindings := aDictionary
!

componentAt:name
    bindings isNil ifTrue:[^ nil].
    ^ bindings at:name ifAbsent:nil
!

componentAt:name put:aComponent
    bindings isNil ifTrue:[
	bindings := IdentityDictionary new.
    ].
    bindings at:name put:aComponent
!

focusSequence 
    ^ focusSequence
!

namedComponents
    ^ bindings
!

source:anApplicationModel
    application := anApplicationModel
!

window
    ^ topView
!

window:aView
    topView := aView
!

windowGroup
    ^ topView windowGroup
! !

!WindowBuilder methodsFor:'operation'!

buildFromSpec:aSpec
    ^ self subclassResponsibility
!

closeRequest
    topView destroy
!

open
    "open my topView, as previously created"

    self openWithExtent:nil andType:#normal 
!

openDialog
    "open my topView, as previously created as a modal view,
     blocking interaction to the currently active view."

    self openWithExtent:nil andType:#dialog
!

openDialogWithExtent:ext
    "open my topView, as previously created as a modal view,
     blocking interaction to the currently active view."

    self openWithExtent:ext andType:#dialog
!

openWithExtent:aPoint
    "open my topView, as previously created, but override
     the extent."

    self openWithExtent:aPoint andType:#normal 
!

openWithExtent:ext andType:type
    "open my topView, as previously created. The type argument
     may be #dialog or #normal, and specifies if the view should
     be opened as a modal view, blocking interaction to the currently 
     active view, or as a normal view."

    ext notNil ifTrue:[
	topView extent:ext
    ].
    type == #dialog ifTrue:[
	topView openModal.
	^ self
    ].

    type == #normal ifTrue:[
	topView open.
	^ self
    ].
    "
     if ST-80 supports more types - these may be added later
    "
    self halt:'unimplemented'
! !

!WindowBuilder methodsFor:'spec creation callbacks'!

createdComponent:aView forSpec:spec

    "Modified: 5.9.1995 / 21:42:54 / claus"
! !

!WindowBuilder class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.12 1996-03-21 17:59:34 cg Exp $'
! !