sk.uniba.euromath.editor.widgets
Interface IUserInputWidget

All Known Implementing Classes:
AbstractUserInputWidget, CreateAttributeList, EncodingWidget, EntityList, ExportClassChooser, FileSelector, GraphSelectorWidget, InsertListChooser, MultiWidget, NameListItemChooser, NamespaceSelector, NewPrefixesQuery, UserInputWidgetDelegator, XHTMLSerializerPropertiesWidget, XMLSerializerPropertiesWidget

public interface IUserInputWidget

Says that implementing object contains a composite and some controls.

Author:
Martin Vysny

Method Summary
 void addMessageListener(IMessagesChangeListener listener)
          Registers given error listener.
 void addModifyListener(IModifyListener listener)
          Registers given modify listener.
 Composite getComposite()
          Returns composite that is encapsulated in this object.
 ValidityMessages getMessages()
          Checks if data contained in the widget are correct.
 Object getState()
          Returns the state of this widget.
 Class<?> getStateClass()
          Returns the class of the state that the widget accepts.
 void removeMessageListener(IMessagesChangeListener listener)
          Unregisters given error listener.
 void removeModifyListener(IModifyListener listener)
          Unregisters given modify listener.
 void setState(Object state)
          Sets new state for the widget.
 

Method Detail

getComposite

Composite getComposite()
Returns composite that is encapsulated in this object.

Returns:
composite where all controls are placed.

addModifyListener

void addModifyListener(IModifyListener listener)
Registers given modify listener.

Parameters:
listener - listener to register.

removeModifyListener

void removeModifyListener(IModifyListener listener)
Unregisters given modify listener.

Parameters:
listener - listener to unregister.

addMessageListener

void addMessageListener(IMessagesChangeListener listener)
Registers given error listener.

Parameters:
listener - the error listener called when last error changes.

removeMessageListener

void removeMessageListener(IMessagesChangeListener listener)
Unregisters given error listener.

Parameters:
listener - the error listener called when last error changes.

getMessages

ValidityMessages getMessages()
Checks if data contained in the widget are correct. Contains error/info/warning messages that occured during last data change.

Returns:
null if data is correct, or instance of ValidityMessages if there is error, warning or info message.

getState

Object getState()
Returns the state of this widget. The state must be in sync with the controls placed on the widget.

Returns:
the model.

setState

void setState(Object state)
Sets new state for the widget. The widget must re-read all relevant properties from the state and set its controls with new values.

Parameters:
state - the model to set. You may use the construct setModel(getModel()) to reflect changes made in the model. Please note that nearly all widgets rejects null value.
Throws:
ClassCastException - if given model is not castable to the supported model class.
UnsupportedOperationException - if state change is not supported.
IllegalArgumentException - if new state is invalid.

getStateClass

Class<?> getStateClass()
Returns the class of the state that the widget accepts.

Returns:
model class, never null.


Copyright © 2003-2006 null. All Rights Reserved.