KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectstyle > cayenne > modeler > dialog > classgen > ClassGeneratorEntityWrapper


1 package org.objectstyle.cayenne.modeler.dialog.classgen;
2
3 import org.objectstyle.cayenne.map.ObjEntity;
4
5 /**
6  * @author Andrei Adamchik
7  */

8 public class ClassGeneratorEntityWrapper {
9     protected ObjEntity entity;
10     protected boolean selected;
11     protected String JavaDoc validationMessage;
12     
13     public ClassGeneratorEntityWrapper(ObjEntity entity, boolean selected) {
14         this(entity, selected, null);
15     }
16     
17     public ClassGeneratorEntityWrapper(ObjEntity entity, boolean selected, String JavaDoc validationMessage) {
18         this.entity = entity;
19         this.selected = selected;
20         this.validationMessage = validationMessage;
21     }
22     
23     /**
24      * Returns the entity.
25      * @return ObjEntity
26      */

27     public ObjEntity getEntity() {
28         return entity;
29     }
30
31     /**
32      * Returns the selected.
33      * @return boolean
34      */

35     public boolean isSelected() {
36         return selected;
37     }
38
39     /**
40      * Sets the entity.
41      * @param entity The entity to set
42      */

43     public void setEntity(ObjEntity entity) {
44         this.entity = entity;
45     }
46
47     /**
48      * Sets the selected.
49      * @param selected The selected to set
50      */

51     public void setSelected(boolean selected) {
52         this.selected = selected;
53     }
54     
55     /**
56      * Returns the enabled.
57      * @return boolean
58      */

59     public boolean isEnabled() {
60         return validationMessage == null;
61     }
62     
63     /**
64      * Returns the validationMessage.
65      * @return String
66      */

67     public String JavaDoc getValidationMessage() {
68         return validationMessage;
69     }
70
71     /**
72      * Sets the validationMessage.
73      * @param validationMessage The validationMessage to set
74      */

75     public void setValidationMessage(String JavaDoc validationMessage) {
76         this.validationMessage = validationMessage;
77     }
78 }
79
Popular Tags