T
- the data type used by this component handlerpublic interface ComponentHandler<T>
Definition of an interface for accessing GUI components independently from their type.
This interface represents a Java GUI widget like a text field or a checkbox. There will be concrete implementations for real components, which implement data exchange.
The form framework uses implementations of this interface to transfer data from and to GUI components. The details of this data transfer are hidden by concrete implementations. This makes it possible for instance to read a complete form and store the entered data in a bean.
Modifier and Type | Method and Description |
---|---|
Object |
getComponent()
Returns a reference to the real component that is wrapped by this
component handler.
|
T |
getData()
Returns the data of the wrapped component.
|
Object |
getOuterComponent()
Returns the outer most component, which is the component to be added to
the enclosing container.
|
Class<?> |
getType()
Returns the data type used by this component.
|
boolean |
isEnabled()
Returns a flag whether this component is enabled.
|
void |
setData(T data)
Sets the data of the wrapped component.
|
void |
setEnabled(boolean f)
Allows to set the enabled flag.
|
Object getComponent()
Object getOuterComponent()
getComponent()
would be the text area. The
mechanism with the outer component allows a GUI library specific
implementation to construct composite components for certain complex
widgets, but from the client's view they behave like a single one.T getData()
void setData(T data)
data
- the data to setClass<?> getType()
Class
object returned here determines, which type is allowed for the
getData()
and setData()
methods. It depends
on the concrete GUI component. For text fields it will be a string, for
checkboxes probably a boolean etc.boolean isEnabled()
void setEnabled(boolean f)
f
- the value of the enabled flagCopyright © 2016 The JGUIraffe Team. All rights reserved.