Statistics
| Revision:

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

History | View | Annotate | Download (1.3 kB)

1
package org.txm.rcpapplication.swt.widget.parameters;
2
import org.kohsuke.args4j.*
3
import groovy.transform.Field
4
import org.txm.rcpapplication.swt.widget.parameters.ParametersDialog
5

    
6
@Field @Option(name="file", usage="a file", widget="File", required=true, def="aFile.ext")
7
def file
8

    
9
@Field @Option(name="dir", usage="a directory", widget="Folder", def="TEMP")
10
def dir
11

    
12
@Field @Option(name="ii", usage="an integer", widget="Integer", def="42")
13
def ii = 0
14

    
15
@Field @Option(name="f", usage="a float", widget="Float", def="42.42")
16
def f = 0
17

    
18
@Field @Option(name="shs", usage="a one line string", widget="String", def="default value")
19
def shs = 0
20

    
21
@Field @Option(name="ls", usage="a very long string with carriage return and stuffs", widget="Text", def="default\nvalue")
22
def ls = 0
23

    
24
@Field @Option(name="q", usage="a CQL", widget="Query", def="\"je\"")
25
def q
26

    
27
@Field @Option(name="date", usage="a date", widget="Date", def="1984-09-01")
28
def date
29

    
30
@Field @Option(name="bool", usage="a boolean", widget="Boolean", def="true")
31
def bool
32

    
33
if (!ParametersDialog.open(this)) return;
34

    
35
println " RUNNING SCRIPT" //$NON-NLS-1$
36
println "file $file" //$NON-NLS-1$
37
println "dir $dir" //$NON-NLS-1$
38
println "ii $ii" //$NON-NLS-1$
39
println "f $f" //$NON-NLS-1$
40
println "shs $shs" //$NON-NLS-1$
41
println "ls $ls" //$NON-NLS-1$
42
println "q $q" //$NON-NLS-1$
43
println "date $date" //$NON-NLS-1$