Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Coulon2016-09-01 13:44:50 +0000
committerJeff Johnston2016-09-06 19:48:22 +0000
commit6123758e8fe9741f62edcf1734c3e8dad033be8f (patch)
treec62dcc6588c948a9893025c34c0e623de6323c4d
parent3c0aec37ce80a0e7ca2790d6e8bd5510ae551000 (diff)
downloadorg.eclipse.linuxtools-6123758e8fe9741f62edcf1734c3e8dad033be8f.tar.gz
org.eclipse.linuxtools-6123758e8fe9741f62edcf1734c3e8dad033be8f.tar.xz
org.eclipse.linuxtools-6123758e8fe9741f62edcf1734c3e8dad033be8f.zip
Bug 500638 - Properties do not show information about selected image/container in respective tab
Fixed the value returned by 'getContributorId()' in DockerImagesView and DockerContainersView to re-enable linking selection with properties view (was a regression introduced in fix for bug 499750 (Add commands in Image Hierarchy view). Added tests to verify that the properties view displays the expected tab upon selection in DockerExplorerView, DockerContainersView, DockerImagesView and DockerImageHierarchyView. Change-Id: I61038304c86b2dda02c46728d69e5dd351d8dcf9 Signed-off-by: Xavier Coulon <xcoulon@redhat.com> Reviewed-on: https://git.eclipse.org/r/80221 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/testutils/swt/SWTUtils.java9
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/testutils/swt/TabDescriptorAssertion.java39
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersViewSWTBotTest.java24
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerViewSWTBotTest.java21
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImageHierarchyViewSWTBotTest.java22
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesViewSWTBotTest.java23
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/wizards/NewDockerConnectionSWTBotTest.java23
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersView.java2
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerView.java1
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesView.java2
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/LabelProviderUtils.java9
11 files changed, 147 insertions, 28 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/testutils/swt/SWTUtils.java b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/testutils/swt/SWTUtils.java
index 09e0074d87..1257009ae3 100644
--- a/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/testutils/swt/SWTUtils.java
+++ b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/testutils/swt/SWTUtils.java
@@ -454,7 +454,14 @@ public class SWTUtils {
@SuppressWarnings("unchecked")
public static <T> T getView(final SWTWorkbenchBot bot, final String viewId) {
- return (T) bot.viewById(viewId).getReference().getView(false);
+ return (T) getView(bot, viewId, false);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> T getView(final SWTWorkbenchBot bot, final String viewId, final boolean restore) {
+ final SWTBotView viewBot = bot.viewById(viewId);
+ viewBot.setFocus();
+ return (T) viewBot.getReference().getView(restore);
}
/**
diff --git a/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/testutils/swt/TabDescriptorAssertion.java b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/testutils/swt/TabDescriptorAssertion.java
new file mode 100644
index 0000000000..715bc9fca9
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/testutils/swt/TabDescriptorAssertion.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.testutils.swt;
+
+import static org.hamcrest.Matchers.notNullValue;
+
+import org.assertj.core.api.AbstractAssert;
+import org.eclipse.ui.views.properties.tabbed.ITabDescriptor;
+
+/**
+ * Custom assertions on a given {@link ITabDescriptor}.
+ */
+public class TabDescriptorAssertion extends AbstractAssert<TabDescriptorAssertion, ITabDescriptor> {
+
+ protected TabDescriptorAssertion(final ITabDescriptor actual) {
+ super(actual, TabDescriptorAssertion.class);
+ }
+
+ public static TabDescriptorAssertion assertThat(final ITabDescriptor actual) {
+ return new TabDescriptorAssertion(actual);
+ }
+
+ public TabDescriptorAssertion hasId(final String id) {
+ notNullValue();
+ if (!actual.getId().equals(id)) {
+ failWithMessage("Expected tab section with id '%s' to be selected but it was '%s'", id, actual.getId());
+ }
+ return this;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersViewSWTBotTest.java b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersViewSWTBotTest.java
index 72262998cc..cb04323277 100644
--- a/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersViewSWTBotTest.java
+++ b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersViewSWTBotTest.java
@@ -27,6 +27,7 @@ import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.DockerConnectionM
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.DockerImageHierarchyViewAssertion;
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.MenuAssertion;
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.SWTUtils;
+import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.TabDescriptorAssertion;
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.TestLoggerRule;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
@@ -35,6 +36,8 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.junit.Assert;
import org.junit.Before;
import org.junit.ClassRule;
@@ -184,4 +187,25 @@ public class DockerContainersViewSWTBotTest {
MenuAssertion.assertThat(menuCommand).isVisible().isEnabled();
}
+ @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);
+ final PropertySheet propertySheet = SWTUtils
+ .syncExec(() -> SWTUtils.getView(bot, "org.eclipse.ui.views.PropertySheet", true));
+ this.dockerContainersView.setFocus();
+ // select the container in the table
+ selectContainerInTable("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();
+ TabDescriptorAssertion.assertThat(currentPage.getSelectedTab()).isNotNull()
+ .hasId("org.eclipse.linuxtools.docker.ui.properties.container.info");
+ }
+
}
diff --git a/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerViewSWTBotTest.java b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerViewSWTBotTest.java
index c3ebf626e4..3abe487541 100644
--- a/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerViewSWTBotTest.java
+++ b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerViewSWTBotTest.java
@@ -32,6 +32,7 @@ import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.DockerExplorerVie
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.MenuAssertion;
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.SWTBotTreeItemAssertions;
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.SWTUtils;
+import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.TabDescriptorAssertion;
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.TestLoggerRule;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
@@ -41,6 +42,8 @@ import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@@ -537,6 +540,14 @@ public class DockerExplorerViewSWTBotTest {
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();
+ TabDescriptorAssertion.assertThat(currentPage.getSelectedTab()).isNotNull()
+ .hasId("org.eclipse.linuxtools.docker.ui.properties.container.info");
}
@Test
@@ -548,10 +559,18 @@ public class DockerExplorerViewSWTBotTest {
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
// open the context menu on one the container
selectImagesInTreeView("Test", "angry_bar");
- // show container info in Properties view
+ // show image 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();
+ TabDescriptorAssertion.assertThat(currentPage.getSelectedTab()).isNotNull()
+ .hasId("org.eclipse.linuxtools.docker.ui.properties.image.info");
}
@Test
diff --git a/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImageHierarchyViewSWTBotTest.java b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImageHierarchyViewSWTBotTest.java
index 8f881adbc0..f23aa0d0d0 100644
--- a/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImageHierarchyViewSWTBotTest.java
+++ b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImageHierarchyViewSWTBotTest.java
@@ -30,6 +30,7 @@ import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.DockerConnectionM
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.DockerImageHierarchyViewAssertion;
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.MenuAssertion;
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.SWTUtils;
+import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.TabDescriptorAssertion;
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.TestLoggerRule;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
@@ -297,6 +298,8 @@ public class DockerImageHierarchyViewSWTBotTest {
@Test
public void shouldShowSelectedImageInPropertiesView() {
// given
+ final PropertySheet propertySheet = SWTUtils
+ .syncExec(() -> SWTUtils.getView(bot, "org.eclipse.ui.views.PropertySheet", true));
shouldDisplayImageHierarchyViewWhenSelectingImage();
// when
selectImageInTreeView(bot, "root");
@@ -304,26 +307,27 @@ public class DockerImageHierarchyViewSWTBotTest {
SWTUtils.getContextMenu(bot.viewById(DockerImageHierarchyView.VIEW_ID).bot().tree(), "Show In", "Properties")
.click();
// the properties view should be visible and filled with image details
- final SWTBotView propertiesBotView = this.bot.viewById("org.eclipse.ui.views.PropertySheet");
- assertThat(propertiesBotView.isActive()).isEqualTo(true);
- final PropertySheet propertiesView = (PropertySheet) propertiesBotView.getViewReference().getView(false);
- assertThat(((TabbedPropertySheetPage) propertiesView.getCurrentPage()).getCurrentTab()).isNotNull();
+ assertThat(propertySheet.getCurrentPage()).isInstanceOf(TabbedPropertySheetPage.class);
+ final TabbedPropertySheetPage currentPage = (TabbedPropertySheetPage) propertySheet.getCurrentPage();
+ TabDescriptorAssertion.assertThat(currentPage.getSelectedTab()).isNotNull()
+ .hasId("org.eclipse.linuxtools.docker.ui.properties.image.info");
}
@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();
- // the properties view should be visible and filled with image details
- final SWTBotView propertiesBotView = this.bot.viewById("org.eclipse.ui.views.PropertySheet");
- assertThat(propertiesBotView.isActive()).isEqualTo(true);
- final PropertySheet propertiesView = (PropertySheet) propertiesBotView.getViewReference().getView(false);
- assertThat(((TabbedPropertySheetPage) propertiesView.getCurrentPage()).getCurrentTab()).isNotNull();
+ assertThat(propertySheet.getCurrentPage()).isInstanceOf(TabbedPropertySheetPage.class);
+ final TabbedPropertySheetPage currentPage = (TabbedPropertySheetPage) propertySheet.getCurrentPage();
+ TabDescriptorAssertion.assertThat(currentPage.getSelectedTab()).isNotNull()
+ .hasId("org.eclipse.linuxtools.docker.ui.properties.container.info");
}
@Test
diff --git a/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesViewSWTBotTest.java b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesViewSWTBotTest.java
index 0a0cad053a..20c8aa52f1 100644
--- a/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesViewSWTBotTest.java
+++ b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesViewSWTBotTest.java
@@ -26,6 +26,7 @@ import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.CloseWelcomePageR
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.DockerConnectionManagerUtils;
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.DockerImageHierarchyViewAssertion;
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.SWTUtils;
+import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.TabDescriptorAssertion;
import org.eclipse.linuxtools.internal.docker.ui.testutils.swt.TestLoggerRule;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
@@ -33,6 +34,8 @@ import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.junit.Assert;
import org.junit.Before;
import org.junit.ClassRule;
@@ -174,5 +177,25 @@ public class DockerImagesViewSWTBotTest {
.isNotNull();
}
+ @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();
+ TabDescriptorAssertion.assertThat(currentPage.getSelectedTab()).isNotNull()
+ .hasId("org.eclipse.linuxtools.docker.ui.properties.image.info");
+ }
+
}
diff --git a/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/wizards/NewDockerConnectionSWTBotTest.java b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/wizards/NewDockerConnectionSWTBotTest.java
index 5cc2f67776..d698efb968 100644
--- a/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/wizards/NewDockerConnectionSWTBotTest.java
+++ b/containers/org.eclipse.linuxtools.docker.ui.tests/src/org/eclipse/linuxtools/internal/docker/ui/wizards/NewDockerConnectionSWTBotTest.java
@@ -92,6 +92,16 @@ public class NewDockerConnectionSWTBotTest {
this.addConnectionButton = dockerExplorerViewBot.toolbarButton("&Add Connection");
}
+ @Before
+ public void clearClipboards() {
+ // Clear all clipboards
+ Display.getDefault().syncExec(() -> {
+ Clipboard clip = new Clipboard(Display.getCurrent());
+ clip.clearContents(DND.CLIPBOARD);
+ clip.clearContents(DND.SELECTION_CLIPBOARD);
+ });
+ }
+
private IDockerConnection configureUnixSocketConnection(final String connectionName, final String pathToSocket) {
final DockerClient client = MockDockerClientFactory.build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from(connectionName, client)
@@ -204,8 +214,7 @@ public class NewDockerConnectionSWTBotTest {
public void shouldNotAllowNewConnectionWithDifferentNameAndSameUnixSocketSettings() throws IOException {
// given
final String dockerSocketTmpPath = File.createTempFile("docker", ".sock").getAbsolutePath();
- MockDockerConnectionSettingsFinder.validUnixSocketConnectionAvailable("Mock",
- "unix://" + dockerSocketTmpPath);
+ MockDockerConnectionSettingsFinder.validUnixSocketConnectionAvailable("Mock", "unix://" + dockerSocketTmpPath);
// add an existing connection based on the settings above
configureUnixSocketConnection("Mock", dockerSocketTmpPath);
// when open wizard
@@ -239,8 +248,7 @@ public class NewDockerConnectionSWTBotTest {
// given
final String dockerSocketTmpPath = File.createTempFile("docker", ".sock").getAbsolutePath();
configureUnixSocketConnection("Bar", dockerSocketTmpPath);
- MockDockerConnectionSettingsFinder.validUnixSocketConnectionAvailable("Mock",
- "unix://" + dockerSocketTmpPath);
+ MockDockerConnectionSettingsFinder.validUnixSocketConnectionAvailable("Mock", "unix://" + dockerSocketTmpPath);
final String otherDockerSocketTmpPath = File.createTempFile("docker", ".sock").getAbsolutePath();
// when open wizard
addConnectionButton.click();
@@ -287,13 +295,6 @@ public class NewDockerConnectionSWTBotTest {
}
private void verifyPopulateConnectionWithClipboard(final int clipboardType) {
- // Clear all clipboards
- Display.getDefault().syncExec(() -> {
- Clipboard clip = new Clipboard(Display.getCurrent());
- clip.clearContents(DND.CLIPBOARD);
- clip.clearContents(DND.SELECTION_CLIPBOARD);
- });
-
// given
final String[] connectionData = new String[] {
"DOCKER_HOST=https://1.2.3.4:1234 DOCKER_CERT_PATH=/path/to/certs DOCKER_TLS_VERIFY=1" };
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersView.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersView.java
index ccab7d2651..8527cf0075 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersView.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersView.java
@@ -147,7 +147,7 @@ public class DockerContainersView extends ViewPart implements
@Override
public String getContributorId() {
- return DockerExplorerView.VIEW_ID;
+ return "org.eclipse.linuxtools.docker.ui.propertiesViewContributor"; //$NON-NLS-1$
}
/**
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerView.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerView.java
index a35b368335..1b1f563d1a 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerView.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerView.java
@@ -106,7 +106,6 @@ public class DockerExplorerView extends CommonNavigator implements
@Override
public String getContributorId() {
return "org.eclipse.linuxtools.docker.ui.propertiesViewContributor"; //$NON-NLS-1$
- // return getSite().getId();
}
@SuppressWarnings("unchecked")
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesView.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesView.java
index 7c3c522cea..02180967e0 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesView.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesView.java
@@ -117,7 +117,7 @@ public class DockerImagesView extends ViewPart implements IDockerImageListener,
@Override
public String getContributorId() {
- return DockerExplorerView.VIEW_ID;
+ return "org.eclipse.linuxtools.docker.ui.propertiesViewContributor"; //$NON-NLS-1$
}
/**
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/LabelProviderUtils.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/LabelProviderUtils.java
index 28437ca6b1..3d834b6bda 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/LabelProviderUtils.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/LabelProviderUtils.java
@@ -273,9 +273,12 @@ public class LabelProviderUtils {
public static StyledString getStyledText(
final IDockerContainer dockerContainer) {
final StyledString styledString = new StyledString();
- styledString.append(dockerContainer.name()).append(
- " (" + dockerContainer.image() + ")", //$NON-NLS-1$ //$NON-NLS-2$
- StyledString.QUALIFIER_STYLER);
+ styledString.append(dockerContainer.name());
+ if (dockerContainer.image() != null
+ && !dockerContainer.image().isEmpty()) {
+ styledString.append(" (" + dockerContainer.image() + ")", //$NON-NLS-1$ //$NON-NLS-2$
+ StyledString.QUALIFIER_STYLER);
+ }
return styledString;
}

Back to the top