Author: adietish
Date: 2011-12-01 13:40:38 -0500 (Thu, 01 Dec 2011)
New Revision: 36841
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/UIUtils.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
Log:
[JBIDE-10305] selecting the whole username and password on focus gained.
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 2011-12-01
18:16:50 UTC (rev 36840)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2011-12-01
18:40:38 UTC (rev 36841)
@@ -40,6 +40,7 @@
import org.jboss.tools.common.ui.databinding.DataBindingUtils;
import org.jboss.tools.common.ui.databinding.ParametrizableWizardPageSupport;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.utils.UIUtils;
/**
* @author André Dietisheim
@@ -71,14 +72,16 @@
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(rhLoginLabel);
Text rhLoginText = new Text(container, SWT.BORDER);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2,
1).applyTo(rhLoginText);
+ UIUtils.selectAllOnFocus(rhLoginText);
DataBindingUtils.bindMandatoryTextField(
rhLoginText, "Username", CredentialsWizardPageModel.PROPERTY_RHLOGIN,
model, dbc);
-
+
Label passwordLabel = new Label(container, SWT.NONE);
passwordLabel.setText("&Password");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(passwordLabel);
Text passwordText = new Text(container, SWT.BORDER | SWT.PASSWORD);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2,
1).applyTo(passwordText);
+ UIUtils.selectAllOnFocus(passwordText);
DataBindingUtils.bindMandatoryTextField(
passwordText, "Password", CredentialsWizardPageModel.PROPERTY_PASSWORD,
model, dbc);
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/UIUtils.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/UIUtils.java
(rev 0)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/UIUtils.java 2011-12-01
18:40:38 UTC (rev 36841)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * 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.utils;
+
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @author André Dietisheim
+ */
+public class UIUtils {
+
+ public static void selectAllOnFocus(final Text text) {
+ text.addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusGained(FocusEvent e) {
+ text.selectAll();
+ }
+ });
+
+ }
+
+}
Property changes on:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/UIUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain