Statistics
| Revision:

root / tmp / org.txm.rcp / src / main / java / org / txm / rcp / swt / widget / parameters / AScript.groovy @ 1448

History | View | Annotate | Download (1.3 kB)

1 388 sjacqu01
package org.txm.rcp.swt.widget.parameters;
2 388 sjacqu01
import org.kohsuke.args4j.*
3 388 sjacqu01
import groovy.transform.Field
4 388 sjacqu01
import org.txm.rcp.swt.widget.parameters.ParametersDialog
5 388 sjacqu01
6 388 sjacqu01
@Field @Option(name="file", usage="a file", widget="File", required=true, def="aFile.ext")
7 388 sjacqu01
def file
8 388 sjacqu01
9 388 sjacqu01
@Field @Option(name="dir", usage="a directory", widget="Folder", def="TEMP")
10 388 sjacqu01
def dir
11 388 sjacqu01
12 388 sjacqu01
@Field @Option(name="ii", usage="an integer", widget="Integer", def="42")
13 388 sjacqu01
def ii = 0
14 388 sjacqu01
15 388 sjacqu01
@Field @Option(name="f", usage="a float", widget="Float", def="42.42")
16 388 sjacqu01
def f = 0
17 388 sjacqu01
18 388 sjacqu01
@Field @Option(name="shs", usage="a one line string", widget="String", def="default value")
19 388 sjacqu01
def shs = 0
20 388 sjacqu01
21 388 sjacqu01
@Field @Option(name="ls", usage="a very long string with carriage return and stuffs", widget="Text", def="default\nvalue")
22 388 sjacqu01
def ls = 0
23 388 sjacqu01
24 388 sjacqu01
@Field @Option(name="q", usage="a CQL", widget="Query", def="\"je\"")
25 388 sjacqu01
def q
26 388 sjacqu01
27 388 sjacqu01
@Field @Option(name="date", usage="a date", widget="Date", def="1984-09-01")
28 388 sjacqu01
def date
29 388 sjacqu01
30 388 sjacqu01
@Field @Option(name="bool", usage="a boolean", widget="Boolean", def="true")
31 388 sjacqu01
def bool
32 388 sjacqu01
33 388 sjacqu01
if (!ParametersDialog.open(this)) return;
34 388 sjacqu01
35 388 sjacqu01
println " RUNNING SCRIPT" //$NON-NLS-1$
36 388 sjacqu01
println "file $file" //$NON-NLS-1$
37 388 sjacqu01
println "dir $dir" //$NON-NLS-1$
38 388 sjacqu01
println "ii $ii" //$NON-NLS-1$
39 388 sjacqu01
println "f $f" //$NON-NLS-1$
40 388 sjacqu01
println "shs $shs" //$NON-NLS-1$
41 388 sjacqu01
println "ls $ls" //$NON-NLS-1$
42 388 sjacqu01
println "q $q" //$NON-NLS-1$
43 388 sjacqu01
println "date $date" //$NON-NLS-1$