example.text
Class TextViewer

java.lang.Object
  extended by javax.microedition.midlet.MIDlet
      extended by example.text.TextViewer
All Implemented Interfaces:
java.lang.Runnable, javax.microedition.lcdui.CommandListener, javax.microedition.lcdui.ItemCommandListener

public class TextViewer
extends javax.microedition.midlet.MIDlet
implements javax.microedition.lcdui.CommandListener, javax.microedition.lcdui.ItemCommandListener, java.lang.Runnable

A text viewer.


Field Summary
(package private)  javax.microedition.content.Registry registry
          The registry for access to invocations and responses.
 
Constructor Summary
TextViewer()
          Create a new Text viewer and set the display.
 
Method Summary
 void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable s)
          Respond to commands
 void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Item item)
          Handle selection of URL item.
protected  void destroyApp(boolean forced)
          MIDlet is being destroyed.
protected  void pauseApp()
           
 void run()
          Pickup the responses to previous Invocations.1
(package private)  void setupFavorites()
          Show the favorites screen.
(package private)  void show(javax.microedition.content.Invocation invoc)
          Received a new Invocation, display the contents of the URL in the Form.
(package private)  void showAlert(java.lang.String message)
          Show an alert with an error message.
protected  void startApp()
          Nothing to do, display already set
 
Methods inherited from class javax.microedition.midlet.MIDlet
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

registry

javax.microedition.content.Registry registry
The registry for access to invocations and responses.

Constructor Detail

TextViewer

public TextViewer()
Create a new Text viewer and set the display. Check for a new Invocation; if there is one pending skip the splash screen.

Method Detail

startApp

protected void startApp()
Nothing to do, display already set

Specified by:
startApp in class javax.microedition.midlet.MIDlet

pauseApp

protected void pauseApp()
Specified by:
pauseApp in class javax.microedition.midlet.MIDlet

destroyApp

protected void destroyApp(boolean forced)
MIDlet is being destroyed. Signal the Invocation handling thread to exit.

Specified by:
destroyApp in class javax.microedition.midlet.MIDlet
Parameters:
forced - to exit; this midlet always cooperates

show

void show(javax.microedition.content.Invocation invoc)
Received a new Invocation, display the contents of the URL in the Form. Called from TextInvocation in its thread; so it is ok to take a while to process

Parameters:
invoc - the new ACTIVE invocation.

showAlert

void showAlert(java.lang.String message)
Show an alert with an error message.

Parameters:
message - the message to show

setupFavorites

void setupFavorites()
Show the favorites screen.


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
Parameters:
c - the command invoked
s - the screen with the command

commandAction

public void commandAction(javax.microedition.lcdui.Command c,
                          javax.microedition.lcdui.Item item)
Handle selection of URL item. Follow the link by invoking the URL.

Specified by:
commandAction in interface javax.microedition.lcdui.ItemCommandListener
Parameters:
c - the command
item - the Item to which the command applies

run

public void run()
Pickup the responses to previous Invocations.1

Specified by:
run in interface java.lang.Runnable