sk.uniba.euromath.editor.widgets
Class NamespaceSelector

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

public class NamespaceSelector
extends AbstractUserInputWidget

Allows user to select a namespace from list of known namespaces (defined in the config file).

Author:
Martin Vysny

Field Summary
protected  Composite composite
          All controls are placed here.
protected  ValidityMessages lastMessages
          Last messages.
protected  Label namespaceDesc
          Description of the namespace.
protected  Combo namespaceSelector
          The namespace selector combobox.
 
Fields inherited from class sk.uniba.euromath.editor.widgets.AbstractUserInputWidget
listeners, msgListeners
 
Constructor Summary
NamespaceSelector(Composite parent)
          Constructs new instance of the widget.
 
Method Summary
protected  void checkErrors()
          Check data for errors.
 String getChosenNamespace()
          Returns chosen namespace.
 String getChosenNamespaceInternal()
          Returns chosen namespace.
 Composite getComposite()
          Returns composite that is encapsulated in this object.
 ValidityMessages getMessages()
          Checks if data contained in the widget are correct.
protected  sk.uniba.euromath.config.bind.NamespaceType getSelected()
          Returns selected namespace.
 String getState()
          Returns the state of this widget.
 Class<?> getStateClass()
          Returns the class of the state that the widget accepts.
 void setState(Object model)
          Sets new state for the widget.
protected  void updateDisplay()
          Updates displayed information.
 
Methods inherited from class sk.uniba.euromath.editor.widgets.AbstractUserInputWidget
addMessageListener, addModifyListener, allowModifyEvent, fireDataModified, removeMessageListener, removeModifyListener, suppressModifyEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

composite

protected final Composite composite
All controls are placed here.


namespaceSelector

protected final Combo namespaceSelector
The namespace selector combobox.


namespaceDesc

protected final Label namespaceDesc
Description of the namespace.


lastMessages

protected ValidityMessages lastMessages
Last messages.

Constructor Detail

NamespaceSelector

public NamespaceSelector(Composite parent)
Constructs new instance of the widget.

Parameters:
parent - parent composite, where to place widget.
Method Detail

updateDisplay

protected void updateDisplay()
Updates displayed information.


getSelected

protected sk.uniba.euromath.config.bind.NamespaceType getSelected()
Returns selected namespace.

Returns:
selected namespace. If none is selected then return null.

getComposite

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

Returns:
composite where all controls are placed.

getChosenNamespace

public String getChosenNamespace()
Returns chosen namespace.

Returns:
chosen namespace. Returns null if no namespace is selected.

getChosenNamespaceInternal

public String getChosenNamespaceInternal()
Returns chosen namespace. Does not check for errors.

Returns:
chosen namespace.

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.

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

checkErrors

protected void checkErrors()
Check data for errors.


getState

public String 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.

Returns:
the model.

getStateClass

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

Returns:
model class, never null.

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.

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.