|
||||||||||
| 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.tree.TreeWM
A widget model that holds a tree and its selection status.
| Field Summary | |
protected TransStringSet |
selection_
Holds selection information. |
| Fields inherited from class at.spardat.xma.mdl.WModel |
S_NULL |
| Fields inherited from interface at.spardat.xma.mdl.tree.ITreeWM |
S_LAST, S_MULTI_SELECT |
| Constructor Summary | |
TreeWM(short id,
Page pm,
int style)
Constructor |
|
| Method Summary | |
boolean |
changed()
Yields true if this WidgetModel has changed since the last server side event (or creation). |
void |
clear()
Removes all nodes from the tree and resets the selection information. |
void |
commit()
This method clears the change history. |
boolean |
containsKey(java.lang.String key)
Returns true if this tree contains a node whose key equals the one provided as parameter. |
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. |
TreeNode |
getNode(java.lang.String key)
Returns the tree node for a particular key or null if there is no such node. |
protected Page |
getPage()
Returns the page this widget model belongs to. |
int |
getRootCount()
Returns the number of root nodes in this tree |
TreeNode[] |
getRoots()
Returns the root nodes of this tree. |
java.lang.String |
getSelected()
Returns the id of the selected element. |
TreeNode |
getSelectedNode()
Returns the selected tree node or null if there is no such node. |
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. |
java.lang.String[] |
getSelectionOrdered()
Returns a newly created array containing the ids of the selected entries in ordered by the rows on the screen. |
boolean |
handle(ModelChangeEvent event)
All events that might change a WidgetModel are executed via this method. |
void |
internalize(XmaInput xin)
Updates the state of this with information of the given XMAObjectInput. |
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()
A implementing subclass must make a random change to its widget model. |
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 |
selectAll()
Selects all nodes in the tree. |
int |
size()
Returns the number of nodes in this tree. |
| 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 |
| Field Detail |
protected TransStringSet selection_
| Constructor Detail |
public TreeWM(short id,
Page pm,
int style)
id - id of the widget model within the pagepm - the page that this widget model is part ofstyle - bit or combination of style constants beginning with S_
in this class or a superclass.| Method Detail |
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 clear()
ITreeWM
clear in interface ITreeWMclear in class WModelWModel.clear()public int size()
size in interface ITreeWMpublic 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 selectAll()
ITreeWM
selectAll in interface ITreeWMITreeWM.selectAll()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 boolean isMultiSelect()
ISelectable
isMultiSelect in interface ISelectableISelectable.isMultiSelect()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 java.lang.String[] getSelectionOrdered()
ITreeWM
getSelectionOrdered in interface ITreeWMITreeWM.getSelectionOrdered()public int getSelectionCount()
ISelectable
getSelectionCount in interface ISelectableISelectable.getSelectionCount()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 randomlyChange()
WModel
randomlyChange in class WModelWModel.randomlyChange()
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 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 xin)
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 Synchronizationxin - 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 boolean containsKey(java.lang.String key)
ITreeWM
containsKey in interface ITreeWMITreeWM.containsKey(java.lang.String)public int getRootCount()
ITreeWM
getRootCount in interface ITreeWMITreeWM.getRootCount()public TreeNode[] getRoots()
ITreeWM
getRoots in interface ITreeWMITreeWM.getRoots()public TreeNode getNode(java.lang.String key)
ITreeWM
getNode in interface ITreeWMITreeWM.getNode(java.lang.String)public TreeNode getSelectedNode()
ITreeWM
getSelectedNode in interface ITreeWMITreeWM.getSelectedNode()protected Page getPage()
public void describe(DNode n)
Descriptive
describe in interface Descriptivedescribe in class WModelDescriptive.describe(at.spardat.xma.mdl.util.DNode)public int estimateMemory()
estimateMemory in class WModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||