Search in sources :

Example 6 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project linuxtools by eclipse.

the class DockerImagesTab method addTagToImage.

public void addTagToImage(String imageName, String newTag) {
    selectImage(imageName);
    new ContextMenu().getItem("Add Tag").select();
    new DefaultShell("Tag Image");
    new LabeledText("New Tag:").setText(newTag);
    new FinishButton().click();
}
Also used : FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu)

Example 7 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-hibernate by jbosstools.

the class HQLEditor method runHQLQuery.

/**
 * Executes HQL query
 */
public void runHQLQuery() {
    new DefaultToolItem("Run HQL").click();
    try {
        Shell s = new DefaultShell("Open Session factory");
        new YesButton(s).click();
        new WaitWhile(new ShellIsAvailable(s));
    } catch (WaitTimeoutExpiredException e) {
        log.warn("Open Session factory question dialog was expected");
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Example 8 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-hibernate by jbosstools.

the class ConnectionProfileFactory method createConnectionProfile.

/**
 * Creates Connection profile based on DatabaseRequirement configuration
 * @param conf given database requirement configuration
 */
public static void createConnectionProfile(DatabaseConfiguration cfg) {
    DataSourceExplorerView dse = new DataSourceExplorerView();
    dse.open();
    // TODO implement this in explorer
    // TODO fix explorer name
    DefaultTreeItem item = new DefaultTreeItem("Database Connections");
    item.expand(TimePeriod.DEFAULT);
    List<TreeItem> items = item.getItems();
    for (TreeItem i : items) {
        i.select();
        new ContextMenuItem("Delete").select();
        Shell delete = new DefaultShell("Delete confirmation");
        new YesButton(delete).click();
        new WaitWhile(new ShellIsAvailable(delete));
    }
    DatabaseProfile dbProfile = new DatabaseProfile();
    dbProfile.setDatabase(cfg.getProfileName());
    dbProfile.setDriverDefinition(DriverDefinitionFactory.getDriverDefinition(cfg));
    dbProfile.setHostname(cfg.getJdbcString());
    dbProfile.setName(cfg.getProfileName());
    dbProfile.setPassword(cfg.getPassword());
    dbProfile.setUsername(cfg.getUsername());
    dbProfile.setVendor(cfg.getDriverVendor());
    // Driver Definition creation
    NewCPWizard cpw = new NewCPWizard();
    cpw.open();
    cpw.createDatabaseProfile(dbProfile);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) DatabaseProfile(org.eclipse.reddeer.eclipse.datatools.ui.DatabaseProfile) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DataSourceExplorerView(org.eclipse.reddeer.eclipse.datatools.connectivity.ui.dse.views.DataSourceExplorerView) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) NewCPWizard(org.eclipse.reddeer.eclipse.datatools.connectivity.ui.wizards.NewCPWizard) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Example 9 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-hibernate by jbosstools.

the class ConnectionProfileFactory method deleteConnectionProfile.

/**
 * Deletes connection profile
 * @param profileName profile name to delete
 */
@SuppressWarnings("unchecked")
public static void deleteConnectionProfile(String profileName) {
    DataSourceExplorerView explorer = new DataSourceExplorerView();
    explorer.open();
    new DefaultTreeItem(new TreeItemRegexMatcher("Database Connections"), new TreeItemRegexMatcher(profileName + ".*")).select();
    new ContextMenuItem("Delete").select();
    Shell delete = new DefaultShell("Delete confirmation");
    new YesButton(delete).click();
    new WaitWhile(new ShellIsAvailable(delete));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) TreeItemRegexMatcher(org.eclipse.reddeer.core.matcher.TreeItemRegexMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) 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) DataSourceExplorerView(org.eclipse.reddeer.eclipse.datatools.connectivity.ui.dse.views.DataSourceExplorerView) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Example 10 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-hibernate by jbosstools.

the class ConnectionProfileFactory method deleteAllConnectionProfiles.

/**
 * Method deletes all connection profiles via Data Source Explorer
 */
public static void deleteAllConnectionProfiles() {
    DataSourceExplorerView dse = new DataSourceExplorerView();
    dse.open();
    List<TreeItem> items = new DefaultTreeItem("Database Connections").getItems();
    for (TreeItem i : items) {
        i.select();
        new ContextMenuItem("Delete").select();
        ;
        Shell delete = new DefaultShell("Delete confirmation");
        new YesButton(delete).click();
        new WaitWhile(new ShellIsAvailable(delete));
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DataSourceExplorerView(org.eclipse.reddeer.eclipse.datatools.connectivity.ui.dse.views.DataSourceExplorerView) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Aggregations

DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)129 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)84 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)83 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)57 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)49 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)46 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)41 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)36 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)30 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)28 Test (org.junit.Test)27 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)25 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)18 Shell (org.eclipse.reddeer.swt.api.Shell)17 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)17 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)17 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)16 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)16 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)16 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)16