|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DfcTreeModel
Extends the JFC TreeModel to include capabilities such as adding and removing entries plus copy and paste support.
Method Summary | |
---|---|
void |
addEntry(Object parent,
Object entry,
int index)
Add a child to parent at a given index. |
boolean |
canAddEntry(Object parent,
Object entry,
int index)
Test if a child can be added at a given index. |
boolean |
canCopyEntry(Object entry)
Test if an entry may be copied into a transferable. |
boolean |
canMoveEntry(Object entry,
Object newParent,
int newIndex)
|
boolean |
canPasteEntry(Object parent,
int index,
Transferable transferable)
Test if a transferable may be pasted. |
boolean |
canRemoveEntry(Object entry)
Test if an entry may be removed. |
Transferable |
copyEntry(Object entry)
Copy an entry into a transferable. |
Object |
getParent(Object entry)
Get the parent for a given entry, or null if the entry is the root. |
Object[] |
getPathForEntry(Object entry)
Get the path for a given entry. |
boolean |
isMutable()
True if the tree can be changed. |
void |
moveEntry(Object entry,
Object newParent,
int newIndex)
Move a child from one location to another. |
void |
pasteEntry(Object parent,
int index,
Transferable transferable)
Paste transferable data into the tree. |
void |
removeEntry(Object entry)
Remove an entry and any children. |
Methods inherited from interface javax.swing.tree.TreeModel |
---|
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged |
Method Detail |
---|
boolean isMutable()
Object getParent(Object entry)
Object[] getPathForEntry(Object entry)
boolean canAddEntry(Object parent, Object entry, int index)
parent
- The parent entry.entry
- The child entry.index
- The index to add the child at. Use -1 to add child
at end.void addEntry(Object parent, Object entry, int index) throws UnsupportedOperationException, IndexOutOfBoundsException
parent
- The parent entry.entry
- The child entry.index
- The index to add the child at. Use -1 to add child
at end.
UnsupportedOperationException
IndexOutOfBoundsException
boolean canRemoveEntry(Object entry)
void removeEntry(Object entry) throws UnsupportedOperationException
UnsupportedOperationException
boolean canMoveEntry(Object entry, Object newParent, int newIndex)
void moveEntry(Object entry, Object newParent, int newIndex) throws UnsupportedOperationException, IndexOutOfBoundsException
UnsupportedOperationException
IndexOutOfBoundsException
boolean canPasteEntry(Object parent, int index, Transferable transferable)
parent
- The parent entry to paste at.index
- The index of the new entry in parent (may be -1 to
add last).transferable
- The data to paste.void pasteEntry(Object parent, int index, Transferable transferable) throws UnsupportedOperationException, UnsupportedFlavorException, CloneNotSupportedException, IOException
parent
- The parent entry to paste at.index
- The index of the new entry in parent (may be -1 to
add last).transferable
- The data to paste.
UnsupportedOperationException
UnsupportedFlavorException
CloneNotSupportedException
IOException
boolean canCopyEntry(Object entry)
entry
- The entry to copy.Transferable copyEntry(Object entry) throws UnsupportedOperationException, CloneNotSupportedException
entry
- The entry to copy.
UnsupportedOperationException
CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |