Class FileChooser

java.lang.Object
  extended by FileChooser
All Implemented Interfaces:
java.lang.Runnable

public class FileChooser
extends java.lang.Object
implements java.lang.Runnable

This class provides a user interface to browse a file system in order to create files or directories, delete them, or select a single file. Requires JSR 75 (PDA Profile for J2ME).

Author:
Michel Deriaz

Field Summary
static int CANCELED
          The current operation has been canceled.
static int CHOOSEN
          The user choosed an existing file.
static int CHOOSEN_NULL
          The user choosed NULL, which means "no file".
static int NOT_CHOOSEN
          No choice has been made so far.
 
Constructor Summary
FileChooser(Display display, java.lang.String initFilename)
          Creates a FileChooser, and sets the current pointer to the specified filename.
 
Method Summary
 void commandAction(Command c, Displayable s)
           
 java.lang.String getFilename()
          Gets the choosen filename.
 int getState()
          Gets the current state of the process.
 void run()
           
 void waitUntilFinished()
          This method blocks until the user chooses a file or cancels the process.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_CHOOSEN

public static final int NOT_CHOOSEN
No choice has been made so far.

See Also:
Constant Field Values

CANCELED

public static final int CANCELED
The current operation has been canceled.

See Also:
Constant Field Values

CHOOSEN_NULL

public static final int CHOOSEN_NULL
The user choosed NULL, which means "no file".

See Also:
Constant Field Values

CHOOSEN

public static final int CHOOSEN
The user choosed an existing file.

See Also:
Constant Field Values
Constructor Detail

FileChooser

public FileChooser(Display display,
                   java.lang.String initFilename)
Creates a FileChooser, and sets the current pointer to the specified filename. If initFilename is null, then the current pointer will be set on the top of all available file systems.

Parameters:
display - the current display
initFilename - the initial filename or null if there is no
Method Detail

getFilename

public java.lang.String getFilename()
Gets the choosen filename.

Returns:
the choosen filename

getState

public int getState()
Gets the current state of the process. The values can be NOT_CHOOSEN, CANCELED, CHOOSEN_NULL, or CHOOSEN.

Returns:
the current state of the process

waitUntilFinished

public void waitUntilFinished()
This method blocks until the user chooses a file or cancels the process.


commandAction

public void commandAction(Command c,
                          Displayable s)

run

public void run()
Specified by:
run in interface java.lang.Runnable