- Timestamp:
- 10/03/11 23:06:06 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/data/WindowTree.java
r228 r229 5 5 import java.util.Map; 6 6 import java.util.SortedSet; 7 import java.util.TreeSet;8 9 import de.ugoe.cs.eventbench.data.GlobalDataContainer;10 import de.ugoe.cs.util.console.Console;11 7 12 8 /** … … 39 35 */ 40 36 private static WindowTree theInstance = null; 37 38 /** 39 * <p> 40 * Maintains a set of all the target strings of all widgets that were at 41 * some point part of the window tree. 42 * </p> 43 */ 44 private SortedSet<String> targets; 41 45 42 46 /** … … 112 116 } 113 117 nodes.put(childHwnd, child); 118 targets.add(child.xmlRepresentation()); 114 119 } 115 116 storeTarget(childHwnd);117 120 } 118 121 … … 172 175 /** 173 176 * <p> 174 * Stores a target in GlobalDataContainer to be able to work on with it in175 * DlgInsert177 * Returns a sorted set of all targets that existed any time in the window 178 * tree. 176 179 * </p> 177 180 * 178 * @param hwnd 179 * hwnd of the window to be stored 181 * @return set of targets 180 182 */ 181 @SuppressWarnings("unchecked") 182 private void storeTarget(int hwnd) { 183 SortedSet<String> targets = new TreeSet<String>(); 184 185 if (GlobalDataContainer.getInstance().getData("ListTargets") == null) { 186 GlobalDataContainer.getInstance().addData("ListTargets", targets); 187 } 188 189 try { 190 targets = (SortedSet<String>) GlobalDataContainer.getInstance().getData("ListTargets"); 191 targets.add(nodes.get(hwnd).xmlRepresentation()); 192 } catch (ClassCastException e) { 193 Console.println("Not able to cast data in GlobalDataContainer to SortedSet of Strings"); 194 } 183 public SortedSet<String> getTargets() { 184 return targets; 195 185 } 196 186 }
Note: See TracChangeset
for help on using the changeset viewer.