blob: 93bdb7d78062c9286e1721747814f5858b4eb099 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
/* *************************************************************************
IT Mill Toolkit
Development of Browser User Interfaces Made Easy
Copyright (C) 2000-2006 IT Mill Ltd
*************************************************************************
This product is distributed under commercial license that can be found
from the product package on license.pdf. Use of this product might
require purchasing a commercial license from IT Mill Ltd. For guidelines
on usage, see licensing-guidelines.html
*************************************************************************
For more information, contact:
IT Mill Ltd phone: +358 2 4802 7180
Ruukinkatu 2-4 fax: +358 2 4802 7181
20540, Turku email: info@itmill.com
Finland company www: www.itmill.com
Primary source for information and releases: www.itmill.com
********************************************************************** */
package com.itmill.toolkit.terminal;
import java.util.Map;
import java.util.Set;
/**
* <p>
* Listener interface for UI variable changes. The user communicates with the
* application using the so-called <i>variables</i>. 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.
* </p>
*
* <p>
* The variable-owning components can be linked with <i>dependency relationships</i>.
* 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.
* </p>
*
* <p>
* 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.
* </p>
*
* @author IT Mill Ltd.
* @version
* @VERSION@
* @since 3.0
*/
public interface VariableOwner {
/**
* Dependencies are not needed anymore as HTML-mode is deprecated in Toolkit
* 5. *
*
* @return Set of <code>VariableOwners</code> this component directly
* depend on, <code>null</code> if this component does not depend
* on anybody.
* @deprecated
*/
public Set getDirectDependencies();
/**
* Called when one or more variables handled by the implementing class are
* changed.
*
* @param source
* the Source of the variable change. This is the origin of
* the event. For example in Web Adapter this is the request.
* @param variables
* the Mapping from variable names to new variable values.
*/
public void changeVariables(Object source, Map variables);
/**
* Dependencies are not needed anymore as HTML-mode is deprecated in Toolkit
* 5.
*
* @param depended
* the <code>VariableOwner</code> component who this
* component depends on.
* @deprecated
*/
public void dependsOn(VariableOwner depended);
/**
* Dependencies are not needed anymore as HTML-mode is deprecated in Toolkit
* 5.
*
* @param depended
* the component to be removed from this component's
* dependency list.
* @deprecated
*/
public void removeDirectDependency(VariableOwner depended);
/**
* <p>
* Tests if the variable owner is enabled or not. The terminal should not
* send any variable changes to disabled variable owners.
* </p>
*
* @return <code>true</code> if the variable owner is enabled,
* <code>false</code> if not
*/
public boolean isEnabled();
/**
* <p>
* 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.
* </p>
*
* <p>
* <strong>Note:</strong> <code>VariableOwner</code> 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 <code>false</code>
* in {@link #isImmediate()}.
* </p>
*
* @return <code>true</code> if the component is in immediate mode,
* <code>false</code> if not.
*/
public boolean isImmediate();
/**
* VariableOwner error event.
*/
public interface ErrorEvent extends Terminal.ErrorEvent {
/**
* Gets the source VariableOwner.
*
* @return the variable owner.
*/
public VariableOwner getVariableOwner();
}
}
|