01: /*
02: * NamedComponentChooser.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.gui;
13:
14: import java.awt.Component;
15: import org.netbeans.jemmy.ComponentChooser;
16:
17: /**
18: *
19: * @author support@sql-workbench.net
20: */
21: public class NamedComponentChooser implements ComponentChooser {
22: private String name;
23:
24: public NamedComponentChooser() {
25: }
26:
27: public NamedComponentChooser(String s) {
28: setName(s);
29: }
30:
31: public boolean checkComponent(Component component) {
32: String compName = component.getName();
33: return this .getName().equalsIgnoreCase(compName);
34: }
35:
36: public String getDescription() {
37: return "Component: " + name;
38: }
39:
40: public String getName() {
41: return name;
42: }
43:
44: public void setName(String newName) {
45: this.name = newName;
46: }
47:
48: }
|