Search in sources :

Example 6 with WidgetIsFound

use of org.eclipse.reddeer.core.condition.WidgetIsFound in project jbosstools-hibernate by jbosstools.

the class ProjectConfigurationFactory method closePreferences.

private static void closePreferences(PropertyDialog pd) {
    WidgetIsFound applyAndCloseButton = new WidgetIsFound(org.eclipse.swt.widgets.Button.class, new WithMnemonicTextMatcher("Apply and Close"));
    org.eclipse.reddeer.swt.api.Button btn;
    if (applyAndCloseButton.test()) {
        // oxygen changed button text
        btn = new PushButton("Apply and Close");
    } else {
        btn = new OkButton();
    }
    btn.click();
    new WaitUntil(new ShellIsAvailable("Warning"), TimePeriod.SHORT, false);
    // when eclipse is build by maven some plugins are missing
    while (new ShellIsAvailable("Warning").test()) {
        Shell warningShell = new DefaultShell("Warning");
        new PushButton(warningShell, "Yes").click();
        new WaitWhile(new ShellIsAvailable(warningShell));
    }
    new WaitWhile(new ShellIsAvailable(pd.getShell()));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) WithMnemonicTextMatcher(org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher) WidgetIsFound(org.eclipse.reddeer.core.condition.WidgetIsFound) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

WidgetIsFound (org.eclipse.reddeer.core.condition.WidgetIsFound)6 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)5 WithMnemonicTextMatcher (org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher)5 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)5 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)5 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)4 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)4 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)3 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)3 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)2 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)2 Shell (org.eclipse.reddeer.swt.api.Shell)2 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)2 WorkbenchPreferenceDialog (org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog)2 WithStyleMatcher (org.eclipse.reddeer.core.matcher.WithStyleMatcher)1 PasswordProvider (org.eclipse.reddeer.eclipse.equinox.security.ui.storage.PasswordProvider)1 StoragePreferencePage (org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage)1 PropertyDialog (org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog)1 ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)1 JFaceLayerException (org.eclipse.reddeer.jface.exception.JFaceLayerException)1