Search in sources :

Example 1 with WorkbenchPreferenceDialog

use of org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog 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 WorkbenchPreferenceDialog

use of org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog in project jbosstools-openshift by jbosstools.

the class StoreConnectionTest method cleanUp.

@AfterClass
public static void cleanUp() {
    WorkbenchPreferenceDialog preferences = new WorkbenchPreferenceDialog();
    preferences.open();
    StoragePreferencePage storagePreferencePage = new StoragePreferencePage(preferences);
    preferences.select(storagePreferencePage);
    storagePreferencePage.selectPasswordsTab();
    List<PasswordProvider> masterPasswordProviders = storagePreferencePage.getMasterPasswordProviders();
    for (PasswordProvider tableItem : masterPasswordProviders) {
        tableItem.setEnabled(true);
    }
    preferences.ok();
}
Also used : WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) PasswordProvider(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.PasswordProvider) StoragePreferencePage(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage) AfterClass(org.junit.AfterClass)

Example 3 with WorkbenchPreferenceDialog

use of org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog in project jbosstools-openshift by jbosstools.

the class StoreConnectionTest method setupClass.

@BeforeClass
public static void setupClass() {
    WorkbenchPreferenceDialog preferences = new WorkbenchPreferenceDialog();
    preferences.open();
    StoragePreferencePage storagePreferencePage = new StoragePreferencePage(preferences);
    preferences.select(storagePreferencePage);
    storagePreferencePage.selectPasswordsTab();
    List<PasswordProvider> masterPasswordProviders = storagePreferencePage.getMasterPasswordProviders();
    for (PasswordProvider tableItem : masterPasswordProviders) {
        // The second part of this if is because https://issues.jboss.org/browse/JBIDE-24567
        if (tableItem.getDescription().contains("UI Prompt") || tableItem.getDescription().contains("secureStorageProvider.name")) {
            tableItem.setEnabled(true);
        } else {
            tableItem.setEnabled(false);
        }
    }
    preferences.ok();
}
Also used : WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) PasswordProvider(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.PasswordProvider) StoragePreferencePage(org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage) BeforeClass(org.junit.BeforeClass)

Example 4 with WorkbenchPreferenceDialog

use of org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog in project jbosstools-openshift by jbosstools.

the class OCBinaryLocationTest method openDialogAndSelectPage.

@Before
public void openDialogAndSelectPage() {
    dialog = new WorkbenchPreferenceDialog();
    page = new OpenShift3PreferencePage(dialog);
    dialog.open();
    dialog.select(page);
}
Also used : OpenShift3PreferencePage(org.jboss.tools.openshift.reddeer.preference.page.OpenShift3PreferencePage) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) Before(org.junit.Before)

Example 5 with WorkbenchPreferenceDialog

use of org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog in project jbosstools-openshift by jbosstools.

the class DebuggingEAPAppTest method doNotSuspendOnUncaughtExceptions.

private static void doNotSuspendOnUncaughtExceptions() {
    WorkbenchPreferenceDialog workbenchPreferenceDialog = new WorkbenchPreferenceDialog();
    workbenchPreferenceDialog.open();
    JavaDebugPreferencePage javaDebugPreferencePage = new JavaDebugPreferencePage(workbenchPreferenceDialog);
    workbenchPreferenceDialog.select(javaDebugPreferencePage);
    javaDebugPreferencePage.setSuspendOnUncaughtExceptions(false);
    workbenchPreferenceDialog.ok();
}
Also used : JavaDebugPreferencePage(org.jboss.tools.openshift.reddeer.preference.page.JavaDebugPreferencePage) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog)

Aggregations

WorkbenchPreferenceDialog (org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog)20 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)6 StoragePreferencePage (org.eclipse.reddeer.eclipse.equinox.security.ui.storage.StoragePreferencePage)5 OpenShift3PreferencePage (org.jboss.tools.openshift.reddeer.preference.page.OpenShift3PreferencePage)4 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)3 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)3 PasswordProvider (org.eclipse.reddeer.eclipse.equinox.security.ui.storage.PasswordProvider)3 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)3 RegistryAccountsPreferencePage (org.eclipse.linuxtools.docker.reddeer.preferences.RegistryAccountsPreferencePage)2 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)2 WidgetIsFound (org.eclipse.reddeer.core.condition.WidgetIsFound)2 WithMnemonicTextMatcher (org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher)2 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)2 DefaultTree (org.eclipse.reddeer.swt.impl.tree.DefaultTree)2 OpenShift3SSLCertificatePreferencePage (org.jboss.tools.cdk.reddeer.preferences.OpenShift3SSLCertificatePreferencePage)2 OpenShifIOPreferencePage (org.jboss.tools.openshift.reddeer.preference.page.OpenShifIOPreferencePage)2 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)1 DockerComposePreferencePage (org.eclipse.linuxtools.docker.reddeer.preferences.DockerComposePreferencePage)1 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)1 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)1