Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.ide.model
Class ContentSetFolder

java.lang.Object
  extended by oracle.ide.model.RelativeDirectoryContextFolder
      extended by oracle.ide.model.ContentSetFolder
All Implemented Interfaces:
AutoExpandable, Displayable, Element, RelativeDirectoryElement, Subject

public final class ContentSetFolder
extends RelativeDirectoryContextFolder
implements AutoExpandable

Although this class is package-private, it extends the public abstract class RelativeDirectoryContextFolder. Clients should retrieve information about a ContentSetFolder through the methods defined in RelativeDirectoryContextFolder.

A ContentSetFolder represents the root of a content set, such as "Application Sources" or "Web Sources", in the navigator.

Implementation note: this class doesn't actually implement the Folder interface, because there is no API means to add/remove children to/from ContentLevelFolder once its been created. If you have code that expects "instanceof Folder" to work, what you need to do instead is call "mayHaveChildren()" and if that returns true, then the Element serves as a "folder".


Method Summary
 void attach(Observer observer)
          Registers an observer interested in being notified when the internal state of the class implementing the Subject interface changes.
 void detach(Observer observer)
          Unregisters an observer that is not interested anymore in being notified when the internal state of the class implementing the Subject interface changes.
 Attributes getAttributes()
          This method returns an Attributes object that encodes the attributes of the Element.
 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.
 ContentSet getContentSet()
           
 java.util.List getContentSetKeys()
          Returns the keys for the content sets that are represented by this RelativeDirectoryContextFolder.
 java.lang.Object getData()
          Returns the data object associated with this Element.
 javax.swing.Icon getIcon()
          Returns an Icon that can be shown in association with this Displayable.
 java.lang.String getLongLabel()
          Returns a long label that can be displayed to the user.
 java.lang.String getRelativePath()
          Retrieves the relative path described by this folder.
 URLPath getRootDirectories()
          Retrieves the root directories used to assemble the folder contents.
 java.lang.String getShortLabel()
          Returns a short label that can be displayed to the user.
 java.lang.String getToolTipText()
          Returns the tool tip text to show when the mouse pointer pauses over a UI component that represents this Displayable.
 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 notifyObservers(java.lang.Object subject, UpdateMessage change)
          Notifies all observers that the state of the subject has changed.
 boolean shouldAutoExpand(Context expansionContext)
          The implementation of this method should return true if this Element is allowed to be auto-expanded.
 java.lang.String toString()
          Returns the Short Label displayed to a user.
 
Methods inherited from class oracle.ide.model.RelativeDirectoryContextFolder
canContainJavaSources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getRootDirectories

public URLPath getRootDirectories()
Description copied from class: RelativeDirectoryContextFolder
Retrieves the root directories used to assemble the folder contents.

Specified by:
getRootDirectories in interface RelativeDirectoryElement
Specified by:
getRootDirectories in class RelativeDirectoryContextFolder
Returns:
the URLPath representing the root directories for this folder.

getRelativePath

public java.lang.String getRelativePath()
Description copied from class: RelativeDirectoryContextFolder
Retrieves the relative path described by this folder.

Specified by:
getRelativePath in interface RelativeDirectoryElement
Specified by:
getRelativePath in class RelativeDirectoryContextFolder
Returns:
a String containing the relative path of this folder.

getContentSetKeys

public java.util.List getContentSetKeys()
Description copied from class: RelativeDirectoryContextFolder
Returns the keys for the content sets that are represented by this RelativeDirectoryContextFolder. The returned List is guaranteed to be non-null.

Specified by:
getContentSetKeys in class RelativeDirectoryContextFolder
Returns:
the ContentSet keys represented by this folder

shouldAutoExpand

public boolean shouldAutoExpand(Context expansionContext)
Description copied from interface: AutoExpandable
The implementation of this method should return true if this Element is allowed to be auto-expanded. If false is returned, it means that auto-expansion will occur up to this Element but not drill in any further.

Specified by:
shouldAutoExpand in interface AutoExpandable
Parameters:
expansionContext - The auto-expansion Context. This Context is not necessarily the context of this Element, but it is the Context where auto-expansion was initiated. It is also possible that the expansionContext will be null if there is a reason that a Context could not be provided. Implementations need to check for null before dereferencing expansionContext.

getContentSet

public ContentSet getContentSet()

attach

public final void attach(Observer observer)
Description copied from interface: Subject
Registers an observer interested in being notified when the internal state of the class implementing the Subject interface changes. Implementors should do nothing when the same observer is added more than once.

Specified by:
attach in interface Subject
Parameters:
observer - the Observer interested in change notification messages.

detach

public final void detach(Observer observer)
Description copied from interface: Subject
Unregisters an observer that is not interested anymore in being notified when the internal state of the class implementing the Subject interface changes. Implementors should do nothing when the same observer is removed more than once.

Specified by:
detach in interface Subject
Parameters:
observer - the Observer disinterested in change notification messages.

notifyObservers

public final void notifyObservers(java.lang.Object subject,
                                  UpdateMessage change)
Description copied from interface: Subject
Notifies all observers that the state of the subject has changed.

Specified by:
notifyObservers in interface Subject
Parameters:
subject - the subject whose state has changed.
change - what changed.

getData

public final java.lang.Object getData()
Description copied from interface: Element
Returns the data object associated with this Element. Implementations will often simply return this, since the Element is often its own data object. If the implementation returns an object other than this, be sure to set ElementAttributes.DECORATES_DATA_ELEMENT.

Specified by:
getData in interface Element
Returns:
the data object associated with this Element instance.

getShortLabel

public java.lang.String getShortLabel()
Description copied from interface: Displayable
Returns a short label that can be displayed to the user. Generally, the value of the returned String is considered translatable and should therefore be placed in an appropriate resource file. When possible, the returned label should be reasonably short enough to show in the navigator or explorer windows but long enough to clearly identify and distinguish the Displayable.

Specified by:
getShortLabel in interface Displayable
Returns:
a short descriptive label of the Displayable that can be shown to the user.

getLongLabel

public java.lang.String getLongLabel()
Description copied from interface: Displayable
Returns a long label that can be displayed to the user. Generally, the value of the returned String is considered translatable and should therefore be placed in an appropriate resource file. The long label differs from the short label essentially on length. Usually the long label will only be shown on-demand and in places where horizontal space is more available. Examples are the status bar and tooltips.

Specified by:
getLongLabel in interface Displayable
Returns:
a long descriptive label of the Displayable that can be shown to the user.

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 to be displayed for the Displayable.

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 to show when the mouse pointer pauses over a UI component that represents this Displayable.

toString

public final java.lang.String toString()
Description copied from interface: Displayable
Returns the Short Label displayed to a user. This overrides the toString method in java.lang.Object.

Implementors of the Displayable interface should override this as appropriate. The default implementation is the same as getShortLabel

Specified by:
toString in interface Displayable
Overrides:
toString in class java.lang.Object
See Also:
Object.toString(), Displayable.getShortLabel()

mayHaveChildren

public final 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 child Elements.

getAttributes

public final Attributes getAttributes()
Description copied from interface: Element
This method returns an Attributes object that encodes the attributes of the Element. Changing the attribute settings on the return object changes the element attributes. Subclasses should use their super class attributes object to define their own attributes. This allows subclasses to inherit their super class attributes. If a subclass does not wish to inherit attributes, they should first call getAttributes().clear() and define new attributes.

Specified by:
getAttributes in interface Element

getChildren

public final 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 over any child Elements contained by this Element. If there are no children, null is returned.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

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