sk.uniba.euromath.editor.widgets
Class UserInputWidgetDelegator

java.lang.Object
  extended by sk.uniba.euromath.editor.widgets.UserInputWidgetDelegator
All Implemented Interfaces:
IUserInputWidget

public class UserInputWidgetDelegator
extends Object
implements IUserInputWidget

Delegates all calls to given delegate.

Author:
Martin Vysny

Field Summary
protected  IUserInputWidget delegate
          The delegate.
 
Constructor Summary
UserInputWidgetDelegator(IUserInputWidget delegate)
          Creates the delegator.
 
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 model)
          Sets new state for the widget.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected final IUserInputWidget delegate
The delegate.

Constructor Detail

UserInputWidgetDelegator

public UserInputWidgetDelegator(IUserInputWidget delegate)
Creates the delegator.

Parameters:
delegate - all calls delegated here.
Method Detail

addMessageListener

public void addMessageListener(IMessagesChangeListener listener)
Description copied from interface: IUserInputWidget
Registers given error listener.

Specified by:
addMessageListener in interface IUserInputWidget
Parameters:
listener - the error listener called when last error changes.

addModifyListener

public void addModifyListener(IModifyListener listener)
Description copied from interface: IUserInputWidget
Registers given modify listener.

Specified by:
addModifyListener in interface IUserInputWidget
Parameters:
listener - listener to register.

getComposite

public Composite getComposite()
Description copied from interface: IUserInputWidget
Returns composite that is encapsulated in this object.

Specified by:
getComposite in interface IUserInputWidget
Returns:
composite where all controls are placed.

getMessages

public ValidityMessages getMessages()
Description copied from interface: IUserInputWidget
Checks if data contained in the widget are correct. Contains error/info/warning messages that occured during last data change.

Specified by:
getMessages in interface IUserInputWidget
Returns:
null if data is correct, or instance of ValidityMessages if there is error, warning or info message.

getState

public Object getState()
Description copied from interface: IUserInputWidget
Returns the state of this widget. The state must be in sync with the controls placed on the widget.

Specified by:
getState in interface IUserInputWidget
Returns:
the model.

getStateClass

public Class<?> getStateClass()
Description copied from interface: IUserInputWidget
Returns the class of the state that the widget accepts.

Specified by:
getStateClass in interface IUserInputWidget
Returns:
model class, never null.

removeMessageListener

public void removeMessageListener(IMessagesChangeListener listener)
Description copied from interface: IUserInputWidget
Unregisters given error listener.

Specified by:
removeMessageListener in interface IUserInputWidget
Parameters:
listener - the error listener called when last error changes.

removeModifyListener

public void removeModifyListener(IModifyListener listener)
Description copied from interface: IUserInputWidget
Unregisters given modify listener.

Specified by:
removeModifyListener in interface IUserInputWidget
Parameters:
listener - listener to unregister.

setState

public void setState(Object model)
Description copied from interface: IUserInputWidget
Sets new state for the widget. The widget must re-read all relevant properties from the state and set its controls with new values.

Specified by:
setState in interface IUserInputWidget
Parameters:
model - 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.


Copyright © 2003-2006 null. All Rights Reserved.