diff options
| author | Raimar Buehmann | 2013-10-24 15:45:33 +0000 |
|---|---|---|
| committer | Raimar Buehmann | 2013-10-25 08:37:01 +0000 |
| commit | 572feddb0a9bb5b598709404bd96bd99206e80a3 (patch) | |
| tree | ec9af914d33aa7c4014f4a2b578df94a0b7526cf | |
| parent | 15f95ae602ce253bd9f85576221d27e744884e5d (diff) | |
| download | org.eclipse.jubula.core-572feddb0a9bb5b598709404bd96bd99206e80a3.tar.gz org.eclipse.jubula.core-572feddb0a9bb5b598709404bd96bd99206e80a3.tar.xz org.eclipse.jubula.core-572feddb0a9bb5b598709404bd96bd99206e80a3.zip | |
Sprint task: Reviewed and applied patch for bug 413792 Swing waiting for closed window
| -rw-r--r-- | org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/SwingApplicationTester.java | 28 |
1 files changed, 14 insertions, 14 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 638bf1f81..03cd055c2 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,21 +172,21 @@ public class SwingApplicationTester extends AbstractApplicationTester { * {@inheritDoc} */ public boolean isTrue(AWTEvent event) { - if (event.getID() != WindowEvent.WINDOW_CLOSED - && event.getID() != ComponentEvent.COMPONENT_HIDDEN) { - return false; - } - if (event.getSource() instanceof Frame) { - Frame frame = (Frame)event.getSource(); - return MatchUtil.getInstance().match( - frame.getTitle(), m_title, m_operator); - } else if (event.getSource() instanceof Dialog) { - Dialog dialog = (Dialog)event.getSource(); - return MatchUtil.getInstance().match( - dialog.getTitle(), m_title, m_operator); - } else { - return false; + 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; + } + return MatchUtil.getInstance().match(name, m_title, m_operator); } + return false; } } |
