Ant-contrib.unkrig.de: Difference between revisions

From unkrig.de
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:
== Tasks ==
== Tasks ==


=== <de.unkrig.ant-contrib.swing-dialog> ===
=== <de.unkrig.ant-contrib.swingdialog> ===


Pops up a highly configurable dialog and invites the user to fill in form fields:
Pops up a highly configurable dialog and invites the user to fill in form fields.
 
This task will fail iff the CANCEL button is pressed or the dialog is closed, except if '<ifCancelTask>'s (or '<ifClosedTask>'s, respectively) are configured.


[[File:swing-dialog.png]]
[[File:swing-dialog.png]]


==== '''Attributes''' ====
==== '''Attributes''' ====
;title="FTP upload of update site": The text to be displayed in the title bar of the dialog.
;title="FTP upload of update site" (optional): The text to be displayed in the title bar of the dialog.
;optionType="...": DEFAULT (an 'OK' button), YES_NO, YES_NO_CANCEL, OK_CANCEL (the default)
;optionType="..." (optional): DEFAULT (an 'OK' button), YES_NO, YES_NO_CANCEL, OK_CANCEL (the default): Determines which buttons are displayed in the dialog.
;messageType="...": ERROR, INFORMATION, WARNING, QUESTION, PLAIN (the default)
;messageType="..." (optional): ERROR, INFORMATION, WARNING, QUESTION, PLAIN (the default): If not set to PLAIN, then a respective icon is displayed in the dialog.
;property="...": The named property will be set to YES, NO, CANCEL, OK or CLOSED when the task completes. If this attribute is not set, then the build will only continue iff the YES or OK button was pressed.
;property="..." (optional): The named property will be set to YES, NO, CANCEL, OK or CLOSED when the task completes.


==== '''Subelements''' ====
==== '''Subelements''' ====
<'''label''' text="User ID:"/>
;<label text="User ID"/> (zero or more)
: Displays the given text.
: Displays the given text.


<'''text''' property="ftp.userid" defaultvalue="www.unkrig.de"/>
;<text property="ftp.userid" defaultvalue="www.unkrig.de"/> (zero or more)
: A one-line text input field with an (optional) default value. On return, the named property is set to the text of the field. Iff 'secure="true"' is given, then characters entered into the field are not echoed.
: A one-line text input field with an (optional) default value. On return, the named property is set to the text of the field. Iff 'secure="true"' is given, then characters entered into the field are not echoed.


<'''checkbox''' text="Use passive FTP" property="ftp.passive" defaultvalue="true"/>
;<checkbox text="Use passive FTP" property="ftp.passive" defaultvalue="true"/> (zero or more)
: A checkbox with a label. On return, the named property is set to 'true' iff the box is checked. Iff 'defaultvalue="true"' is given, then the checkbox is pre-selected.
: A checkbox with a label. On return, the named property is set to 'true' iff the box is checked. Iff 'defaultvalue="true"' is given, then the checkbox is pre-selected.
;<ifYes>, <ifNo>, <ifCancel>, <ifOk>, <ifClosed> (at most one of each)
:These can have task subelements, which are executed iff the respective dialog button is pressed (<ifYes>, <ifNo>, <ifCancel>, <ifOk>) or the dialog is closed (<ifClosed>).


== Download and installation ==
== Download and installation ==

Revision as of 16:31, 11 November 2013

Abstract

Some contributions to APACHE ANT, e.g. the 'de.unkrig.ant-contrib.swing-dialog' task which significantly enhances ANT's <input> task.

Tasks

<de.unkrig.ant-contrib.swingdialog>

Pops up a highly configurable dialog and invites the user to fill in form fields.

This task will fail iff the CANCEL button is pressed or the dialog is closed, except if '<ifCancelTask>'s (or '<ifClosedTask>'s, respectively) are configured.

Swing-dialog.png

Attributes

title="FTP upload of update site" (optional)
The text to be displayed in the title bar of the dialog.
optionType="..." (optional)
DEFAULT (an 'OK' button), YES_NO, YES_NO_CANCEL, OK_CANCEL (the default): Determines which buttons are displayed in the dialog.
messageType="..." (optional)
ERROR, INFORMATION, WARNING, QUESTION, PLAIN (the default): If not set to PLAIN, then a respective icon is displayed in the dialog.
property="..." (optional)
The named property will be set to YES, NO, CANCEL, OK or CLOSED when the task completes.

Subelements

<label text="User ID"/> (zero or more)
Displays the given text.
<text property="ftp.userid" defaultvalue="www.unkrig.de"/> (zero or more)
A one-line text input field with an (optional) default value. On return, the named property is set to the text of the field. Iff 'secure="true"' is given, then characters entered into the field are not echoed.
<checkbox text="Use passive FTP" property="ftp.passive" defaultvalue="true"/> (zero or more)
A checkbox with a label. On return, the named property is set to 'true' iff the box is checked. Iff 'defaultvalue="true"' is given, then the checkbox is pre-selected.
<ifYes>, <ifNo>, <ifCancel>, <ifOk>, <ifClosed> (at most one of each)
These can have task subelements, which are executed iff the respective dialog button is pressed (<ifYes>, <ifNo>, <ifCancel>, <ifOk>) or the dialog is closed (<ifClosed>).

Download and installation

The JAR file can be downloaded from http://ant-contrib.unkrig.de/download/.

To make the contributions available in your ANT scripts, write

<taskdef resource="de/unkrig/antcontrib/ant.xml" classpath="lib/de.unkrig.ant-contrib.jar"/>

, or, if you put the JAR file on ANT's default classpath, just

<taskdef resource="de/unkrig/antcontrib/ant.xml"/>

Source code

The source code is available in the SUBVERSION repository. The repository URL is

https://svn.code.sf.net/p/loggifier/code

License

ANT-CONTRIB is published under the "New BSD License".