Search in sources :

Example 6 with Shell

use of org.eclipse.reddeer.swt.api.Shell in project jbosstools-hibernate by jbosstools.

the class ProjectConfigurationFactory method addFurtherJPAConfiguration.

private static void addFurtherJPAConfiguration(String jpaVersion, boolean addedJavaFacet) {
    DefaultHyperlink hyperlink = new DefaultHyperlink();
    hyperlink.activate();
    Shell s = new DefaultShell("Modify Faceted Project");
    if (addedJavaFacet) {
        new NextButton().click();
    }
    DefaultGroup group = new DefaultGroup("Platform");
    new DefaultCombo(group).setSelection("Hibernate (JPA " + jpaVersion + ")");
    new LabeledCombo("Type:").setSelection("Disable Library Configuration");
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(s));
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) Shell(org.eclipse.reddeer.swt.api.Shell) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) DefaultHyperlink(org.eclipse.reddeer.uiforms.impl.hyperlink.DefaultHyperlink) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultGroup(org.eclipse.reddeer.swt.impl.group.DefaultGroup)

Example 7 with Shell

use of org.eclipse.reddeer.swt.api.Shell in project jbosstools-hibernate by jbosstools.

the class ProjectConfigurationFactory method setProjectFacetForDB.

/**
 * Sets JPA project facets for given database configuration
 * @param prj given project
 * @param cfg given database configuration
 * @param jpaVersion JPA version (2.0 or 2.1 is supported)
 */
public static void setProjectFacetForDB(String prj, DatabaseConfiguration cfg, String jpaVersion) {
    ProjectExplorer pe = new ProjectExplorer();
    pe.open();
    PropertyDialog pd = pe.getProject(prj).openProperties();
    boolean javaFacet = false;
    FacetsPropertyPage pp = new FacetsPropertyPage(pd);
    pd.select(pp);
    for (TreeItem t : getFacets(pd.getShell())) {
        if (t.getText().equals("Java")) {
            javaFacet = true;
            break;
        }
    }
    if (!javaFacet) {
        pp.selectFacet("Java");
        DefaultHyperlink hyperlink = new DefaultHyperlink();
        hyperlink.activate();
        Shell s = new DefaultShell("Modify Faceted Project");
        new OkButton().click();
        new WaitWhile(new ShellIsAvailable(s));
    }
    pp.selectFacet("JPA");
    pp.selectVersion("JPA", jpaVersion);
    addFurtherJPAConfiguration(jpaVersion, !javaFacet);
    closePreferences(pd);
    new WorkbenchShell().setFocus();
    pe.open();
    pe.selectProjects(prj);
    pd.open();
    // TODO Why this takes so long ?
    pd.select("JPA");
    JpaFacetInstallPage jpaPage = new JpaFacetInstallPage(pd);
    jpaPage.setConnectionProfile(cfg.getProfileName());
    jpaPage.setAutoDiscovery(true);
    closePreferences(pd);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    checkPersistenceXML(prj);
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultHyperlink(org.eclipse.reddeer.uiforms.impl.hyperlink.DefaultHyperlink) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) Shell(org.eclipse.reddeer.swt.api.Shell) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) PropertyDialog(org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) FacetsPropertyPage(org.eclipse.reddeer.eclipse.wst.common.project.facet.ui.FacetsPropertyPage) JpaFacetInstallPage(org.jboss.tools.hibernate.reddeer.wizard.JpaFacetInstallPage)

Example 8 with Shell

use of org.eclipse.reddeer.swt.api.Shell in project jbosstools-hibernate by jbosstools.

the class PersistenceXMLFileTest method prepare.

