Changeset 857 for vanHelsing/trunk/gui/src/de/dass_it
- Timestamp:
- Apr 1, 2010, 7:02:55 PM (15 years ago)
- Location:
- vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui
- Files:
-
- 2 added
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/BeanUtil.java
r856 r857 8 8 import javax.faces.model.SelectItem; 9 9 import java.util.ResourceBundle; 10 import java.util.Locale; 10 11 11 12 … … 24 25 25 26 //Messagebundles 27 public static String getProperty(String key){ 28 String s = PropertyBundle.getProperty(key); 29 return s; 30 } 26 31 27 32 public static String[] getProperties(String key){ 33 String[] suffix = {"ref", "type", "required", "def"}; 34 String[] bundle = new String[4]; 35 for (int i = 0; i < 4; i++) { 36 bundle[i] = BeanUtil.getProperty(key+"."+suffix[i]); 37 } 38 return bundle; 39 } 40 //getRenderer returns rendererType based on properties 41 public static String getRenderer(String type, String key){ 42 String daemon = "director"; 43 String res = "inputText"; 44 if (type.startsWith("SD")){ 45 daemon = "storagedaemon"; 46 } 47 if (type.startsWith("FD")){ 48 daemon = "filedaemon"; 49 } 50 type = type.toLowerCase(); 51 key = key.toLowerCase(); 52 String result[] = getProperties((daemon+"."+type+"."+key)); 53 if (result[1].equals("boolean")){ 54 return "radioGroup"; 55 } 56 if (!(result[0].equals("0"))){ 57 return "selectOneMenu"; 58 } 59 60 return res; 61 } 28 62 //Statusmeldungen an den Client 29 63 public static void setInfoMessage(String client, String message){ -
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/ConfigurationBean.java
r856 r857 5 5 6 6 import javax.faces.event.ActionEvent; 7 import javax.faces.event.ValueChangeEvent; 7 8 import javax.swing.tree.DefaultMutableTreeNode; 8 9 import javax.swing.tree.DefaultTreeModel; … … 96 97 String Id = BeanUtil.getRequestParameter("userObject.resId"); 97 98 node = getNode(Id, tree); 98 Validation validation = new Validation();99 99 String type = ((UserObjectItem) ((UserObjectItemType) node 100 100 .getUserObject()).getUserObject()).getResType(); … … 127 127 vi.setResName(resName); 128 128 vi.setDirector(director); 129 if (type.equals("Client") && 1 == 0){ 130 131 vi.setRendererFlag(validation.getRenderer(classType+":"+key)); 132 vi.setNecessary(validation.getNecessary(classType+":"+key)); 133 } 129 vi.setRendererFlag(BeanUtil.getRenderer(type, key)); 130 System.err.println(vi.getRenderer()); 131 System.err.println(vi.getInputText()); 132 System.err.println(vi.getSelectOneMenu()+"\n\n"); 134 133 selectedObject.add(vi); 135 134 } … … 141 140 } 142 141 public void newResourceButtonListener(ActionEvent ae){ 142 143 } 144 public void userObjectItemOptionSelected(ValueChangeEvent vce){ 143 145 144 146 } -
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/ViewItem.java
r856 r857 1 1 package de.dass_it.vanhelsing.gui; 2 2 3 import javax.faces.model.SelectItem; 3 4 import de.dass_it.vanhelsing.gui.items.ItemType; 4 5 import de.dass_it.vanhelsing.gui.items.UserObjectItem; 5 import de.dass_it.vanhelsing.gui.ValidationItem.*;6 6 7 7 public class ViewItem extends ItemType implements UserObjectItem { … … 10 10 private String inputText; 11 11 private String selectOneMenu; 12 private String radioGroup; 12 13 private boolean necessary; 13 14 private String renderer; 14 15 private String dataType; 16 private SelectItem[] keyValueList; 15 17 16 18 public ViewItem(){ … … 89 91 return selectOneMenu; 90 92 } 93 94 //TODO: RendererFlag überarbeiten 91 95 public void setRendererFlag(String r){ 92 96 if (r.equals("inputText")) { 93 97 this.inputText = new String("bernd"); 94 98 this.selectOneMenu = null; 99 this.radioGroup = null; 95 100 } 96 101 if (r.equals("selectOneMenu")){ 97 this.selectOneMenu = new String ("bernd"); 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; 98 116 this.inputText = null; 99 117 } 100 118 } 119 120 public SelectItem[] getKeyValueList() { 121 return keyValueList; 122 } 123 124 public void setKeyValueList(SelectItem[] keyValueList) { 125 this.keyValueList = keyValueList; 126 } 101 127 }
Note:
See TracChangeset
for help on using the changeset viewer.