public abstract class AsyncExpandableTreeNode extends NodeWithTreeReference implements RefreshableNode
O carregamento é feito de forma assíncrona, incluindo no lugar do nó um nó temporário que ilustra a espera pelo carregamento em questão.
Nós que estenderem deste deverão implementar apenas o código que carrega
os filhos (loadChildren()), e um método para dar um "título" para
a tela de "aguarde" para o usuário, para o caso de ele clicar no nó enquanto
o carregamento é feito (getLoadingDescription().
Nós deste tipo implicitamente aceitam a tecla de atalho F5 para recarregar os nós filhos.
| Modifier and Type | Class and Description |
|---|---|
static class |
AsyncExpandableTreeNode.LoadingState
Estados admissíveis pelo comportamento de carregamento assíncrono.
|
| Modifier and Type | Field and Description |
|---|---|
protected DefaultTreeModel |
myModel |
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject| Constructor and Description |
|---|
AsyncExpandableTreeNode(SCSTree tree) |
| Modifier and Type | Method and Description |
|---|---|
Enumeration<?> |
children() |
boolean |
getAllowsChildren() |
TreeNode |
getChildAt(int childIndex) |
int |
getChildCount() |
int |
getIndex(TreeNode node) |
protected abstract String |
getLoadingDescription()
Caso o usuário clique no nó "aguardando
|
boolean |
isLeaf() |
protected abstract List<DefaultMutableTreeNode> |
loadChildren()
Carregar os nós filhos deste.
|
void |
refreshNode()
Executar o "refresh" do nó.
|
getMyTreeadd, breadthFirstEnumeration, clone, depthFirstEnumeration, getChildAfter, getChildBefore, getDepth, getFirstChild, getFirstLeaf, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toStringprotected final DefaultTreeModel myModel
public AsyncExpandableTreeNode(SCSTree tree)
protected abstract List<DefaultMutableTreeNode> loadChildren() throws Exception
Exceptionprotected abstract String getLoadingDescription()
public void refreshNode()
RefreshableNoderefreshNode in interface RefreshableNodepublic TreeNode getChildAt(int childIndex)
getChildAt in interface TreeNodegetChildAt in class DefaultMutableTreeNodepublic int getChildCount()
getChildCount in interface TreeNodegetChildCount in class DefaultMutableTreeNodepublic int getIndex(TreeNode node)
getIndex in interface TreeNodegetIndex in class DefaultMutableTreeNodepublic boolean getAllowsChildren()
getAllowsChildren in interface TreeNodegetAllowsChildren in class DefaultMutableTreeNodepublic boolean isLeaf()
isLeaf in interface TreeNodeisLeaf in class DefaultMutableTreeNodepublic Enumeration<?> children()
children in interface TreeNodechildren in class DefaultMutableTreeNodeCopyright © 2014 Tecgraf/PUC-Rio. All Rights Reserved.