Search in sources :

Example 1 with DefaultTable

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();
    }
}
Also used : DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) Table(org.eclipse.reddeer.swt.api.Table) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 2 with DefaultTable

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();
}
Also used : TableItem(org.eclipse.reddeer.swt.api.TableItem) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable)

Example 3 with DefaultTable

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();
}
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 4 with DefaultTable

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());
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShift3Connection(org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 5 with DefaultTable

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;
}
Also used : TableItem(org.eclipse.reddeer.swt.api.TableItem) ArrayList(java.util.ArrayList) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable)

Aggregations

DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)28 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)20 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)18 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)17 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)16 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)11 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)10 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)8 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)7 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)6 Test (org.junit.Test)6 Table (org.eclipse.reddeer.swt.api.Table)5 TableItem (org.eclipse.reddeer.swt.api.TableItem)5 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)4 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)3 DefaultText (org.eclipse.reddeer.swt.impl.text.DefaultText)3 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)3 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)3 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)2 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)2