Author: xcoulon
Date: 2012-02-09 06:11:41 -0500 (Thu, 09 Feb 2012)
New Revision: 38542
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftPasswordStorageKey.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStoreException.java
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/OpenShiftPasswordStorageKey.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/SecurePasswordStore.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/SecurePasswordStoreException.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
Log:
OPEN - issue JBIDE-10528: Improve OpenShift UI
https://issues.jboss.org/browse/JBIDE-10528
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-02-09
10:35:29 UTC (rev 38541)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-02-09
11:11:41 UTC (rev 38542)
@@ -14,7 +14,7 @@
</category>
<wizard
category="org.jboss.ide.eclipse.as.openshift.express.ui.wizard.category"
-
class="org.jboss.tools.openshift.express.internal.ui.wizard.CreateNewApplicationWizard"
+
class="org.jboss.tools.openshift.express.internal.ui.wizard.OpenShiftExpressApplicationWizard"
icon="icons/openshift-logo-white-icon.png"
id="org.jboss.ide.eclipse.as.openshift.express.ui.wizard.createNewApplicationWizard"
name="OpenShift Express Application">
Deleted:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/OpenShiftPasswordStorageKey.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/OpenShiftPasswordStorageKey.java 2012-02-09
10:35:29 UTC (rev 38541)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/OpenShiftPasswordStorageKey.java 2012-02-09
11:11:41 UTC (rev 38542)
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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.util;
-
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-import
org.jboss.tools.openshift.express.internal.ui.util.SecurePasswordStore.IStorageKey;
-
-
-/**
- * Implements a key to be used to store values in the preferences store.
- *
- * @author Andre Dietisheim
- *
- */
-public class OpenShiftPasswordStorageKey implements IStorageKey {
-
- private static final char SEPARATOR = '/';
-
- private static final String PREFERNCES_BASEKEY =
OpenShiftUIActivator.PLUGIN_ID.replace('.', SEPARATOR);
- private String platform;
- private String userName;
-
- public OpenShiftPasswordStorageKey(String platform, String userName) {
- this.userName = userName;
- this.platform = userName;
- }
-
- @Override
- public String getKey() {
- return new StringBuilder(PREFERNCES_BASEKEY)
- .append(platform)
- .append(SEPARATOR)
- .append(userName)
- .toString();
- }
-
- @Override
- public boolean equals(IStorageKey key) {
- if (!key.getClass().isAssignableFrom(OpenShiftPasswordStorageKey.class)) {
- return false;
- }
- OpenShiftPasswordStorageKey deltaCloudKey = (OpenShiftPasswordStorageKey) key;
- return userName.equals(deltaCloudKey.userName)
- && platform.equals(deltaCloudKey.platform);
- }
-}
Deleted:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/SecurePasswordStore.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/SecurePasswordStore.java 2012-02-09
10:35:29 UTC (rev 38541)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/SecurePasswordStore.java 2012-02-09
11:11:41 UTC (rev 38542)
@@ -1,98 +0,0 @@
-package org.jboss.tools.openshift.express.internal.ui.util;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-
-import org.eclipse.equinox.security.storage.EncodingUtils;
-import org.eclipse.equinox.security.storage.ISecurePreferences;
-import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
-import org.eclipse.equinox.security.storage.StorageException;
-
-/**
- * @author Andre Dietisheim
- *
- */
-public class SecurePasswordStore {
-
- private static final String ENCODING = "UTF-8";
-
- public static interface IStorageKey {
- public String getKey();
-
- public boolean equals(IStorageKey key);
- }
-
- private String password;
- private IStorageKey storageKey;
-
- public SecurePasswordStore(IStorageKey key) {
- this.storageKey = key;
- }
-
- public String getPassword() throws SecurePasswordStoreException {
- try {
- return this.password = getFromPreferences(storageKey);
- } catch (Exception e) {
- throw new SecurePasswordStoreException("Could get password", e);
- }
- }
-
- public void setPassword(String password) throws SecurePasswordStoreException {
- update(storageKey, password);
- }
-
- private void update(IStorageKey key, String password) throws
SecurePasswordStoreException {
- if (!storageKey.equals(key) || isPasswordChanged(password)) {
- storeInPreferences(this.password = password, this.storageKey = key);
- }
- }
-
- private boolean isPasswordChanged(String password) {
- if (this.password == null && password == null) {
- return false;
- } else {
- return (this.password == null && password != null) || (this.password != null
&& password == null)
- || !password.equals(this.password);
- }
- }
-
- public void remove() throws SecurePasswordStoreException {
- try {
- ISecurePreferences node = getNode(storageKey);
- if (node == null) {
- throw new SecurePasswordStoreException("Could not remove password");
- }
- node.clear();
- } catch (Exception e) {
- throw new SecurePasswordStoreException("Could not remove password", e);
- }
- }
-
- private String getFromPreferences(IStorageKey key) throws StorageException,
UnsupportedEncodingException {
- ISecurePreferences node = getNode(key);
- String password = node.get("password", null); //$NON-NLS-1$
- if (password == null) {
- return null;
- }
- return new String(EncodingUtils.decodeBase64(password));
- }
-
- private void storeInPreferences(String password, IStorageKey key) throws
SecurePasswordStoreException {
- try {
- ISecurePreferences node = getNode(key);
- node.put("password", EncodingUtils.encodeBase64(password.getBytes()), true
/* encrypt */); //$NON-NLS-1$
- } catch (Exception e) {
- throw new SecurePasswordStoreException("Could not store password", e);
- }
- }
-
- private ISecurePreferences getNode(IStorageKey key) throws UnsupportedEncodingException
{
- if (key == null) {
- return null;
- }
-
- ISecurePreferences root = SecurePreferencesFactory.getDefault();
- String keyString = URLEncoder.encode(key.getKey(), ENCODING);
- return root.node(keyString);
- }
-}
Deleted:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/SecurePasswordStoreException.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/SecurePasswordStoreException.java 2012-02-09
10:35:29 UTC (rev 38541)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/SecurePasswordStoreException.java 2012-02-09
11:11:41 UTC (rev 38542)
@@ -1,33 +0,0 @@
-/**
- *
- */
-package org.jboss.tools.openshift.express.internal.ui.util;
-
-/**
- * @author Xavier Coulon
- *
- */
-public class SecurePasswordStoreException extends Exception {
-
- /** generated serialVersionUID. */
- private static final long serialVersionUID = -1732042851833545771L;
-
- /**
- * Full constructor
- * @param message the message to print
- * @param cause the underlying cause
- */
- public SecurePasswordStoreException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Full constructor
- * @param message the message to print
- */
- public SecurePasswordStoreException(String message) {
- super(message);
- }
-
-
-}
Copied:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftPasswordStorageKey.java
(from rev 38538,
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/OpenShiftPasswordStorageKey.java)
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftPasswordStorageKey.java
(rev 0)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftPasswordStorageKey.java 2012-02-09
11:11:41 UTC (rev 38542)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.utils;
+
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import
org.jboss.tools.openshift.express.internal.ui.utils.SecurePasswordStore.IStorageKey;
+
+
+/**
+ * Implements a key to be used to store values in the preferences store.
+ *
+ * @author Andre Dietisheim
+ *
+ */
+public class OpenShiftPasswordStorageKey implements IStorageKey {
+
+ private static final char SEPARATOR = '/';
+
+ private static final String PREFERNCES_BASEKEY =
OpenShiftUIActivator.PLUGIN_ID.replace('.', SEPARATOR);
+ private String platform;
+ private String userName;
+
+ public OpenShiftPasswordStorageKey(String platform, String userName) {
+ this.userName = userName;
+ this.platform = userName;
+ }
+
+ @Override
+ public String getKey() {
+ return new StringBuilder(PREFERNCES_BASEKEY)
+ .append(platform)
+ .append(SEPARATOR)
+ .append(userName)
+ .toString();
+ }
+
+ @Override
+ public boolean equals(IStorageKey key) {
+ if (!key.getClass().isAssignableFrom(OpenShiftPasswordStorageKey.class)) {
+ return false;
+ }
+ OpenShiftPasswordStorageKey deltaCloudKey = (OpenShiftPasswordStorageKey) key;
+ return userName.equals(deltaCloudKey.userName)
+ && platform.equals(deltaCloudKey.platform);
+ }
+}
Property changes on:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftPasswordStorageKey.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java
(from rev 38538,
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/SecurePasswordStore.java)
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java
(rev 0)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java 2012-02-09
11:11:41 UTC (rev 38542)
@@ -0,0 +1,98 @@
+package org.jboss.tools.openshift.express.internal.ui.utils;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import org.eclipse.equinox.security.storage.EncodingUtils;
+import org.eclipse.equinox.security.storage.ISecurePreferences;
+import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
+import org.eclipse.equinox.security.storage.StorageException;
+
+/**
+ * @author Andre Dietisheim
+ *
+ */
+public class SecurePasswordStore {
+
+ private static final String ENCODING = "UTF-8";
+
+ public static interface IStorageKey {
+ public String getKey();
+
+ public boolean equals(IStorageKey key);
+ }
+
+ private String password;
+ private IStorageKey storageKey;
+
+ public SecurePasswordStore(IStorageKey key) {
+ this.storageKey = key;
+ }
+
+ public String getPassword() throws SecurePasswordStoreException {
+ try {
+ return this.password = getFromPreferences(storageKey);
+ } catch (Exception e) {
+ throw new SecurePasswordStoreException("Could get password", e);
+ }
+ }
+
+ public void setPassword(String password) throws SecurePasswordStoreException {
+ update(storageKey, password);
+ }
+
+ private void update(IStorageKey key, String password) throws
SecurePasswordStoreException {
+ if (!storageKey.equals(key) || isPasswordChanged(password)) {
+ storeInPreferences(this.password = password, this.storageKey = key);
+ }
+ }
+
+ private boolean isPasswordChanged(String password) {
+ if (this.password == null && password == null) {
+ return false;
+ } else {
+ return (this.password == null && password != null) || (this.password != null
&& password == null)
+ || !password.equals(this.password);
+ }
+ }
+
+ public void remove() throws SecurePasswordStoreException {
+ try {
+ ISecurePreferences node = getNode(storageKey);
+ if (node == null) {
+ throw new SecurePasswordStoreException("Could not remove password");
+ }
+ node.clear();
+ } catch (Exception e) {
+ throw new SecurePasswordStoreException("Could not remove password", e);
+ }
+ }
+
+ private String getFromPreferences(IStorageKey key) throws StorageException,
UnsupportedEncodingException {
+ ISecurePreferences node = getNode(key);
+ String password = node.get("password", null); //$NON-NLS-1$
+ if (password == null) {
+ return null;
+ }
+ return new String(EncodingUtils.decodeBase64(password));
+ }
+
+ private void storeInPreferences(String password, IStorageKey key) throws
SecurePasswordStoreException {
+ try {
+ ISecurePreferences node = getNode(key);
+ node.put("password", EncodingUtils.encodeBase64(password.getBytes()), true
/* encrypt */); //$NON-NLS-1$
+ } catch (Exception e) {
+ throw new SecurePasswordStoreException("Could not store password", e);
+ }
+ }
+
+ private ISecurePreferences getNode(IStorageKey key) throws UnsupportedEncodingException
{
+ if (key == null) {
+ return null;
+ }
+
+ ISecurePreferences root = SecurePreferencesFactory.getDefault();
+ String keyString = URLEncoder.encode(key.getKey(), ENCODING);
+ return root.node(keyString);
+ }
+}
Property changes on:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStoreException.java
(from rev 38538,
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/util/SecurePasswordStoreException.java)
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStoreException.java
(rev 0)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStoreException.java 2012-02-09
11:11:41 UTC (rev 38542)
@@ -0,0 +1,33 @@
+/**
+ *
+ */
+package org.jboss.tools.openshift.express.internal.ui.utils;
+
+/**
+ * @author Xavier Coulon
+ *
+ */
+public class SecurePasswordStoreException extends Exception {
+
+ /** generated serialVersionUID. */
+ private static final long serialVersionUID = -1732042851833545771L;
+
+ /**
+ * Full constructor
+ * @param message the message to print
+ * @param cause the underlying cause
+ */
+ public SecurePasswordStoreException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Full constructor
+ * @param message the message to print
+ */
+ public SecurePasswordStoreException(String message) {
+ super(message);
+ }
+
+
+}
Property changes on:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStoreException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-09
10:35:29 UTC (rev 38541)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-09
11:11:41 UTC (rev 38542)
@@ -136,7 +136,9 @@
final ISWTObservableValue existingAppNameTextObservable =
WidgetProperties.text(SWT.Modify).observe(
existingAppNameText);
ValueBindingBuilder.bind(existingAppNameTextObservable).to(existingAppNameModelObservable).in(dbc);
- existingAppNameText.setText(pageModel.getExistingApplicationName());
+ if (pageModel.getExistingApplicationName() != null) {
+ existingAppNameText.setText(pageModel.getExistingApplicationName());
+ }
// enable the app name text when the model state is set to 'use existing app'
ValueBindingBuilder.bind(WidgetProperties.enabled().observe(existingAppNameText))
.notUpdating(useExistingAppObservable).in(dbc);
@@ -175,12 +177,11 @@
final IObservableValue existingAppValidityObservable = BeanProperties.value(
ApplicationConfigurationWizardPageModel.PROPERTY_EXISTING_APPLICATION_NAME).observe(pageModel);
-
final ApplicationToSelectNameValidator existingProjectValidator = new
ApplicationToSelectNameValidator(
existingAppValidityObservable, existingAppNameTextObservable,
existingAppNameModelObservable);
dbc.addValidationStatusProvider(existingProjectValidator);
ControlDecorationSupport.create(existingProjectValidator, SWT.LEFT | SWT.TOP);
-
+
return existingAppSelectionGroup;
}
@@ -257,11 +258,12 @@
final ApplicationToCreateInputValidator applicationInputValidator = new
ApplicationToCreateInputValidator(
applicationNameTextObservable, cartridgesComboObservable);
dbc.addValidationStatusProvider(applicationInputValidator);
- /*final ApplicationToSelectNameValidator applicationNameValidator = new
ApplicationToSelectNameValidator(us
- applicationNameStatusObservable, applicationNameTextObservable);
- dbc.addValidationStatusProvider(applicationNameValidator);
- ControlDecorationSupport.create(applicationNameValidator, SWT.LEFT | SWT.TOP);
- */
+ /*
+ * final ApplicationToSelectNameValidator applicationNameValidator = new
ApplicationToSelectNameValidator(us
+ * applicationNameStatusObservable, applicationNameTextObservable);
+ * dbc.addValidationStatusProvider(applicationNameValidator);
+ * ControlDecorationSupport.create(applicationNameValidator, SWT.LEFT | SWT.TOP);
+ */
// embeddable cartridges
Group cartridgesGroup = new Group(container, SWT.NONE);
cartridgesGroup.setText("Embeddable Cartridges");
@@ -626,14 +628,15 @@
class ApplicationToSelectNameValidator extends MultiValidator {
- private final IObservableValue applicationNameStatusObservable;
+ private final IObservableValue existingAppValidityObservable;
+ private final ISWTObservableValue existingAppNameTextObservable;
+ private final IObservableValue existingAppNameModelObservable;
- private final ISWTObservableValue applicationNameTextObservable;
-
- public ApplicationToSelectNameValidator(IObservableValue
applicationNameStatusObservable,
- ISWTObservableValue applicationNameTextObservable, IObservableValue
existingAppNameModelObservable) {
- this.applicationNameStatusObservable = applicationNameStatusObservable;
- this.applicationNameTextObservable = applicationNameTextObservable;
+ public ApplicationToSelectNameValidator(IObservableValue
existingAppValidityObservable,
+ ISWTObservableValue existingAppNameTextObservable, IObservableValue
existingAppNameModelObservable) {
+ this.existingAppValidityObservable = existingAppValidityObservable;
+ this.existingAppNameTextObservable = existingAppNameTextObservable;
+ this.existingAppNameModelObservable = existingAppNameModelObservable;
}
@Override
@@ -652,7 +655,7 @@
@Override
public IObservableList getTargets() {
WritableList targets = new WritableList();
- targets.add(applicationNameTextObservable);
+ targets.add(existingAppNameTextObservable);
return targets;
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2012-02-09
10:35:29 UTC (rev 38541)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2012-02-09
11:11:41 UTC (rev 38542)
@@ -35,6 +35,7 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
@@ -69,15 +70,6 @@
protected void doCreateControls(Composite container, DataBindingContext dbc) {
GridLayoutFactory.fillDefaults().numColumns(2).margins(10, 10).applyTo(container);
- // This wizard page status and navigation controls are bound to the credentials
validity status:
- // 1 - No error message is displayed if the credentials validity status is
"OK"
- // 2 - when the user changes the 'rhLogin' or 'password' field values,
the credentials validity status is set to
- // "Cancel", thus no error message should appear on the wizard page
- // 3 - when the 'rhLogin' and the 'password' fields are not null/empty,
the 'next' control button is enabled
- // 4 - if the credentials validation fails (ie, invalid credentials), the
'next' button is disabled and an error
- // message is displayed at the top of the wizard page until the 'rhLogin'
and/or the 'password' field values
- // have been changed. Then back to step 2.
-
Label rhLoginLabel = new Label(container, SWT.NONE);
rhLoginLabel.setText("&Username");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(rhLoginLabel);
@@ -107,6 +99,11 @@
dbc.addValidationStatusProvider(credentialsStatusValidator);
ControlDecorationSupport.create(credentialsStatusValidator, SWT.LEFT | SWT.TOP);
+ new Label(container, SWT.NONE); // filler to align the checkbox under the text fields
+ Button rememberMeCheckBox = new Button(container, SWT.CHECK);
+ rememberMeCheckBox.setText("Save password (could trigger secure storage
login)");
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true,
false).applyTo(rememberMeCheckBox);
+
Link signupLink = new Link(container, SWT.WRAP);
signupLink.setText("If you don't have an account on OpenShift, please sign up
<a>here</a>.");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(2, 1).hint(SWT.DEFAULT,
30).applyTo(signupLink);
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-02-09
10:35:29 UTC (rev 38541)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-02-09
11:11:41 UTC (rev 38542)
@@ -16,10 +16,10 @@
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.common.ui.preferencevalue.StringPreferenceValue;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-import org.jboss.tools.openshift.express.internal.ui.util.OpenShiftPasswordStorageKey;
-import org.jboss.tools.openshift.express.internal.ui.util.SecurePasswordStore;
-import org.jboss.tools.openshift.express.internal.ui.util.SecurePasswordStoreException;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
+import org.jboss.tools.openshift.express.internal.ui.utils.OpenShiftPasswordStorageKey;
+import org.jboss.tools.openshift.express.internal.ui.utils.SecurePasswordStore;
+import org.jboss.tools.openshift.express.internal.ui.utils.SecurePasswordStoreException;
import com.openshift.express.client.IUser;
import com.openshift.express.client.NotFoundOpenShiftException;