Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

oracle.jdeveloper.cmt
Class CmtFolder

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by oracle.jdeveloper.cmt.CmtFolder
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode, Displayable, Element, Folder, Locatable, CmtModelNode

public class CmtFolder
extends javax.swing.tree.DefaultMutableTreeNode
implements CmtModelNode

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Fields inherited from interface oracle.jdeveloper.cmt.CmtModelNode
PROTOCOL, QUERY_TOKEN
 
Constructor Summary
CmtFolder(CmtModel model)
           
 
Method Summary
 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)
          Returns true if the folder contains the specified child Element; returns false otherwise.
 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.
 
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, 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, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.tree.MutableTreeNode
insert, remove, remove, removeFromParent, setParent, setUserObject
 
Methods inherited from interface javax.swing.tree.TreeNode
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
 
Methods inherited from interface oracle.ide.model.Displayable
toString
 

Constructor Detail

CmtFolder

public CmtFolder(CmtModel model)
Method Detail

getShortLabel

public java.lang.String getShortLabel()
Gets a short label for display purpose.

Specified by:
getShortLabel in interface Displayable
Returns:
a short descriptive label. For example; an unqaualified file name.

getLongLabel

public java.lang.String getLongLabel()
Gets a fully qualified label for display purpose.

Specified by:
getLongLabel in interface Displayable
Returns:
a long descriptive label. For example; a fully qualified file name.

getData

public java.lang.Object getData()
Gets the data object that implements this interface.

Specified by:
getData in interface Element
Returns:
object implementing this interface.

getIcon

public javax.swing.Icon getIcon()
Description copied from interface: Displayable
Returns an Icon 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.

Specified by:
getIcon in interface Displayable
Returns:
the Icon for this node instance

getToolTipText

public java.lang.String getToolTipText()
Description copied from interface: Displayable
Returns the tool tip text to show when the mouse pointer pauses over a UI component that represents this Displayable. In many cases it may be appropriate for this method to return the same value as Displayable.getLongLabel().

Specified by:
getToolTipText in interface Displayable
Returns:
the ToolTip for this node instance

mayHaveChildren

public boolean mayHaveChildren()
Description copied from interface: Element
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.

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.

Specified by:
mayHaveChildren in interface Element
Returns:
true if this Element may contain children.

getChildren

public java.util.Iterator getChildren()
Description copied from interface: Element
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.

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.

Specified by:
getChildren in interface Element
Returns:
an Iterator of any children held by this Element, else null.

getAttributes

public Attributes getAttributes()
Returns oracle.ide.model.DefaultAttributes.EMPTY_ATTRIBUTES;

Specified by:
getAttributes in interface Element

add

public boolean add(Element element)
Add the specified Element to this Folder.

Specified by:
add in interface Folder
Parameters:
element - document to be added to this folder.

add

public void add(int index,
                Element element)

remove

public boolean remove(Element element)
Remove the specified Element from this Folder.

Specified by:
remove in interface Folder
Parameters:
element - Element to be removed from this container.

canRemove

public boolean canRemove(Element element)
Description copied from interface: Folder
Other classes can call this method to determine whether the specified Element can be removed from this Folder.

Specified by:
canRemove in interface Folder
Parameters:
element - the Element being checked for removal from this folder
Returns:
TRUE if the specified element can be removed from this folder in the specified context. Quick responses are appreciated, since this method is used to enable/disable the Delete accelerator key in the Navigator with every context change.

canAdd

public boolean canAdd(Element element)
Description copied from interface: Folder
Other classes can call this method to determine whether the given Element can be added to the Folder.

Specified by:
canAdd in interface Folder
Parameters:
element - the Element that is about to be added to this Folder.
Returns:
true if the specified Element can be added to this Folder; false if the Element cannot be added.

containsChild

public boolean containsChild(Element child)
Description copied from interface: Folder
Returns true if the folder contains the specified child Element; returns false otherwise.

Specified by:
containsChild in interface Folder

size

public int size()
Description copied from interface: Folder
Returns the current number of children in the folder.

Specified by:
size in interface Folder

removeAll

public void removeAll()
Description copied from interface: Folder
Removes all children from the folder.

Specified by:
removeAll in interface Folder

getCmtModel

public CmtModel getCmtModel()
Description copied from interface: CmtModelNode
Get the CmtModel to which this object belongs.

Specified by:
getCmtModel in interface CmtModelNode
Returns:
a CmtModel

setCmtModel

public void setCmtModel(CmtModel model)
Description copied from interface: CmtModelNode
Set the owning CmtModel

Specified by:
setCmtModel in interface CmtModelNode
Parameters:
model - an owning CmtModel

getSubcomponent

public CmtSubcomponent getSubcomponent()
Description copied from interface: CmtModelNode
Get the CmtSubcomponent for the Component represented by this object.

Specified by:
getSubcomponent in interface CmtModelNode
Returns:

release

public void release()
Description copied from interface: CmtModelNode
Release all data structures and consider this object as dead.

Specified by:
release in interface CmtModelNode

getUserObject

public java.lang.Object getUserObject()
Overrides:
getUserObject in class javax.swing.tree.DefaultMutableTreeNode

getName

public java.lang.String getName()
Description copied from interface: CmtModelNode
Get the name of the CmtSubcomponent for the Component represented by this object.

Specified by:
getName in interface CmtModelNode
Returns:
the name of a CmtSubcomponent.

getURL

public java.net.URL getURL()
Description copied from interface: Locatable
Returns the URL 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.

Specified by:
getURL in interface Locatable
Returns:
The URL identifying this Locatable.

setURL

public void setURL(java.net.URL url)
Description copied from interface: Locatable
Sets the URL 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.

Specified by:
setURL in interface Locatable
Parameters:
url - The URL to set.

isComponent

public boolean isComponent()
Description copied from interface: CmtModelNode
Determine whether or not this object represents a Component.

Specified by:
isComponent in interface CmtModelNode
Returns:
true when the object represented is a Component.

isContainer

public boolean isContainer()
Description copied from interface: CmtModelNode
Determine whether or not this object should be treated as a container.

Specified by:
isContainer in interface CmtModelNode
Returns:
true when the object represented can take children.

getLayout

public CmtSubcomponent getLayout()
Description copied from interface: CmtModelNode
Get the CmtSubcomponent representing the LayoutManger controlling the Component represented by this object if in fact this object represents a Component. Returns null otherwise.

Specified by:
getLayout in interface CmtModelNode
Returns:
a CmtSubcomponent or null.

getLayoutAssistant

public LayoutAssistant getLayoutAssistant()
Description copied from interface: CmtModelNode
Get the LayoutAssistant associated with the LayoutManager which controls the Component represented by this object if in fact this object represents a Component. Returns null otherwise.

Specified by:
getLayoutAssistant in interface CmtModelNode
Returns:
a LayoutAssistant or null.

adjustPosition

public void adjustPosition(boolean adjust)
Description copied from interface: CmtModelNode
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. Recursively calls adjustPosition on children, without live adjustment, such that all add calls are grouped togeather.

Specified by:
adjustPosition in interface CmtModelNode
Parameters:
adjust - true if the represented Component should be adjusted within the controlling LayoutManger instance.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

Copyright © 1997, 2009, Oracle. All rights reserved.