Author: adietish
Date: 2011-03-08 11:10:12 -0500 (Tue, 08 Mar 2011)
New Revision: 29603
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
Log:
[JBIDE-8293] added link to SSH2 private keys in preferences
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-03-08 15:25:47
UTC (rev 29602)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-03-08 16:10:12
UTC (rev 29603)
@@ -1,3 +1,8 @@
+2011-03-08 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
(createWidgets):
+ [JBIDE-8293] added link to SSH2 private keys in preferences
+
2011-02-18 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2011-03-08
15:25:47 UTC (rev 29602)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2011-03-08
16:10:12 UTC (rev 29603)
@@ -44,6 +44,7 @@
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
@@ -54,10 +55,14 @@
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.PreferencesUtil;
import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
@@ -81,6 +86,8 @@
*/
public class NewInstancePage extends WizardPage {
+ private static final String SSH_PREFERENCE_PAGE_ID =
"org.eclipse.jsch.ui.SSHPreferences";
+
private static final int IMAGE_CHECK_DELAY = 500;
private static final int KEY_CHECK_DELAY = 500;
@@ -102,6 +109,7 @@
private static final String MUST_ENTER_IMAGE_ID =
"ErrorMustProvideImageId.text"; //$NON-NLS-1$
private static final String LOADING_VALUE = "Loading.value"; //$NON-NLS-1$
private static final String IMAGE_ID_NOT_FOUND = "ErrorImageIdNotFound.text";
//$NON-NLS-1$
+ private static final String SHOW_SSH2_PREFS = "ShowSSH2Preferences.label";
//$NON-NLS-1$
private Composite container;
private NewInstancePageModel model;
@@ -216,6 +224,23 @@
keyManageButton.addSelectionListener(manageListener);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(keyManageButton);
+ Label dummyLabel = new Label(container, SWT.NULL);
+ dummyLabel.setVisible(false);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(dummyLabel);
+
+ Link sshPrefsLink = new Link(container, SWT.NULL);
+ sshPrefsLink.setText(WizardMessages.getString(SHOW_SSH2_PREFS));
+ sshPrefsLink.addListener(SWT.Selection, new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
+ event.display.getActiveShell(), SSH_PREFERENCE_PAGE_ID, null, null);
+ dialog.open();
+ }
+ });
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(2,
1).applyTo(sshPrefsLink);
+
Label hardwareLabel = new Label(container, SWT.NULL);
hardwareLabel.setText(WizardMessages.getString(HARDWARE_LABEL));
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(hardwareLabel);
@@ -440,9 +465,9 @@
if (keyName == null) {
return false;
}
- for (String key :SshPrivateKeysPreferences.getKeys()) {
+ for (String key : SshPrivateKeysPreferences.getKeys()) {
File file = new File(key);
- if (file.getName().equals(keyName)
+ if (file.getName().equals(keyName)
|| file.getName().startsWith(keyName + ".")) {
return true;
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2011-03-08
15:25:47 UTC (rev 29602)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2011-03-08
16:10:12 UTC (rev 29603)
@@ -84,6 +84,7 @@
ErrorMustProvideName.text=A name must be specified
ErrorMustProvideKeyName.text=A key name must be specified
ErrorMustProvideImageId.text=An image id must be specified
+ShowSSH2Preferences.label=<a>Show Private Keys in preferences</a>
NewInstance.desc=Specify details for a new instance you wish to launch based on an image
NewInstance.title=Launch Instance