sk.uniba.euromath.editor.widgets
Class EntityList

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

public class EntityList
extends AbstractUserInputWidget

Shows list of entities.

Author:
Martin Vysny

Field Summary
protected  String _entityName
          Entity name is stored here.
protected  Composite composite
          Here all controls will be placed.
protected  sk.baka.ikslibs.ref.EntityManager entityManager
          The entity manager.
protected  List<? extends String> entityNames
          Entity names list we can select an item from.
protected  Combo entitySelector
          Combo with all entities.
protected  ValidityMessages lastMessages
          Messages from last data retrieval.
 
Fields inherited from class sk.uniba.euromath.editor.widgets.AbstractUserInputWidget
listeners, msgListeners
 
Constructor Summary
EntityList(Composite parent, sk.baka.ikslibs.ref.EntityManager entityManager, List<? extends String> entityNames)
          Constructs the instance.
 
Method Summary
protected  void fillData()
          Fills _entityName from the controls, setting null and an error message if no entity is selected.
 Composite getComposite()
          Returns composite that is encapsulated in this object.
 String getEntityName()
          Returns actually selected entity name.
 ValidityMessages getMessages()
          Checks if data contained in the widget are correct.
 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.
 
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
Here all controls will be placed.


entityNames

protected final List<? extends String> entityNames
Entity names list we can select an item from.


entityManager

protected final sk.baka.ikslibs.ref.EntityManager entityManager
The entity manager.


entitySelector

protected final Combo entitySelector
Combo with all entities.


_entityName

protected String _entityName
Entity name is stored here.


lastMessages

protected ValidityMessages lastMessages
Messages from last data retrieval.

Constructor Detail

EntityList

public EntityList(Composite parent,
                  sk.baka.ikslibs.ref.EntityManager entityManager,
                  List<? extends String> entityNames)
Constructs the instance.

Parameters:
parent - the parent component.
entityManager - an entity manager for the document.
entityNames - the list of entities that can be picked from.
Method Detail

getComposite

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

Returns:
composite where all controls are placed.

fillData

protected void fillData()
Fills _entityName from the controls, setting null and an error message if no entity is selected. The combobox must not yet be disposed.


getEntityName

public String getEntityName()
Returns actually selected entity name. Sets last error property if no entity is selected.

Returns:
entity name or null if no entity is selected.

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.

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.