Author: adietish
Date: 2011-10-17 03:00:13 -0400 (Mon, 17 Oct 2011)
New Revision: 35693
Added:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/PassphraseDialog.java
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/common/StringUtils.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
Log:
[JBIDE-9920] changed passphrase text field to be a password text field
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/common/StringUtils.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/common/StringUtils.java 2011-10-16
21:10:06 UTC (rev 35692)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/common/StringUtils.java 2011-10-17
07:00:13 UTC (rev 35693)
@@ -22,4 +22,9 @@
return "";
}
+ public static boolean isEmpty(String value) {
+ return value != null
+ && value.length() > 0;
+ }
+
}
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2011-10-16
21:10:06 UTC (rev 35692)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2011-10-17
07:00:13 UTC (rev 35693)
@@ -25,7 +25,6 @@
import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
@@ -124,20 +123,8 @@
@Override
public void widgetSelected(SelectionEvent e) {
- InputDialog dialog = new InputDialog(getShell(),
- "New ssh key"
- , "Please pick a passphrase for your new ssh key pair",
"openshift"
- , new IInputValidator() {
-
- @Override
- public String isValid(String input) {
- if (isEmpty(input)) {
- return "You have to provide a pass phrase";
- }
- return null;
- }
- });
- if (Dialog.OK == dialog.open()) {
+ InputDialog dialog = new PassphraseDialog(getShell());
+ if (Dialog.OK == dialog.open()) {
try {
String passPhrase = dialog.getValue();
String sshKeysDirectory = SshPrivateKeysPreferences.getSshKeyDirectory();
Added:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/PassphraseDialog.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/PassphraseDialog.java
(rev 0)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/PassphraseDialog.java 2011-10-17
07:00:13 UTC (rev 35693)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.wizard;
+
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.openshift.express.internal.ui.common.StringUtils;
+
+public class PassphraseDialog extends InputDialog {
+
+ public PassphraseDialog(Shell shell) {
+ super(shell
+ , "New ssh key"
+ , "Please pick a passphrase for your new ssh key pair",
"openshift"
+ , new PassphraseValidator());
+ }
+
+ protected int getInputTextStyle() {
+ return SWT.SINGLE | SWT.BORDER | SWT.PASSWORD;
+ }
+
+ private static class PassphraseValidator implements IInputValidator {
+
+ @Override
+ public String isValid(String input) {
+ if (StringUtils.isEmpty(input)) {
+ return "You have to provide a pass phrase";
+ }
+ return null;
+ }
+ }
+}
Property changes on:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/PassphraseDialog.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain