oracle.ide.model
Class DirectoryFolder
java.lang.Object
|
+--oracle.ide.model.DefaultDisplayable
|
+--oracle.ide.model.DefaultElement
|
+--oracle.ide.model.DefaultFolder
|
+--oracle.ide.model.HierarchicalFolder
|
+--oracle.ide.model.DirectoryFolder
- All Implemented Interfaces:
- Data, Displayable, Element, Folder, Locatable
- public final class DirectoryFolder
- extends HierarchicalFolder
The DirectoryFolder
class encapsulates a directory
element managed by the DirectoryFilter
.
Method Summary |
boolean |
equals(java.lang.Object obj)
One DirectoryFolder is equal to another if their HierarchicalFolder.url members are identical. |
java.lang.String |
getShortLabel()
Returns the short label for this Displayable . |
protected boolean |
isInProject()
Tests whether any Element objects belonging to the project are
contained by this directory folder. |
protected boolean |
isSrcRoot()
Returns true if this directory is a source path root. |
protected java.net.URL[] |
list()
Lists the files and directories belonging to this directory folder. |
protected void |
setIsSrcRoot(boolean isSrcRoot)
Marks this directory folder as either a source path root or a
subfolder. |
Methods inherited from class oracle.ide.model.HierarchicalFolder |
add, canAdd, canRemove, getChildren, getLongLabel, getToolTipText, getURL, getViewAllFiles, getViewHierarchically, remove, removeAll, setURL |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.ide.model.Data |
getData |
DirectoryFolder
public DirectoryFolder(java.net.URL url,
DirectoryFilter filter)
- Constructs a
DirectoryFolder
given an URL
and a
DirectoryFilter
that will manage this directory folder.
- Parameters:
url
- the URL
for this folder.filter
- the HierarchicalFilter
that manages this folder.
DirectoryFolder
protected DirectoryFolder(java.lang.Object key,
DirectoryFilter filter)
- Protected constructor that constructs a
DirectoryFolder
given a folder key and a DirectoryFilter
that will manage this
directory folder. The given key should be created by DirectoryFilter.getFolderKey(URL)
or DirectoryFilter.getParentKey(Object)
.
This constructor is not for general use and should only ever be called
by the DirectoryFilter.createFolder(Object)
method.
- Parameters:
key
- the key for this folder.filter
- the HierarchicalFilter
that manages this folder.
list
protected java.net.URL[] list()
- Lists the files and directories belonging to this directory folder.
This implementation lists the contents of the directory URL for this
folder.
- Overrides:
list
in class HierarchicalFolder
- Returns:
- an array of
URL
objects naming the files and
directories contained by the URL
for this directory; if the
contents of this directory folder cannot be listed, then
null
is returned.
isInProject
protected boolean isInProject()
- Tests whether any
Element
objects belonging to the project are
contained by this directory folder.
- Overrides:
isInProject
in class HierarchicalFolder
- Returns:
- returns
true
if the URL
for this
directory folder contains one or more Element
objects
belonging to the project.
getShortLabel
public java.lang.String getShortLabel()
- Returns the short label for this
Displayable
. This
implementation returns the full platform path name of this directory
folder if this folder is a source path root; otherwise, it defers to
the superclass implementation.
- Overrides:
getShortLabel
in class HierarchicalFolder
- Following copied from interface:
oracle.ide.model.Displayable
- Returns:
- a short descriptive label of the
Displayable
that can be shown to the user.
equals
public boolean equals(java.lang.Object obj)
- One
DirectoryFolder
is equal to another if their HierarchicalFolder.url
members are identical.
- Overrides:
equals
in class java.lang.Object
isSrcRoot
protected boolean isSrcRoot()
- Returns
true
if this directory is a source path root.
setIsSrcRoot
protected void setIsSrcRoot(boolean isSrcRoot)
- Marks this directory folder as either a source path root or a
subfolder.
- Parameters:
isSrcRoot
- if true
, marks this directory folder as
a source path root.