JBoss Tools SVN: r28826 - trunk/smooks/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2011-02-01 10:17:59 -0500 (Tue, 01 Feb 2011)
New Revision: 28826
Modified:
trunk/smooks/docs/reference/en-US/references.xml
Log:
[SmooksDoc] Input method list updated
Modified: trunk/smooks/docs/reference/en-US/references.xml
===================================================================
--- trunk/smooks/docs/reference/en-US/references.xml 2011-02-01 14:48:32 UTC (rev 28825)
+++ trunk/smooks/docs/reference/en-US/references.xml 2011-02-01 15:17:59 UTC (rev 28826)
@@ -71,6 +71,7 @@
<itemizedlist>
<listitem><para>System</para></listitem>
<listitem><para>Simple</para></listitem>
+ <listitem><para>IBus (Inteligent Input Bus)</para></listitem>
<listitem><para>Amharic(EZ+)</para></listitem>
<listitem><para>Cedilla</para></listitem>
<listitem><para>Cyrillic</para></listitem>
@@ -84,6 +85,7 @@
<listitem><para>Tigrigna-Ethiopian(EZ+)</para></listitem>
<listitem><para>Vietnamese</para></listitem>
<listitem><para>X input Method</para></listitem>
+ <listitem><para>None</para></listitem>
</itemizedlist>
</entry>
<entry>System</entry>
13 years, 11 months
JBoss Tools SVN: r28825 - trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-02-01 09:48:32 -0500 (Tue, 01 Feb 2011)
New Revision: 28825
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java
Log:
https://issues.jboss.org/browse/JBIDE-8298
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java 2011-02-01 14:35:13 UTC (rev 28824)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java 2011-02-01 14:48:32 UTC (rev 28825)
@@ -81,11 +81,12 @@
}
public void earlyStartup() {
- /* init xulrunner path for */
try {
- String xulRunnerPath = XulRunnerBrowser.getXulRunnerPath();
+ /* init xulrunner path */
+ XulRunnerBrowser.getXulRunnerPath();
+// String xulRunnerPath = XulRunnerBrowser.getXulRunnerPath();
// if ("true".equals(Platform.getDebugOption(PLUGIN_ID + "/debug/earlyStartup"))) { //$NON-NLS-1$ //$NON-NLS-2$
- logInfo(MessageFormat.format("earlyStartup: XULRunner path is: {0}",xulRunnerPath)); //$NON-NLS-1$
+// logInfo(MessageFormat.format("earlyStartup: XULRunner path is: {0}",xulRunnerPath)); //$NON-NLS-1$
// }
} catch (XulRunnerException e) {
logError(e);
13 years, 11 months
JBoss Tools SVN: r28824 - trunk/documentation/guides/Beginners_Guide/en-US.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-02-01 09:35:13 -0500 (Tue, 01 Feb 2011)
New Revision: 28824
Modified:
trunk/documentation/guides/Beginners_Guide/en-US/master.xml
Log:
fixed Version to 4.0.0 and copyright to 2011
Modified: trunk/documentation/guides/Beginners_Guide/en-US/master.xml
===================================================================
--- trunk/documentation/guides/Beginners_Guide/en-US/master.xml 2011-02-01 14:28:47 UTC (rev 28823)
+++ trunk/documentation/guides/Beginners_Guide/en-US/master.xml 2011-02-01 14:35:13 UTC (rev 28824)
@@ -49,11 +49,11 @@
</editor>
<copyright>
- <year>2010</year>
+ <year>2011</year>
<holder>JBoss by Red Hat</holder>
</copyright>
<releaseinfo>
- Version: 3.0.1.GA
+ Version: 4.0.0.GA
</releaseinfo>
<!--<abstract>
<title/>
13 years, 11 months
JBoss Tools SVN: r28823 - trunk/smooks/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2011-02-01 09:28:47 -0500 (Tue, 01 Feb 2011)
New Revision: 28823
Modified:
trunk/smooks/docs/reference/en-US/introduction.xml
Log:
[SmooksDoc] Duplicate screenshot removed
Modified: trunk/smooks/docs/reference/en-US/introduction.xml
===================================================================
--- trunk/smooks/docs/reference/en-US/introduction.xml 2011-02-01 13:55:54 UTC (rev 28822)
+++ trunk/smooks/docs/reference/en-US/introduction.xml 2011-02-01 14:28:47 UTC (rev 28823)
@@ -166,14 +166,6 @@
</listitem>
</itemizedlist>
- <figure>
- <title>Smooks Form editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/introduction/introduction2.png" scale="90"/>
- </imageobject>
- </mediaobject>
- </figure>
<!-- <para>The easiest way to use the Smooks Configuration Editor is to create a project
(Java project, an ESB project, etc.), right-click on it and select <property>New -> Other</property>
to open the New wizard. Drill into <property>Smooks -> Smooks Configuration File</property>
13 years, 11 months
JBoss Tools SVN: r28822 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-02-01 08:55:54 -0500 (Tue, 01 Feb 2011)
New Revision: 28822
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
Log:
https://issues.jboss.org/browse/JBIDE-7635
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-02-01 10:52:38 UTC (rev 28821)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-02-01 13:55:54 UTC (rev 28822)
@@ -11,6 +11,7 @@
package org.jboss.tools.cdi.ui.marker;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -76,27 +77,62 @@
primitives.add("java.lang.String"); //$NON-NLS-1$
}
- public static void addImport(String qualifiedName, ICompilationUnit compilationUnit) throws JavaModelException{
+ /**
+ *
+ * @param qualifiedName
+ * @param compilationUnit
+ * @return true if there is import in compilation unit with the same short name
+ * @throws JavaModelException
+ */
+ public static boolean addImport(String qualifiedName, ICompilationUnit compilationUnit) throws JavaModelException{
if(primitives.contains(qualifiedName))
- return;
+ return false;
- IPackageDeclaration[] packages = compilationUnit.getPackageDeclarations();
+ if(qualifiedName != null){
+ String shortName = getShortName(qualifiedName);
+
+ IPackageDeclaration[] packages = compilationUnit.getPackageDeclarations();
+
+ // local classes do not need to be imported
+ if(qualifiedName.indexOf(DOT) >= 0){
+ String typePackage = qualifiedName.substring(0,qualifiedName.lastIndexOf(DOT));
+
+ for(IPackageDeclaration packageDeclaration : packages){
+ if(packageDeclaration.getElementName().equals(typePackage))
+ return false;
+ }
+
+ for(IPackageDeclaration packageDeclaration : packages){
+ IType type = compilationUnit.getJavaProject().findType(packageDeclaration.getElementName()+DOT+shortName);
+ if(type != null && type.exists())
+ return true;
+ }
+ }
- if(qualifiedName.indexOf(DOT) >= 0){
- String typePackage = qualifiedName.substring(0,qualifiedName.lastIndexOf(DOT));
+ IImportDeclaration[] importDeclarations = compilationUnit.getImports();
- for(IPackageDeclaration packageDeclaration : packages){
- if(packageDeclaration.getElementName().equals(typePackage))
- return;
+ for(IImportDeclaration importDeclaration : importDeclarations){
+ String importName = importDeclaration.getElementName();
+ String elementShort = getShortName(importName);
+ if(importDeclaration.isOnDemand()){
+ int importLastDot = importName.lastIndexOf(DOT);
+ if(importLastDot == -1) return false; // invalid import declaration
+ int elementLastDot = qualifiedName.lastIndexOf(DOT);
+ if(elementLastDot == -1) return false; // invalid import declaration
+
+ if(qualifiedName.substring(0, elementLastDot).equals(importName.substring(0, importLastDot)))
+ return false;
+ }
+
+ if(importName.equals(qualifiedName))
+ return false;
+ if(elementShort.equals(shortName))
+ return true;
+
}
+ compilationUnit.createImport(qualifiedName, null, new NullProgressMonitor());
}
-
- if(qualifiedName != null){
- IImportDeclaration importDeclaration = compilationUnit.getImport(qualifiedName);
- if(importDeclaration == null || !importDeclaration.exists())
- compilationUnit.createImport(qualifiedName, null, new NullProgressMonitor());
- }
-
+ return false;
}
public static void addAnnotation(String qualifiedName, ICompilationUnit compilationUnit, IType element) throws JavaModelException{
@@ -104,13 +140,16 @@
if(annotation != null && annotation.exists())
return;
- addImport(qualifiedName, compilationUnit);
+ boolean duplicateShortName = addImport(qualifiedName, compilationUnit);
String lineDelim = compilationUnit.findRecommendedLineSeparator();
IBuffer buffer = compilationUnit.getBuffer();
String shortName = getShortName(qualifiedName);
+ if(duplicateShortName)
+ shortName = qualifiedName;
+
buffer.replace(element.getSourceRange().getOffset(), 0, AT+shortName+lineDelim);
synchronized(compilationUnit) {
@@ -125,13 +164,16 @@
if(annotation != null && annotation.exists())
return;
- addImport(qualifiedName, compilationUnit);
+ boolean duplicateShortName = addImport(qualifiedName, compilationUnit);
String lineDelim = SPACE;
IBuffer buffer = compilationUnit.getBuffer();
String shortName = getShortName(qualifiedName);
+ if(duplicateShortName)
+ shortName = qualifiedName;
+
annotation = getAnnotation(element, CDIConstants.INJECT_ANNOTATION_TYPE_NAME);
if(annotation != null && annotation.exists())
buffer.replace(annotation.getSourceRange().getOffset()+annotation.getSourceRange().getLength(), 0, lineDelim+AT+shortName);
@@ -212,26 +254,26 @@
}
private static void addQualifiersToParameter(ICompilationUnit compilationUnit, IInjectionPoint injectionPoint, Set<IQualifier> qualifiers){
+ HashMap<IQualifier, Boolean> duplicants = new HashMap<IQualifier, Boolean>();
if(!(injectionPoint instanceof IInjectionPointParameter))
return;
try{
for(IQualifier qualifier : qualifiers){
String qualifierName = qualifier.getSourceType().getFullyQualifiedName();
- if(!qualifierName.equals(CDIConstants.ANY_QUALIFIER_TYPE_NAME) && !qualifierName.equals(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME))
- addImport(qualifierName, compilationUnit);
+ boolean duplicant = false;
+ if(!qualifierName.equals(CDIConstants.ANY_QUALIFIER_TYPE_NAME) &&
+ !qualifierName.equals(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME)){
+ duplicant = addImport(qualifierName, compilationUnit);
+ }
+ duplicants.put(qualifier, new Boolean(duplicant));
}
- synchronized(compilationUnit) {
- compilationUnit.reconcile(ICompilationUnit.NO_AST, true, null, null);
- }
-
String paramName = ((IInjectionPointParameter)injectionPoint).getName();
IMethod method = ((IInjectionPointParameter)injectionPoint).getBeanMethod().getMethod();
IType type = method.getDeclaringType();
IType t = compilationUnit.getType(type.getElementName());
IMethod m = t.getMethod(method.getElementName(), method.getParameterTypes());
-
IBuffer buffer = compilationUnit.getBuffer();
MethodStructure ms = parseMethod(m, buffer.getContents());
@@ -246,7 +288,10 @@
for(IQualifier qualifier : qualifiers){
String qualifierName = qualifier.getSourceType().getFullyQualifiedName();
if(!qualifierName.equals(CDIConstants.ANY_QUALIFIER_TYPE_NAME) && !qualifierName.equals(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME)){
+ boolean duplicant = duplicants.get(qualifier).booleanValue();
String annotation = getShortName(qualifierName);
+ if(duplicant)
+ annotation = qualifierName;
b.append(AT+annotation+SPACE);
}
}
13 years, 11 months
JBoss Tools SVN: r28821 - trunk/documentation/guides/Beginners_Guide/en-US.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-02-01 05:52:38 -0500 (Tue, 01 Feb 2011)
New Revision: 28821
Modified:
trunk/documentation/guides/Beginners_Guide/en-US/Java_Web_(EE)_and_Standard_Edition_(SE).xml
Log:
typos in beginners guide
Modified: trunk/documentation/guides/Beginners_Guide/en-US/Java_Web_(EE)_and_Standard_Edition_(SE).xml
===================================================================
--- trunk/documentation/guides/Beginners_Guide/en-US/Java_Web_(EE)_and_Standard_Edition_(SE).xml 2011-02-01 10:43:38 UTC (rev 28820)
+++ trunk/documentation/guides/Beginners_Guide/en-US/Java_Web_(EE)_and_Standard_Edition_(SE).xml 2011-02-01 10:52:38 UTC (rev 28821)
@@ -562,17 +562,17 @@
<itemizedlist>
<listitem>
<para>
- the Attributes page, which allows the attributes of the Managed Bean to be viewed edited;
+ the Attributes page, which allows the attributes of the Managed Bean to be viewed and edited.
</para>
</listitem>
<listitem>
<para>
- the Operations page, which allows the operations of the Managed Bean to be viewed and edited;
+ the Operations page, which allows the operations of the Managed Bean to be viewed and edited.
</para>
</listitem>
<listitem>
<para>
- the Notifications page, which allows the Managed Bean to be subscribed to, and which notifications are received;
+ the Notifications page, which allows the Managed Bean to be subscribed to, and which notifications are received.
</para>
</listitem>
<listitem>
13 years, 11 months
JBoss Tools SVN: r28820 - trunk/documentation/guides/Beginners_Guide/en-US.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-02-01 05:43:38 -0500 (Tue, 01 Feb 2011)
New Revision: 28820
Modified:
trunk/documentation/guides/Beginners_Guide/en-US/Java_Web_(EE)_and_Standard_Edition_(SE).xml
Log:
removed parenthesis in beginners guide
Modified: trunk/documentation/guides/Beginners_Guide/en-US/Java_Web_(EE)_and_Standard_Edition_(SE).xml
===================================================================
--- trunk/documentation/guides/Beginners_Guide/en-US/Java_Web_(EE)_and_Standard_Edition_(SE).xml 2011-02-01 09:15:44 UTC (rev 28819)
+++ trunk/documentation/guides/Beginners_Guide/en-US/Java_Web_(EE)_and_Standard_Edition_(SE).xml 2011-02-01 10:43:38 UTC (rev 28820)
@@ -526,7 +526,7 @@
<section id="sect-Beginners_Guide-Java_Web_EE_and_Standard_Edition_SE_Plug_Ins-JMX_Tools">
<title>JMX Tools</title>
<para>
- Java Management Extensions (<acronym>JMX</acronym>) is a Java tool-set for managing and monitoring applications, connected devices, and service-oriented networks. A managed resource is represented by a dynamic object called a <emphasis>Managed Bean</emphasis> (or <emphasis>MBean</emphasis>, which is a JavaBean with a dependency injection.
+ Java Management Extensions (<acronym>JMX</acronym>) is a Java tool-set for managing and monitoring applications, connected devices, and service-oriented networks. A managed resource is represented by a dynamic object called a <emphasis>Managed Bean</emphasis> or <emphasis>MBean</emphasis>, which is a JavaBean with a dependency injection.
</para>
<para>
The <acronym>JMX</acronym> Tools consists of the <emphasis>MBean Explorer</emphasis> and the <emphasis>MBean Editor</emphasis>.
13 years, 11 months
JBoss Tools SVN: r28819 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-01 04:15:44 -0500 (Tue, 01 Feb 2011)
New Revision: 28819
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudUIUtils.java
Log:
[JBIDE-8259] added content proposals for cloud name, cloud url, username
Deleted: 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-02-01 09:14:58 UTC (rev 28818)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudUIUtils.java 2011-02-01 09:15:44 UTC (rev 28819)
@@ -1,73 +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.internal.deltacloud.ui.utils;
-
-import org.eclipse.jface.bindings.keys.KeyStroke;
-import org.eclipse.jface.fieldassist.ContentProposalAdapter;
-import org.eclipse.jface.fieldassist.ControlDecoration;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.fieldassist.SimpleContentProposalProvider;
-import org.eclipse.jface.fieldassist.TextContentAdapter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.jboss.tools.deltacloud.ui.Activator;
-import org.jboss.tools.internal.deltacloud.ui.preferences.StringsPreferenceValue;
-
-/**
- * @author André Dietisheim
- */
-public class DeltaCloudUIUtils {
-
- public static ContentProposalAdapter addPreferencesProposalAdapter(final Text text, String preferencesKey) {
- final ControlDecoration decoration = createContenAssistDecoration(text);
-
- final StringsPreferenceValue preferencesValues =
- new StringsPreferenceValue(',', preferencesKey, Activator.PLUGIN_ID);
- SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(preferencesValues.get());
- proposalProvider.setFiltering(true);
- text.addFocusListener(new FocusAdapter() {
-
- @Override
- public void focusGained(FocusEvent e) {
- decoration.show();
- }
-
- @Override
- public void focusLost(FocusEvent e) {
- decoration.hide();
-
- 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);
- return proposalAdapter;
- }
-
- private static ControlDecoration createContenAssistDecoration(Control control) {
- ControlDecoration decoration = new ControlDecoration(control, SWT.RIGHT | SWT.TOP);
- Image errorImage = FieldDecorationRegistry.getDefault()
- .getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL).getImage();
- decoration.setImage(errorImage);
- decoration.setDescriptionText("Content Assist Available");
- decoration.setShowHover(true);
- decoration.hide();
- return decoration;
- }
-}
13 years, 11 months
JBoss Tools SVN: r28818 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-01 04:14:58 -0500 (Tue, 01 Feb 2011)
New Revision: 28818
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.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/wizards/NewInstancePage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2011-02-01 08:49:17 UTC (rev 28817)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2011-02-01 09:14:58 UTC (rev 28818)
@@ -72,7 +72,7 @@
import org.jboss.tools.internal.deltacloud.ui.common.databinding.validator.MandatoryStringValidator;
import org.jboss.tools.internal.deltacloud.ui.common.databinding.validator.SelectedComboItemValidator;
import org.jboss.tools.internal.deltacloud.ui.utils.DataBindingUtils;
-import org.jboss.tools.internal.deltacloud.ui.utils.DeltaCloudUIUtils;
+import org.jboss.tools.internal.deltacloud.ui.utils.ContentProposalFactory;
/**
* @author Jeff Jonston
@@ -180,14 +180,14 @@
nameLabel.setText(WizardMessages.getString(NAME_LABEL));
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(nameLabel);
this.nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
- DeltaCloudUIUtils.addPreferencesProposalAdapter(nameText, NAME_PROPOSAL_KEY);
+ ContentProposalFactory.addPreferencesProposalAdapter(nameText, NAME_PROPOSAL_KEY);
GridDataFactory.fillDefaults().span(2, 1).grab(true, false).applyTo(nameText);
Label imageLabel = new Label(container, SWT.NULL);
imageLabel.setText(WizardMessages.getString(IMAGE_LABEL));
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(imageLabel);
this.imageText = new Text(container, SWT.BORDER | SWT.SINGLE);
- DeltaCloudUIUtils.addPreferencesProposalAdapter(imageText, IMAGE_PROPOSAL_KEY);
+ ContentProposalFactory.addPreferencesProposalAdapter(imageText, IMAGE_PROPOSAL_KEY);
GridDataFactory.fillDefaults().grab(true, false).applyTo(imageText);
Button findImageButton = new Button(container, SWT.NULL);
findImageButton.setText(WizardMessages.getString(FIND_BUTTON_LABEL));
@@ -212,7 +212,7 @@
keyLabel.setText(WizardMessages.getString(KEY_LABEL));
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(keyLabel);
keyText = new Text(container, SWT.BORDER | SWT.SINGLE);
- DeltaCloudUIUtils.addPreferencesProposalAdapter(keyText, KEY_PROPOSAL_KEY);
+ ContentProposalFactory.addPreferencesProposalAdapter(keyText, KEY_PROPOSAL_KEY);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(keyText);
Button keyManageButton = new Button(container, SWT.NULL);
keyManageButton.setText(WizardMessages.getString(MANAGE_BUTTON_LABEL));
13 years, 11 months
JBoss Tools SVN: r28817 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui: wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-01 03:49:17 -0500 (Tue, 01 Feb 2011)
New Revision: 28817
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/ContentProposalFactory.java
Modified:
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
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/ContentProposalFactory.java (from rev 28780, 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/ContentProposalFactory.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/ContentProposalFactory.java 2011-02-01 08:49:17 UTC (rev 28817)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * 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.internal.deltacloud.ui.utils;
+
+import org.eclipse.jface.bindings.keys.KeyStroke;
+import org.eclipse.jface.fieldassist.ContentProposalAdapter;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.jface.fieldassist.SimpleContentProposalProvider;
+import org.eclipse.jface.fieldassist.TextContentAdapter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.deltacloud.ui.Activator;
+import org.jboss.tools.internal.deltacloud.ui.preferences.StringsPreferenceValue;
+
+/**
+ * @author André Dietisheim
+ */
+public class ContentProposalFactory {
+
+ public static ContentProposalAdapter addPreferencesProposalAdapter(final Text text, String preferencesKey) {
+ final ControlDecoration decoration = createContenAssistDecoration(text);
+
+ final StringsPreferenceValue preferencesValues =
+ new StringsPreferenceValue(',', preferencesKey, Activator.PLUGIN_ID);
+ SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(preferencesValues.get());
+ proposalProvider.setFiltering(true);
+ text.addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusGained(FocusEvent e) {
+ decoration.show();
+ }
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ decoration.hide();
+
+ 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);
+ return proposalAdapter;
+ }
+
+ private static ControlDecoration createContenAssistDecoration(Control control) {
+ ControlDecoration decoration = new ControlDecoration(control, SWT.RIGHT | SWT.TOP);
+ Image errorImage = FieldDecorationRegistry.getDefault()
+ .getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL).getImage();
+ decoration.setImage(errorImage);
+ decoration.setDescriptionText("History available");
+ decoration.setShowHover(true);
+ decoration.hide();
+ return decoration;
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/ContentProposalFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-02-01 07:37:54 UTC (rev 28816)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2011-02-01 08:49:17 UTC (rev 28817)
@@ -66,7 +66,7 @@
import org.jboss.tools.internal.deltacloud.ui.common.swt.JFaceUtils;
import org.jboss.tools.internal.deltacloud.ui.preferences.IPreferenceKeys;
import org.jboss.tools.internal.deltacloud.ui.preferences.StringPreferenceValue;
-import org.jboss.tools.internal.deltacloud.ui.utils.DeltaCloudUIUtils;
+import org.jboss.tools.internal.deltacloud.ui.utils.ContentProposalFactory;
/**
* @author Jeff Jonhston
@@ -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.addPreferencesProposalAdapter(nameText, NAME_PROPOSAL_KEY);
+ ContentProposalFactory.addPreferencesProposalAdapter(nameText, NAME_PROPOSAL_KEY);
bindName(dbc, nameText);
// url
@@ -342,7 +342,7 @@
urlLabel.setText(WizardMessages.getString(URL_LABEL));
Point p1 = urlLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Text urlText = new Text(container, SWT.BORDER | SWT.SINGLE);
- DeltaCloudUIUtils.addPreferencesProposalAdapter(urlText, URL_PROPOSAL_KEY);
+ ContentProposalFactory.addPreferencesProposalAdapter(urlText, URL_PROPOSAL_KEY);
dbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(urlText),
BeanProperties.value(
@@ -367,7 +367,7 @@
Label usernameLabel = new Label(container, SWT.NULL);
usernameLabel.setText(WizardMessages.getString(USERNAME_LABEL));
Text usernameText = new Text(container, SWT.BORDER | SWT.SINGLE);
- DeltaCloudUIUtils.addPreferencesProposalAdapter(usernameText, USERNAME_PROPOSAL_KEY);
+ ContentProposalFactory.addPreferencesProposalAdapter(usernameText, USERNAME_PROPOSAL_KEY);
IObservableValue usernameObservable = WidgetProperties.text(SWT.Modify).observe(usernameText);
dbc.bindValue(
usernameObservable,
13 years, 11 months