public class CmtFolder extends javax.swing.tree.DefaultMutableTreeNode implements CmtModelNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObjectPROTOCOL, QUERY_TOKEN| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Element element)
Add the specified Element to this Folder.
|
void |
add(int index,
Element element) |
void |
adjustPosition(boolean adjust)
Adjust the position (z-order) of the Component represented by this object,
if in fact this object represents a Component, affecting source add call
and optionaly the live Component within its controlling LayoutManager.
|
boolean |
canAdd(Element element)
Other classes can call this method to determine whether the given
Element can be added to the Folder. |
boolean |
canRemove(Element element)
Other classes can call this method to determine whether the
specified
Element can be removed from this
Folder. |
boolean |
containsChild(Element child)
|
Attributes |
getAttributes()
Returns
oracle.ide.model.DefaultAttributes.EMPTY_ATTRIBUTES; |
java.util.Iterator |
getChildren()
This method is part of the
Element interface to
provide a convenient way of getting an Iterator over any
contained child Elements without having to test the
object's type with the instanceof operator or having
to downcast to a more specific type. |
CmtModel |
getCmtModel()
Get the CmtModel to which this object belongs.
|
java.lang.Object |
getData()
Gets the data object that implements this interface.
|
javax.swing.Icon |
getIcon()
Returns an
Icon that can be shown in association with this
Displayable. |
CmtSubcomponent |
getLayout()
Get the CmtSubcomponent representing the LayoutManger controlling the
Component represented by this object if in fact this object represents a
Component.
|
LayoutAssistant |
getLayoutAssistant()
Get the LayoutAssistant associated with the LayoutManager which controls
the Component represented by this object if in fact this object represents
a Component.
|
java.lang.String |
getLongLabel()
Gets a fully qualified label for display purpose.
|
java.lang.String |
getName()
Get the name of the CmtSubcomponent for the Component represented by this
object.
|
java.lang.String |
getShortLabel()
Gets a short label for display purpose.
|
CmtSubcomponent |
getSubcomponent()
Get the CmtSubcomponent for the Component represented by this object.
|
java.lang.String |
getToolTipText()
Returns the tool tip text to show when the mouse pointer pauses
over a UI component that represents this
Displayable. |
java.net.URL |
getURL()
Returns the
URL that identifies this
Locatable. |
java.lang.Object |
getUserObject() |
boolean |
isComponent()
Determine whether or not this object represents a Component.
|
boolean |
isContainer()
Determine whether or not this object should be treated as a container.
|
boolean |
mayHaveChildren()
This method is part of the
Element interface to
provide a convenient way of determining whether an object may
have children without having to test the object's type with the
instanceof operator or having to downcast to a
more specific type. |
void |
release()
Release all data structures and consider this object as dead.
|
boolean |
remove(Element element)
Remove the specified Element from this Folder.
|
void |
removeAll()
Removes all children from the folder.
|
void |
setCmtModel(CmtModel model)
Set the owning CmtModel
|
void |
setURL(java.net.URL url)
Sets the
URL associated with this Locatable. |
int |
size()
Returns the current number of children in the folder.
|
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, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toStringequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinsert, remove, remove, removeFromParent, setParent, setUserObjectchildren, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeafgetAttributedLabel, toStringpublic CmtFolder(CmtModel model)
public java.lang.String getShortLabel()
getShortLabel in interface Displayablepublic java.lang.String getLongLabel()
getLongLabel in interface Displayablepublic java.lang.Object getData()
public javax.swing.Icon getIcon()
DisplayableIcon that can be shown in association with this
Displayable. Typically the icon will be used in a
tree control or list control. Therefore the icon must fit
naturally within the space normally given to items within those
controls. Such icons are usually 16x16 in size or, if there is a
one-pixel transparent padding around the edge, 18x18 in size. It
is strongly recommended that icons returned by this method be
either 16x16 or 18x18 in size. If null is returned,
the control may show a default icon, or it may show no icon,
whichever is appropriate.getIcon in interface Displayablepublic java.lang.String getToolTipText()
DisplayableDisplayable.
In many cases it may be appropriate for this method to return the
same value as Displayable.getLongLabel().getToolTipText in interface Displayablepublic boolean mayHaveChildren()
ElementElement interface to
provide a convenient way of determining whether an object may
have children without having to test the object's type with the
instanceof operator or having to downcast to a
more specific type.
An implementation of Element that represents a leaf
in a tree structure should return false from this
method. An implementation of Element that could
represent a non-leaf in a tree structure should return
true from this method, even if it does not currently
contain any children.
mayHaveChildren in interface Elementpublic java.util.Iterator getChildren()
ElementElement interface to
provide a convenient way of getting an Iterator over any
contained child Elements without having to test the
object's type with the instanceof operator or having
to downcast to a more specific type.
An implementation of Element that represents a leaf
in a tree structure should return null from this
method. An implementation of Element that could
represent a non-leaf in a tree structure should return either an
Iterator over the child Elements or
null if there are no children.
getChildren in interface Elementpublic Attributes getAttributes()
oracle.ide.model.DefaultAttributes.EMPTY_ATTRIBUTES;getAttributes in interface Elementpublic boolean add(Element element)
public void add(int index,
Element element)
public boolean remove(Element element)
public boolean canRemove(Element element)
FolderElement can be removed from this
Folder.canRemove in interface Folderelement - the Element being checked for removal from this folderpublic boolean canAdd(Element element)
FolderElement can be added to the Folder.public boolean containsChild(Element child)
FoldercontainsChild in interface Folderpublic int size()
Folderpublic void removeAll()
Folderpublic CmtModel getCmtModel()
CmtModelNodegetCmtModel in interface CmtModelNodepublic void setCmtModel(CmtModel model)
CmtModelNodesetCmtModel in interface CmtModelNodemodel - an owning CmtModelpublic CmtSubcomponent getSubcomponent()
CmtModelNodegetSubcomponent in interface CmtModelNodepublic void release()
CmtModelNoderelease in interface CmtModelNodepublic java.lang.Object getUserObject()
getUserObject in class javax.swing.tree.DefaultMutableTreeNodepublic java.lang.String getName()
CmtModelNodegetName in interface CmtModelNodepublic java.net.URL getURL()
LocatableURL that identifies this
Locatable. Parts of the IDE will use the value of
this URL as a hash key for caching UI components for this
Locatable. Therefore, URL uniqueness is
important.public void setURL(java.net.URL url)
LocatableURL associated with this Locatable.
It is important that the URL only be changed when the
Locatable has just been created or when all caches
keyed on the previous URL can also be updated.public boolean isComponent()
CmtModelNodeisComponent in interface CmtModelNodepublic boolean isContainer()
CmtModelNodeisContainer in interface CmtModelNodepublic CmtSubcomponent getLayout()
CmtModelNodegetLayout in interface CmtModelNodepublic LayoutAssistant getLayoutAssistant()
CmtModelNodegetLayoutAssistant in interface CmtModelNodepublic void adjustPosition(boolean adjust)
CmtModelNodeadjustPosition in interface CmtModelNodeadjust - true if the represented Component should be adjusted within
the controlling LayoutManger instance.