| java.lang.Object example.mmademo.Utils
All known Subclasses: example.mmademo.SimpleRmsBrowser, example.mmademo.SimplePlayerForm, example.mmademo.SimpleTones, example.mmademo.SimplePlayerCanvas, example.mmademo.SimpleHttpBrowser, example.mmademo.SimplePlayer,
Utils | public class Utils (Code) | | Utility functions and listener interfaces
version: 1.5 |
Inner Class :interface BreadCrumbTrail | |
Inner Class :interface ContentHandler | |
Inner Class :interface QueryListener | |
Inner Class :interface Interruptable | |
Field Summary | |
public static boolean | DEBUG |
Method Summary | |
public static void | FYI(String s, BreadCrumbTrail bct) | public static void | debugOut(String s) | public static void | debugOut(Throwable t) | public static void | error(Throwable t, BreadCrumbTrail bct) | public static void | error(String s, BreadCrumbTrail bct) | public static String | friendlyException(Throwable t) | public static String | guessContentType(String url) | public static String | mergeURL(String[] url) | public static void | query(String title, String def, int maxSize, QueryListener listener, BreadCrumbTrail bct) Prompts the user to enter a string.
Caution: this must be called in
a different Thread than the lcdui event dispatcher. | public static void | query(String title, String def, int maxSize, int constraints, QueryListener listener, BreadCrumbTrail bct) Prompts the user to enter a string. | public static void | sort(String[] elements) | public static String[] | splitURL(String url) splits the URL in the parts
E.g: http://www.12fb.com:80/Media/MIDI/fb.mid#1
0: protocol (e.g. |
DEBUG | public static boolean DEBUG(Code) | | |
FYI | public static void FYI(String s, BreadCrumbTrail bct)(Code) | | |
error | public static void error(String s, BreadCrumbTrail bct)(Code) | | |
friendlyException | public static String friendlyException(Throwable t)(Code) | | "javax.microedition.rms.RecordStoreException: Bla"
->
"RecordStoreException: Bla"
|
query | public static void query(String title, String def, int maxSize, QueryListener listener, BreadCrumbTrail bct)(Code) | | Prompts the user to enter a string.
Caution: this must be called in
a different Thread than the lcdui event dispatcher. Unfortunately !
Parameters: title - - title of the query window Parameters: def - - a default value that appears in the input field Parameters: maxSize - - max number of characters the entered text, or null if the user cancelled |
query | public static void query(String title, String def, int maxSize, int constraints, QueryListener listener, BreadCrumbTrail bct)(Code) | | Prompts the user to enter a string.
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.
Parameters: title - - title of the query window Parameters: def - - a default value that appears in the input field Parameters: maxSize - - max number of characters Parameters: constraints - - see javax.microedition.lcdui.TextBox Parameters: listener - - the QueryListener which receives the events |
splitURL | public static String[] splitURL(String url) throws Exception(Code) | | 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. /Media/MIDI)
4: file (e.g. fb.mid)
5: anchor (e.g. 1)
LIMITATION: URL must end with a slash if it is a directory
|
|
|