Search in sources :

Example 1 with DefaultTableItem

use of org.eclipse.reddeer.swt.impl.table.DefaultTableItem 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();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DriverDefinition(org.eclipse.reddeer.eclipse.datatools.ui.DriverDefinition) DefaultTableItem(org.eclipse.reddeer.swt.impl.table.DefaultTableItem) TableItem(org.eclipse.reddeer.swt.api.TableItem) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) DefaultTableItem(org.eclipse.reddeer.swt.impl.table.DefaultTableItem) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton) DriverPreferences(org.eclipse.reddeer.eclipse.datatools.connectivity.ui.preferences.DriverPreferences) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) DriverTemplate(org.eclipse.reddeer.eclipse.datatools.ui.DriverTemplate) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) DriverDialog(org.eclipse.reddeer.eclipse.datatools.connectivity.ui.dialogs.DriverDialog)

Example 2 with DefaultTableItem

use of org.eclipse.reddeer.swt.impl.table.DefaultTableItem in project jbosstools-hibernate by jbosstools.

the class LaunchConfigurationsDialog method selectExporter.

/**
 * Select exporter which should be selected
 * @param index index of the exporter
 */
public void selectExporter(int index) {
    new DefaultCTabItem(this, "Exporters").activate();
    new DefaultTableItem(new DefaultTable(this), index).setChecked(true);
}
Also used : DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) DefaultTableItem(org.eclipse.reddeer.swt.impl.table.DefaultTableItem) DefaultCTabItem(org.eclipse.reddeer.swt.impl.ctab.DefaultCTabItem)

Aggregations

DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)2 DefaultTableItem (org.eclipse.reddeer.swt.impl.table.DefaultTableItem)2 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)1 DriverDialog (org.eclipse.reddeer.eclipse.datatools.connectivity.ui.dialogs.DriverDialog)1 DriverPreferences (org.eclipse.reddeer.eclipse.datatools.connectivity.ui.preferences.DriverPreferences)1 DriverDefinition (org.eclipse.reddeer.eclipse.datatools.ui.DriverDefinition)1 DriverTemplate (org.eclipse.reddeer.eclipse.datatools.ui.DriverTemplate)1 Shell (org.eclipse.reddeer.swt.api.Shell)1 TableItem (org.eclipse.reddeer.swt.api.TableItem)1 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)1 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)1 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)1 DefaultCTabItem (org.eclipse.reddeer.swt.impl.ctab.DefaultCTabItem)1 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)1 WorkbenchPreferenceDialog (org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog)1