Line | |
---|
1 | package org.greenstone.admin.guiext;
|
---|
2 |
|
---|
3 | import org.w3c.dom.Element;
|
---|
4 |
|
---|
5 | public class Option
|
---|
6 | {
|
---|
7 | String _name = null;
|
---|
8 | String _id = null;
|
---|
9 | String _value = null;
|
---|
10 | OptionList _parent = null;
|
---|
11 |
|
---|
12 | public Option(Element optionElement, OptionList parent)
|
---|
13 | {
|
---|
14 | _parent = parent;
|
---|
15 |
|
---|
16 | if(optionElement != null){
|
---|
17 | _name = optionElement.getAttribute("label");
|
---|
18 | if(_name == null || _name.equals("")){
|
---|
19 | System.err.println("This option element does not have a label");
|
---|
20 | }
|
---|
21 |
|
---|
22 | _id = optionElement.getAttribute("id");
|
---|
23 | if(_id == null || _id.equals("")){
|
---|
24 | System.err.println("This option element does not have an id");
|
---|
25 | }
|
---|
26 |
|
---|
27 | _value = ExtXMLHelper.getValueFromSingleElement(optionElement, false);
|
---|
28 |
|
---|
29 | if(_value == null){
|
---|
30 | _value = "";
|
---|
31 | }
|
---|
32 | }
|
---|
33 | else{
|
---|
34 | System.err.println("This <" + ExtXMLHelper.OPTION + "> element is null");
|
---|
35 | }
|
---|
36 | }
|
---|
37 |
|
---|
38 | public String getName()
|
---|
39 | {
|
---|
40 | return _name;
|
---|
41 | }
|
---|
42 |
|
---|
43 | public String getValue()
|
---|
44 | {
|
---|
45 | return _value;
|
---|
46 | }
|
---|
47 |
|
---|
48 | public void setValue(String value)
|
---|
49 | {
|
---|
50 | _value = value;
|
---|
51 | }
|
---|
52 |
|
---|
53 | public String getId()
|
---|
54 | {
|
---|
55 | return _id;
|
---|
56 | }
|
---|
57 |
|
---|
58 | public OptionList getParent()
|
---|
59 | {
|
---|
60 | return _parent;
|
---|
61 | }
|
---|
62 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.