Changeset 1212 for trunk/autoquest-test-utils/src
- Timestamp:
- 05/27/13 14:21:02 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-test-utils/src/main/java/de/ugoe/cs/autoquest/tasktrees/TaskTreeDecoder.java
r1202 r1212 222 222 } 223 223 224 private ITask createUserInteractionTask(Matcher matcher) { 225 String evenType = matcher.group(1); 224 /** 225 * <p> 226 * </p> 227 * 228 * @param matcher 229 * @return 230 */ 231 private ITask createUserInteractionTask(Matcher matcher) { 232 String evenType = matcher.group(1); 226 233 String id = matcher.group(2); 227 228 if (evenTarget == null) {229 230 234 IEventTarget evenTarget = targets.get(id); 235 if (evenTarget == null) { 236 evenTarget = determineTarget(evenType, id, matcher.group(4)); 237 targets.put(id, evenTarget); 231 238 } 232 239 IEventType eventType = determineType(evenType, matcher.group(4)); 233 240 return taskFactory.createNewEventTask(eventType, evenTarget); 234 } 235 236 private IEventTarget determineTarget(String type, String id, String enteredText) { 237 if ("TextInput".equals(type) && enteredText != null) { 238 return new DummyTextField(enteredText); 239 } else { 240 return new DummyGUIElement(id); 241 } 242 } 243 244 private IEventType determineType(String type, String enteredText) { 245 if ("TextInput".equals(type) && enteredText != null) { 246 return new TextInput(enteredText, new ArrayList<Event>()); 247 } else { 248 return new StringEventType(type); 249 } 250 } 241 } 242 243 /** 244 * <p> 245 * </p> 246 * 247 * @param type 248 * @param id 249 * @param enteredText 250 * @return 251 */ 252 private IEventTarget determineTarget(String type, String id, String enteredText) { 253 if ("TextInput".equals(type) && enteredText != null) { 254 return new DummyTextField(enteredText); 255 } 256 else { 257 return new DummyGUIElement(id); 258 } 259 } 260 261 /** 262 * <p> 263 * </p> 264 * 265 * @param type 266 * @param enteredText 267 * @return 268 */ 269 private IEventType determineType(String type, String enteredText) { 270 if ("TextInput".equals(type) && enteredText != null) { 271 return new TextInput(enteredText, new ArrayList<Event>()); 272 } 273 else { 274 return new StringEventType(type); 275 } 276 } 251 277 252 278 }
Note: See TracChangeset
for help on using the changeset viewer.