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");
}
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");
}
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;
}
Aggregations