|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.xma.mdl.UIDelegateClient
A UIDelegateClient is an aspect of a WidgetModel which is responsible for handling all UI related tasks. All client side widget models have a UIDelegateClient attached at construction time.
A UIDelegateClient is in one of two states: isUIAttached() or not. This specifies, whether a widget is attachet or not. A note about the WModel enable/disable behauvior as implemented by the UIDelegateClients: 1. A call to WModel.setEnabled() is stored at the attribute enabled_ and set at the underlying widget. 2. If WModel.isEnabled() is called the value is always taken from the underlying widget. Then this actual value is also stored at the attribute enabled_. So if the widget was manipulated directly this is reflected at the model. Also this is the behauvior as implemented so far. 3. Normally at attachUI() the enabled_ value is set at the widget. 4. attachUI(): If the widget is disabled then this overrides the model's enabled_ state. Then the attribute enabled_ is set to false, too. It is assumed that disabling a widget is done deliberately (as it is not the default), so the value is taken from there (instead from the model). Also this is the behauvior as implemented so far (e.g. in the *Gen classes disabling is set on widgets). 5.Resume: The widget model now stores the enabled state. But this is always overritten by a widget's negative enabled state, or in other words: Only a negative enable state of a WModel is rembered, a positive is always overwritten.
| Constructor Summary | |
protected |
UIDelegateClient()
Constructs a UIDelegateClient. |
| Method Summary | |
abstract void |
attachUI(java.lang.Object control,
java.lang.Object label)
Attaches a UI library control. |
abstract void |
detachUI()
Detaches the UI-control. |
abstract java.lang.Object |
getUIControl()
This method returns the attached UI-control. |
abstract java.lang.Object |
getUILabel()
Returns the label that has been provided via attachUI. |
abstract WModel |
getWModel()
Returns the WidgetModel this UIDelegateClient is attached to. |
abstract void |
handleModelChangeEvent(ModelChangeEvent event)
The widget model has been changed. |
abstract void |
handleUIEvent(java.lang.Object event,
int type)
This method is responsible for accepting events originating from the UI library, creating corresponding ModelChangeEvents and updating the WidgetModels. |
abstract boolean |
isEditable()
Returns true if this model's widget may be modified by the end-user. |
abstract boolean |
isEnabled()
Returns true, if this model's widget is enabled. |
abstract boolean |
isUIAttached()
Yields true, if this UIDelegateClient is attached, i.e., has a Control of the UI-library associated. |
abstract void |
setEditable(boolean what)
Sets the editable-state of this models's widget. |
abstract void |
setEnabled(boolean what)
Sets the enabled-state of this model's widget. |
abstract void |
setErrorColor(boolean inError)
If inError, this method sets the background of the corresponding Control c to the error color defined in ComponentClient. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected UIDelegateClient()
| Method Detail |
public abstract void handleUIEvent(java.lang.Object event,
int type)
This method does nothing if isUIAttached() is false.
event - the Event-object from a particular UI libraray, e.g., SWT.type - TODOpublic abstract void handleModelChangeEvent(ModelChangeEvent event)
public abstract WModel getWModel()
public abstract boolean isUIAttached()
public abstract void attachUI(java.lang.Object control,
java.lang.Object label)
throws AttachmentExceptionClient
control - an object of the UI class library. For example, in the
case of SWT it is a SWT Widget like a Text, Label or Check Box.label - a widget of the UI class library which is the label for control.
With SWT, typically it the control is a Text field, the
label is a Label widget which usually is the widget
holding the describing text in front of the Text field. The label
is used in error messages. It may be null.
AttachmentExceptionClient - if the control cannot be attached.public abstract java.lang.Object getUIControl()
java.lang.IllegalStateException - if !isUIAttached().public abstract java.lang.Object getUILabel()
java.lang.IllegalStateException - if !isUIAttached().public abstract void detachUI()
public abstract boolean isEditable()
public abstract void setEditable(boolean what)
Usually, this method is called on all widget-models of a page to set the whole page to a read-only mode.
If this method is not called, the default is true.
what - true if the model's widget should be editable, false otherwise.public abstract boolean isEnabled()
public abstract void setEnabled(boolean what)
what - the state to set.public abstract void setErrorColor(boolean inError)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||