logo
pix
SourceForge.net Logo
open source
created with vim
Valid XHTML 1.0!
Valid CSS!

AntMenu

Description

Provides a swing-based window with a series of links to other targets set out in a single column. The links are implemented by appropriately-labeled buttons.

Parameters

Attribute Description Required
title title of the form window and also set in a label at the top of the form. Defaults to Ant Controls No
image filepath of the image displayed alongside the title in the top panel of the menu. No
width Width of the form window in pixels No
height Height of the form window in pixels No
stylesheet filepath of a stylesheet to affect widget styles No
lookAndFeel Classname of a java look and feel implementation. The look and feel will carry over to other AntMenu tasks if not reset. No
icon The icon file to use (JPG, GIF, PNG). Valid only on Windows platforms. No
showwhenempty This boolean (true/false) specifies whether the form should be displayed if no nested widget is to be displayed. This can happen if there are no nested elements or if all of them are hidden due to their if/unless attributes.
Defaults to false.
No
loop This boolean (true/false) specifies whether the form should be shown again after action (ok, cancel, call target). It can be useful for a main window to which we come back after each action.
The loop is exited by clicking on a button (or menu) which has its loopexit attribute set to true.
Defaults to false.
No

Parameters specified as nested elements

ButtonBar

Provide a bar with a horizontal layout of buttons to other targets. This type has no attributes and is basically a holder for button types.

ButtonBar

Provide a bar with a horizontal layout of buttons to other targets. This type has no attributes and is basically a holder for button types.

link

Deprecated. Use button instead

button

Add a button that calls other target in the current Ant process.

Attribute Description Required
if specify a property that must be set for this widget to exist. No
unless specify a property that must NOT be set for this widget to exist. No
label Button label Yes
target Name of the target to call when clicking this button. Not used when type="reset" No
type Type of action performed when clicking on this button. Valid action types are:
  • ok: validate form properties and close window
  • cancel: do not validate form properties and close window
  • reset: reset form properties and keep window open
Default action is "ok".
No
background Wether to run the target in a separate thread or not. The ant project in which antform is used will not exit until the created thread is finished. Defaults to false No
newproject Wether to run the target in a separate project (as antcall does) or not. Setting this attribute to false allows to set properties in the called target that will be reusable in the calling target. Defaults to true (simulates antcall) No
focus Specifies that this widget should get the focus when the form is shown. If several widgets have this set to true, the first one will get the focus.
Defaults to false.
No
loopexit When set to true, clicking on this component will exit the form loop (see the loop attribute of antmenu/antform).
Defaults to false.
No

separator

Add a separator line to divide the form into sections.

label

Add a message box to the menu. Maps to a non-editable multiline text field with automatic line wrapping.The text content of the label tag sets the message text.

Attribute Description Required
if specify a property that must be set for this widget to exist. No
unless specify a property that must NOT be set for this widget to exist. No
width Width of the label in pixels No

antMenuItem

Provide a menu bound to the frame menu bar and recursively hosting other AntMenuItems, each of which links to an Ant target.

Attribute Description Required
if specify a property that must be set for this widget to exist. No
unless specify a property that must NOT be set for this widget to exist. No
target Name of the target to which the AntMenuItem links. No
name Label of the file menu item Yes
background Wether to run the target in a separate thread or not. The ant project in which antform is used will not exit until the created thread is finished. Defaults to false No
loopexit When set to true, clicking on this component will exit the form loop (see the loop attribute of antmenu/antform).
Defaults to false.
No

Examples

The following example generates a simple menu.


<antmenu image="doc/images/logo-small.jpg" 
	title="AntForm & AntMenu tests">
	<AntMenuItem name="AntMenu Tests">
		<AntMenuItem name="Mail-type form" target="test"/>
		<AntMenuItem name="Spinners & dateProperty test" target="spinners"/>
		<AntMenuItem name="Test non-editable properties" target="testne"/>
		<AntMenuItem name="Login & password test" target="password"/>
		<AntMenuItem name="AntForm with inner menu test" target="afm"/>
		<AntMenuItem name="Wizards test" target="wizard1"/>
	</AntMenuItem>				
	<AntMenuItem name="AntMenu tests">
		<AntMenuItem name="This test" target="testmenu"/>
	</AntMenuItem>				
	<label>A short label with a few explanatory words concerning the menu at hand.</label>
	<link label="Echo 1 target" target="echo1"/>
	<link label="Echo 2 target" target="echo2"/>
	<link label="Echo 3 target" target="echo3"/>			
	<link label="End" target="end"/>
</antmenu>

The AntForm Team - sardak@users.sourceforge.net- updated: 31/01/2009