Search in sources :

Example 11 with PropertySheet

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

the class DockerImageHierarchyViewSWTBotTest method shouldShowSelectedImageInPropertiesView.

@Test
public void shouldShowSelectedImageInPropertiesView() {
    // given
    final PropertySheet propertySheet = SWTUtils.syncExec(() -> SWTUtils.getView(bot, "org.eclipse.ui.views.PropertySheet", true));
    shouldDisplayImageHierarchyViewWhenSelectingImage();
    // when
    selectImageInTreeView(bot, "root");
    // show container info in Properties view
    SWTUtils.getContextMenu(bot.viewById(DockerImageHierarchyView.VIEW_ID).bot().tree(), "Show In", "Properties").click();
    // the properties view should be visible and filled with images details
    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 : PropertySheet(org.eclipse.ui.views.properties.PropertySheet) TabbedPropertySheetPage(org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) Test(org.junit.Test)

Example 12 with PropertySheet

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

the class DockerImagesViewSWTBotTest 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);
    final PropertySheet propertySheet = SWTUtils.syncExec(() -> SWTUtils.getView(bot, "org.eclipse.ui.views.PropertySheet", true));
    this.dockerImagesView.setFocus();
    // select the container in the table
    selectImageInTable("angry_bar");
    // then the properties view should have a selected tab with container
    // info
    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)

Example 13 with PropertySheet

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

the class ShowInPropertiesViewCommandHandler method execute.

@Override
public Object execute(final ExecutionEvent event) {
    final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
    final List<IDockerContainer> containers = CommandUtils.getSelectedContainers(activePart);
    if (containers == null || containers.isEmpty()) {
        return null;
    }
    Display.getDefault().asyncExec(() -> {
        try {
            final PropertySheet propertySheet = (PropertySheet) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(// $NON-NLS-1$
            "org.eclipse.ui.views.PropertySheet");
            final PropertyShowInContext showInContext = new PropertyShowInContext(activePart, HandlerUtil.getCurrentSelection(event));
            propertySheet.show(showInContext);
        } catch (PartInitException e) {
            Activator.logErrorMessage(CommandMessages.getString(// $NON-NLS-1$
            "command.showIn.propertiesView.failure"), e);
        }
    });
    return null;
}
Also used : IDockerContainer(org.eclipse.linuxtools.docker.core.IDockerContainer) PropertySheet(org.eclipse.ui.views.properties.PropertySheet) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) PropertyShowInContext(org.eclipse.ui.views.properties.PropertyShowInContext) PartInitException(org.eclipse.ui.PartInitException)

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