|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.xma.mdl.WModel
at.spardat.xma.mdl.list.ListDomWM
The widget model that encapsulates domain values which are usually displayed in a combo box.
The displayed entries in the combobox are drawn from a tabular data source specified by a parameter in the constructor. The datasource is required to provide three columns:
| Field Summary |
| Fields inherited from class at.spardat.xma.mdl.WModel |
S_NULL |
| Constructor Summary | |
ListDomWM(short id,
Page pm,
java.lang.String dataSource)
Constructs with a provided data source. |
|
| Method Summary | |
boolean |
changed()
Yields true if this WidgetModel has changed since the last server side event (or creation). |
void |
clear()
Removes the selection from this. |
void |
commit()
This method clears the change history. |
void |
describe(DNode n)
describe puts all relevant information about this into the provided node. |
void |
deselect(java.lang.String key)
Deselects a particular entry. |
void |
deselectAll()
All selected entries get deselected. |
void |
equalsCS(WModel mServer,
int syncPoint)
Compares this widget model (which must be a client side one) with the server buddy mServer and returns true if they are correct with respect to syncPoint. |
int |
estimateMemory()
Estimates the number of bytes this object consumes in memory. |
void |
externalize(XmaOutput xo,
boolean forceFull)
Externalizing either saves the actual state or deltas (changes) in a provided XMAObjectOutput. |
java.lang.String |
getDataSource()
Returns the set data source or null, if non is set. |
Page |
getPage()
Returns the page this widget model is part of. |
java.lang.String |
getSelected()
Returns the id of the selected element. |
java.lang.String[] |
getSelection()
Returns a newly created array containing the ids of the selected entries or an empty array, if nothing is selected. |
int |
getSelectionCount()
Returns the number of selected elements. |
boolean |
handle(ModelChangeEvent event)
All events that might change a WidgetModel are executed via this method. |
void |
internalize(XmaInput in)
Updates the state of this with information of the given XMAObjectInput. |
boolean |
isDynamicDataSource()
Defines whether the data-source is defined at compile-time in the UI-designer or is always set dynamically (via setDataSource()). |
boolean |
isMultiSelect()
Returns true if more than one entry may be selected. |
boolean |
isSelected(java.lang.String key)
Returns true if the entry with the provided key is selected, false otherwise. |
boolean |
isStrict()
Returns if this Selectable has strict behaviour, that is, the selected keys must always be in the underlying domain of this. |
void |
randomlyChange()
Make random changes to this |
void |
rollback()
This method restores this Widget Model to its state immediately after the last server side event (or creation). |
void |
select(java.lang.String key)
Sets the entry with a provided key as selected. |
void |
setDataSource(java.lang.String dataSource)
Sets a new data source. |
void |
setDynamicDataSource(boolean what)
Sets whether the data source is set at runtime or compile-time. |
| Methods inherited from class at.spardat.xma.mdl.WModel |
cleanUpAfterServerEvent, getId, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ListDomWM(short id,
Page pm,
java.lang.String dataSource)
id - a numeric id which identifies the WidgetModel within its Page.pm - reference to the enclosing PagedataSource - specifies a tabular data source
java.lang.IllegalArgumentException - if dataSource is null or empty.ITabularDataSource| Method Detail |
public void setDataSource(java.lang.String dataSource)
IListDomWM
setDataSource in interface IListDomWMdataSource - specification of a tabular data source.IListDomWM.setDataSource(java.lang.String)public java.lang.String getDataSource()
IListDomWM
getDataSource in interface IListDomWMIListDomWM.getDataSource()public boolean isDynamicDataSource()
IListDomWM
isDynamicDataSource in interface IListDomWMIListDomWM.isDynamicDataSource()public void setDynamicDataSource(boolean what)
public boolean changed()
WModel
changed in interface Transactionalchanged in class WModelTransactional.changed()public void rollback()
WModel
rollback in interface Transactionalrollback in class WModelTransactional.rollback()public void commit()
WModel
commit in interface Transactionalcommit in class WModelTransactional.commit()public boolean handle(ModelChangeEvent event)
WModel
handle in class WModelevent - the event carrying the information of a change.
WModel.handle(at.spardat.xma.mdl.ModelChangeEvent)
public void externalize(XmaOutput xo,
boolean forceFull)
throws java.io.IOException
SynchronizationIf forceFull is false, the object implementing this interface must also implement Transactional. If the object implementing this is able to track changes, these are the changes since the last syncpoint.
externalize in interface Synchronizationxo - the serialization destinationforceFull - if true, the complete state is written
and deltas are ignored.
java.io.IOException - on serialization errorsSynchronization.externalize(at.spardat.xma.serializer.XmaOutput, boolean)
public void internalize(XmaInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
SynchronizationThis method is not allowed to throw Exceptions because that would leave models in an inconsistent state. Thrown exceptions are considered to be programming errors. Internalize must not throw technical exceptions which indicate system or ressource failures. That implies that the person implementing internalize is not allowed to access ressources outside the JVM, either directly or via calls to other methods. Examples of ressource access which must not be triggered are calls to communication of file system services.
internalize in interface Synchronizationin - the XMAObjectInput. If a XMAObjectInputChangeListener is
set in the object in, it will be notified after applying
changes read from in.
java.lang.ClassNotFoundException - on serialization errors
java.io.IOException - on serialization errorsSynchronization.internalize(at.spardat.xma.serializer.XmaInput)public void deselect(java.lang.String key)
ISelectable
deselect in interface ISelectablekey - identifies the entry to deselect. If the entry with the provided key is not
selected, this method does nothing.ISelectable.deselect(java.lang.String)public void deselectAll()
ISelectable
deselectAll in interface ISelectableISelectable.deselectAll()public java.lang.String getSelected()
ISelectableUsually, this method is the preferred way of querying the selection state if !isMultiSelect().
getSelected in interface ISelectableISelectable.getSelected()public java.lang.String[] getSelection()
ISelectable
getSelection in interface ISelectableISelectable.getSelection()public int getSelectionCount()
ISelectable
getSelectionCount in interface ISelectableISelectable.getSelectionCount()public boolean isMultiSelect()
ISelectable
isMultiSelect in interface ISelectableISelectable.isMultiSelect()public boolean isSelected(java.lang.String key)
ISelectable
isSelected in interface ISelectableISelectable.isSelected(java.lang.String)public boolean isStrict()
ISelectableStrict behaviour is only supported if !isMultiSelect(). That means, isMultiSelect() always implies isStrict().
isStrict in interface ISelectableISelectable.isStrict()public void select(java.lang.String key)
ISelectableIf isStrict() and the provided key is not contained in the underlying domain, this method does nothing.
select in interface ISelectablekey - the entry to selectISelectable.select(java.lang.String)public void describe(DNode n)
Descriptive
describe in interface Descriptivedescribe in class WModelDescriptive.describe(at.spardat.xma.mdl.util.DNode)public void randomlyChange()
randomlyChange in class WModel
public void equalsCS(WModel mServer,
int syncPoint)
WModelThis method is for debugging purpose and assumes that client and server models are running within the same VM. It tests if the models the programmer views after a synchronization operation are consistent.
This method requires that this is a client side model.
This method does not throw an exception if models are the same in terms of their contained model data. If it is allowed that models differ (for example some one way tables), this method must take this fact into account. If the models differ, this indicates a programming error and a RuntimeException is thrown.
equalsCS in class WModelmServer - the server side model partner for this.syncPoint - 0 if the point in time is after a client to server
sychnronization, 1 if the point is after a server to
client synchronization.WModel.equalsCS(at.spardat.xma.mdl.WModel, int)public Page getPage()
public void clear()
clear in class WModelWModel.clear()public int estimateMemory()
estimateMemory in class WModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||