|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cc.framework.ui.control.TreeLineIterator
A TreeLineIterator
Field Summary | |
private TreeNodeDataModel |
current
Field current |
private int |
maxRows
The maximum number of rows the iterator can handle before returning done() = true |
private Principal |
principal
The principal object used to check permissions |
private TreeStateModel |
state
The state model of the tree that holds the expansion state of the tree items. |
Constructor Summary | |
TreeLineIterator(TreeNodeDataModel current,
Principal principal)
Constructor for TreeLineIterator |
|
TreeLineIterator(TreeStateModel state,
TreeNodeDataModel current,
int maxRows,
Principal principal)
Constructor for TreeLineIterator |
|
TreeLineIterator(TreeStateModel state,
TreeNodeDataModel current,
Principal principal)
Constructor for TreeLineIterator |
Method Summary | |
protected int |
countVisibleNodes(TreeNodeDataModel item)
Counts the visible nodes in the given subtree |
java.lang.Object |
current()
Returns the current tree node |
java.lang.Object |
current(java.lang.String property)
Method current |
int |
currentCheckState()
Returns the check state of the current tree node |
int |
currentIndex()
Returns the current row index (offset between the first line and the current line) |
java.lang.String |
currentKey()
Returns the unique key of the current node |
boolean |
done()
Checks if there tree iterator has reached the end of the collection |
protected int |
getChildIndex(TreeNodeDataModel child)
Returns the index of a child node in its parent node |
protected TreeNodeDataModel |
getLastVisibleTreeItem(TreeNodeDataModel item)
retrieves the last visible node in the given subtree |
int |
getMaxRows()
|
protected TreeNodeDataModel |
getNextVisibleItem(TreeNodeDataModel item)
returns the next visible item of the given node |
protected TreeNodeDataModel |
getNextVisibleSibling(TreeNodeDataModel child,
boolean expandSearch)
Searches for a sibling node of the given child node |
protected TreeNodeDataModel |
getPrevVisibleItem(TreeNodeDataModel item)
returns the previous visible item oft the given node |
Principal |
getPrincipal()
|
int |
getVisibleChildren()
Returns the number of visible children of the current tree node |
boolean |
isCurrentExpanded()
Checks if the current node is expanded |
boolean |
isCurrentSelected()
Checks if the current node is selected |
boolean |
isExpanded(TreeNodeDataModel node)
Checks if the given node is expanded |
boolean |
isLastVisibleChild(TreeNodeDataModel item)
Checks if the given node is the last visible node in a child list |
boolean |
isMarked()
Checks if the current Item is highlighted |
boolean |
isValidProperty(java.lang.String property)
Checks if the current iteration element has the given property |
protected boolean |
isVisible(TreeNodeDataModel item)
Checks if the given item is visible |
protected void |
locate(TreeNodeDataModel current)
Locates the tree iterator on the given node |
static TreeLineIterator |
locateOnLastVisibleChild(TreeStateModel state,
TreeNodeDataModel parent,
Principal principal)
Creates a new tree iterator that is located on the last visible item |
void |
next()
Moves the iterator to the next visible tree node |
void |
prev()
Moves the iterator to the previous visible tree node |
void |
reset()
resets the iterator to the first element of the collection |
void |
skip(int index)
Skips a certain number of visible tree nodes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private TreeNodeDataModel current
private int maxRows
true
private TreeStateModel state
private Principal principal
Constructor Detail |
public TreeLineIterator(TreeNodeDataModel current, Principal principal)
current
- TreeNodeDataModelprincipal
- Principalpublic TreeLineIterator(TreeStateModel state, TreeNodeDataModel current, Principal principal)
state
- TreeStateModelcurrent
- TreeNodeDataModelprincipal
- Principalpublic TreeLineIterator(TreeStateModel state, TreeNodeDataModel current, int maxRows, Principal principal)
state
- TreeStateModelcurrent
- TreeNodeDataModelmaxRows
- The maximum number of rows the iterator can handle before
returning done() = true
principal
- PrincipalMethod Detail |
public static TreeLineIterator locateOnLastVisibleChild(TreeStateModel state, TreeNodeDataModel parent, Principal principal)
state
- TreeStateModelparent
- TreeNodeDataModelprincipal
- Principal
protected void locate(TreeNodeDataModel current)
current
- TreeNodeDataModelpublic boolean done()
done
in interface LineIterator
LineIterator.done()
public java.lang.Object current()
current
in interface LineIterator
LineIterator.current()
public java.lang.Object current(java.lang.String property)
LineIterator
current
in interface LineIterator
property
- Bean Property Name
LineIterator.current(String property)
public boolean isValidProperty(java.lang.String property)
LineIterator
isValidProperty
in interface LineIterator
property
- the property name
true
if the current bean possesses a matching
propertyLineIterator.isValidProperty(java.lang.String)
public java.lang.String currentKey()
currentKey
in interface LineIterator
LineIterator.currentKey()
public int currentIndex()
LineIterator
currentIndex
in interface LineIterator
LineIterator.currentIndex()
public boolean isCurrentExpanded()
public boolean isExpanded(TreeNodeDataModel node)
node
- the node to check
public boolean isCurrentSelected()
public int currentCheckState()
currentCheckState
in interface LineIterator
LineIterator.currentCheckState()
public void next()
next
in interface LineIterator
LineIterator.next()
public void prev()
prev
in interface LineIterator
LineIterator.prev()
public void skip(int index)
index
- Number of visible rows to skippublic int getVisibleChildren()
public boolean isLastVisibleChild(TreeNodeDataModel item)
item
- TreeNodeDataModel
protected boolean isVisible(TreeNodeDataModel item)
item
- TreeNodeDataModel
protected int countVisibleNodes(TreeNodeDataModel item)
item
- the root node of the subtree
protected TreeNodeDataModel getLastVisibleTreeItem(TreeNodeDataModel item)
item
- the root of the subtree
null
protected TreeNodeDataModel getPrevVisibleItem(TreeNodeDataModel item)
item
- TreeNodeDataModel
null
protected TreeNodeDataModel getNextVisibleItem(TreeNodeDataModel item)
item
- TreeNodeDataModel
null
protected TreeNodeDataModel getNextVisibleSibling(TreeNodeDataModel child, boolean expandSearch)
child
- TreeNodeDataModelexpandSearch
- permission to expand the search towards the root of the tree
null
public boolean isMarked()
LineIterator
isMarked
in interface LineIterator
LineIterator.isMarked()
public void reset()
LineIterator
reset
in interface LineIterator
LineIterator.reset()
protected int getChildIndex(TreeNodeDataModel child)
child
- the node whose index is to search
-1
if the position
could not be calculatedpublic Principal getPrincipal()
public int getMaxRows()
true
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |