eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ValueHolder':

Home

everywhere
www.exept.de
for:
[back]

Class: ValueHolder


Inheritance:

   Object
   |
   +--Model
      |
      +--ValueModel
         |
         +--ValueHolder
            |
            +--BooleanValueHolder
            |
            +--BufferedValueHolder
            |
            +--RadioButtonGroup
            |
            +--RangeAdaptor
            |
            +--SelectionInList
            |
            +--TriggerValue
            |
            +--ValueHolderWithWeakDependents

Package:
stx:libview2
Category:
Interface-Support-Models
Version:
rev: 1.19 date: 2009/10/22 19:09:13
user: cg
file: ValueHolder.st directory: libview2
module: stx stc-classLibrary: libview2
Author:
Claus Gittinger

Description:


a valueHolder can be used as a model for editFields, buttons etc.
It stores some value internally, and sends update messages to its
dependents when changed.

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.


Class protocol:

instance creation
o  newBoolean
return a new ValueHolder holding false as initial value

o  newFraction
return a new ValueHolder holding 0.0 as initial value.
The name is somewhat missleading - actually it should be called newFloat.

o  newNumber
return a new ValueHolder holding 0 as initial value

o  newString
return a new ValueHolder holding an empty string as initial value

o  with: anObject
return a new ValueHolder holding anObject as initial value


Instance protocol:

accessing
o  setValue: anObject
set my value without notification.

o  value
return my value

printing & storing
o  displayString
return a string for display in inspectors etc.

o  printOn: aStream
return a string for display in inspectors etc.


Examples:


See many examples in DialogBox & EditField edit strings:


    |firstName lastName dialog|

    firstName := ValueHolder newString.
    lastName := ValueHolder newString.

    dialog := Dialog new.
    (dialog addTextLabel:'Name:') adjust:#left.
    dialog addInputFieldOn:firstName.
    dialog addVerticalSpace.
    (dialog addTextLabel:'Address:') adjust:#left.
    dialog addInputFieldOn:lastName.

    dialog addAbortButton; addOkButton.

    dialog open.
    dialog accepted ifTrue:[
        Transcript show:firstName value; show:' '; showCR:lastName value
    ]


ST/X 6.1.1; WebServer 1.620 at exept:8081; Tue, 22 May 2012 23:08:01 GMT