- Timestamp:
- Mar 23, 2010, 3:01:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/ConfigurationBean.java
r848 r849 30 30 ResourceInfo[] ri; 31 31 SimpleResource sr; 32 ((ClientItem)selectedObject).setName("ClientNameTest");32 //((ClientItem)selectedObject).setName("ClientNameTest"); 33 33 34 34 Client c = new Client(); 35 //String[] nodes = {"Director", "Storage", "Catalog", "Autochanger", "Client", "FileSet", "FDClient", "Schedule", "SDStorage", "Console", "Catalog", "SDDevice", "Job", "JobDefs", "Messages", "Pool"};36 String[] nodes = {"Client"};35 String[] nodes = {"Director", "Storage", "Catalog", "Autochanger", "Client", "FileSet", "FDClient", "Schedule", "SDStorage", "Console", "Catalog", "SDDevice", "Job", "JobDefs", "Messages", "Pool"}; 36 //String[] nodes = {"Client"}; 37 37 setTree(super.createTree(root, nodes, "Configuration")); 38 38 39 // \forall header wird eine ResourceList[] angefragt39 //forall header wird eine ResourceList[] angefragt 40 40 for(int i = 0; i < tree.getChildCount(root); i++){ 41 41 header = (DefaultMutableTreeNode)tree.getChild(root, i); … … 49 49 //myNode = null; 50 50 myNode = addNode(header, type, ri[j]); 51 //Node mit Daten befüllen 52 grt = new GetResourceType(); 53 grt.setDirector(lrt.getDirector()); 54 grt.setResId(ri[j].getResId()); 55 sr = c.getSimpleResource(grt); 56 myNode = addNode(myNode, type, sr.getResourceAttributeType()); 51 57 if (myNode != null){ 52 58 header.add(myNode); … … 54 60 } 55 61 } 56 for (int i = 0; i < tree.getChildCount(root); i++){62 /*for (int i = 0; i < tree.getChildCount(root); i++){ 57 63 header = (DefaultMutableTreeNode)tree.getChild(root, i); 58 64 … … 71 77 72 78 } 73 } 79 }*/ 74 80 75 81 … … 78 84 DefaultMutableTreeNode node; 79 85 UserObjectItem userObject; 86 selectedObject = new ArrayList<ViewItem>(); 80 87 String Id = BeanUtil.getRequestParameter("userObject.resId"); 81 88 node = getNode(Id, tree); 82 89 String type = ((UserObjectItem)((UserObjectItemType)node.getUserObject()).getUserObject()).getResType(); 90 String classType = "de.dass_it.vanhelsing.gui.items." + type + "Item"; 91 //Daten aus dem UserObjectItem extrahieren 92 try { 83 93 94 UserObjectItem item = ((UserObjectItemType)(node.getUserObject())).getUserObject(); 95 96 Class c = ((UserObjectItemType)(node.getUserObject())).getUserObject().getClass(); 97 Method[] m = c.getDeclaredMethods(); 98 String keyValue; 99 String key; 100 ViewItem vi; 101 for (Method n : m) { 102 if(n.getName().startsWith("get")) { 103 keyValue = (String)n.invoke(item, (Object[])null); 104 if (keyValue == null) continue; 105 key = n.getName().substring(3); 106 vi = new ViewItem(); 107 vi.setKey(key); vi.setKeyValue(keyValue); vi.setResType(type); 108 selectedObject.add(vi); 109 } 110 } 111 } catch(Exception e) { 112 e.printStackTrace(); 113 } 84 114 } 85 115 … … 90 120 return tree; 91 121 } 92 public UserObjectItemgetSelectedObject() {122 public ArrayList<ViewItem> getSelectedObject() { 93 123 return selectedObject; 94 124 } 95 public void setSelectedObject( UserObjectItemselectedObject) {125 public void setSelectedObject(ArrayList<ViewItem> selectedObject) { 96 126 this.selectedObject = selectedObject; 97 127 }
Note:
See TracChangeset
for help on using the changeset viewer.