|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--amber.type.server.FileDirFilter
This class implements the FilenameFilter interface. It is used by File dialogs to specify only files rather than files/directories. By specifying the correct argument only directories or only files can be selected.
FileDialog,
FileHandler| Field Summary | |
protected java.io.File |
baseDirectory
This holds the base directory below which the object will fail the accept. |
| Constructor Summary | |
FileDirFilter()
Default Constructor. |
|
FileDirFilter(boolean matchFiles)
Initialising Constructor. |
|
FileDirFilter(boolean matchFiles,
java.lang.String baseDirectory)
Initialising Constructor. |
|
| Method Summary | |
boolean |
accept(java.io.File dir,
java.lang.String name)
Tests if a specified file should be included in a file list. |
java.io.File |
getBaseDirectory()
This returns the base directory for this filter. |
boolean |
isFilesOnly()
Gets the data in the following variable: boolean containing the filter selection state. |
protected boolean |
isHigherDirectory(java.io.File dir)
Checks to see if the directory is higher than the base directory. |
void |
setBaseDirectory(java.io.File directory)
This sets the base directory for this filter. |
void |
setFilesOnly(boolean data)
Sets the data in the following variable: boolean containing the filter selection state. |
java.lang.String |
toString()
This function returns the String form of the data. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.io.File baseDirectory
| Constructor Detail |
public FileDirFilter()
public FileDirFilter(boolean matchFiles)
matchFiles - boolean when true the filter will only return files
otherwise will only return directories.
public FileDirFilter(boolean matchFiles,
java.lang.String baseDirectory)
matchFiles - boolean when true the filter will only return files
otherwise will only return directories.baseDirectory - String containing the base directory for this
object. The filter will fail to accept any file higher than this directory.| Method Detail |
public boolean isFilesOnly()
public void setFilesOnly(boolean data)
data - boolean containing the data to set the variable to.
public boolean accept(java.io.File dir,
java.lang.String name)
accept in interface java.io.FilenameFilterdir - File directory in which the file was found.name - String name of the file to test.protected boolean isHigherDirectory(java.io.File dir)
dir - File containing the directory to check.public void setBaseDirectory(java.io.File directory)
directory - File containing the base directory.public java.io.File getBaseDirectory()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||