|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectexample.mmademo.Utils
public class Utils
Utility functions and listener interfaces
Nested Class Summary | |
---|---|
(package private) static interface |
Utils.BreadCrumbTrail
Interface to be implemented by classes that provide Back functionality. |
(package private) static interface |
Utils.ContentHandler
Interface implemented by classes that can handle (playback, display, etc.) url's. |
(package private) static interface |
Utils.Interruptable
Interface implemented by Displayable's that want to respond to the MIDlet's startApp() and pauseApp() calls. |
(package private) static interface |
Utils.QueryListener
Interface that is implemented by classes that use the query() functions. |
Field Summary | |
---|---|
static boolean |
DEBUG
|
Method Summary | |
---|---|
static void |
debugOut(java.lang.String s)
|
static void |
debugOut(java.lang.Throwable t)
|
static void |
error(java.lang.String s,
Utils.BreadCrumbTrail bct)
|
static void |
error(java.lang.Throwable t,
Utils.BreadCrumbTrail bct)
|
static java.lang.String |
friendlyException(java.lang.Throwable t)
"javax.microedition.rms.RecordStoreException: Bla" -> "RecordStoreException: Bla" |
static void |
FYI(java.lang.String s,
Utils.BreadCrumbTrail bct)
|
static java.lang.String |
guessContentType(java.lang.String url)
|
static java.lang.String |
mergeURL(java.lang.String[] url)
|
static void |
query(java.lang.String title,
java.lang.String def,
int maxSize,
int constraints,
Utils.QueryListener listener,
Utils.BreadCrumbTrail bct)
Prompts the user to enter a string. |
static void |
query(java.lang.String title,
java.lang.String def,
int maxSize,
Utils.QueryListener listener,
Utils.BreadCrumbTrail bct)
Prompts the user to enter a string. |
static void |
sort(java.lang.String[] elements)
|
static java.lang.String[] |
splitURL(java.lang.String url)
splits the URL in the parts E.g: http://www.12fb.com:80/Media/MIDI/fb.mid#1 0: protocol (e.g. http) 1: host (e.g. www.12fb.com) 2: port (e.g. 80) 3: path (e.g. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean DEBUG
Method Detail |
---|
public static void debugOut(java.lang.String s)
public static void debugOut(java.lang.Throwable t)
public static void error(java.lang.Throwable t, Utils.BreadCrumbTrail bct)
public static void error(java.lang.String s, Utils.BreadCrumbTrail bct)
public static void FYI(java.lang.String s, Utils.BreadCrumbTrail bct)
public static java.lang.String friendlyException(java.lang.Throwable t)
public static void query(java.lang.String title, java.lang.String def, int maxSize, Utils.QueryListener listener, Utils.BreadCrumbTrail bct)
Caution: this must be called in a different Thread than the lcdui event dispatcher. Unfortunately !
title
- - title of the query windowdef
- - a default value that appears in the input fieldmaxSize
- - max number of characterslistener
- -bct
- -public static void query(java.lang.String title, java.lang.String def, int maxSize, int constraints, Utils.QueryListener listener, Utils.BreadCrumbTrail bct)
When the user finished entering the text,
the listener
's methods are called.
If the user pressed the OK button, the
listener
's queryOK
method
is called with the entered text as parameter.
The listener
need not care about hiding the displayable.
title
- - title of the query windowdef
- - a default value that appears in the input fieldmaxSize
- - max number of charactersconstraints
- - see javax.microedition.lcdui.TextBoxlistener
- - the QueryListener which receives the eventspublic static java.lang.String[] splitURL(java.lang.String url) throws java.lang.Exception
java.lang.Exception
public static java.lang.String mergeURL(java.lang.String[] url)
public static java.lang.String guessContentType(java.lang.String url) throws java.lang.Exception
java.lang.Exception
public static void sort(java.lang.String[] elements)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |