eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'IndirectValue':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: IndirectValue


Inheritance:

   Object
   |
   +--Model
      |
      +--ValueModel
         |
         +--IndirectValue

Package:
stx:libview2
Category:
Interface-Support-Models
Version:
rev: 1.9 date: 2014/03/26 21:59:54
user: cg
file: IndirectValue.st directory: libview2
module: stx stc-classLibrary: libview2
Author:
Claus Gittinger

Description:


IndirectValue refers to another valueHolder and presents that holder's value
as my own value.
However, the holder can be changed, which results in a change message from myself.
Can be used if a valueHolder is needed which represents different values over
time, for example, a line/column holder for a notebook-like multi-codeView 
application, where the line/col holder is switched whenever the tab is switched.
(use an IndirectValue as holder of the line/col labels).
Another possible use is to synchronize two notebools via a common valueHolder,
which is used as indirect-value for the two individual indirect-selection-valueholders.


Class protocol:

instance creation
o  for: aValueHolder
return a new IndirectValue presenting aValueHolder


Instance protocol:

accessing
o  setValue: newValue
physically set my value, without change notifications

o  setValueHolder: aValueHolder
change my holder

o  value
return my value

o  valueHolder
return my valueHolder

o  valueHolder: aValueHolder
change my holder

change & update
o  update: something with: aParameter from: someone
the holder I depend on has changed - send a change notification to my dependents


Examples:


a label alternatively showing the value of 2 other valueHolders:
    |holder1 holder2 indirVal lbl|

    holder1 := '1' asValue.
    holder2 := '2' asValue.
    indirVal := IndirectValue for:holder1.

    lbl := Label new.
    lbl labelChannel:indirVal.
    lbl open.
    lbl waitUntilVisible.
    
    Delay waitForSeconds:2.
    indirVal valueHolder:holder2.

    Delay waitForSeconds:2.
    indirVal valueHolder:holder1.


ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Sun, 23 Sep 2018 10:31:41 GMT