public class SmartTreeStructure extends AbstractTreeStructure
Modifier and Type | Field and Description |
---|---|
protected TreeModel |
myModel |
protected Project |
myProject |
Constructor and Description |
---|
SmartTreeStructure(Project project,
TreeModel model) |
Modifier and Type | Method and Description |
---|---|
ActionCallback |
asyncCommit() |
void |
commit() |
NodeDescriptor |
createDescriptor(java.lang.Object element,
NodeDescriptor parentDescriptor) |
protected TreeElementWrapper |
createTree() |
java.lang.Object [] |
getChildElements(java.lang.Object element) |
java.lang.Object |
getParentElement(java.lang.Object element) |
java.lang.Object |
getRootElement() |
boolean |
hasSomethingToCommit() |
boolean |
isAlwaysLeaf(java.lang.Object element) |
void |
rebuildTree() |
asyncCommitDocuments, getLeafState, isToBuildChildrenInBackground, isValid, revalidateElement
public void commit()
commit
in class AbstractTreeStructure
public ActionCallback asyncCommit()
asyncCommit
in class AbstractTreeStructure
ActionCallback.setDone()
when the tree structure is committed.
By default it just calls AbstractTreeStructure.commit()
synchronously but it is desirable to override it
to provide asynchronous commit to the tree structure to make it more responsible.
E.g. when you should commit all documents during the AbstractTreeStructure.commit()
,
you can use AbstractTreeStructure.asyncCommitDocuments(Project)
to do it asynchronously.public boolean hasSomethingToCommit()
hasSomethingToCommit
in class AbstractTreeStructure
public NodeDescriptor createDescriptor(java.lang.Object element, NodeDescriptor parentDescriptor)
createDescriptor
in class AbstractTreeStructure
public java.lang.Object [] getChildElements(java.lang.Object element)
getChildElements
in class AbstractTreeStructure
public java.lang.Object getParentElement(java.lang.Object element)
getParentElement
in class AbstractTreeStructure
public java.lang.Object getRootElement()
getRootElement
in class AbstractTreeStructure
protected TreeElementWrapper createTree()
public boolean isAlwaysLeaf(java.lang.Object element)
isAlwaysLeaf
in class AbstractTreeStructure
public void rebuildTree()