private void prepare() {
    importProject(prj, null);
    ProjectExplorer pe = new ProjectExplorer();
    pe.open();
    PropertyDialog pd = pe.getProject(prj).openProperties();
    FacetsPropertyPage fp = new FacetsPropertyPage(pd);
    pd.select(fp);
    List<TreeItem> facets = fp.getSelectedFacets();
    boolean javaFacet = false;
    boolean jpaFacet = false;
    for (TreeItem facet : facets) {
        if (facet.getText().equals("Java")) {
            javaFacet = true;
        } else if (facet.getText().equals("JPA")) {
            jpaFacet = true;
        }
    }
    if (!javaFacet) {
        fp.selectFacet("Java");
        new DefaultHyperlink(pd).activate();
        Shell s = new DefaultShell("Modify Faceted Project");
        new OkButton(s).click();
        new WaitWhile(new ShellIsAvailable(s));
    }
    if (!jpaFacet) {
        fp.selectFacet("JPA");
        new DefaultHyperlink(pd).activate();
        Shell s = new DefaultShell("Modify Faceted Project");
        new NextButton(s).click();
        JpaFacetInstallPage installPage = new JpaFacetInstallPage(s);
        installPage.setPlatform("Hibernate (JPA 2.1)");
        installPage.setJpaImplementation("Disable Library Configuration");
        new OkButton(s).click();
        new WaitWhile(new ShellIsAvailable(s));
    }
    pd.ok();
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultHyperlink(org.eclipse.reddeer.uiforms.impl.hyperlink.DefaultHyperlink) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) PropertyDialog(org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) FacetsPropertyPage(org.eclipse.reddeer.eclipse.wst.common.project.facet.ui.FacetsPropertyPage) JpaFacetInstallPage(org.jboss.tools.hibernate.reddeer.wizard.JpaFacetInstallPage)

Example 9 with Shell

use of org.eclipse.reddeer.swt.api.Shell in project linuxtools by eclipse.

the class RunDockerImageLaunchConfiguration method deleteRunConfiguration.

public void deleteRunConfiguration(String configuratioName) {
    selectConfiguration(configuratioName);
    new DefaultToolItem(DELETE_LAUNCH_CONFIGURATION_LABEL).click();
    Shell deleteShell = new DefaultShell("Confirm Launch Configuration Deletion");
    WidgetIsFound deleteButton = new WidgetIsFound(org.eclipse.swt.widgets.Button.class, deleteShell.getSWTWidget(), new WithMnemonicTextMatcher("Delete"));
    Button button;
    if (deleteButton.test()) {
        // photon changed button text
        button = new PushButton(deleteShell, "Delete");
    } else {
        button = new YesButton(deleteShell);
    }
    button.click();
    new WaitWhile(new ShellIsAvailable(deleteShell));
    new WaitUntil(new ShellIsAvailable("Run Configurations"));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) WithMnemonicTextMatcher(org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WidgetIsFound(org.eclipse.reddeer.core.condition.WidgetIsFound) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton) RadioButton(org.eclipse.reddeer.swt.impl.button.RadioButton) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) Button(org.eclipse.reddeer.swt.api.Button) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 10 with Shell

use of org.eclipse.reddeer.swt.api.Shell in project linuxtools by eclipse.

the class DockerConnection method pullImage.

public void pullImage(String imageName, String imageTag, String dockerRegister) {
    if (getImage(imageName, imageTag) == null) {
        refreshImages();
        treeViewerHandler.getTreeItem(item, "Images").select();
        new ContextMenu().getItem("Pull...").select();
        new WaitUntil(new ShellIsAvailable("Pull Image"), TimePeriod.DEFAULT);
        Shell pullShell = new DefaultShell("Pull Image");
        // select register
        if (dockerRegister != null) {
            Combo combo = new DefaultCombo();
            combo.setSelection(dockerRegister);
        }
        new LabeledText(IMAGE_NAME_LABEL_DIALOG).setFocus();
        new LabeledText(IMAGE_NAME_LABEL_DIALOG).setText(imageTag == null ? imageName : imageName + ":" + imageTag);
        new WaitUntil(new ControlIsEnabled(new FinishButton()));
        new FinishButton(pullShell).click();
        new WaitWhile(new ShellIsAvailable(pullShell));
        new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu) Combo(org.eclipse.reddeer.swt.api.Combo) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)17 Shell (org.eclipse.reddeer.swt.api.Shell)17 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)17 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)17 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)7 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)7 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)7 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)6 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)5 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)5 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)4 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)4 WorkbenchShell (org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell)4 DataSourceExplorerView (org.eclipse.reddeer.eclipse.datatools.connectivity.ui.dse.views.DataSourceExplorerView)3 DefaultCombo (org.eclipse.reddeer.swt.impl.combo.DefaultCombo)3 DefaultToolItem (org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem)3 DefaultHyperlink (org.eclipse.reddeer.uiforms.impl.hyperlink.DefaultHyperlink)3 WidgetIsFound (org.eclipse.reddeer.core.condition.WidgetIsFound)2 WithMnemonicTextMatcher (org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher)2 PropertyDialog (org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog)2