KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > designer > elements > FilesDE


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

4 package org.oddjob.designer.elements;
5
6 import org.oddjob.arooa.ArooaContext;
7 import org.oddjob.arooa.ArooaHandler;
8 import org.oddjob.designer.arooa.DesignSkipHandler;
9 import org.oddjob.designer.elements.simple.SimpleTextAttribute;
10 import org.oddjob.designer.model.DesignDefinition;
11 import org.oddjob.designer.model.DesignElementAttribute;
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.MultiTypeTable;
16
17 /**
18  *
19  */

20 public class FilesDE extends DesignElementAttribute {
21
22     private ListDE filesList;
23     private SimpleTextAttribute filesAttribute;
24     
25     public FilesDE() {
26         setFiles(new SimpleTextAttribute());
27         addValueFiles(new ListDE());
28     }
29     
30     public DesignDefinition detail() {
31         return new FieldGroup("Files")
32             .add(new FieldSelection()
33                 .add(new ElementField("File Spec", filesAttribute))
34                 .add(new MultiTypeTable("File List", filesList).setNamed(false)));
35     }
36
37     public void setFiles(SimpleTextAttribute files) {
38         files.addObserver(detailObserver);
39         this.filesAttribute = files;
40     }
41
42     public SimpleTextAttribute getFiles() {
43         return filesAttribute;
44     }
45
46     public void addValueFiles(ListDE filesList) {
47         filesList.addObserver(detailObserver);
48         filesList.supportedTypes(supportedTypes());
49         this.filesList = filesList;
50     }
51     
52     public ArooaHandler handlerForFiles(ArooaContext context) {
53         return new DesignSkipHandler(new ListDE());
54     }
55     
56     public Object JavaDoc elementFiles() {
57         return filesList;
58     }
59     
60     public void clear() {
61         filesAttribute.clear();
62         filesList.clear();
63         super.clear();
64     }
65     
66 }
67
Popular Tags