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