Author: akazakov
Date: 2011-10-13 20:16:04 -0400 (Thu, 13 Oct 2011)
New Revision: 35643
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/images/message_bundle.gif
Removed:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/images/
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIImages.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el/CdiElResolver.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/build.properties
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/CDISeamCorePlugin.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/el/JSF2ElResolver.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
https://issues.jboss.org/browse/JBIDE-9717 added new icons for CDI message bundles
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/images/message_bundle.gif
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/images/message_bundle.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIImages.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIImages.java 2011-10-13
23:28:44 UTC (rev 35642)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIImages.java 2011-10-14
00:16:04 UTC (rev 35643)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * 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,
@@ -8,7 +8,6 @@
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
-
package org.jboss.tools.cdi.core;
import java.net.MalformedURLException;
@@ -42,6 +41,8 @@
public static final Image ANNOTATION_IMAGE = CDIXMLImages.ANNOTATION_IMAGE;
public static final Image CDI_EVENT_IMAGE = getImage("event.png");
//$NON-NLS-1$
+ public static final Image MESSAGE_BUNDLE_IMAGE =
getImage("message_bundle.gif"); //$NON-NLS-1$
+
public static final Image QUICKFIX_ADD = getImage("quickfixes/cdi_add.png");
//$NON-NLS-1$
public static final Image QUICKFIX_REMOVE =
getImage("quickfixes/cdi_remove.png"); //$NON-NLS-1$
public static final Image QUICKFIX_EDIT = getImage("quickfixes/cdi_edit.png");
//$NON-NLS-1$
@@ -69,7 +70,6 @@
private CDIImages parentRegistry;
protected CDIImages(URL registryUrl, CDIImages parent){
-
if(registryUrl == null) throw new
IllegalArgumentException(CDICoreMessages.CDI_IMAGESBASE_URL_FOR_IMAGE_REGISTRY_CANNOT_BE_NULL);
baseUrl = registryUrl;
parentRegistry = parent;
@@ -92,7 +92,6 @@
} else {
return parentRegistry.createImageDescriptor(key);
}
-
}
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el/CdiElResolver.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el/CdiElResolver.java 2011-10-13
23:28:44 UTC (rev 35642)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el/CdiElResolver.java 2011-10-14
00:16:04 UTC (rev 35643)
@@ -37,6 +37,7 @@
import org.jboss.tools.common.el.core.resolver.IRelevanceCheck;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
+import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberPresentation;
import org.jboss.tools.common.text.TextProposal;
/**
@@ -46,15 +47,29 @@
private static ELParserFactory factory = ELParserUtil.getJbossFactory();
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine#getELProposalImage()
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
@Override
- public Image getELProposalImage() {
- return CDIImages.BEAN_METHOD_IMAGE;
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
+ return (memberInfo instanceof
TypeInfoCollector.FieldInfo)?CDIImages.BEAN_FIELD_IMAGE:CDIImages.BEAN_METHOD_IMAGE;
}
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImage(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberPresentation)
+ */
@Override
+ protected Image getELProposalImage(MemberPresentation memberPresentation) {
+ return
memberPresentation.isProperty()?CDIImages.BEAN_FIELD_IMAGE:CDIImages.BEAN_METHOD_IMAGE;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#setImage(org.jboss.tools.common.text.TextProposal,
org.jboss.tools.common.el.core.resolver.IVariable)
+ */
+ @Override
protected void setImage(TextProposal kbProposal, IBean var) {
kbProposal.setImage(CDIImages.getImageByElement(var));
}
@@ -154,11 +169,20 @@
return factory;
}
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#isStaticMethodsCollectingEnabled()
+ */
@Override
protected boolean isStaticMethodsCollectingEnabled() {
return true;
}
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#createRelevanceCheck(org.eclipse.jdt.core.IJavaElement)
+ */
+ @Override
public IRelevanceCheck createRelevanceCheck(IJavaElement element) {
return new BeanRelevanceCheck(element);
}
@@ -182,6 +206,11 @@
}
}
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.el.core.ca.DefaultJavaRelevanceCheck#isRelevant(java.lang.String)
+ */
+ @Override
public boolean isRelevant(String content) {
if(super.isRelevant(content)) {
return true;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/build.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/build.properties 2011-10-13 23:28:44
UTC (rev 35642)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/build.properties 2011-10-14 00:16:04
UTC (rev 35643)
@@ -2,11 +2,9 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- images/,\
plugin.xml
src.includes = .settings/,\
META-INF/,\
build.properties,\
plugin.xml,\
- images/,\
src/
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/CDISeamCorePlugin.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/CDISeamCorePlugin.java 2011-10-13
23:28:44 UTC (rev 35642)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/CDISeamCorePlugin.java 2011-10-14
00:16:04 UTC (rev 35643)
@@ -23,8 +23,6 @@
// The plug-in ID
public static final String PLUGIN_ID = "org.jboss.tools.cdi.seam.core";
//$NON-NLS-1$
- public static final String CA_CDI_MESSAGE_IMAGE_PATH =
"images/ca/icons_CDI_Message.gif";
-
// Seam 3 International Module Runtime Extension ID
public static final String CDI_INTERNATIONAL_RUNTIME_EXTENTION =
"org.jboss.seam.international.status.TypedStatusMessageBundleExtension";
@@ -41,6 +39,7 @@
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -50,6 +49,7 @@
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java 2011-10-13
23:28:44 UTC (rev 35642)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java 2011-10-14
00:16:04 UTC (rev 35643)
@@ -26,6 +26,7 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.CDIImages;
import org.jboss.tools.cdi.seam.core.CDISeamCorePlugin;
import org.jboss.tools.cdi.seam.core.international.BundleModelFactory;
import org.jboss.tools.cdi.seam.core.international.IBundle;
@@ -66,15 +67,14 @@
*
*/
public class CDIInternationalMessagesELResolver extends
AbstractELCompletionEngine<IVariable> {
- private static final Image CDI_INTERNATIONAL_MESSAGE_PROPOSAL_IMAGE =
- CDISeamCorePlugin.getDefault().getImage(CDISeamCorePlugin.CA_CDI_MESSAGE_IMAGE_PATH);
/*
* (non-Javadoc)
- * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImage()
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
- public Image getELProposalImage() {
- return CDI_INTERNATIONAL_MESSAGE_PROPOSAL_IMAGE;
+ @Override
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
+ return CDIImages.MESSAGE_BUNDLE_IMAGE;
}
private static ELParserFactory factory = ELParserUtil.getDefaultFactory();
@@ -85,6 +85,7 @@
* (non-Javadoc)
* @see org.jboss.tools.common.el.core.resolver.ELResolver#getParserFactory()
*/
+ @Override
public ELParserFactory getParserFactory() {
return factory;
}
@@ -93,6 +94,7 @@
* (non-Javadoc)
* @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#log(java.lang.Exception)
*/
+ @Override
protected void log(Exception e) {
CDISeamCorePlugin.getDefault().logError(e);
}
@@ -101,22 +103,23 @@
* (non-Javadoc)
* @see
org.jboss.tools.common.el.core.resolver.ELResolver2#getProposals(org.jboss.tools.common.el.core.resolver.ELContext,
java.lang.String)
*/
+ @Override
public List<TextProposal> getProposals(ELContext context, String el, int offset)
{
return getCompletions(el, false, 0, context);
}
public List<TextProposal> getCompletions(String elString,
boolean returnEqualedVariablesOnly, int position, ELContext context) {
-
+
IProject project = context == null ? null :
context.getResource() == null ? null :
context.getResource().getProject();
if (project == null)
return null;
-
+
if (!CDICorePlugin.getCDI(project,
true).getExtensionManager().isCDIExtensionAvailable(CDISeamCorePlugin.CDI_INTERNATIONAL_RUNTIME_EXTENTION))
return null;
-
+
IBundleModel bundleModel = BundleModelFactory.getBundleModel(project);
IResourceBundle[] bundles = bundleModel == null ? null :
findResourceBundles(bundleModel);
if (bundles == null)
@@ -137,6 +140,7 @@
* (non-Javadoc)
* @see
org.jboss.tools.common.el.core.resolver.ELResolver2#resolve(org.jboss.tools.common.el.core.resolver.ELContext,
org.jboss.tools.common.el.core.model.ELExpression)
*/
+ @Override
public ELResolution resolve(ELContext context, ELExpression operand, int offset) {
ELResolutionImpl resolution = resolveELOperand(operand, context, true);
if(resolution != null)
@@ -152,7 +156,7 @@
context.getResource().getProject();
if (project == null)
return null;
-
+
if (!CDICorePlugin.getCDI(project,
true).getExtensionManager().isCDIExtensionAvailable(CDISeamCorePlugin.CDI_INTERNATIONAL_RUNTIME_EXTENTION))
return null;
@@ -183,6 +187,11 @@
return completions;
}
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#parseOperand(java.lang.String)
+ */
+ @Override
public ELExpression parseOperand(String operand) {
if(operand == null) return null;
String el = (operand.indexOf("#{") < 0 &&
operand.indexOf("${") < 0) ? "#{" + operand + "}" :
operand; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
@@ -243,7 +252,7 @@
ELSegmentImpl segment = new
MessagePropertyELSegmentImpl(combineLexicalTokensForExpression(left));
processMessageBundleSegment(expr, (MessagePropertyELSegmentImpl)segment,
resolvedVariables);
-
+
segment.setResolved(true);
for (Variable variable : resolvedVars) {
segment.getVariables().add(variable);
@@ -278,16 +287,16 @@
if (left != null) {
ELSegmentImpl segment = new MessagePropertyELSegmentImpl(left.getFirstToken());
processMessageBundleSegment(expr, (MessagePropertyELSegmentImpl)segment,
resolvedVariables);
-
+
segment.setResolved(false);
resolution.addSegment(segment);
-
+
for (Variable var : resolvedVariables) {
String varName = var.getName();
if(varName.startsWith(operand.getText())) {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
}
}
@@ -309,13 +318,13 @@
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
proposal.setLabel(varName);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
} else if(returnEqualedVariablesOnly) {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName);
proposal.setLabel(varName);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
}
resolution.getLastSegment().getVariables().add(var);
@@ -364,10 +373,6 @@
return result;
}
- protected void setImage(TextProposal kbProposal) {
- kbProposal.setImage(getELProposalImage());
- }
-
protected void resolveLastSegment(ELInvocationExpression expr,
List<Variable> members,
ELResolutionImpl resolution,
@@ -409,7 +414,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal);
kbProposal.setLabel(proposal);
- setImage(kbProposal);
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
@@ -420,8 +425,8 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal.substring(filter.length()));
kbProposal.setLabel(proposal);
- kbProposal.setImage(getELProposalImage());
-
+ kbProposal.setImage(getELProposalImageForMember(null));
+
kbProposals.add(kbProposal);
}
}
@@ -461,7 +466,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal);
kbProposal.setLabel(proposal);
- setImage(kbProposal);
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
@@ -478,7 +483,7 @@
kbProposal.setReplacementString(replacementString);
kbProposal.setLabel(proposal);
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
}
@@ -489,7 +494,7 @@
resolution.setLastResolvedToken(expr);
}
}
-
+
private void processMessageBundleSegment(ELInvocationExpression expr,
MessagePropertyELSegmentImpl segment, List<Variable> variables) {
if(segment.getToken() == null)
return;
@@ -509,7 +514,6 @@
for (XModelObject o: os.values()) {
segment.addObject(o);
}
-
}
}
}
@@ -529,7 +533,7 @@
}
return ok;
}
-
+
private void processMessagePropertySegment(ELInvocationExpression expr,
MessagePropertyELSegmentImpl segment, List<Variable> variables){
if(segment.getToken() == null)
return;
@@ -540,9 +544,9 @@
IBundle bundle = bundleModel.getBundle(variable.basename);
if(bundle == null)
return;
-
+
String propertyName = segment.getToken().getText();
-
+
IProperty prop = bundle.getProperty(trimQuotes(propertyName));
if(prop == null) continue;
Map<String, LocalizedValue> values = ((PropertyImpl)prop).getValues();
@@ -563,7 +567,7 @@
}
}
}
-
+
public boolean findPropertyLocation(XModelObject property, String content,
MessagePropertyELSegmentImpl segment) {
String name = property.getAttributeValue("name"); //$NON-NLS-1$
String nvs = property.getAttributeValue("name-value-separator");
//$NON-NLS-1$
@@ -572,7 +576,7 @@
segment.setMessagePropertySourceReference(i, name.length());
return true;
}
-
+
protected void processSingularMember(Variable mbr, Set<TextProposal> kbProposals)
{
// Surround the "long" keys containing the dots with [' ']
TreeSet<String> keys = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
@@ -586,15 +590,15 @@
TextProposal proposal = new TextProposal();
proposal.setReplacementString("['" + key + "']");
//$NON-NLS-1$ //$NON-NLS-2$
proposal.setLabel("['" + key + "']");
- setImage(proposal);
-
+ proposal.setImage(getELProposalImageForMember(null));
+
kbProposals.add(proposal);
} else {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(key);
proposal.setLabel(key);
- setImage(proposal);
-
+ proposal.setImage(getELProposalImageForMember(null));
+
kbProposals.add(proposal);
}
}
@@ -618,6 +622,11 @@
this.f = f;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.resolver.IVariable#getName()
+ */
+ @Override
public String getName() {
return name;
}
@@ -659,11 +668,20 @@
return null;
}
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#isStaticMethodsCollectingEnabled()
+ */
@Override
protected boolean isStaticMethodsCollectingEnabled() {
return false;
}
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#createRelevanceCheck(org.eclipse.jdt.core.IJavaElement)
+ */
+ @Override
public IRelevanceCheck createRelevanceCheck(IJavaElement element) {
return IRRELEVANT;
}
@@ -677,5 +695,4 @@
}
return result.values().toArray(new IResourceBundle[0]);
}
-
-}
+}
\ No newline at end of file
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2011-10-13
23:28:44 UTC (rev 35642)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2011-10-14
00:16:04 UTC (rev 35643)
@@ -53,9 +53,9 @@
import org.jboss.tools.common.el.core.resolver.JavaMemberELSegment;
import org.jboss.tools.common.el.core.resolver.JavaMemberELSegmentImpl;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
-import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberPresentation;
+import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.el.internal.core.parser.token.JavaNameTokenDescription;
import org.jboss.tools.common.text.TextProposal;
@@ -69,12 +69,16 @@
public AbstractELCompletionEngine() {}
- public abstract Image getELProposalImage();
+ protected abstract Image getELProposalImageForMember(MemberInfo memberInfo);
protected abstract void log(Exception e);
private static ELParserFactory defaultFactory = ELParserUtil.getJbossFactory();
+ protected Image getELProposalImage(MemberPresentation memberPresentation) {
+ return
getELProposalImageForMember(memberPresentation!=null?memberPresentation.getMember():null);
+ }
+
/* (non-Javadoc)
* @see
org.jboss.tools.common.el.core.resolver.ELResolver#getProposals(org.jboss.tools.common.el.core.resolver.ELContext,
int)
*/
@@ -354,7 +358,7 @@
proposal.setLabel(v.getName());
proposal.setReplacementString(varNameProposal);
proposal.setLabel(v.getName());
- proposal.setImage(getELProposalImage());
+ proposal.setImage(getELProposalImageForMember(memberInfo));
proposal.setType(typeName);
proposal.setSourceType(sourceTypeName);
if (jmSegment != null) {
@@ -770,7 +774,7 @@
ELTextProposal proposal = new ELTextProposal();
proposal.setReplacementString(presentationString);
proposal.setLabel(presentationDisplayName);
- proposal.setImage(getELProposalImage());
+ proposal.setImage(getELProposalImage(presentation));
proposal.setType(typeName);
proposal.setSourceType(sourceTypeName);
for (MemberInfo mi : presentation.getAllMembers()) {
@@ -816,7 +820,7 @@
ELTextProposal proposal = new ELTextProposal();
proposal.setReplacementString(presentationString);
proposal.setLabel(presentationDisplayName);
- proposal.setImage(getELProposalImage());
+ proposal.setImage(getELProposalImage(presentation));
proposal.setType(typeName);
proposal.setSourceType(sourceTypeName);
for (MemberInfo mi : presentation.getAllMembers()) {
@@ -904,7 +908,7 @@
ELTextProposal kbProposal = new ELTextProposal();
kbProposal.setReplacementString(proposal.getPresentation().substring(filter.length()));
kbProposal.setLabel(proposal.getPresentationDisplayName());
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(proposal.getMember()));
kbProposal.setType(typeName);
kbProposal.setSourceType(sourceTypeName);
for (MemberInfo mi : proposal.getAllMembers()) {
@@ -1015,7 +1019,7 @@
kbProposal.setReplacementString(replacementString);
kbProposal.setLabel(proposal.getPresentationDisplayName());
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(member));
kbProposal.setType(typeName);
kbProposal.setSourceType(sourceTypeName);
for (MemberInfo mi : proposal.getAllMembers()) {
@@ -1045,11 +1049,11 @@
}
protected void setImage(TextProposal kbProposal, TypeInfoCollector.MemberPresentation
proposal) {
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImage(proposal));
}
protected void setImage(TextProposal kbProposal, V var) {
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(null));
}
/**
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2011-10-13
23:28:44 UTC (rev 35642)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2011-10-14
00:16:04 UTC (rev 35643)
@@ -1057,6 +1057,7 @@
* @author Alexey Kazakov
*/
public static class MemberPresentation {
+ private boolean property;
private String presentation;
private String displayName;
private MemberInfo member;
@@ -1121,6 +1122,14 @@
public Set<MemberInfo> getAllMembers() {
return allMembers;
}
+
+ public boolean isProperty() {
+ return property;
+ }
+
+ public void setProperty(boolean property) {
+ this.property = property;
+ }
}
private static class MemberPresentationComparator implements
Comparator<MemberPresentation> {
@@ -1296,6 +1305,7 @@
MemberPresentation existingPresentation = presentations.get(pr.getPresentation());
existingPresentation.addMember(m);
}
+ pr.setProperty(true);
if(unpairedGettersOrSetters!=null) {
MethodInfo previousGetter = getters.get(propertyName);
MethodInfo previousSetter = setters.get(propertyName);
@@ -1319,7 +1329,7 @@
}
return properties;
}
-
+
public static void cleanCache() {
caches = new Caches();
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/el/JSF2ElResolver.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/el/JSF2ElResolver.java 2011-10-13
23:28:44 UTC (rev 35642)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/el/JSF2ElResolver.java 2011-10-14
00:16:04 UTC (rev 35643)
@@ -38,12 +38,12 @@
public static final Image JSF_EL_PROPOSAL_IMAGE =
JSFModelPlugin.getDefault().getImage(JSFModelPlugin.CA_JSF_EL_IMAGE_PATH);
-
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine#getELProposalImage()
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
@Override
- public Image getELProposalImage() {
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
return JSF_EL_PROPOSAL_IMAGE;
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java 2011-10-13
23:28:44 UTC (rev 35642)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java 2011-10-14
00:16:04 UTC (rev 35643)
@@ -68,9 +68,10 @@
/*
* (non-Javadoc)
- * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImage()
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
- public Image getELProposalImage() {
+ @Override
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
return JSF2_EL_CC_ATTRS_PROPOSAL_IMAGE;
}
@@ -225,7 +226,7 @@
if(varName.startsWith(operand.getText())) {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
}
}
@@ -249,13 +250,13 @@
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
proposal.setLabel(varName);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
} else if(returnEqualedVariablesOnly) {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName);
proposal.setLabel(varName);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
}
segment.getVariables().add(var);
@@ -413,10 +414,6 @@
return result;
}
- protected void setImage(TextProposal kbProposal) {
- kbProposal.setImage(getELProposalImage());
- }
-
protected void resolveLastSegment(ELInvocationExpression expr,
List<IVariable> members,
ELResolutionImpl resolution,
@@ -456,7 +453,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal);
kbProposal.setLabel(proposal);
- setImage(kbProposal);
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
@@ -467,7 +464,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal.substring(filter.length()));
kbProposal.setLabel(proposal);
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
}
@@ -508,7 +505,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal);
kbProposal.setLabel(proposal);
- setImage(kbProposal);
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
@@ -525,7 +522,7 @@
kbProposal.setReplacementString(replacementString);
kbProposal.setLabel(proposal);
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
}
@@ -550,15 +547,15 @@
TextProposal proposal = new TextProposal();
proposal.setReplacementString("['" + key + "']");
//$NON-NLS-1$ //$NON-NLS-2$
proposal.setLabel("['" + key + "']");
- setImage(proposal);
-
+ proposal.setImage(getELProposalImageForMember(null));
+
kbProposals.add(proposal);
} else {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(key);
proposal.setLabel(key);
- setImage(proposal);
-
+ proposal.setImage(getELProposalImageForMember(null));
+
kbProposals.add(proposal);
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java 2011-10-13
23:28:44 UTC (rev 35642)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java 2011-10-14
00:16:04 UTC (rev 35643)
@@ -26,6 +26,7 @@
import org.jboss.tools.common.el.core.parser.ELParserUtil;
import org.jboss.tools.common.el.core.resolver.IVariable;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
+import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jsf.JSFModelPlugin;
@@ -43,9 +44,10 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine#getELProposalImage()
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
- public Image getELProposalImage() {
+ @Override
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
return JSF_EL_PROPOSAL_IMAGE;
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2011-10-13
23:28:44 UTC (rev 35642)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2011-10-14
00:16:04 UTC (rev 35643)
@@ -66,9 +66,10 @@
/*
* (non-Javadoc)
- * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImage()
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
- public Image getELProposalImage() {
+ @Override
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
return JSF_EL_MESSAGES_PROPOSAL_IMAGE;
}
@@ -259,7 +260,7 @@
if(varName.startsWith(operand.getText())) {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
}
}
@@ -281,13 +282,13 @@
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
proposal.setLabel(varName);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
} else if(returnEqualedVariablesOnly) {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName);
proposal.setLabel(varName);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
}
resolution.getLastSegment().getVariables().add(var);
@@ -355,10 +356,6 @@
return result;
}
- protected void setImage(TextProposal kbProposal) {
- kbProposal.setImage(getELProposalImage());
- }
-
protected void resolveLastSegment(ELInvocationExpression expr,
List<Variable> members,
ELResolutionImpl resolution,
@@ -400,7 +397,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal);
kbProposal.setLabel(proposal);
- setImage(kbProposal);
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
@@ -411,7 +408,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal.substring(filter.length()));
kbProposal.setLabel(proposal);
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
}
@@ -452,7 +449,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal);
kbProposal.setLabel(proposal);
- setImage(kbProposal);
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
@@ -469,7 +466,7 @@
kbProposal.setReplacementString(replacementString);
kbProposal.setLabel(proposal);
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
}
@@ -620,14 +617,14 @@
TextProposal proposal = new TextProposal();
proposal.setReplacementString("['" + key + "']");
//$NON-NLS-1$ //$NON-NLS-2$
proposal.setLabel("['" + key + "']");
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
kbProposals.add(proposal);
} else {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(key);
proposal.setLabel(key);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
kbProposals.add(proposal);
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2011-10-13
23:28:44 UTC (rev 35642)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2011-10-14
00:16:04 UTC (rev 35643)
@@ -39,6 +39,7 @@
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
import org.jboss.tools.common.el.core.resolver.JavaMemberELSegment;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
+import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -75,9 +76,10 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine#getELProposalImage()
+ * @see
org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
- public Image getELProposalImage() {
+ @Override
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
return SEAM_EL_PROPOSAL_IMAGE;
}
@@ -162,7 +164,7 @@
if (isSeamMessagesComponentVariable((ISeamContextVariable)var)) {
proposal.setImage(SEAM_MESSAGES_PROPOSAL_IMAGE);
} else {
- proposal.setImage(getELProposalImage());
+ proposal.setImage(getELProposalImageForMember(null));
}
}