|
Extension SDK 10.1.2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectoracle.ide.model.DefaultDisplayable
oracle.ide.model.DefaultElement
oracle.ide.model.DefaultFolder
oracle.ide.model.HierarchicalFolder
oracle.ide.model.PackageFolder
The PackageFolder class encapsulates a package element
managed by the PackageFilter. A package folder may correspond
to more than one physical directory on the file system; each directory,
however, should correspond to the same package directory. This list of
directories that this package folder represents is maintained in an
URLPath.
For example, if the project's source path is:
file:/Z:/jdev/src/java;file:/Z:/jbuilder/src/java
and the package name is "oracle", then the package folder's URLPath would be:
file:/Z:/jdev/src/java/oracle;file:/Z:/jbuilder/src/java/oracle
While the PackageFolder technically implements the Locatable interface, the URL returned by the HierarchicalFolder.getURL()
method is simply the first URL along this package's URLPath. We should instead return a synthetic URL that
represents this package but does not correspond to a physical directory
on the file system.
| Field Summary |
| Fields inherited from class oracle.ide.model.HierarchicalFolder |
filter, isOpen, longName, shortName, url |
| Fields inherited from class oracle.ide.model.DefaultFolder |
_children |
| Fields inherited from interface oracle.ide.addin.Subject |
OBJECT_MODIFIED |
| Fields inherited from interface oracle.ide.model.Category |
UNDEFINED |
| Constructor Summary | |
|
PackageFolder()
Default constructor. |
protected |
PackageFolder(java.lang.Object key,
PackageFilter filter)
Protected constructor that constructs a PackageFolder
given a folder key and a PackageFilter that will manage this
package folder. |
|
PackageFolder(java.net.URL url,
PackageFilter filter)
Constructs a PackageFolder given an URL and a
PackageFilter that will manage this package folder. |
| Method Summary | |
protected void |
addToPath(java.net.URL url)
Adds an URL to the URLPath for this package. |
void |
attach(Observer observer)
Registers an observer interested in being notified when the internal state of the class implementing the Subject interface
changes. |
protected void |
close()
|
java.lang.Object |
copyTo(java.lang.Object object)
Not really copiable. |
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. |
boolean |
equals(java.lang.Object obj)
One PackageFolder is equal to another if their #urlPath members are identical. |
java.util.Iterator |
getChildren()
Returns an Iterator over the child Element objects
belonging to this folder. |
PackageFilter.PackageFactory |
getFactory()
|
javax.swing.Icon |
getIcon()
Returns the icon tip for this Displayable. |
java.lang.String |
getLongLabel()
Returns the long label for this Displayable. |
URLPath |
getPath()
Returns the URLPath that represents the list of directory
URLs for this package. |
java.util.Map |
getProperties()
Retrieves a map holding the property-value pairs. |
java.lang.Object |
getProperty(java.lang.String name)
Retrieves the value associated with a property. |
java.lang.Object |
getProperty(java.lang.String name,
java.lang.Object defaultValue)
Accessor to user data saved in the project file |
java.lang.String |
getShortLabel()
Returns the short label for this Displayable. |
java.lang.String |
getToolTipText()
Returns the tool tip for this Displayable. |
protected void |
init(java.lang.String packageName)
Initializes the PackageFolder from the package name. |
protected boolean |
isInProject()
Tests whether any Element objects belonging to the project are
contained by this package folder. |
boolean |
isStrict()
When true indicates that this package is strict with name and children |
protected java.net.URL[] |
list()
Lists the files and directories belonging to this package folder. |
void |
notifyObservers(java.lang.Object subject,
UpdateMessage change)
Notifies all observers that the state of the subject has changed. |
protected void |
reset()
|
void |
setFilter(HierarchicalFilter filter)
Set the HierarchicalFilter associated with this folder. |
void |
setProperties(java.util.Map properties)
Sets the map holding the property-value pairs. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Accessor to user data saved in the project file |
void |
setStrict(boolean strict)
Indicate whether this package is strict with name and children. |
| Methods inherited from class oracle.ide.model.HierarchicalFolder |
add, canAdd, canRemove, containsChild, getCategory, getFilter, getURL, getViewAllFiles, getViewHierarchically, remove, removeAll, setURL |
| Methods inherited from class oracle.ide.model.DefaultFolder |
copyToImpl, equalsImpl, mayHaveChildren, size |
| Methods inherited from class oracle.ide.model.DefaultElement |
getAttributes, getData |
| Methods inherited from class oracle.ide.model.DefaultDisplayable |
toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface oracle.ide.model.Element |
getAttributes |
| Methods inherited from interface oracle.ide.model.Data |
getData |
| Methods inherited from interface oracle.ide.model.Displayable |
toString |
| Constructor Detail |
public PackageFolder()
public PackageFolder(java.net.URL url,
PackageFilter filter)
PackageFolder given an URL and a
PackageFilter that will manage this package folder. The given
URL represents the first entry on this package's URLPath; additional URLs can be added to the URLPath
by calling the addToPath(URL) method.
url - the URL for this folder.filter - the HierarchicalFilter that manages this folder.
protected PackageFolder(java.lang.Object key,
PackageFilter filter)
PackageFolder
given a folder key and a PackageFilter that will manage this
package folder. The given key should be created by PackageFilter.getFolderKey(URL) or PackageFilter.getParentKey(Object).
This constructor is not for general use and should only ever be called
by the PackageFilter.createFolder(Object) method.
key - the key for this folder.filter - the HierarchicalFilter that manages this folder.| Method Detail |
public java.util.Map getProperties()
DynamicPropertySet
getProperties in interface DynamicPropertySetpublic void setProperties(java.util.Map properties)
DynamicPropertySet
setProperties in interface DynamicPropertySetpublic java.lang.Object getProperty(java.lang.String name)
DynamicPropertySet
getProperty in interface DynamicPropertySetname - the property key for which a value is desired.
exists.
null value
if the property does not exist or is not set.
public java.lang.Object getProperty(java.lang.String name,
java.lang.Object defaultValue)
getProperty in interface DynamicPropertySetname - the property key for which a value is desired.defaultValue - the value to return if no value currently
exists.
public void setProperty(java.lang.String name,
java.lang.Object value)
setProperty in interface DynamicPropertySetname - the property key to setvalue - the value to setpublic java.lang.Object copyTo(java.lang.Object object)
null
copyTo in interface Copyableobject - The target object to which the state of
this object should be copied. If target
is null, then the copyTo method will
return a new instance of this class.
this
object was copied. If the target was
non-null, then the return value is the same as the
target object that was passed in; otherwise, the
return value is a new instance of this class.public void attach(Observer observer)
SubjectSubject interface
changes.
Implementors should do nothing when the same observer is added more
than once.
attach in interface Subjectobserver - the Observer interested in change notification
messages.public void detach(Observer observer)
SubjectSubject
interface changes.
Implementors should do nothing when the same observer is removed more
than once.
detach in interface Subjectobserver - the Observer disinterested in change
notification messages.
public void notifyObservers(java.lang.Object subject,
UpdateMessage change)
Subject
notifyObservers in interface Subjectsubject - the subject whose state has changed.change - what changed.protected java.net.URL[] list()
URL along this package's URLPath and merge them
together to eliminate duplicates.
list in class HierarchicalFolderURL objects naming the files and
directories contained by the URLPath for this package folder;
if the contents of this package folder cannot be listed, then
null is returned.protected boolean isInProject()
Element objects belonging to the project are
contained by this package folder.
isInProject in class HierarchicalFoldertrue if any of the URL entries
along this package's URLPath contain one or more Element objects belonging to the project.public boolean isStrict()
isStrict in class HierarchicalFolderpublic void setStrict(boolean strict)
public PackageFilter.PackageFactory getFactory()
PackageFilter.PackageFactory used to create
packages with the same filter as this pacakage folder.public java.lang.String getShortLabel()
Displayable. This
implementation returns the full package name when in flat view, and it
returns the bottom-most package name when in nested view.
getShortLabel in interface DisplayablegetShortLabel in class HierarchicalFolderpublic java.lang.String getLongLabel()
Displayable. This
implementation returns the full package name.
getLongLabel in interface DisplayablegetLongLabel in class HierarchicalFolderpublic java.lang.String getToolTipText()
Displayable. This
implementation returns the full package name.
getToolTipText in interface DisplayablegetToolTipText in class HierarchicalFolderpublic javax.swing.Icon getIcon()
Displayable. This
implementation returns the package icon.
getIcon in interface DisplayablegetIcon in class DefaultFolderDisplayable.getIcon()public boolean equals(java.lang.Object obj)
PackageFolder is equal to another if their #urlPath members are identical.
public void setFilter(HierarchicalFilter filter)
HierarchicalFolderHierarchicalFilter associated with this folder. The
specified filter will only be set if it has never
been set.
setFilter in class HierarchicalFolderpublic java.util.Iterator getChildren()
Iterator over the child Element objects
belonging to this folder.
getChildren in interface ElementgetChildren in class HierarchicalFolderprotected void reset()
protected void close()
protected void init(java.lang.String packageName)
PackageFolder from the package name. The
URLPath for the package is automatically calculated from the
package name and the filter's sourcepath.
protected void addToPath(java.net.URL url)
URL to the URLPath for this package. The
URL is assumed to be contained by the source path. The URL is also assumed to correspond to the same package directory as
every other URL in the #urlPath.
url - the URL to add to the path.public URLPath getPath()
URLPath that represents the list of directory
URLs for this package.
|
Extension SDK | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Copyright © 1997, 2004, Oracle. All rights reserved.