|
Extension SDK | |||||||||
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/javaand the package name is "oracle", then the package folder's
URLPath
would be:
file:/Z:/jdev/src/java/oracle;file:/Z:/jbuilder/src/java/oracleWhile 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, uniqueNames, url |
Fields inherited from class oracle.ide.model.DefaultFolder |
_children |
Fields inherited from interface oracle.ide.model.Category |
UNDEFINED |
Constructor Summary | |
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. |
boolean |
equals(java.lang.Object obj)
One PackageFolder is equal to another if their #urlPath members are identical. |
javax.swing.Icon |
getIcon()
Returns the icon tip for this Displayable . |
java.lang.String |
getLongLabel()
Returns the long label for this Displayable . |
protected URLPath |
getPath()
Returns the URLPath that represents the list of directory
URL s for this package. |
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. |
protected java.net.URL[] |
list()
Lists the files and directories belonging to this package folder. |
Methods inherited from class oracle.ide.model.HierarchicalFolder |
add, canAdd, canRemove, getCategory, getChildren, getURL, getViewAllFiles, getViewHierarchically, remove, removeAll, setURL |
Methods inherited from class oracle.ide.model.DefaultFolder |
containsChild, 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(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 URL
s 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 |
protected java.net.URL[] list()
URL
along this package's URLPath
and merge them
together to eliminate duplicates.
list
in class HierarchicalFolder
URL
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 HierarchicalFolder
true
if any of the URL
entries
along this package's URLPath
contain one or more Element
objects belonging to the project.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 Displayable
getShortLabel
in class HierarchicalFolder
public java.lang.String getLongLabel()
Displayable
. This
implementation returns the full package name.
getLongLabel
in interface Displayable
getLongLabel
in class HierarchicalFolder
public java.lang.String getToolTipText()
Displayable
. This
implementation returns the full package name.
getToolTipText
in interface Displayable
getToolTipText
in class HierarchicalFolder
public javax.swing.Icon getIcon()
Displayable
. This
implementation returns the package icon.
getIcon
in interface Displayable
getIcon
in class DefaultFolder
Displayable.getIcon()
public boolean equals(java.lang.Object obj)
PackageFolder
is equal to another if their #urlPath
members are identical.
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.protected URLPath getPath()
URLPath
that represents the list of directory
URL
s for this package.
|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©1997, 2003, Oracle. All rights reserved.