|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.clients.util.FileLocator
General purpose file locator class. Currently uses java.awt.FileDialog but may be converted into a bean which inherits from FileDialog.
Nested Class Summary | |
(package private) class |
FileLocator.LastAccessListener
This inner class is used to keep track of the last path accessed. |
Field Summary | |
private FileAccess |
fileAccess
|
private FileDialog |
fileDialog
|
private Frame |
frame
|
private static String |
lastPath
Keep track of the last path accessed by any FileLocator. |
private Hashtable |
listeners
|
static int |
LOAD
Load mode indicator. |
private int |
mode
|
private String |
path
|
private static String |
RESOURCE
|
static int |
SAVE
Save mode indicator. |
private int |
status
|
static int |
STATUS_CANCEL
File dialog was closed without file beind identified, returned by getStatus(). |
static int |
STATUS_INITIAL
Initial or inactive status, returned by getStatus(). |
static int |
STATUS_OK
File dialog was closed with file identified, returned by getStatus(). |
static int |
STATUS_SHOW
File dialog showing status indicator, returned by getStatus(). |
static String |
UNIX_HOME
The Unix home directory environment variable. |
static String |
WINDOWS_TEMP
The Windows temp directory environment variable. |
Constructor Summary | |
FileLocator(Frame frame,
int mode)
Constructor which leaves FileLocator in a valid state for calling show(). |
|
FileLocator(Frame frame,
String path,
int mode)
Constructor which leaves FileLocator in a valid state for calling show(). |
Method Summary | |
void |
addFileLocatorListener(FileLocatorListener l)
Add a listener to file locator events. |
private void |
fireFileLocatorEvent(int newStatus)
|
static String |
getDefaultDirectory()
Return the default local directory path for the passed application data item. |
static String |
getDefaultFileName()
Return the default file name. |
private FileAccess |
getFileAccess()
|
private FileDialog |
getFileDialog()
|
Frame |
getFrame()
Return the frame used to launch the dialog. |
static String |
getLastPath()
Return the last path accessed with a FileLocator. |
int |
getMode()
Return the mode of file location, returns SAVE or LOAD. |
String |
getPath()
Get the path. |
int |
getStatus()
Return the status of the last operation. |
static boolean |
isUnix()
Test for Unix operating system. |
static boolean |
isWindows()
Test for Windows operating system. |
static String |
parseDirectory(String path)
File path parsing utility for determining directory path. |
static String |
parseFilename(String path)
File path parsing utility for determining file name. |
void |
removeFileLocatorListener(FileLocatorListener l)
Remove a listener to file locator events. |
protected void |
setFrame(Frame newValue)
Set the frame used to launch the dialog. |
void |
setMode(int newMode)
Set the mode to SAVE or LOAD. |
void |
setPath(String newValue)
Set the path. |
protected void |
setStatus(int newStatus)
|
void |
show(boolean block)
Show the file load dialog. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SAVE
public static final int LOAD
public static final String WINDOWS_TEMP
public static final String UNIX_HOME
public static final int STATUS_INITIAL
public static final int STATUS_SHOW
public static final int STATUS_OK
public static final int STATUS_CANCEL
private static String lastPath
private static String RESOURCE
private Frame frame
private FileDialog fileDialog
private String path
private int mode
private int status
private Hashtable listeners
private FileAccess fileAccess
Constructor Detail |
public FileLocator(Frame frame, int mode)
public FileLocator(Frame frame, String path, int mode)
Method Detail |
public int getStatus()
protected void setStatus(int newStatus)
public Frame getFrame()
protected void setFrame(Frame newValue)
public String getPath()
public void setPath(String newValue)
public static String getLastPath()
public int getMode()
public void setMode(int newMode)
newMode
- The mode of operation.public void show(boolean block)
block
- Either block the thread or launch a new thread.public void addFileLocatorListener(FileLocatorListener l)
public void removeFileLocatorListener(FileLocatorListener l)
public static String getDefaultFileName()
public static String getDefaultDirectory()
public static String parseDirectory(String path)
public static String parseFilename(String path)
public static boolean isWindows()
public static boolean isUnix()
private FileAccess getFileAccess()
private FileDialog getFileDialog()
private void fireFileLocatorEvent(int newStatus)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |