example.mmademo
Class SimpleRmsBrowser
java.lang.Object
javax.microedition.lcdui.Displayable
javax.microedition.lcdui.Screen
javax.microedition.lcdui.List
example.mmademo.SimpleRmsBrowser
- All Implemented Interfaces:
- Utils.ContentHandler, javax.microedition.lcdui.Choice, javax.microedition.lcdui.CommandListener
class SimpleRmsBrowser
- extends javax.microedition.lcdui.List
- implements javax.microedition.lcdui.CommandListener, Utils.ContentHandler
A RecordStore (RMS) browser. Used in SimplePlayer.
Pseudo URLs are used:
rms:/RecordStoreName#index
Examples:
rms:/TheStorage#3
- to get index 3 in RecordStore named "TheStorage"
rms:/
- to list all RecordStores
rms:/TheStorage
- to list the indexes in RecordStore named "TheStorage"
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 |
Method Summary |
boolean |
canHandle(java.lang.String url)
|
void |
close()
|
void |
commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable s)
Respond to commands |
void |
display(java.lang.String url,
int selectedIndex)
|
static javax.microedition.rms.RecordStore |
getRecordStore(java.lang.String url,
boolean canCreate)
Callers must make sure to call closeRecordStore() ! |
static java.io.InputStream |
getRecordStoreStream(javax.microedition.rms.RecordStore rs,
int index)
|
static java.io.InputStream |
getRecordStoreStream(java.lang.String url)
|
void |
handle(java.lang.String name,
java.lang.String url)
|
static boolean |
isRmsFile(java.lang.String url)
|
static int |
saveToRecordStore(java.io.InputStream is,
javax.microedition.rms.RecordStore rs)
|
static int |
saveToRecordStore(java.io.InputStream is,
java.lang.String url)
|
java.lang.String |
toString()
|
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, setTitle, size |
Methods inherited from class javax.microedition.lcdui.Displayable |
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, setCommandListener, sizeChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SimpleRmsBrowser
public SimpleRmsBrowser(java.lang.String title,
Utils.BreadCrumbTrail parent)
display
public void display(java.lang.String url,
int selectedIndex)
close
public void close()
- Specified by:
close
in interface Utils.ContentHandler
canHandle
public boolean canHandle(java.lang.String url)
- Specified by:
canHandle
in interface Utils.ContentHandler
handle
public void handle(java.lang.String name,
java.lang.String url)
- Specified by:
handle
in interface Utils.ContentHandler
isRmsFile
public static boolean isRmsFile(java.lang.String url)
- Returns:
- true if the URL points to a file, i.e. Record Store name + Index
commandAction
public void commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable s)
- Respond to commands
- Specified by:
commandAction
in interface javax.microedition.lcdui.CommandListener
getRecordStore
public static javax.microedition.rms.RecordStore getRecordStore(java.lang.String url,
boolean canCreate)
throws java.lang.Exception
- Callers must make sure to call closeRecordStore() !
- Throws:
java.lang.Exception
saveToRecordStore
public static int saveToRecordStore(java.io.InputStream is,
java.lang.String url)
throws java.io.IOException,
javax.microedition.rms.RecordStoreException,
java.lang.Exception
- Throws:
java.io.IOException
javax.microedition.rms.RecordStoreException
java.lang.Exception
saveToRecordStore
public static int saveToRecordStore(java.io.InputStream is,
javax.microedition.rms.RecordStore rs)
throws java.io.IOException,
javax.microedition.rms.RecordStoreException
- Throws:
java.io.IOException
javax.microedition.rms.RecordStoreException
getRecordStoreStream
public static java.io.InputStream getRecordStoreStream(java.lang.String url)
throws javax.microedition.rms.RecordStoreException,
java.lang.Exception
- Throws:
javax.microedition.rms.RecordStoreException
java.lang.Exception
getRecordStoreStream
public static java.io.InputStream getRecordStoreStream(javax.microedition.rms.RecordStore rs,
int index)
throws javax.microedition.rms.RecordStoreException,
java.lang.Exception
- Throws:
javax.microedition.rms.RecordStoreException
java.lang.Exception
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object