|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.xma.mdl.UIDelegateClient
at.spardat.xma.mdl.simple.SimpleUIDelegateClient
The UIDelegateClient for a SimpleWM. Responsible for handling all UI-related stuff of a SimpleWidgetModel.
The following attachements are eligible:
SimpleWM SWT-Control ----------------------------------------------------- T_BOOLEAN Button of types CHECK, RADIO, TOGGLE T_* every model may be attached to Text and Label controls.
| Constructor Summary | |
SimpleUIDelegateClient(SimpleWMClient model)
Constructor |
|
| Method Summary | |
void |
attachUI(java.lang.Object control,
java.lang.Object label)
Attaches a UI library control. |
void |
detachUI()
Detaches the UI-control. |
java.lang.Object |
getUIControl()
This method returns the attached UI-control. |
java.lang.Object |
getUILabel()
Returns the label that has been provided via attachUI. |
WModel |
getWModel()
Returns the WidgetModel this UIDelegateClient is attached to. |
void |
handleModelChangeEvent(ModelChangeEvent event)
The widget model has been changed. |
void |
handleUIEvent(java.lang.Object event,
int type)
The following events must be notified from SWT widgets: Widget EVENT -------------------------------------------------------------------- Button (RADIO, CHECK, TOGGLE) SelectionEvent Text VerifyEvent, ModifyEvent, FocusEvent from FocusListener.focusLost (important: do not call with FocusEvents from focusGained method). |
boolean |
isEditable()
Returns true if this model's widget may be modified by the end-user. |
boolean |
isEnabled()
Returns true, if this model's widget is enabled. |
boolean |
isUIAttached()
Yields true, if this UIDelegateClient is attached, i.e., has a Control of the UI-library associated. |
boolean |
isValidateIfUneditable()
|
void |
resetWidgetFromModel()
Sets the widget to the current value of the model. |
void |
setEditable(boolean what)
Sets the editable-state of this models's widget. |
void |
setEnabled(boolean what)
Sets the enabled-state of this model's widget. |
void |
setErrorColor(boolean inError)
If inError, this method sets the background of the corresponding Control c to the error color defined in ComponentClient. |
void |
setValidateIfUneditable(boolean what)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SimpleUIDelegateClient(SimpleWMClient model)
| Method Detail |
public void attachUI(java.lang.Object control,
java.lang.Object label)
throws AttachmentExceptionClient
UIDelegateClient
attachUI in class UIDelegateClientcontrol - 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.UIDelegateClient.attachUI(java.lang.Object, java.lang.Object)public void detachUI()
UIDelegateClient
detachUI in class UIDelegateClientUIDelegateClient.detachUI()public java.lang.Object getUIControl()
UIDelegateClient
getUIControl in class UIDelegateClientUIDelegateClient.getUIControl()public java.lang.Object getUILabel()
UIDelegateClient
getUILabel in class UIDelegateClientUIDelegateClient.getUILabel()
public void handleUIEvent(java.lang.Object event,
int type)
Widget EVENT
--------------------------------------------------------------------
Button (RADIO, CHECK, TOGGLE) SelectionEvent
Text VerifyEvent, ModifyEvent, FocusEvent from FocusListener.focusLost
(important: do not call with FocusEvents from focusGained method).
handleUIEvent in class UIDelegateClientevent - the Event-object from a particular UI libraray, e.g., SWT.type - TODOUIDelegateClient.handleUIEvent(Object,int type)public void handleModelChangeEvent(ModelChangeEvent event)
UIDelegateClient
handleModelChangeEvent in class UIDelegateClientUIDelegateClient.handleModelChangeEvent(ModelChangeEvent)public void resetWidgetFromModel()
public boolean isUIAttached()
UIDelegateClient
isUIAttached in class UIDelegateClientUIDelegateClient.isUIAttached()public WModel getWModel()
UIDelegateClient
getWModel in class UIDelegateClientUIDelegateClient.getWModel()public void setErrorColor(boolean inError)
setErrorColor in class UIDelegateClientpublic boolean isEnabled()
UIDelegateClient
isEnabled in class UIDelegateClientUIDelegateClient.isEnabled()public void setEnabled(boolean what)
UIDelegateClient
setEnabled in class UIDelegateClientwhat - the state to set.UIDelegateClient.setEnabled(boolean)public boolean isEditable()
UIDelegateClient
isEditable in class UIDelegateClientUIDelegateClient.isEditable()public void setEditable(boolean what)
UIDelegateClientUsually, 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.
setEditable in class UIDelegateClientwhat - true if the model's widget should be editable, false otherwise.UIDelegateClient.setEditable(boolean)public boolean isValidateIfUneditable()
at.spardat.xma.mdl.IWModelClient#isValidateIfUneditable()public void setValidateIfUneditable(boolean what)
what - at.spardat.xma.mdl.IWModelClient#setValidateIfUneditable()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||