- Timestamp:
- Apr 16, 2010, 5:55:54 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/ConfigurationBean.java
r862 r864 14 14 import de.dass_it.www.vanhelsing.VanHelsingStub.*; 15 15 16 /* 17 * List all Bacula configuration components by name 16 /** 17 * List all Bacula configuration components by name. 18 18 */ 19 19 public class ConfigurationBean extends TreeNavigation { … … 26 26 init(); 27 27 } 28 29 /** 30 * init() builds the data tree of the configuration view. The heading nodes are read from the properties file. 31 * the web service will be queried for each heading node(e.g. client). 32 */ 28 33 private void init(){ 29 34 DefaultMutableTreeNode root = new DefaultMutableTreeNode(); … … 36 41 ResourceInfo[] ri; 37 42 SimpleResource sr; 38 // ((ClientItem)selectedObject).setName("ClientNameTest");39 43 40 44 Client c = new Client(); 41 /*String[] nodes = { "Director", "Storage", "Autochanger",42 "Client", "FileSet", "FDClient", "Schedule", "SDStorage",43 "Console", "Catalog", "SDDevice", "Job", "JobDefs", "Messages",44 "Pool" }; */45 // String[] nodes = {"Client"};46 45 setTree(super.createTree(root, BeanUtil.getProperty("nodes").split(","), "Configuration")); 47 46 48 // \forall header wird eine ResourceList[] angefragt49 47 50 48 for (int i = 0; i < tree.getChildCount(root); i++) { … … 59 57 continue; 60 58 for (int j = 0; j < ri.length; j++) { 61 // myNode = null;62 59 myNode = addNode(header, type, ri[j]); 63 // Node mit Daten befüllen64 60 grt = new GetResourceType(); 65 61 grt.setDirector(lrt.getDirector()); … … 72 68 } 73 69 } 74 /* 75 * for (int i = 0; i < tree.getChildCount(root); i++){ header = 76 * (DefaultMutableTreeNode)tree.getChild(root, i); 77 * 78 * for (int j = 0; j < tree.getChildCount(header); j++){ leaf = 79 * (DefaultMutableTreeNode)tree.getChild(header, j); type = 80 * ((UserObjectItemType 81 * )leaf.getUserObject()).getUserObject().getResType(); grt = new 82 * GetResourceType(); grt.setDirector("bacula-dir"); 83 * grt.setResId(((ItemType 84 * )(((UserObjectItemType)leaf.getUserObject()).getUserObject 85 * ())).getResId()); sr = c.getSimpleResource(grt); 86 * sr.getResourceAttributeType(); myNode = addNode(leaf, type, 87 * sr.getResourceAttributeType()); if (myNode != null){ 88 * leaf.add(myNode); } 89 * 90 * } } 91 */ 92 93 } 94 95 70 } 71 72 /** 73 * transfers the selected (by attribute resId) dataobject (resource) into an ArrayList of ViewItems.<br/> 74 * Each ViewItem contain the key value pair and the rendering type. If the attribute is rendered as a 75 * selectOneMenu, the values for the selectOneMenu will be read from the data tree. 76 * 77 * @param ae ActionEvent which contains relevant information about the component tree. the variable is not used. 78 */ 96 79 public void userObjectItemNodeSelected(ActionEvent ae) { 97 80 DefaultMutableTreeNode node; … … 112 95 String classType = "de.dass_it.vanhelsing.gui.items." + type + "Item"; 113 96 String accessType = BeanUtil.getAccessType(type.toLowerCase()); 114 // Daten aus dem UserObjectItem extrahieren115 97 try { 116 98 UserObjectItem item = ((UserObjectItemType) (node.getUserObject())) … … 163 145 } 164 146 } 147 /** 148 * return an array of nodes of a given resource type 149 * 150 * @param tree2 copy of the data tree 151 * @param key name of the requested resource type 152 * @return dmtn array of nodes of a given resource type 153 * @return null null object there are no nodes of the requested type 154 */ 165 155 private DefaultMutableTreeNode[] getChildNodes(DefaultTreeModel tree2, String key) { 166 156 DefaultMutableTreeNode[] dmtn; … … 179 169 return null; 180 170 } 171 /** 172 * 173 * @param ae 174 */ 181 175 public void newResourceButtonListener(ActionEvent ae){ 182 176 DefaultMutableTreeNode node; … … 215 209 si[i] = new SelectItem((String)o.invoke(nodeObject, (Object[])null), 216 210 (String)o.invoke(nodeObject, (Object[])null)); 217 //System.err.println("si[i]"+si[i].getLabel());218 211 219 212 } … … 231 224 232 225 } 226 /** 227 * **EXPERIMENTAL** returns type of the selected resource. 228 * The method is used for an evaluation about dynamic navigation. 229 * @param ae ActionEvent contains relevant information about the jsf component tree. 230 * @return viewName name of the resource type of the selected data tree node 231 */ 232 public String newResourceListener(ActionEvent ae){ 233 if (selectedObject != null && selectedObject.size() > 0){ 234 String resType = selectedObject.get(0).getResType(); 235 String viewName = BeanUtil.getAccessType(resType); 236 return viewName; 237 } 238 return ""; 239 } 240 233 241 public void userObjectItemOptionSelected(ValueChangeEvent vce){ 234 242 235 243 } 236 244 /** 245 * repeat the entire construction process of the data tree 246 * @param ae 247 */ 237 248 public void reloadResourceButtonListener(ActionEvent ae){ 238 249 init(); … … 241 252 BeanUtil.setInfoMessage(null, "Diese Methode ist noch nicht implementiert."); 242 253 } 243 254 /** 255 * **EXPERIMENTAL** writes the selected resource to the data tree of the web service. 256 * 257 * @param ae ActionEvent contains relevant information 258 */ 244 259 public void saveButtonListener(ActionEvent ae) { 245 260 if (selectedObject == null){ … … 280 295 } 281 296 } 282 297 /** 298 * Setter method for the tree attribute 299 * @param tree tree contains the DefaultTreeModel for the data tree 300 */ 283 301 public void setTree(DefaultTreeModel tree) { 284 302 this.tree = tree; 285 303 } 286 304 /** 305 * getter method for the tree attribute 306 * @return tree tree contains the DefaultTreeModel for the data tree 307 */ 287 308 public DefaultTreeModel getTree() { 288 309 return tree; 289 310 } 290 311 312 /** 313 * gettter method for the selectedObject attribute 314 * @return selectedObject selectedObject contains the data object of the selected leaf node. 315 */ 291 316 public ArrayList<ViewItem> getSelectedObject() { 292 317 return selectedObject; 293 318 } 294 319 320 /** 321 * setter method for the selectedObject attribute 322 * @param selectedObject selectedObject contains the data object of the selected leaf node 323 */ 295 324 public void setSelectedObject(ArrayList<ViewItem> selectedObject) { 296 325 this.selectedObject = selectedObject; 297 326 } 327 328 /** 329 * getter method for the resId attribute of the selectedObject i.e. the selected leaf node of the data tree 330 * @return id resId attribute of the selected object 331 */ 298 332 public int getSelectedId(){ 299 333 if (selectedObject != null){
Note:
See TracChangeset
for help on using the changeset viewer.