Search in sources :

Example 66 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.

the class ServerAdapter method delete.

/**
 * Deletes server adapter safely - if it was not selected, selects it and
 * then deletes.
 */
public void delete() {
    select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.DELETE).select();
    new DefaultShell(OpenShiftLabel.Shell.DELETE_ADAPTER);
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.DELETE_ADAPTER));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 67 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.

the class OpenShift3Connection method createNewProject.

/**
 * Creates a new OpenShift project for a connection.
 *
 * @param projectName project name
 * @param displayedName displayed name
 * @return OpenShift Project
 */
public OpenShiftProject createNewProject(String projectName, String displayedName) {
    select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_OS_PROJECT).select();
    new DefaultShell(OpenShiftLabel.Shell.CREATE_OS_PROJECT);
    new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText(projectName);
    if (displayedName != null) {
        new LabeledText(OpenShiftLabel.TextLabels.PROJECT_DISPLAYED_NAME).setText(displayedName);
    }
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
    if (displayedName == null) {
        return getProject(projectName);
    } else {
        return getProject(displayedName);
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText)

Example 68 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-hibernate by jbosstools.

the class HibernateRedDeerTest method deleteHibernateConfigurations.

private static void deleteHibernateConfigurations() {
    KnownConfigurationsView v = new KnownConfigurationsView();
    v.open();
    while (v.getConsoleConfigurations() != null && !v.getConsoleConfigurations().isEmpty()) {
        TreeItem i = v.getConsoleConfigurations().get(0);
        i.select();
        ContextMenuItem closeConfig = new ContextMenuItem("Close Configuration");
        if (closeConfig.isEnabled()) {
            closeConfig.select();
            new WaitWhile(new JobIsRunning());
        }
        v.deleteConsoleConfiguration(i.getText());
    }
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) KnownConfigurationsView(org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 69 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-hibernate by jbosstools.

the class JpaAnnotationGenerationTest method testGenerateJPAHibernateAnnotations.

@Test
public void testGenerateJPAHibernateAnnotations() {
    ProjectUtils.getItem(prj, PCKG, "Dog.java").select();
    new ContextMenuItem("Source", "Generate Hibernate/JPA annotations...").select();
    postCheck("Dog");
    ProjectUtils.getItem(prj, PCKG, "Owner.java").select();
    new ShellMenuItem("Source", "Generate Hibernate/JPA annotations...").select();
    postCheck("Owner");
}
Also used : ShellMenuItem(org.eclipse.reddeer.swt.impl.menu.ShellMenuItem) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) Test(org.junit.Test)

Example 70 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-hibernate by jbosstools.

the class MappingDiagramTest method openMappingDiagram.

private void openMappingDiagram() {
    KnownConfigurationsView v = new KnownConfigurationsView();
    v.open();
    v.selectConsole(prj);
    ContextMenuItem mappingMenu = new ContextMenuItem("Mapping Diagram");
    mappingMenu.select();
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) KnownConfigurationsView(org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView)

Aggregations

ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)73 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)36 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)36 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)33 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)29 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)29 Test (org.junit.Test)26 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)19 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)17 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)15 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)11 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)11 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)9 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)8 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)8 KnownConfigurationsView (org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView)7 OpenShift3Connection (org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)7 ImportApplicationWizard (org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard)6 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)5 EditConfigurationShell (org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell)5