use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project linuxtools by eclipse.
the class ComposeTest method runDockerCompose.
private void runDockerCompose(String project, String projectFile) {
PackageExplorerPart pe = new PackageExplorerPart();
pe.open();
pe.getProject(project).getProjectItem(projectFile).select();
@SuppressWarnings("unchecked") ContextMenuItem contextMenu = new ContextMenuItem(new WithTextMatcher("Run As"), new RegexMatcher(".*Docker Compose"));
contextMenu.select();
new OkButton().click();
try {
new DefaultShell("Docker Compose");
new PushButton("Apply and Close").click();
fail("Docker Compose has not been found! Is it installed and the path is correct?");
} catch (CoreLayerException ex) {
}
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
new WaitWhile(new ConsoleHasNoChange());
}
use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-hibernate by jbosstools.
the class KnownConfigurationsView method addConfiguration.
/**
* Add configuration
*/
public EditConfigurationShell addConfiguration() {
open();
new ContextMenuItem("Add Configuration...").select();
return new EditConfigurationShell();
}
use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-hibernate by jbosstools.
the class KnownConfigurationsView method openConsoleConfiguration.
/**
* Open console configuration
* @param name given console name
* @return shell of the console
*/
public EditConfigurationShell openConsoleConfiguration(String name) {
selectConsole(name);
String title = "Edit Configuration";
new ContextMenuItem(title).select();
return new EditConfigurationShell();
}
use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem 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);
}
use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem 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));
}
Aggregations