com.itmill.toolkit.terminal
Interface VariableOwner

All Known Subinterfaces:
Component, ComponentContainer, Field, Layout
All Known Implementing Classes:
AbstractComponent, AbstractComponentContainer, AbstractField, Button, CustomComponent, CustomLayout, DateField, DebugWindow, Embedded, ExpandLayout, Form, FrameWindow, GridLayout, Label, Link, OrderedLayout, Panel, ProgressIndicator, Select, Table, TabSheet, TextField, Tree, Upload, Window

public interface VariableOwner

Listener interface for UI variable changes. The user communicates with the application using the so-called variables. When the user makes a change using the UI the terminal trasmits the changed variables to the application, and the components owning those variables may then process those changes.

The variable-owning components can be linked with dependency relationships. A dependency between two components means that all variable change events to the depended component will be handled before any such events to the depending component.

For example, the commit button for a text field will depend on that text field. This is because we want to handle any pending changes the user makes to the contents on the text field before we accept the click of the commit button which starts processing the text field contents.

Since:
3.0
Version:
4.1.4
Author:
IT Mill Ltd.

Nested Class Summary
static interface VariableOwner.ErrorEvent
          VariableOwner error event.
 
Method Summary
 void changeVariables(Object source, Map variables)
          Called when one or more variables handled by the implementing class are changed.
 void dependsOn(VariableOwner depended)
          Makes this VariableOwner depend on the given VariableOwner.
 Set getDirectDependencies()
          Gets the variable change listeners this VariableOwner directly depends on.
 boolean isEnabled()
           Tests if the variable owner is enabled or not.
 boolean isImmediate()
           Tests if the variable owner is in immediate mode or not.
 void removeDirectDependency(VariableOwner depended)
          Removes the given component from this component's dependency list.
 

Method Detail

getDirectDependencies

Set getDirectDependencies()
Gets the variable change listeners this VariableOwner directly depends on. This list does not contain any indirect dependencies, for example, if A depends on B and B depends on C, the dependency list of A does not include C.

Returns:
Set of VariableOwners this component directly depend on, null if this component does not depend on anybody.

changeVariables

void changeVariables(Object source,
                     Map variables)
Called when one or more variables handled by the implementing class are changed.

Parameters:
source - the Source of the variable change. This is the origin of the event. For example in Web Adapter this is the request.
variables - the Mapping from variable names to new variable values.

dependsOn

void dependsOn(VariableOwner depended)
Makes this VariableOwner depend on the given VariableOwner. This means that any variable change events relating to depended must be sent before any such events that relate to this object.

Parameters:
depended - the VariableOwner component who this component depends on.

removeDirectDependency

void removeDirectDependency(VariableOwner depended)
Removes the given component from this component's dependency list. After the call this component will no longer depend on depended wdepende direct dependency from the component. Indirect dependencies are not removed.

Parameters:
depended - the component to be removed from this component's dependency list.

isEnabled

boolean isEnabled()

Tests if the variable owner is enabled or not. The terminal should not send any variable changes to disabled variable owners.

Returns:
true if the variable owner is enabled, false if not

isImmediate

boolean isImmediate()

Tests if the variable owner is in immediate mode or not. Being in immediate mode means that all variable changes are required to be sent back from the terminal immediately when they occur.

Note: VariableOwner does not include a set- method for the immediateness property. This is because not all VariableOwners wish to offer the functionality. Such VariableOwners are never in the immediate mode, thus they always return false in isImmediate().

Returns:
true if the component is in immediate mode, false if not.


Copyright © 2000-2008 IT Mill Ltd. All Rights Reserved.