TOC PREV NEXT INDEX



Commands


Command

The only item on the Commands palette is the Command. A Command is a way of expressing an action and the code to be performed when an action occurs on a screen of a MIDlet. Commands may execute arbitrary Java code before and after displaying new screens.

Commands have several properties which may be set on their property sheet. The label of a command is the suggested text which will be associated with the command. The type of command may also be set. The command type includes self-explanatory types like Back, Cancel, Ok, Help, Stop, and Exit. In addition, a command could be of type Item. This indicates that the Command relates to a specific item on the current screen. Finally, a command may be of type Screen, which indicates a command relates to the current screen. The MID-enabled device may display the command differently based on the command type. The Palm OS Platform generally displays commands as buttons at the bottom of the screen, and as options which can be chosen from a menu.

The Priority of a command may be set on its property sheet as well. The priority is used by the MID-enabled device to determine in what order to display commands of the same type. A lower number indicates a higher priority, with 1 being the highest priority.

A Command may be used to switch from one screen to another. The dropdown list on the property sheet has a list of all the displays which have been added to the current MIDlet. If none is chosen, then the command will not switch screens.

Each command has two code areas associated with it: Code before and Code after. These code areas are built-in, and cannot be removed. Unchecking the execute code checkboxes in the property sheet will hide the areas and prevent the code from executing. The code in these code areas will execute within the commandAction method of the MIDlet.


Data Representations, Inc.
http://www.datarepresentations.com
support@datarepresentations.com
sales@datarepresentations.com
TOC PREV NEXT INDEX