Search in sources :

Example 6 with PropertySheet

use of org.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class DockerExplorerViewSWTBotTest method shouldShowSelectedContainerInPropertiesView.

@Test
public void shouldShowSelectedContainerInPropertiesView() {
    // given
    final DockerClient client = MockDockerClientFactory.container(MockContainerFactory.name("angry_bar").status("Stopped").build()).build();
    final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
    DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
    // open the context menu on one the container
    selectContainersInTreeView("Test", "angry_bar");
    // show container info in Properties view
    SWTUtils.getContextMenu(dockerExplorerViewBot.bot().tree(), "Show In", "Properties").click();
    // the properties view should be visible
    assertThat(this.bot.viewById("org.eclipse.ui.views.PropertySheet").isActive()).isEqualTo(true);
    // then the properties view should have a selected tab with container
    // info
    final PropertySheet propertySheet = SWTUtils.syncExec(() -> SWTUtils.getView(bot, "org.eclipse.ui.views.PropertySheet", true));
    assertThat(propertySheet.getCurrentPage()).isInstanceOf(TabbedPropertySheetPage.class);
    final TabbedPropertySheetPage currentPage = (TabbedPropertySheetPage) propertySheet.getCurrentPage();
    TabDescriptorAssertions.assertThat(currentPage.getSelectedTab()).isNotNull().hasId("org.eclipse.linuxtools.docker.ui.properties.container.info");
}
Also used : DockerConnection(org.eclipse.linuxtools.internal.docker.core.DockerConnection) DockerClient(com.spotify.docker.client.DockerClient) PropertySheet(org.eclipse.ui.views.properties.PropertySheet) TabbedPropertySheetPage(org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) Test(org.junit.Test)

Example 7 with PropertySheet

use of org.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class DockerImageHierarchyViewSWTBotTest method shouldShowSelectedContainerInPropertiesView.

@Test
public void shouldShowSelectedContainerInPropertiesView() {
    // given
    final PropertySheet propertySheet = SWTUtils.syncExec(() -> SWTUtils.getView(bot, "org.eclipse.ui.views.PropertySheet", true));
    shouldDisplayImageHierarchyViewWhenSelectingImage();
    // when
    selectImageInTreeView(bot, "root", "foo_image1", "foo_container1");
    // show container info in Properties view
    SWTUtils.getContextMenu(bot.viewById(DockerImageHierarchyView.VIEW_ID).bot().tree(), "Show In", "Properties").click();
    assertThat(propertySheet.getCurrentPage()).isInstanceOf(TabbedPropertySheetPage.class);
    final TabbedPropertySheetPage currentPage = (TabbedPropertySheetPage) propertySheet.getCurrentPage();
    TabDescriptorAssertions.assertThat(currentPage.getSelectedTab()).isNotNull().hasId("org.eclipse.linuxtools.docker.ui.properties.container.info");
}
Also used : PropertySheet(org.eclipse.ui.views.properties.PropertySheet) TabbedPropertySheetPage(org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) Test(org.junit.Test)

Example 8 with PropertySheet

use of org.eclipse.ui.views.properties.PropertySheet in project tdi-studio-se by Talend.

the class StartMonitorJobAction method getProperriesView.

/**
     * Gets the currently opened properties view.
     * 
     * @return The properties views
     */
private static List<PropertySheet> getProperriesView() {
    List<PropertySheet> list = new ArrayList<PropertySheet>();
    IViewReference[] views = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences();
    for (IViewReference viewReference : views) {
        if (IPageLayout.ID_PROP_SHEET.equals(viewReference.getId())) {
            list.add((PropertySheet) viewReference.getView(true));
        }
    }
    return list;
}
Also used : PropertySheet(org.eclipse.ui.views.properties.PropertySheet) IViewReference(org.eclipse.ui.IViewReference) ArrayList(java.util.ArrayList)

Example 9 with PropertySheet

