Search in sources :

Example 71 with OkButton

use of org.eclipse.reddeer.swt.impl.button.OkButton in project jbosstools-hibernate by jbosstools.

the class KnownConfigurationsView method deleteConsoleConfiguration.

/**
 * Deletes hibernate console configuration
 * @param console hibernate console configuration name
 */
public void deleteConsoleConfiguration(String console) {
    new DefaultTreeItem(new DefaultTree(this), console).select();
    new ContextMenuItem("Delete Configuration").select();
    Shell deleteShell = new DefaultShell("Delete console configuration");
    new OkButton(deleteShell).click();
    new WaitWhile(new ShellIsAvailable(deleteShell));
    new WaitWhile(new JobIsRunning());
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) EditConfigurationShell(org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 72 with OkButton

use of org.eclipse.reddeer.swt.impl.button.OkButton in project jbosstools-hibernate by jbosstools.

the class HibernateToolsFactory method setHibernateVersion.

/**
 * Sets hibernate version to given console
 * @param consoleName console name
 * @param hibernateVersion hibernate version
 */
public static void setHibernateVersion(String consoleName, String hbVersion) {
    KnownConfigurationsView v = new KnownConfigurationsView();
    v.open();
    v.openConsoleConfiguration(consoleName);
    new LabeledCombo("Hibernate Version:").setSelection(hbVersion);
    new OkButton().click();
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) KnownConfigurationsView(org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView)

Example 73 with OkButton

use of org.eclipse.reddeer.swt.impl.button.OkButton 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

OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)73 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)48 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)45 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)43 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)37 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)32 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)32 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)22 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)17 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)15 Test (org.junit.Test)15 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)11 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)11 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)10 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)9 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)9 RadioButton (org.eclipse.reddeer.swt.impl.button.RadioButton)7 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)6 Shell (org.eclipse.reddeer.swt.api.Shell)6 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)6