use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project linuxtools by eclipse.
the class RegistryAccountsPreferencePage method removeRegistry.
public void removeRegistry(String serverAddress) {
Table table = new DefaultTable();
if (table.containsItem(serverAddress)) {
table.select(serverAddress);
new PushButton("Remove").click();
}
}
use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project jbosstools-hibernate by jbosstools.
the class NewHibernateMappingFilePage method selectClasses.
/**
* Select class for further hbm.xml generation
* @param clazz class name
*/
public void selectClasses(String clazz) {
int headerIndex = new DefaultTable(referencedComposite).getHeaderIndex("Class name");
TableItem item = new DefaultTable(referencedComposite).getItem(clazz, headerIndex);
item.select();
}
use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project jbosstools-hibernate by jbosstools.
the class DriverDefinitionFactory method createDatabaseDriverDefinition.
/**
* Creates Driver definition based on DatabaseRequirement configuration
* @param conf given database requirement configuration
*/
public static void createDatabaseDriverDefinition(DatabaseConfiguration cfg) {
DriverTemplate dt = getDriverTemplate(cfg);
DriverDefinition dd = getDriverDefinition(cfg);
// Driver Definition creation
WorkbenchPreferenceDialog preferenceDialog = new WorkbenchPreferenceDialog();
preferenceDialog.open();
DriverPreferences preferencePage = new DriverPreferences(preferenceDialog);
preferenceDialog.select(preferencePage);
// TODO implement this in preference page
// TODO dont create new driver def if it already exists
List<TableItem> items = new DefaultTable().getItems();
for (int i = 0; i < items.size(); i++) {
new DefaultTableItem(0).select();
new PushButton("Remove").click();
Shell confirm = new DefaultShell("Confirm Driver Removal");
new YesButton().click();
new WaitWhile(new ShellIsAvailable(confirm));
new DefaultShell("Preferences");
}
DriverDialog ddw = preferencePage.addDriverDefinition();
ddw.selectDriverTemplate(dt.getType(), dt.getVersion());
ddw.setName(cfg.getDriverName());
ddw.addDriverLibrary(dd.getDriverLibrary());
ddw.setDriverClass(cfg.getDriverClass());
ddw.ok();
preferenceDialog.ok();
}
use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project jbosstools-openshift by jbosstools.
the class CreateNewProjectTest method testCreateNewProjectViaManageShell.
@Test
public void testCreateNewProjectViaManageShell() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.reopen();
OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
connection.select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT_OS_PROJECTS).select();
new DefaultShell(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS);
new PushButton(OpenShiftLabel.Button.NEW).click();
new DefaultShell(OpenShiftLabel.Shell.CREATE_OS_PROJECT);
new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText(DatastoreOS3.PROJECT1);
new LabeledText(OpenShiftLabel.TextLabels.PROJECT_DISPLAYED_NAME).setText(DatastoreOS3.PROJECT1_DISPLAYED_NAME);
new WaitUntil(new ControlIsEnabled(new FinishButton()));
new FinishButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS);
try {
new DefaultTable().getItem(DatastoreOS3.PROJECT1);
} catch (RedDeerException ex) {
fail("Project " + DatastoreOS3.PROJECT1 + " does not exist in the table. It has not been created.");
}
assertTrue("Displayed name for project " + DatastoreOS3.PROJECT1 + " is not shown in the table.", new DefaultTable().getItem(DatastoreOS3.PROJECT1).getText(1).equals(DatastoreOS3.PROJECT1_DISPLAYED_NAME));
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS), TimePeriod.LONG);
try {
connection.getProject();
} catch (RedDeerException ex) {
fail("OpenShift project created for a connection has not been shown in OpenShift explorer.\n" + ex.getCause());
}
}
use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project jbosstools-openshift by jbosstools.
the class OpenShiftProject method getOpenShiftResources.
/**
* Gets all resources of specific type for project and allows to lock properties view
* @param resourceType resource type
* @param pinView true to lock properties view, false otherwise
* @return list of resources of specified type or empty list if there are no resources
*/
public List<OpenShiftResource> getOpenShiftResources(Resource resourceType, boolean pinView) {
List<OpenShiftResource> resources = new ArrayList<OpenShiftResource>();
expand();
openProperties();
togglePinPropertiesView(pinView);
selectTabbedProperty("Details");
selectTabbedProperty(resourceType.toString());
List<TableItem> tableItems = new DefaultTable().getItems();
if (!tableItems.isEmpty()) {
for (TableItem tableItem : tableItems) {
resources.add(new OpenShiftResource(tableItem));
}
}
togglePinPropertiesView(false);
return resources;
}
Aggregations