source: vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/ViewItem.java@ 857

Last change on this file since 857 was 857, checked in by tobias, on Apr 1, 2010 at 7:02:55 PM

type dependent rendering added

File size: 2.7 KB
Line 
1package de.dass_it.vanhelsing.gui;
2
3import javax.faces.model.SelectItem;
4import de.dass_it.vanhelsing.gui.items.ItemType;
5import de.dass_it.vanhelsing.gui.items.UserObjectItem;
6
7public class ViewItem extends ItemType implements UserObjectItem {
8 private String key;
9 private String keyValue;
10 private String inputText;
11 private String selectOneMenu;
12 private String radioGroup;
13 private boolean necessary;
14 private String renderer;
15 private String dataType;
16 private SelectItem[] keyValueList;
17
18 public ViewItem(){
19 inputText = null;
20 selectOneMenu = null;
21 }
22
23 public boolean isNecessary() {
24 return necessary;
25 }
26
27 public void setNecessary(boolean necessary) {
28 this.necessary = necessary;
29 }
30
31 public String getRenderer() {
32 return renderer;
33 }
34
35 public void setRenderer(String renderer) {
36 this.renderer = renderer;
37 }
38
39 public String getDataType() {
40 return dataType;
41 }
42
43 public void setDataType(String dataType) {
44 this.dataType = dataType;
45 }
46
47
48 //Methoden aus ItemType für die Zuordnung von Änderungen
49 public int getResId(){
50 return super.getResId();
51 }
52 public void setResId(int id){
53 super.setResId(id);
54 }
55 public String getResType(){
56 return super.getResType();
57 }
58 public void setResType(String resType){
59 super.setResType(resType);
60 }
61 //eigene Felder für die Tabellenspalten
62 public void setKey(String key) {
63 this.key = key;
64 }
65
66 public String getKey() {
67 return key;
68 }
69
70 public String getKeyValue() {
71 return keyValue;
72 }
73
74 public void setKeyValue(String keyValue) {
75 this.keyValue = keyValue;
76 }
77
78 public void setInputText(String inputText) {
79 this.inputText = inputText;
80 }
81
82 public String getInputText() {
83 return inputText;
84 }
85
86 public void setSelectOneMenu(String selectOneMenu) {
87 this.selectOneMenu = selectOneMenu;
88 }
89
90 public String getSelectOneMenu() {
91 return selectOneMenu;
92 }
93
94 //TODO: RendererFlag überarbeiten
95 public void setRendererFlag(String r){
96 if (r.equals("inputText")) {
97 this.inputText = new String("bernd");
98 this.selectOneMenu = null;
99 this.radioGroup = null;
100 }
101 if (r.equals("selectOneMenu")){
102 this.selectOneMenu = new String("bernd"); //null;
103 this.inputText = null; //new String ("bernd");
104 this.radioGroup = null;
105 //KeyValuesList erzeugen
106 keyValueList = new SelectItem[3];
107 keyValueList[0] = new SelectItem("keyBernd","valueBernd");
108 keyValueList[1] = new SelectItem("keyHorst","valueHorst");
109 keyValueList[2] = new SelectItem("keyPeter","valuePeter");
110
111
112 }
113 if (r.equals("radioGroup")){
114 this.radioGroup = new String("bernd");
115 this.selectOneMenu = null;
116 this.inputText = null;
117 }
118 }
119
120 public SelectItem[] getKeyValueList() {
121 return keyValueList;
122 }
123
124 public void setKeyValueList(SelectItem[] keyValueList) {
125 this.keyValueList = keyValueList;
126 }
127}
Note: See TracBrowser for help on using the repository browser.