]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.support.jemmy/src/main/java/org/argeo/slc/jemmy/FictiveComponentWrapper.java
Clean up directories
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.jemmy / src / main / java / org / argeo / slc / jemmy / FictiveComponentWrapper.java
1 /*
2 * Copyright (C) 2007-2012 Argeo GmbH
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.argeo.slc.jemmy;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import org.netbeans.jemmy.operators.ComponentOperator;
22
23 public class FictiveComponentWrapper implements ComponentWrapper {
24
25 protected ComponentWrapper parent;
26
27 public ComponentOperator find() {
28 // just ask the parent
29 return parent.find();
30 }
31
32 /**
33 * Return only itself (if the class matches)
34 */
35 public Map getAccessors(Class accessorClass) {
36 Map accessors = new HashMap();
37 if (accessorClass.isInstance(this)) {
38 accessors.put(((Accessor) this).getFieldName(), this);
39 }
40 return accessors;
41 }
42
43 public ComponentWrapper getParent() {
44 return parent;
45 }
46
47 public void setParent(ComponentWrapper parent) {
48 this.parent = parent;
49 }
50
51 }