|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
org.jivesoftware.spark.component.JiveTreeNode
public class JiveTreeNode
JiveTreeNode class is a better implementation than using the
DefaultMutableTree node. This allows better searching of children/parents as well
as handling of icons and drag and drop events.
| Field Summary | |
|---|---|
static java.awt.datatransfer.DataFlavor[] |
DATA_FLAVORS
Default Drag and Drop to use for Node detection. |
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
|---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
| Constructor Summary | |
|---|---|
JiveTreeNode(java.lang.Object o,
boolean allowsChildren)
Creates a new JiveTreeNode. |
|
JiveTreeNode(java.lang.String userobject)
Creates a new JiveTreeNode. |
|
JiveTreeNode(java.lang.String name,
boolean allowsChildren)
Create parent node. |
|
JiveTreeNode(java.lang.String userObject,
boolean allowChildren,
javax.swing.Icon icon)
Creates a new JiveTreeNode. |
|
JiveTreeNode(TreeFolder folder)
|
|
JiveTreeNode(TreeFolder folder,
javax.swing.Icon img)
Creates a new JiveTreeNode from a TreeFolder. |
|
JiveTreeNode(TreeItem item)
Creates a new JiveTreeNode from a TreeItem. |
|
JiveTreeNode(TreeItem item,
javax.swing.Icon img)
Createa new JiveTreeNode from a TreeItem and Image. |
|
| Method Summary | |
|---|---|
java.lang.Object |
getAssociatedObject()
Returns the associated object used. |
javax.swing.Icon |
getClosedIcon()
Returns the icon that is displayed when the node is collapsed. |
javax.swing.Icon |
getIcon()
Returns the default image used. |
javax.swing.Icon |
getOpenIcon()
Return the icon that is displayed when the node is expanded. |
java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor flavor)
|
java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors()
Transferable implementation |
boolean |
hasParent(java.lang.String parentName)
Returns true if a parent with the specified name is found. |
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
|
void |
setAssociatedObject(java.lang.Object o)
Returns the associated object. |
void |
setIcon(javax.swing.Icon icon)
Sets the default icon. |
| Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
|---|
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.awt.datatransfer.DataFlavor[] DATA_FLAVORS
| Constructor Detail |
|---|
public JiveTreeNode(TreeFolder folder)
public JiveTreeNode(java.lang.String name,
boolean allowsChildren)
name - the name of the node.allowsChildren - true if the node allows children.
public JiveTreeNode(java.lang.Object o,
boolean allowsChildren)
o - the object to use.allowsChildren - true if it allows children.public JiveTreeNode(TreeItem item)
item - the TreeItem
public JiveTreeNode(TreeFolder folder,
javax.swing.Icon img)
folder - the TreeFolder.img - the image to use in the node.
public JiveTreeNode(TreeItem item,
javax.swing.Icon img)
item - the TreeItem to use.img - the image to use in the node.public JiveTreeNode(java.lang.String userobject)
userobject - the object to use in the node. Note: By default, the node
will not allow children.
public JiveTreeNode(java.lang.String userObject,
boolean allowChildren,
javax.swing.Icon icon)
userObject - the userObject to use.allowChildren - true if it allows children.icon - the image to use in the node.| Method Detail |
|---|
public javax.swing.Icon getIcon()
public javax.swing.Icon getOpenIcon()
public javax.swing.Icon getClosedIcon()
public void setIcon(javax.swing.Icon icon)
icon - the icon.public java.lang.Object getAssociatedObject()
public void setAssociatedObject(java.lang.Object o)
o - the associated object.public final boolean hasParent(java.lang.String parentName)
parentName - the name of the parent.
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors in interface java.awt.datatransfer.Transferablepublic boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
isDataFlavorSupported in interface java.awt.datatransfer.Transferable
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
throws java.awt.datatransfer.UnsupportedFlavorException,
java.io.IOException
getTransferData in interface java.awt.datatransfer.Transferablejava.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||