|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.webengine.ui.tree.TreeItemImpl
public class TreeItemImpl
Field Summary | |
---|---|
static TreeItem[] |
EMPTY_CHILDREN
|
static int |
F_CONTAINER
|
static int |
F_EXPANDED
|
static TreeItem[] |
HAS_CHILDREN
|
Fields inherited from interface org.nuxeo.ecm.webengine.ui.tree.TreeItem |
---|
BOTH, CHILDREN, DATA, NONE |
Constructor Summary | |
---|---|
TreeItemImpl(ContentProvider provider,
Object data)
|
|
TreeItemImpl(TreeItem parent,
ContentProvider provider,
Object data)
|
|
TreeItemImpl(TreeItem parent,
Object data)
|
Method Summary | |
---|---|
Object |
accept(TreeItemVisitor visitor)
Accepts a visitor. |
void |
collapse()
Collapses this item. |
boolean |
equals(Object obj)
|
TreeItem[] |
expand()
Expands the item. |
TreeItem |
find(Path path)
Finds the item given its relative path to that item. |
TreeItem |
findAndReveal(Path path)
Finds the item given its relative path to that item and expand all its parents so that the item will be visible in the tree. |
TreeItem |
getChild(String name)
Gets the child item given its name. |
TreeItem[] |
getChildren()
Gets the cached children. |
ContentProvider |
getContentProvider()
Gets the current content provider. |
String[] |
getFacets()
|
String |
getLabel()
Gets the label to be displayed for this item. |
String |
getName()
Gets this node name. |
Object |
getObject()
Gets the object attached to this item. |
TreeItem |
getParent()
Gets the parent item or null if this is the root item. |
Path |
getPath()
Gets the item path. |
int |
getValidationState()
Returns the validation state. |
boolean |
hasChildren()
Tests whether this item has any children. |
void |
invalidate(int type)
Invalidates the item. |
boolean |
isContainer()
Tests whether or not the item may have children. |
boolean |
isExpanded()
Tests whether or not the item is expanded. |
void |
refresh(int type)
Reloads item information like label, properties and children depending on the specified refresh type. |
String |
toString()
|
void |
validate()
Validates the item. |
void |
validateChildren()
|
void |
validateData()
|
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int F_CONTAINER
public static final int F_EXPANDED
public static final TreeItem[] EMPTY_CHILDREN
public static final TreeItem[] HAS_CHILDREN
Constructor Detail |
---|
public TreeItemImpl(TreeItem parent, ContentProvider provider, Object data)
public TreeItemImpl(ContentProvider provider, Object data)
public TreeItemImpl(TreeItem parent, Object data)
Method Detail |
---|
public boolean hasChildren()
TreeItem
This method will not load children if not already loaded.
hasChildren
in interface TreeItem
public TreeItem[] getChildren()
TreeItem
The children items are created using the content provider
the first time you call TreeItem.expand()
getChildren
in interface TreeItem
public Object getObject()
TreeItem
The nature of the object
depends on the registered content provider which will populate the tree
branches when ContentProvider.getChildren(Object)
is called. The
root item is specified by using TreeModel.setInput(Object)
getObject
in interface TreeItem
public Path getPath()
TreeItem
The path is uniquely identifying the item in its tree and is consistent with the tree structure so the parent item will have the same path as the child minus the last segment. The root item path will always be "/". (The root item should not be displayed in the tree - it has no label or other properties.)
Paths are useful to locate items in the tree using
find methods.
TreeItem.find(Path)
,
TreeItem.findAndReveal(Path)
,
TreeModel.find(Path)
,
TreeModel.findAndReveal(Path)
public TreeItem getParent()
TreeItem
getParent
in interface TreeItem
public ContentProvider getContentProvider()
TreeItem
getContentProvider
in interface TreeItem
public String getName()
TreeItem
This is the same as the last segment on the item path
getName
in interface TreeItem
public String getLabel()
TreeItem
getLabel
in interface TreeItem
public String[] getFacets()
public boolean isContainer()
TreeItem
isContainer
in interface TreeItem
public TreeItem find(Path path)
TreeItem
This method will search only the loaded items - it will not make additional calls to provider to get new items.
find
in interface TreeItem
path
- the item path to find
public TreeItem findAndReveal(Path path)
TreeItem
The item itself will not be expanded. Use TreeItem.expand()
on the returned item
if you want so.
This method is loading any parent if not already loaded by using the registered provider.
findAndReveal
in interface TreeItem
path
- the item path to find
public TreeItem getChild(String name)
TreeItem
This method will force loading children using the provider if not already loaded or if invalidated.
getChild
in interface TreeItem
name
- the name of the child item
public TreeItem[] expand()
TreeItem
This will load children items from the provider if they are not already loaded or if invalidated.
expand
in interface TreeItem
public void validateData()
public void validateChildren()
public void collapse()
TreeItem
collapse
in interface TreeItem
public boolean isExpanded()
TreeItem
isExpanded
in interface TreeItem
public void refresh(int type)
TreeItem
The argument is used to specify the type of refresh and can have one of the following values:
TreeItem.DATA
- to refresh only item data like labels
TreeItem.CHILDREN
- to refresh only item children
TreeItem.BOTH
- to refresh both data and children
refresh
in interface TreeItem
type
- of refreshpublic void validate()
TreeItem
If the item was not invalidated do nothing.
validate
in interface TreeItem
public void invalidate(int type)
TreeItem
This will force reloading item data and/or children next time item and/or children are accessed. The argument is used to specify the type of invalidation and can have one of the following values:
TreeItem.DATA
- to invalidate only item data like labels
TreeItem.CHILDREN
- to invalidate only item children
TreeItem.BOTH
- to invalidate both data and children
invalidate
in interface TreeItem
type
- of invalidationpublic int getValidationState()
TreeItem
Can be one of:
TreeItem.DATA
- the item data is invalid (not loaded or invalidated)
TreeItem.CHILDREN
- the item children are invalid
TreeItem.BOTH
- both data and children are invalid
getValidationState
in interface TreeItem
public Object accept(TreeItemVisitor visitor)
TreeItem
accept
in interface TreeItem
visitor
- the visitor to accept
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |