Changeset 862 for vanHelsing/trunk/gui/src
- Timestamp:
- Apr 15, 2010, 3:49:35 PM (15 years ago)
- Location:
- vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/BeanUtil.java
r858 r862 43 43 return false; 44 44 } 45 public static String getDataType(String type, String key){ 46 return getFieldProperty(type, key, 1); 47 } 45 48 //getRenderer returns rendererType based on properties 46 49 public static String getRenderer(String type, String key){ 47 return getFieldProperty(type, key, 1);50 return getFieldProperty(type, key, 0); 48 51 } 49 52 public static String getFieldProperty(String type, String key, int i){ … … 58 61 type = type.toLowerCase(); 59 62 key = key.toLowerCase(); 63 key = key.replaceAll(" ", ""); 60 64 String result[] = getProperties((daemon+"."+type+"."+key)); 61 if (i == 1) {65 if (i == 0) { 62 66 if (result[1].equals("boolean")){ 63 67 return "radioGroup"; … … 69 73 } 70 74 if (i == 2) return result[2]; 75 if (i == 1) return result[1]; 76 if (i == 3) return result[3]; 71 77 return res; 72 78 } -
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/Client.java
r860 r862 6 6 7 7 public class Client { 8 8 public ResourceInfo[] getListResources(String director, String resource){ 9 ListResourcesType lrt = new ListResourcesType(); 10 lrt.setDirector(director); 11 lrt.setResourceType(resource); 12 return getListResources(lrt); 13 } 9 14 public ResourceInfo[] getListResources(ListResourcesType lrt){ 10 15 VanHelsingStub stub; … … 24 29 return new ResourceInfo[0]; 25 30 } 26 31 32 public SimpleResource getSimpleResource(String director, int resId){ 33 GetResourceType grt = new GetResourceType(); 34 grt.setDirector(director); 35 grt.setResId(resId); 36 return getSimpleResource(grt); 37 } 27 38 public SimpleResource getSimpleResource(GetResourceType grt){ 28 39 VanHelsingStub stub; … … 46 57 return new SimpleResource(new ResourceInfo(), new ResourceAttributeType[0]); 47 58 } 48 59 public SetSimpleResourceResponse setSimpleResource(){ 60 ResourceInitialization ri = new ResourceInitialization(); 61 return setSimpleResource(ri); 62 } 49 63 public SetSimpleResourceResponse setSimpleResource(ResourceInitialization ri){ 50 64 VanHelsingStub stub; … … 74 88 return stub; 75 89 } 76 77 90 public static void main(String args[]){ 78 91 Client c = new Client(); -
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/ConfigurationBean.java
r860 r862 39 39 40 40 Client c = new Client(); 41 String[] nodes = { "Director", "Storage", "Autochanger",41 /*String[] nodes = { "Director", "Storage", "Autochanger", 42 42 "Client", "FileSet", "FDClient", "Schedule", "SDStorage", 43 43 "Console", "Catalog", "SDDevice", "Job", "JobDefs", "Messages", 44 "Pool" }; 44 "Pool" }; */ 45 45 // String[] nodes = {"Client"}; 46 setTree(super.createTree(root, nodes, "Configuration"));46 setTree(super.createTree(root, BeanUtil.getProperty("nodes").split(","), "Configuration")); 47 47 48 48 // \forall header wird eine ResourceList[] angefragt -
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/JobScheduleBean.java
r832 r862 1 1 package de.dass_it.vanhelsing.gui; 2 3 import javax.faces.event.ActionEvent; 4 import javax.swing.tree.DefaultMutableTreeNode; 5 import javax.swing.tree.DefaultTreeModel; 6 import de.dass_it.www.vanhelsing.VanHelsingStub.*; 7 import de.dass_it.vanhelsing.gui.items.ConcreteUserObjectItem; 8 2 9 /* 3 10 * JobSchedule will list all schedules and the jobs which are associated with a given schedule. 4 11 */ 5 public class JobScheduleBean extends TreeNavigation { 12 public class JobScheduleBean { 13 private DataTree dataTree; 14 private ConcreteUserObjectItem selectedObject; 6 15 16 public JobScheduleBean(){ 17 init(); 18 } 19 private void init(){ 20 Client c = new Client(); 21 UserObjectItemFactory UOFactory = new UserObjectItemFactory(); 22 23 ResourceInfo riSched[]; 24 ResourceInfo riJobs[]; 25 SimpleResource sr; 26 DefaultMutableTreeNode parent; 27 28 dataTree = new DataTree(); 29 dataTree.setTree("JobSchedule"); 30 31 32 //TODO: Director auslesen 33 riSched = c.getListResources("bacula-dir", "Schedule"); 34 for (ResourceInfo rinfo : riSched){ 35 parent = dataTree.createNode(dataTree.getRoot(), 36 UOFactory.createUserObjectItem(rinfo)); 37 38 riJobs = c.getListResources(rinfo.getDirector(), "Job"); 39 for (ResourceInfo rJobs : riJobs){ 40 41 sr = c.getSimpleResource(rJobs.getDirector(), rJobs.getResId()); 42 for (ResourceAttributeType rat : sr.getResourceAttributeType()){ 43 if (rat.getKey().toLowerCase().equals("schedule") && 44 rat.getValue().equals(rinfo.getResName())){ 45 dataTree.createNode(parent, 46 UOFactory.createUserObjectItem(rJobs)); 47 } 48 } 49 } 50 } 51 } 52 53 public void createNodeListener(ActionEvent ae){ 54 //Methode kann nur mit ausgewählten ParentNode ausgeführt werden 55 DefaultMutableTreeNode parent = dataTree.getNodeByName("horst"); 56 UserObjectItemFactory UOFactory = new UserObjectItemFactory(); 57 58 //UOFactory.createUserObjectItem(new ResourceAttributeType[], ) 59 //dataTree.createNode(parent, userObject); 60 } 61 public void updateNodeListener(ActionEvent ae){ 62 BeanUtil.setInfoMessage(null, "Die Methode ist noch nicht implementiert"); 63 64 } 65 public void deleteNodeListener(ActionEvent ae){ 66 BeanUtil.setInfoMessage(null, "Die Methode ist noch nicht implementiert"); 67 68 } 69 public void reloadTreeListener(ActionEvent ae){ 70 init(); 71 } 72 public void selectNode(ActionEvent ae){ 73 BeanUtil.setInfoMessage(null, "Die Methode ist noch nicht implementiert"); 74 } 75 76 public DataTree getDataTree(){ 77 return dataTree; 78 } 79 80 public void setDataTree(DataTree dataTree){ 81 this.dataTree = dataTree; 82 } 7 83 } -
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/ViewItem.java
r858 r862 6 6 7 7 public class ViewItem extends ItemType implements UserObjectItem { 8 /**9 * @uml.property name="key"10 */11 8 private String key; 12 /**13 * @uml.property name="keyValue"14 */15 9 private String keyValue; 16 /** 17 * @uml.property name="inputText" 18 */ 10 private boolean required; 11 private String renderer; 12 private String dataType; 13 private SelectItem[] keyValueList; 14 19 15 private String inputText; 20 /**21 * @uml.property name="selectOneMenu"22 */23 16 private String selectOneMenu; 24 /**25 * @uml.property name="radioGroup"26 */27 17 private String radioGroup; 28 /** 29 * @uml.property name="required" 30 */ 31 private boolean required; 32 /** 33 * @uml.property name="renderer" 34 */ 35 private String renderer; 36 /** 37 * @uml.property name="dataType" 38 */ 39 private String dataType; 40 /** 41 * @uml.property name="keyValueList" 42 * @uml.associationEnd multiplicity="(0 -1)" 43 */ 44 private SelectItem[] keyValueList; 45 18 46 19 public ViewItem(){ 47 20 inputText = null; 48 21 selectOneMenu = null; 22 radioGroup = null; 49 23 } 50 24 51 /**52 * @return53 * @uml.property name="required"54 */55 25 public boolean getRequired() { 56 26 return required; 57 27 } 58 28 59 /**60 * @param necessary61 * @uml.property name="required"62 */63 29 public void setRequired(boolean required) { 64 30 this.required = required; 65 31 } 66 32 67 /**68 * @return69 * @uml.property name="renderer"70 */71 33 public String getRenderer() { 72 34 return renderer; 73 35 } 74 36 75 /**76 * @param renderer77 * @uml.property name="renderer"78 */79 37 public void setRenderer(String renderer) { 80 38 this.renderer = renderer; 81 39 } 82 40 83 /**84 * @return85 * @uml.property name="dataType"86 */87 41 public String getDataType() { 88 42 return dataType; 89 43 } 90 44 91 /**92 * @param dataType93 * @uml.property name="dataType"94 */95 45 public void setDataType(String dataType) { 96 46 this.dataType = dataType; … … 112 62 } 113 63 //eigene Felder für die Tabellenspalten 114 /**115 * @param key116 * @uml.property name="key"117 */118 64 public void setKey(String key) { 119 65 this.key = key; 120 66 } 121 67 122 /**123 * @return124 * @uml.property name="key"125 */126 68 public String getKey() { 127 69 return key; 128 70 } 129 71 130 /**131 * @return132 * @uml.property name="keyValue"133 */134 72 public String getKeyValue() { 135 73 return keyValue; 136 74 } 137 75 138 /**139 * @param keyValue140 * @uml.property name="keyValue"141 */142 76 public void setKeyValue(String keyValue) { 143 77 this.keyValue = keyValue; 144 78 } 145 79 146 /**147 * @param inputText148 * @uml.property name="inputText"149 */150 80 public void setInputText(String inputText) { 151 81 this.inputText = inputText; 152 82 } 153 83 154 /**155 * @return156 * @uml.property name="inputText"157 */158 84 public String getInputText() { 159 85 return inputText; 160 86 } 161 87 162 /**163 * @param selectOneMenu164 * @uml.property name="selectOneMenu"165 */166 88 public void setSelectOneMenu(String selectOneMenu) { 167 89 this.selectOneMenu = selectOneMenu; 168 90 } 169 91 170 /**171 * @return172 * @uml.property name="selectOneMenu"173 */174 92 public String getSelectOneMenu() { 175 93 return selectOneMenu; 176 94 } 177 178 95 179 96 public void setRendererFlag(String r){ 180 97 if (r.equals("inputText")) { 181 98 this.inputText = new String("bernd"); 182 this.selectOneMenu = null;183 this.radioGroup = null;184 99 } 185 100 if (r.equals("selectOneMenu")){ 186 101 this.selectOneMenu = new String("bernd"); //null; 187 this.inputText = null; //new String ("bernd");188 this.radioGroup = null;189 //KeyValuesList erzeugen190 /*keyValueList = new SelectItem[3];191 * keyValueList[0] = new SelectItem("keyBernd","valueBernd");192 * keyValueList[1] = new SelectItem("keyHorst","valueHorst");193 * keyValueList[2] = new SelectItem("keyPeter","valuePeter");194 */195 196 102 } 197 103 if (r.equals("radioGroup")){ 198 104 this.radioGroup = new String("bernd"); 199 this.selectOneMenu = null;200 this.inputText = null;201 105 } 202 106 } 203 107 204 /**205 * @return206 * @uml.property name="keyValueList"207 */208 108 public SelectItem[] getKeyValueList() { 209 109 return keyValueList; 210 110 } 211 111 212 /**213 * @param keyValueList214 * @uml.property name="keyValueList"215 */216 112 public void setKeyValueList(SelectItem[] keyValueList) { 217 113 this.keyValueList = keyValueList; -
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/messages_en.properties
r859 r862 1 director = bacula-dir 2 nodes = Director,Storage,Autochanger,Client,FileSet,FDClient,Schedule,SDStorage,Console,Catalog,SDDevice,Job,JobDefs,Messages,Pool 1 3 director.director.name.ref = 0 2 4 director.director.name.type = String
Note:
See TracChangeset
for help on using the changeset viewer.