Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Coulon2015-06-09 15:36:14 -0400
committerJeff Johnston2015-06-09 21:24:33 -0400
commit792bd4476001f0e78363e6a161ca0d17ecc273f1 (patch)
tree3b004c8c9acce834f57d6bba2bc5d635c863763c
parentb281337dedf7a9eaa646d16fe37e493ff8b21b32 (diff)
downloadorg.eclipse.linuxtools-792bd4476001f0e78363e6a161ca0d17ecc273f1.tar.gz
org.eclipse.linuxtools-792bd4476001f0e78363e6a161ca0d17ecc273f1.tar.xz
org.eclipse.linuxtools-792bd4476001f0e78363e6a161ca0d17ecc273f1.zip
Bug 469352 - Browse button are stubs in Docker Tooling
Including browse buttons in the New Connection wizard page Change-Id: Ia99dfc0d457a5498062e1994be8610313aa02803 Signed-off-by: Xavier Coulon <xcoulon@redhat.com> Reviewed-on: https://git.eclipse.org/r/49847 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com> (cherry picked from commit a792657f559bc3fb7c4683e7ff59510218494795) Reviewed-on: https://git.eclipse.org/r/49876
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/NewDockerConnectionPage.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/NewDockerConnectionPage.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/NewDockerConnectionPage.java
index 45bb0ca382..4ff4c8af47 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/NewDockerConnectionPage.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/NewDockerConnectionPage.java
@@ -38,7 +38,9 @@ import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
@@ -143,6 +145,8 @@ public class NewDockerConnectionPage extends WizardPage {
final Button unixSocketPathBrowseButton = new Button(customSettingsGroup, SWT.BUTTON1);
unixSocketPathBrowseButton.setText(WizardMessages
.getString("NewDockerConnectionPage.browseButton")); //$NON-NLS-1$
+ unixSocketPathBrowseButton
+ .addSelectionListener(onBrowseUnixSocketPath());
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(unixSocketPathBrowseButton);
tcpConnectionSelectionButton = new Button(customSettingsGroup, SWT.RADIO);
@@ -172,6 +176,7 @@ public class NewDockerConnectionPage extends WizardPage {
final Button tcpCertPathBrowseButton = new Button(customSettingsGroup, SWT.BUTTON1);
tcpCertPathBrowseButton.setText(WizardMessages
.getString("NewDockerConnectionPage.browseButton")); //$NON-NLS-1$
+ tcpCertPathBrowseButton.addSelectionListener(onBrowseTcpCertPathFile());
tcpCertPathText.setEnabled(false);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(tcpCertPathBrowseButton);
@@ -203,6 +208,35 @@ public class NewDockerConnectionPage extends WizardPage {
tcpAuthControls);
}
+ private SelectionListener onBrowseUnixSocketPath() {
+ return new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ final FileDialog fileDialog = new FileDialog(getShell());
+ final String selectedPath = fileDialog.open();
+ if (selectedPath != null) {
+ unixSocketPathText.setText(selectedPath);
+ }
+
+ }
+ };
+ }
+
+ private SelectionListener onBrowseTcpCertPathFile() {
+ return new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ final DirectoryDialog directoryDialog = new DirectoryDialog(
+ getShell());
+ final String selectedPath = directoryDialog.open();
+ if (selectedPath != null) {
+ tcpCertPathText.setText(selectedPath);
+ }
+
+ }
+ };
+ }
+
/**
* Sets the default settings by looking for the:
* <ul>

Back to the top