example.text
Class TextForm
java.lang.Object
javax.microedition.lcdui.Displayable
javax.microedition.lcdui.Screen
javax.microedition.lcdui.Form
example.text.TextForm
public class TextForm
- extends javax.microedition.lcdui.Form
A text viewer; the contents of the URL are read and displayed
in a form. The text is scanned for patterns that match HTTP
URLs. For example, "http://host/index.html". The non=URL
text is inserted in the form as Strings, the URL text is
inserted as Hyperlinks and the default SELECT command is
associated with the URL items. The itemCommandListener
is the TextViewer which will retrieve the URL and invoke it.
This class handles fetching the text from the URL and all
of the parsing operations.
Constructor Summary |
TextForm(TextViewer viewer,
java.lang.String title)
Create a new Text viewer and set the display. |
Method Summary |
(package private) void |
displayText(javax.microedition.content.Invocation invoc)
Display the contents of the URL in the Form. |
Methods inherited from class javax.microedition.lcdui.Form |
append, append, append, delete, deleteAll, get, getHeight, getWidth, insert, set, setItemStateListener, size |
Methods inherited from class javax.microedition.lcdui.Displayable |
addCommand, getTicker, getTitle, isShown, removeCommand, setCommandListener, setTicker, setTitle, sizeChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextForm
TextForm(TextViewer viewer,
java.lang.String title)
- Create a new Text viewer and set the display.
Check for a new Invocation; if there is one pending
skip the splash screen.
displayText
void displayText(javax.microedition.content.Invocation invoc)
- Display the contents of the URL in the Form.
The stream is read into a StringBuffer. It is scanned
for embedded http URLs. When a URL is found, the text
before the URL is entered as a StringItem.
The URL string is entered as a separate StringItem with
the attribute for URL.