1 package eu
.etaxonomy
.taxeditor
.prototype2
.model
;
3 import java
.util
.ArrayList
;
6 import org
.eclipse
.core
.databinding
.observable
.value
.IObservableValue
;
14 public class PropertySheetNode
{
16 private boolean editable
;
17 private List
<PropertySheetNode
> childProperties
;
18 private PropertySheetNode parentProperty
;
19 private String propertyField
;
20 private String propertyValue
;
21 private IObservableValue observeValue
;
23 public static boolean EDITABLE
= true;
24 public static boolean NOT_EDITABLE
= false;
26 public PropertySheetNode(String field
, String value
,
27 PropertySheetNode parent
, boolean editable
) {
28 this.propertyField
= field
;
29 this.propertyValue
= value
;
30 this.parentProperty
= parent
;
31 if (parent
!= null) parent
.addChildProperty(this);
32 this.editable
= editable
;
35 public PropertySheetNode(String field
, IObservableValue observeValue
,
36 PropertySheetNode parent
, boolean editable
) {
37 this(field
, (String
) observeValue
.getValue(), parent
, editable
);
38 this.observeValue
= observeValue
;
41 private void addChildProperty(PropertySheetNode childProperty
) {
42 if (childProperties
== null)
43 childProperties
= new ArrayList
<PropertySheetNode
>();
44 if (!childProperties
.contains(childProperty
))
45 childProperties
.add(childProperty
);
48 public boolean isEditable() {
52 public void setEditable(boolean editable
) {
53 this.editable
= editable
;
56 public String
getPropertyField() {
60 public void setPropertyField(String propertyField
) {
61 this.propertyField
= propertyField
;
64 public String
getPropertyValue() {
65 if (observeValue
!= null)
66 return (String
) observeValue
.getValue();
70 public void setPropertyValue(String propertyValue
) {
71 this.propertyValue
= propertyValue
;
74 public List
<PropertySheetNode
> getChildProperties() {
75 return childProperties
;
78 public void setChildProperties(List
<PropertySheetNode
> subProperties
) {
79 this.childProperties
= subProperties
;
82 public PropertySheetNode
getParentProperty() {
83 return parentProperty
;
86 public void setParentProperty(PropertySheetNode parentProperty
) {
87 this.parentProperty
= parentProperty
;
90 public IObservableValue
getObserveValue() {
91 return this.observeValue
;