org.netbeans.microedition.lcdui.pda
Class FileBrowser

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Screen
          extended by javax.microedition.lcdui.List
              extended by org.netbeans.microedition.lcdui.pda.FileBrowser
All Implemented Interfaces:
javax.microedition.lcdui.Choice, javax.microedition.lcdui.CommandListener

public class FileBrowser
extends javax.microedition.lcdui.List
implements javax.microedition.lcdui.CommandListener

The FileBrowser custom component lets the user list files and directories. It's uses FileConnection Optional Package (JSR 75). The FileConnection Optional Package APIs give J2ME devices access to file systems residing on mobile devices, primarily access to removable storage media such as external memory cards.


Field Summary
static javax.microedition.lcdui.Command SELECT_FILE_COMMAND
          Command fired on file selection.
 
Fields inherited from class javax.microedition.lcdui.List
SELECT_COMMAND
 
Fields inherited from interface javax.microedition.lcdui.Choice
EXCLUSIVE, IMPLICIT, MULTIPLE, POPUP, TEXT_WRAP_DEFAULT, TEXT_WRAP_OFF, TEXT_WRAP_ON
 
Constructor Summary
FileBrowser(javax.microedition.lcdui.Display display)
          Creates a new instance of FileBrowser for given Display object.
 
Method Summary
 void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
          Indicates that a command event has occurred on Displayable d.
protected  javax.microedition.lcdui.CommandListener getCommandListener()
          Returns command listener.
 javax.microedition.io.file.FileConnection getSelectedFile()
          Returns selected file as a FileConnection object.
 java.lang.String getSelectedFileURL()
          Returns selected FileURL object.
 void setCommandListener(javax.microedition.lcdui.CommandListener commandListener)
          Sets command listener to this component.
 void setFilter(java.lang.String filter)
          Sets the file filter.
 void setTitle(java.lang.String title)
          Sets component's title.
 
Methods inherited from class javax.microedition.lcdui.List
append, delete, deleteAll, getFitPolicy, getFont, getImage, getSelectedFlags, getSelectedIndex, getString, insert, isSelected, removeCommand, set, setFitPolicy, setFont, setSelectCommand, setSelectedFlags, setSelectedIndex, setTicker, size
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, sizeChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECT_FILE_COMMAND

public static final javax.microedition.lcdui.Command SELECT_FILE_COMMAND
Command fired on file selection.

Constructor Detail

FileBrowser

public FileBrowser(javax.microedition.lcdui.Display display)
Creates a new instance of FileBrowser for given Display object.

Parameters:
display - non null display object.
Method Detail

commandAction

public void commandAction(javax.microedition.lcdui.Command c,
                          javax.microedition.lcdui.Displayable d)
Indicates that a command event has occurred on Displayable d.

Specified by:
commandAction in interface javax.microedition.lcdui.CommandListener
Parameters:
c - a Command object identifying the command. This is either one of the applications have been added to Displayable with addCommand(Command) or is the implicit SELECT_COMMAND of List.
d - the Displayable on which this event has occurred

setTitle

public void setTitle(java.lang.String title)
Sets component's title.

Overrides:
setTitle in class javax.microedition.lcdui.List
Parameters:
title - component's title.

getSelectedFile

public javax.microedition.io.file.FileConnection getSelectedFile()
                                                          throws java.io.IOException
Returns selected file as a FileConnection object.

Returns:
non null FileConection object
Throws:
java.io.IOException

getSelectedFileURL

public java.lang.String getSelectedFileURL()
Returns selected FileURL object.

Returns:
non null FileURL object

setFilter

public void setFilter(java.lang.String filter)
Sets the file filter.

Parameters:
filter - file filter String object

getCommandListener

protected javax.microedition.lcdui.CommandListener getCommandListener()
Returns command listener.

Returns:
non null CommandListener object

setCommandListener

public void setCommandListener(javax.microedition.lcdui.CommandListener commandListener)
Sets command listener to this component.

Overrides:
setCommandListener in class javax.microedition.lcdui.Displayable
Parameters:
commandListener - CommandListener to be used