KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > designer > components > CopyDC


1 /*
2  * (c) Rob Gordon 2005.
3  */

4 package org.oddjob.designer.components;
5
6 import org.oddjob.designer.elements.FilesDE;
7 import org.oddjob.designer.elements.InputDE;
8 import org.oddjob.designer.elements.ListDE;
9 import org.oddjob.designer.elements.OutputDE;
10 import org.oddjob.designer.elements.simple.FileAttribute;
11 import org.oddjob.designer.factory.DesignFactory;
12 import org.oddjob.designer.model.ElementField;
13 import org.oddjob.designer.model.FieldGroup;
14 import org.oddjob.designer.model.FieldSelection;
15 import org.oddjob.designer.model.FileSelection;
16 import org.oddjob.designer.model.FormDefinition;
17 import org.oddjob.designer.model.StandardForm;
18
19 /**
20  *
21  */

22 public class CopyDC extends BaseDC {
23
24     private ListDE from = new ListDE();
25     private FileAttribute to = new FileAttribute();
26     private InputDE input = new InputDE();
27     private OutputDE output = new OutputDE();
28             
29     public FormDefinition form() {
30         return
31             new StandardForm(tag())
32             .addGroup(basePanel())
33             .addGroup(new FieldGroup("From")
34                     .add(new FieldSelection()
35                         .add(new ElementField("File(s)/Dir(s)", from))
36                         .add(new ElementField("Input", input))))
37             .addGroup(new FieldGroup("To")
38                     .add(new FieldSelection()
39                             .add(new FileSelection("File/Dir", to))
40                             .add(new ElementField("Output", output))));
41     }
42         
43     public void setFrom(ListDE from) {
44         from.supportedTypes(DesignFactory.supportedTypes(FilesDE.class));
45         this.from = from;
46     }
47     
48     public ListDE getFrom() {
49         return from;
50     }
51     
52     public void setTo(FileAttribute to) {
53         this.to = to;
54     }
55     
56     public FileAttribute getTo() {
57         return to;
58     }
59     
60     /**
61      * @return Returns the input.
62      */

63     public InputDE getInput() {
64         return input;
65     }
66     /**
67      * @param input The input to set.
68      */

69     public void setInput(InputDE input) {
70         this.input = input;
71     }
72     /**
73      * @return Returns the output.
74      */

75     public OutputDE getOutput() {
76         return output;
77     }
78     /**
79      * @param output The output to set.
80      */

81     public void setOutput(OutputDE output) {
82         this.output = output;
83     }
84 }
85
Popular Tags