Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaimar Buehmann2013-10-25 08:59:23 +0000
committerRaimar Buehmann2013-10-25 08:59:23 +0000
commitcd5d00a369ceefda93d7e7b76ad6c4b3f49fae1b (patch)
treecc4b2183928f052a2d08b557c5b723265cfdf084 /org.eclipse.jubula.rc.swing/src
parent572feddb0a9bb5b598709404bd96bd99206e80a3 (diff)
downloadorg.eclipse.jubula.core-cd5d00a369ceefda93d7e7b76ad6c4b3f49fae1b.tar.gz
org.eclipse.jubula.core-cd5d00a369ceefda93d7e7b76ad6c4b3f49fae1b.tar.xz
org.eclipse.jubula.core-cd5d00a369ceefda93d7e7b76ad6c4b3f49fae1b.zip
Sprint task: Fix for fix of bug 413792 added checking isVisible
Diffstat (limited to 'org.eclipse.jubula.rc.swing/src')
-rw-r--r--org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/SwingApplicationTester.java30
1 files changed, 19 insertions, 11 deletions
diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/SwingApplicationTester.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/SwingApplicationTester.java
index 03cd055c2..ad0cc562a 100644
--- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/SwingApplicationTester.java
+++ b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/SwingApplicationTester.java
@@ -172,19 +172,27 @@ public class SwingApplicationTester extends AbstractApplicationTester {
* {@inheritDoc}
*/
public boolean isTrue(AWTEvent event) {
+ // we use lost focus, because it is triggered independently of hiding the window
+ // by setVisible(false) or dispose()
if (event.getID() == WindowEvent.WINDOW_LOST_FOCUS) {
- String name = null;
- if (event.getSource() instanceof Frame) {
- Frame frame = (Frame)event.getSource();
- name = frame.getTitle();
- } else if (event.getSource() instanceof Dialog) {
- Dialog dialog = (Dialog)event.getSource();
- name = dialog.getTitle();
- } else {
- // Window found, but we currently do not support it, because it has no title
- return false;
+ if (event.getSource() instanceof Window) {
+ Window window = (Window) event.getSource();
+ if (!window.isVisible()) {
+ String name = null;
+ if (window instanceof Frame) {
+ Frame frame = (Frame) window;
+ name = frame.getTitle();
+ } else if (window instanceof Dialog) {
+ Dialog dialog = (Dialog) window;
+ name = dialog.getTitle();
+ } else {
+ // Window found, but we currently do not support it, because it has no title
+ return false;
+ }
+ return MatchUtil.getInstance()
+ .match(name, m_title, m_operator);
+ }
}
- return MatchUtil.getInstance().match(name, m_title, m_operator);
}
return false;
}

Back to the top