[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 |
|
---|
[871] | 20 | private boolean inputText;
|
---|
| 21 | private boolean selectOneMenu;
|
---|
| 22 | private boolean radioGroup;
|
---|
[848] | 23 | public ViewItem(){
|
---|
[871] | 24 | inputText = false;
|
---|
| 25 | selectOneMenu = false;
|
---|
| 26 | radioGroup = false;
|
---|
[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 String getDataType() {
|
---|
| 42 | return dataType;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | public void setDataType(String dataType) {
|
---|
| 46 | this.dataType = dataType;
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 |
|
---|
[848] | 50 | public int getResId(){
|
---|
| 51 | return super.getResId();
|
---|
| 52 | }
|
---|
| 53 | public void setResId(int id){
|
---|
| 54 | super.setResId(id);
|
---|
| 55 | }
|
---|
| 56 | public String getResType(){
|
---|
| 57 | return super.getResType();
|
---|
| 58 | }
|
---|
| 59 | public void setResType(String resType){
|
---|
| 60 | super.setResType(resType);
|
---|
| 61 | }
|
---|
| 62 | //eigene Felder für die Tabellenspalten
|
---|
| 63 | public void setKey(String key) {
|
---|
| 64 | this.key = key;
|
---|
| 65 | }
|
---|
| 66 |
|
---|
| 67 | public String getKey() {
|
---|
| 68 | return key;
|
---|
| 69 | }
|
---|
| 70 |
|
---|
[849] | 71 | public String getKeyValue() {
|
---|
| 72 | return keyValue;
|
---|
[848] | 73 | }
|
---|
| 74 |
|
---|
[849] | 75 | public void setKeyValue(String keyValue) {
|
---|
| 76 | this.keyValue = keyValue;
|
---|
[848] | 77 | }
|
---|
[856] | 78 |
|
---|
[871] | 79 | public void setInputText(boolean inputText) {
|
---|
[856] | 80 | this.inputText = inputText;
|
---|
| 81 | }
|
---|
| 82 |
|
---|
[871] | 83 | public boolean getInputText() {
|
---|
[856] | 84 | return inputText;
|
---|
| 85 | }
|
---|
| 86 |
|
---|
[871] | 87 | public void setSelectOneMenu(boolean selectOneMenu) {
|
---|
[856] | 88 | this.selectOneMenu = selectOneMenu;
|
---|
| 89 | }
|
---|
| 90 |
|
---|
[871] | 91 | public boolean getSelectOneMenu() {
|
---|
[856] | 92 | return selectOneMenu;
|
---|
| 93 | }
|
---|
[871] | 94 | public boolean getRadioGroup(){
|
---|
| 95 | return radioGroup;
|
---|
| 96 | }
|
---|
| 97 | public void setRadioGroup(boolean radioGroup){
|
---|
| 98 | this.radioGroup = radioGroup;
|
---|
| 99 | }
|
---|
[865] | 100 | /**
|
---|
| 101 | * Set the string property of the intended render type to the value of the none empty string "bernd"
|
---|
| 102 | * @param r valid inputs are inputText, selectOneMenu and radioGroup
|
---|
| 103 | */
|
---|
[871] | 104 | public void setRenderer(String r){
|
---|
[856] | 105 | if (r.equals("inputText")) {
|
---|
[871] | 106 | this.inputText = true;
|
---|
[856] | 107 | }
|
---|
| 108 | if (r.equals("selectOneMenu")){
|
---|
[871] | 109 | this.selectOneMenu = true; //null;
|
---|
[857] | 110 | }
|
---|
| 111 | if (r.equals("radioGroup")){
|
---|
[871] | 112 | this.radioGroup = true;
|
---|
[856] | 113 | }
|
---|
[871] | 114 | this.renderer = r;
|
---|
[856] | 115 | }
|
---|
[865] | 116 | /**
|
---|
| 117 | * Key-Value-Pairs for the SelectOneMenu
|
---|
| 118 | * @return an array of key value pairs as an SelectItem object array
|
---|
| 119 | */
|
---|
[857] | 120 | public SelectItem[] getKeyValueList() {
|
---|
| 121 | return keyValueList;
|
---|
| 122 | }
|
---|
[865] | 123 | /**
|
---|
| 124 | *
|
---|
| 125 | * @param keyValueList
|
---|
| 126 | */
|
---|
[857] | 127 | public void setKeyValueList(SelectItem[] keyValueList) {
|
---|
| 128 | this.keyValueList = keyValueList;
|
---|
| 129 | }
|
---|
[848] | 130 | }
|
---|