|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nokia.mid.ui.FileSelect
public final class FileSelect
A class which gives the client the ability to use the device's File Select to list and select files.
The launch will block and wait until the File Select exits. If this is not the desired behavior, the client should start a new thread for the launch. Note: don't use it in the event handling thread, e.g. command action.
Functionalities provided by the File Select are:
Code Snippet 1:
// This is a sample code to launch the File Select from the root of
// all user file systems to browse for single selection. And only files which media type is MEDIA_TYPE_PICTURE will be displayed.
try
{
// Instantiate the FileSelect with types
FileSelectDetail [] arrSelectedFiles = FileSelect.launch(FileSelect.FILE_SYSTEM_ALL, FileSelect.MEDIA_TYPE_PICTURE, false);
// If files were selected and returned
if (arrSelectedFiles != null)
{
System.out.println("number of selected files " + arrSelectedFiles.length);
for (int i = 0; i < arrSelectedFiles.length; i++)
{
System.out.println("mime_type " + arrSelectedFiles[i].mimeType);
System.out.println("display_name " + arrSelectedFiles[i].displayName);
System.out.println("url " + arrSelectedFiles[i].url);
System.out.println("size" + arrSelectedFiles[i].size);
}
}
}
catch (Exception ex)
{
log("Exception: " + ex.toString());
}
Code Snippet 2:
// This is a sample code to launch the File Select specifying the photos folder to browser for multiple selection and no file type filtering
try
{
FileSelectDetail [] arrSelectedFiles = FileSelect.launch(System.getProperty("fileconn.dir.photos"), FileSelect.MEDIA_TYPE_ALL, true);
// If files were selected and returned
if (arrSelectedFiles != null)
{
System.out.println("number of selected files " + arrSelectedFiles.length);
for (int i = 0; i < arrSelectedFiles.length; i++)
{
System.out.println("mime_type " + arrSelectedFiles[i].mimeType);
System.out.println("display_name " + arrSelectedFiles[i].displayName);
System.out.println("url " + arrSelectedFiles[i].url);
System.out.println("size" + arrSelectedFiles[i].size);
}
}
}
catch (Exception ex)
{
log("Exception: " + ex.toString());
}
Field Summary | |
---|---|
static java.lang.String |
FILE_SYSTEM_ALL
All user file systems. |
static java.lang.String |
FILE_SYSTEM_EXTERNAL
External user file system. |
static java.lang.String |
FILE_SYSTEM_INTERNAL
Internal user file system. |
static int |
MEDIA_TYPE_ALL
All media types. |
static int |
MEDIA_TYPE_APPLICATION
Application media types. |
static int |
MEDIA_TYPE_AUDIO
Video media types. |
static int |
MEDIA_TYPE_PICTURE
Picture media types. |
static int |
MEDIA_TYPE_VIDEO
Video media types. |
Method Summary | |
---|---|
static FileSelectDetail[] |
launch(java.lang.String startURL,
int mediaType,
boolean multipleSelection)
Launch the File Select component. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MEDIA_TYPE_ALL
public static final int MEDIA_TYPE_PICTURE
public static final int MEDIA_TYPE_AUDIO
public static final int MEDIA_TYPE_VIDEO
public static final int MEDIA_TYPE_APPLICATION
public static final java.lang.String FILE_SYSTEM_ALL
public static final java.lang.String FILE_SYSTEM_EXTERNAL
public static final java.lang.String FILE_SYSTEM_INTERNAL
Method Detail |
---|
public static FileSelectDetail[] launch(java.lang.String startURL, int mediaType, boolean multipleSelection) throws java.io.IOException, java.lang.IllegalArgumentException
startURL
- the begin file path. It can be FILE_SYSTEM_ALL, FILE_SYSTEM_INTERNAL, FILE_SYSTEM_EXTERNAL and other valid file path.mediaType
- the filter media types. It can be one or combination of the media type constant defined in this API.multipleSelection
- whether enabling or disabling multiple selection.
java.io.IOException
- if either the FileSelect is busy or file system is not ready.
java.lang.IllegalArgumentException
- if either the startURL or mediaType is invalid.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |