ValModel.st
author Claus Gittinger <cg@exept.de>
Thu, 06 Mar 1997 15:16:03 +0100
changeset 494 ce8c074d5e6b
parent 492 4a308c56cb06
child 504 b77cdd860259
permissions -rw-r--r--
checkin from browser

"
 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.
"

Model subclass:#ValueModel
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-Support-Models'
!

!ValueModel 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
"
    abstract superclass for ValueHolders and Adaptors.
    It does not itself know how and where the value is stored,
    but knows about interested objects (which get informed, whenever
    the value changes) and keeps track if the value was ever accepted.

    Notice: 
        this class was implemented using protocol information
        from alpha testers - it may not be complete or compatible to
        the corresponding ST-80 class. 
        If you encounter any incompatibilities, please forward a note 
        describing the incompatibility verbal (i.e. no code) to the ST/X team.

    subclasses must redefine: #setValue: and #value
    (and optionally redefine #value:)

    [author:]
        Claus Gittinger
"
! !

!ValueModel class methodsFor:'instance creation'!

new
    ^ (super new) initialize
! !

!ValueModel methodsFor:'accessing'!

setValue:newValue 
    "physically set my value, without change notifications"

    ^ self subclassResponsibility
!

value 
    "return my value"

    ^ self subclassResponsibility
!

value:anObject
    "set my value & send change notifications to my dependents."

    self setValue:anObject.
    self changed:#value

    "Modified: 21.2.1997 / 16:29:19 / cg"
! !

!ValueModel methodsFor:'converting'!

compute:aBlock
    "return a BlockValue on the receiver, which computes aBlock"

    ^ BlockValue with:aBlock arguments:(Array with:self)
! !

!ValueModel methodsFor:'initialization'!

initialize

    "Modified: 21.2.1997 / 16:29:38 / cg"
! !

!ValueModel class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libview2/Attic/ValModel.st,v 1.20 1997-03-05 16:10:31 ca Exp $'
! !