|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.microedition.lcdui.Displayable
javax.microedition.lcdui.Screen
javax.microedition.lcdui.Form
com.nokia.midp.examples.lcdui.helloworldplus.TextScreen
The TextScreen class displays a message on the screen.
This class extends the Form class and uses an instance of StringItem to display the text message. The Form with StringItem implementation was chosen because it allows a non-editable text message to be written onto the screen.
The text message can set via the constructor and setCurrentText() method.
| Field Summary | |
private static javax.microedition.lcdui.Command |
CMD_EDIT
Command specified to initiate the launch of the TextEditor screen. |
private static javax.microedition.lcdui.Command |
CMD_EXIT
Command specified to initiate the termination of the MIDlet. |
private static int |
COMMAND_PRIORITY
Priority of commands relative to others of the same type. |
private HelloWorldPlusMIDlet |
midlet
Reference to the parent MIDlet class enabling this class to access the callback methods provided by HelloWorldMIDlet. |
private javax.microedition.lcdui.StringItem |
stringItem
Reference to the string item added to the form for displaying a message. |
| Fields inherited from class javax.microedition.lcdui.Form |
|
| Fields inherited from class javax.microedition.lcdui.Displayable |
|
| Constructor Summary | |
(package private) |
TextScreen(HelloWorldPlusMIDlet midlet,
java.lang.String message)
The constructor initializes the class making it ready for use. |
| Method Summary | |
void |
commandAction(javax.microedition.lcdui.Command cmd,
javax.microedition.lcdui.Displayable source)
Handles commands received. |
java.lang.String |
getCurrentText()
Returns the text currently displayed |
void |
setCurrentText(java.lang.String message)
Sets the text to be displayed. |
| 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 |
| Field Detail |
private javax.microedition.lcdui.StringItem stringItem
private final HelloWorldPlusMIDlet midlet
private static final int COMMAND_PRIORITY
private static final javax.microedition.lcdui.Command CMD_EXIT
private static final javax.microedition.lcdui.Command CMD_EDIT
| Constructor Detail |
TextScreen(HelloWorldPlusMIDlet midlet,
java.lang.String message)
It initializes the reference to the parent MIDlet class with the paramater
value 'midlet'.
It creates an instance of the class ItemString and initializes it with
the parameter value 'message'.
It appends the created instance of ItemString to the form.
It adds the Command objects defined to the command handling framework.
It calls setCommandListener() to register itself with the command framework
as the command listener and will be notified when a command is activated.
midlet - is a reference to the parent MIDlet. Enables callback to parent object.message - sets displayed text.| Method Detail |
public void setCurrentText(java.lang.String message)
public java.lang.String getCurrentText()
public void commandAction(javax.microedition.lcdui.Command cmd,
javax.microedition.lcdui.Displayable source)
The CMD_EXIT command initiates the termination of the MIDlet. The method handles this command by calling the parent method exitRequested().
The CMD_EDIT command initiates the launch of the TextEditor screen. The method handles this command by calling the parent method textEditorRequested().
commandAction in interface javax.microedition.lcdui.CommandListenercmd - is the identity of command received from the framework.source - is the identity of the UI area displayed which generated the
command.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||