]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.support.jemmy/src/main/java/org/argeo/slc/jemmy/FictiveComponentWrapper.java
6964a3196ee76157b871b8a5f8e34c22af511178
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.jemmy / src / main / java / org / argeo / slc / jemmy / FictiveComponentWrapper.java
1 package org.argeo.slc.jemmy;
2
3 import java.util.HashMap;
4 import java.util.Map;
5
6 import org.netbeans.jemmy.operators.ComponentOperator;
7
8 public class FictiveComponentWrapper implements ComponentWrapper {
9
10 protected ComponentWrapper parent;
11
12 public ComponentOperator find() {
13 // just ask the parent
14 return parent.find();
15 }
16
17 /**
18 * Return only itself (if the class matches)
19 */
20 public Map getAccessors(Class accessorClass) {
21 Map accessors = new HashMap();
22 if (accessorClass.isInstance(this)) {
23 accessors.put(((Accessor) this).getFieldName(), this);
24 }
25 return accessors;
26 }
27
28 public ComponentWrapper getParent() {
29 return parent;
30 }
31
32 public void setParent(ComponentWrapper parent) {
33 this.parent = parent;
34 }
35
36 }