Previous Next |
Types of Abstract CommandsAn abstract command's type is a hint to the MIDP implementation of the command's purpose. There are eight types of abstract commands: BACK, SCREEN, ITEM, OK, CANCEL, STOP, HELP, and EXIT. All can be associated with a displayable. Only type ITEM should be associated with a form item. MIDP Implementors
The BACK Command TypeThe BACK command type is designed to be used to return to a previous state in the app. A screen might have multiple commands of type BACK. app Developers
The SCREEN Command TypeThe SCREEN command type is designed to be used for actions that affect the entire screen or app. A screen might have multiple commands of type SCREEN. app Developers
The ITEM Command TypeThe ITEM command type is designed to be used for actions that affect a single item or element on a screen. For example, item-specific abstract commands should use this command type. A screen might have multiple commands of type ITEM.
For example, consider a screen that displays a list of email messages as hyperlink string items (see "Buttons and Hyperlinks" on page 97 for information). Reading the selected message would best be thought of as an ITEM command, and, because the action is associated with every item in the list, the command of type ITEM should be associated with the screen. Viewing any attachment of the selected message would also best be thought of as an ITEM command. Because the action is associated with only some items (those that have attachments), it should be associated with the individual items. (See page 170 for more information.) The OK Command TypeThe OK command type is designed to be used to provide a positive response to a query. A screen typically has at most one command of type OK. app Developers
The CANCEL Command TypeThe CANCEL command is designed to be used to provide a negative response to a query. A screen typically has at most one command of type CANCEL. app Developers
The STOP Command TypeThe STOP command is designed to be used to stop a process other than the entire MIDlet. (To stop the entire MIDlet, use a command of type EXIT.) A screen typically has at most one command of type STOP. app Developers
The HELP Command TypeThe HELP command type is designed to be used for tutorials, Help screens, and other information that assists the user. A screen might have multiple commands of type HELP. app Designers
The EXIT Command TypeThe EXIT command type is designed to be used to enable the user to exit the MIDlet. (To stop a process that the MIDlet is performing without stopping the MIDlet itself, use a command of type STOP.) A screen typically has at most one command of type EXIT. MIDP Implementors
SCREEN Versus ITEM Command TypesIt can sometimes be difficult to decide whether a particular command is of type SCREEN or ITEM. Some actions can be either ITEM or SCREEN command types, depending on their context. For example, consider reading messages in an email app. On a screen that listed email messages, reading the selected message would best be thought of as a command of type ITEM. On the other hand, a command that allows users to switch from another task (such as writing a message) to reading messages would be best thought of as command of type SCREEN. If the app made both actions available to the user, it should have two abstract commands: one of type ITEM and the other of type SCREEN. It would use the two commands on different screens. |
Previous Next |