use of org.eclipse.ui.views.properties.PropertySheet in project tdi-studio-se by Talend.

the class StartMonitorJobAction method openPropertiesView.

/**
     * Opens the properties view.
     * 
     * @param jvm The JVM
     * @throws PartInitException
     */
private static void openPropertiesView(IActiveJvm jvm) throws PartInitException {
    PropertySheet view = (PropertySheet) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(IPageLayout.ID_PROP_SHEET, String.valueOf(new Date().getTime()), IWorkbenchPage.VIEW_ACTIVATE);
    // make sure to set the selection as an identifier of view
    PropertyShowInContext context = (PropertyShowInContext) view.getShowInContext();
    if (context.getSelection() == null) {
        RuntimeVisualizationView jvmExplorer = (RuntimeVisualizationView) context.getPart();
        if (jvmExplorer != null) {
            view.selectionChanged(jvmExplorer, jvmExplorer.getSelection());
        }
    }
}
Also used : PropertySheet(org.eclipse.ui.views.properties.PropertySheet) PropertyShowInContext(org.eclipse.ui.views.properties.PropertyShowInContext) Date(java.util.Date)

Example 10 with PropertySheet

use of org.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class DockerExplorerViewSWTBotTest method shouldShowSelectedImageInPropertiesView.

@Test
public void shouldShowSelectedImageInPropertiesView() {
    // given
    final DockerClient client = MockDockerClientFactory.image(MockImageFactory.name("angry_bar").build()).build();
    final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
    DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
    // open the context menu on one the container
    selectImagesInTreeView("Test", "angry_bar");
    // show images info in Properties view
    SWTUtils.getContextMenu(dockerExplorerViewBot.bot().tree(), "Show In", "Properties").click();
    // the properties view should be visible
    assertThat(this.bot.viewById("org.eclipse.ui.views.PropertySheet").isActive()).isEqualTo(true);
    // then the properties view should have a selected tab with container
    // info
    final PropertySheet propertySheet = SWTUtils.syncExec(() -> SWTUtils.getView(bot, "org.eclipse.ui.views.PropertySheet", true));
    assertThat(propertySheet.getCurrentPage()).isInstanceOf(TabbedPropertySheetPage.class);
    final TabbedPropertySheetPage currentPage = (TabbedPropertySheetPage) propertySheet.getCurrentPage();
    TabDescriptorAssertions.assertThat(currentPage.getSelectedTab()).isNotNull().hasId("org.eclipse.linuxtools.docker.ui.properties.image.info");
}
Also used : DockerConnection(org.eclipse.linuxtools.internal.docker.core.DockerConnection) DockerClient(com.spotify.docker.client.DockerClient) PropertySheet(org.eclipse.ui.views.properties.PropertySheet) TabbedPropertySheetPage(org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) Test(org.junit.Test)

Aggregations

PropertySheet (org.eclipse.ui.views.properties.PropertySheet)13 TabbedPropertySheetPage (org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)7 Test (org.junit.Test)6 DockerClient (com.spotify.docker.client.DockerClient)4 DockerConnection (org.eclipse.linuxtools.internal.docker.core.DockerConnection)4 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)3 PartInitException (org.eclipse.ui.PartInitException)2 PropertyShowInContext (org.eclipse.ui.views.properties.PropertyShowInContext)2 Field (java.lang.reflect.Field)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 IDockerContainer (org.eclipse.linuxtools.docker.core.IDockerContainer)1 IViewReference (org.eclipse.ui.IViewReference)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1 IPage (org.eclipse.ui.part.IPage)1 ISection (org.eclipse.ui.views.properties.tabbed.ISection)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 JobSettingsView (org.talend.designer.core.ui.views.jobsettings.JobSettingsView)1 ComponentSettingsView (org.talend.designer.core.ui.views.properties.ComponentSettingsView)1 IFindTarget (org.talend.designer.runtime.visualization.internal.ui.properties.cpu.actions.FindAction.IFindTarget)1