beautypg.com

Emulating abstract command button assignments – Sun Microsystems Computer Accessories User Manual

Page 48

background image

34

Wireless Toolkit Basic Customization Guide • December 2003

The MIDP implementation in the Wireless Toolkit allocates a command issued by
the application to a device button based on the following considerations:

1. The first consideration is the natural correspondence between the command’s

type and a input signal such as a button press. For example, if the BACK
command type is usually associated with the left soft button, then the
implementation first tries to assign it there. If there is no such preferred button
for a command type, this consideration is not relevant.

2. The secondary consideration is assignment of the remaining commands that

could not be assigned to their preferred buttons. The command precedence and
the command priority are used to assign these commands to alternate buttons or
to a command menu.

The J2ME Wireless Toolkit allows a variety of abstract command mapping policies
to be implemented. An emulated device can use a combination of soft buttons and
dedicated command buttons to implement abstract commands, or it can have none
of these and just present all abstract commands to the user in an on-screen menu.
The J2ME Wireless Toolkit includes examples of different configurations (see the
Wireless Toolkit User’s Guide).

Note –

The mapping policy for abstract commands can vary across actual devices.

For example, command type precedence may differ.

Emulating Abstract Command Button Assignments

The Emulator provides the device property file definitions

command.keys.<

command_type

>

and

command.menu.<

action

>

to emulate the

way a MIDP implementation on the corresponding real device assigns abstract
commands to buttons and menus.

You specify the button assignments following the considerations specified at the
end of the previous section:

1. Use the definitions

command.menu.activate

and

command.menu.<

action

>

to

assign the menu operations to buttons. See

“The Abstract Command Menu” on

page 37

.

OK

Standard positive answer to a dialog implemented by current
screen

SCREEN

Specifies an application-defined command that pertains to the
current screen, for example, "Load" and "Save"

ITEM

The command is specific to a particular item on the screen

HELP

Request for on-line help

TABLE 3

Abstract Command Types in Order of Precedence

Command Type

Description