Author: adietish
Date: 2011-01-31 10:57:56 -0500 (Mon, 31 Jan 2011)
New Revision: 28771
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudUIUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
Log:
[JBIDE-8259] added content proposals for cloud name, cloud url, username
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudUIUtils.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudUIUtils.java 2011-01-31
15:51:06 UTC (rev 28770)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudUIUtils.java 2011-01-31
15:57:56 UTC (rev 28771)
@@ -15,8 +15,8 @@
import org.eclipse.jface.fieldassist.SimpleContentProposalProvider;
import org.eclipse.jface.fieldassist.TextContentAdapter;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.internal.deltacloud.ui.preferences.StringEntriesPreferenceValue;
@@ -30,16 +30,15 @@
final StringEntriesPreferenceValue preferencesValues = new
StringEntriesPreferenceValue(",", preferencesKey, Activator.PLUGIN_ID);
SimpleContentProposalProvider proposalProvider = new
SimpleContentProposalProvider(preferencesValues.get());
proposalProvider.setFiltering(true);
- text.addDisposeListener(new DisposeListener() {
-
+ text.addFocusListener(new FocusAdapter() {
+
@Override
- public void widgetDisposed(DisposeEvent e) {
- String currentValue = text.getText();
- preferencesValues.add(currentValue);
+ public void focusLost(FocusEvent e) {
+ preferencesValues.add(text.getText());
preferencesValues.store();
}
- });
+ });
KeyStroke keyStroke = KeyStroke.getInstance(SWT.CONTROL, ' ');
ContentProposalAdapter proposalAdapter = new ContentProposalAdapter(text, new
TextContentAdapter(), proposalProvider, keyStroke, null);
proposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2011-01-31
15:51:06 UTC (rev 28770)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2011-01-31
15:57:56 UTC (rev 28771)
@@ -74,10 +74,10 @@
*/
public class CloudConnectionPage extends WizardPage {
+ private static final String NAME_PROPOSAL_KEY = "cloud/name";
private static final String USERNAME_PROPOSAL_KEY = "cloud/username";
-
private static final String URL_PROPOSAL_KEY = "cloud/url";
-
+
private static final int CLOUDTYPE_CHECK_DELAY = 1000;
private static final String DESCRIPTION = "CloudConnection.desc";
//$NON-NLS-1$
@@ -334,7 +334,7 @@
Label nameLabel = new Label(container, SWT.NULL);
nameLabel.setText(WizardMessages.getString(NAME_LABEL));
Text nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
- DeltaCloudUIUtils.createPreferencesProposalAdapter(nameText, NAME_PROPOSAL_KEY());
+ DeltaCloudUIUtils.createPreferencesProposalAdapter(nameText, NAME_PROPOSAL_KEY);
bindName(dbc, nameText);
// url
@@ -487,10 +487,6 @@
setControl(container);
}
- private String NAME_PROPOSAL_KEY() {
- return "cloud/name";
- }
-
/**
* Enables/Disables (credentials) test button on url validity changes.
*
Show replies by date