TOC PREV NEXT INDEX



Separator


The Separator tag creates a separator between MenuItems. In most operating systems, the separator appears as a line.

Action

The Action tag tells Simplicity what to do when a menu item is chosen. It should be enclosed within MenuItem tags. There are two different ways to tell Simplicity what should be done. The command= command or the class= command can be used.

The command= command lets the user specify a command just as would normally be done from the command line of the operating system being used. Tabs can be used to separate parts of the command. The following command might be used to open Netscape on a machine running Windows:

command=C:/Netscape.exe

Windows normally uses the "\" character to separate directories. However, this character is used to denote escape sequences in Java. To use \s in the above example, the command would have to be command=C:\\Netscape.exe.

Even though the MacOS does not have a command line, command= will work to open programs with the MacOS. See the next section for an example.

The class= command can be used to have Simplicity open a class. The class to be opened must extend datarep.ide.config.Action. The actionPerformed(ActionEvent) method will be called when the menu item is chosen. There are two possible ways to use this command. One would be to create a new class which extends Action; the other would be to extend one of Simplicity's existing menu commands by extending that class. Examples of both will be given in the next section.

Any number of Action tags can be associated with a menuItem; they will be executed in sequential order. The </Action> tag is optional, because Action tags do not nest. Simplicity interprets the following sequence correctly as being two Actions associated with the menuItem "test": <menuItem label=test> <action command=command1> <action command=command2> </menuItem>


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