[848] | 1 | package de.dass_it.vanhelsing.gui;
|
---|
| 2 |
|
---|
[857] | 3 | import javax.faces.model.SelectItem;
|
---|
[848] | 4 | import de.dass_it.vanhelsing.gui.items.ItemType;
|
---|
| 5 | import de.dass_it.vanhelsing.gui.items.UserObjectItem;
|
---|
[865] | 6 | /**
|
---|
| 7 | * The class ViewItem is used for the visualization of a SimpleResource object.
|
---|
| 8 | * Rendered SimpleResources are ArrayLists of ViewItem objects.
|
---|
| 9 | * @author tgoecke
|
---|
| 10 | *
|
---|
| 11 | */
|
---|
[848] | 12 | public class ViewItem extends ItemType implements UserObjectItem {
|
---|
| 13 | private String key;
|
---|
[849] | 14 | private String keyValue;
|
---|
[858] | 15 | private boolean required;
|
---|
[856] | 16 | private String renderer;
|
---|
| 17 | private String dataType;
|
---|
[857] | 18 | private SelectItem[] keyValueList;
|
---|
[862] | 19 |
|
---|
| 20 | private String inputText;
|
---|
| 21 | private String selectOneMenu;
|
---|
| 22 | private String radioGroup;
|
---|
[848] | 23 | public ViewItem(){
|
---|
[856] | 24 | inputText = null;
|
---|
| 25 | selectOneMenu = null;
|
---|
[862] | 26 | radioGroup = null;
|
---|
[848] | 27 | }
|
---|
| 28 |
|
---|
[858] | 29 | public boolean getRequired() {
|
---|
| 30 | return required;
|
---|
[856] | 31 | }
|
---|
| 32 |
|
---|
[858] | 33 | public void setRequired(boolean required) {
|
---|
| 34 | this.required = required;
|
---|
[856] | 35 | }
|
---|
| 36 |
|
---|
| 37 | public String getRenderer() {
|
---|
| 38 | return renderer;
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | public void setRenderer(String renderer) {
|
---|
| 42 | this.renderer = renderer;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | public String getDataType() {
|
---|
| 46 | return dataType;
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | public void setDataType(String dataType) {
|
---|
| 50 | this.dataType = dataType;
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 |
|
---|
[848] | 54 | public int getResId(){
|
---|
| 55 | return super.getResId();
|
---|
| 56 | }
|
---|
| 57 | public void setResId(int id){
|
---|
| 58 | super.setResId(id);
|
---|
| 59 | }
|
---|
| 60 | public String getResType(){
|
---|
| 61 | return super.getResType();
|
---|
| 62 | }
|
---|
| 63 | public void setResType(String resType){
|
---|
| 64 | super.setResType(resType);
|
---|
| 65 | }
|
---|
| 66 | //eigene Felder für die Tabellenspalten
|
---|
| 67 | public void setKey(String key) {
|
---|
| 68 | this.key = key;
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | public String getKey() {
|
---|
| 72 | return key;
|
---|
| 73 | }
|
---|
| 74 |
|
---|
[849] | 75 | public String getKeyValue() {
|
---|
| 76 | return keyValue;
|
---|
[848] | 77 | }
|
---|
| 78 |
|
---|
[849] | 79 | public void setKeyValue(String keyValue) {
|
---|
| 80 | this.keyValue = keyValue;
|
---|
[848] | 81 | }
|
---|
[856] | 82 |
|
---|
| 83 | public void setInputText(String inputText) {
|
---|
| 84 | this.inputText = inputText;
|
---|
| 85 | }
|
---|
| 86 |
|
---|
| 87 | public String getInputText() {
|
---|
| 88 | return inputText;
|
---|
| 89 | }
|
---|
| 90 |
|
---|
| 91 | public void setSelectOneMenu(String selectOneMenu) {
|
---|
| 92 | this.selectOneMenu = selectOneMenu;
|
---|
| 93 | }
|
---|
| 94 |
|
---|
| 95 | public String getSelectOneMenu() {
|
---|
| 96 | return selectOneMenu;
|
---|
| 97 | }
|
---|
[865] | 98 | /**
|
---|
| 99 | * Set the string property of the intended render type to the value of the none empty string "bernd"
|
---|
| 100 | * @param r valid inputs are inputText, selectOneMenu and radioGroup
|
---|
| 101 | */
|
---|
[856] | 102 | public void setRendererFlag(String r){
|
---|
| 103 | if (r.equals("inputText")) {
|
---|
| 104 | this.inputText = new String("bernd");
|
---|
| 105 | }
|
---|
| 106 | if (r.equals("selectOneMenu")){
|
---|
[857] | 107 | this.selectOneMenu = new String("bernd"); //null;
|
---|
| 108 | }
|
---|
| 109 | if (r.equals("radioGroup")){
|
---|
| 110 | this.radioGroup = new String("bernd");
|
---|
[856] | 111 | }
|
---|
| 112 | }
|
---|
[865] | 113 | /**
|
---|
| 114 | * Key-Value-Pairs for the SelectOneMenu
|
---|
| 115 | * @return an array of key value pairs as an SelectItem object array
|
---|
| 116 | */
|
---|
[857] | 117 | public SelectItem[] getKeyValueList() {
|
---|
| 118 | return keyValueList;
|
---|
| 119 | }
|
---|
[865] | 120 | /**
|
---|
| 121 | *
|
---|
| 122 | * @param keyValueList
|
---|
| 123 | */
|
---|
[857] | 124 | public void setKeyValueList(SelectItem[] keyValueList) {
|
---|
| 125 | this.keyValueList = keyValueList;
|
---|
| 126 | }
|
---|
[848] | 127 | }
|
---|