Author: vrubezhny
Date: 2011-06-01 11:44:56 -0400 (Wed, 01 Jun 2011)
New Revision: 31733
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.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
JBIDE-3845
Code assist for #{messages['...']} should suggest properties when user types
"[".
Labels were fixed for the Resource Bundles CA Proposals
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-06-01
15:26:16 UTC (rev 31732)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2011-06-01
15:44:56 UTC (rev 31733)
@@ -921,8 +921,13 @@
bSurroundWithQuotes = true;
} else {
if((filter.startsWith("'") || filter.startsWith("\""))
//$NON-NLS-1$ //$NON-NLS-2$
- && (filter.endsWith("'") ||
filter.endsWith("\""))) { //$NON-NLS-1$ //$NON-NLS-2$
- filter = filter.length() == 1 ? "" : filter.substring(1, filter.length() -
1); //$NON-NLS-1$
+ || (filter.endsWith("'") || filter.endsWith("\""))) {
//$NON-NLS-1$ //$NON-NLS-2$
+ if (filter.startsWith("'") || filter.startsWith("\""))
{
+ filter = filter.length() == 1 ? "" : filter.substring(1); //$NON-NLS-1$
+ }
+ if (filter.endsWith("'") || filter.endsWith("\"")) {
+ filter = filter.length() == 1 ? "" : filter.substring(0, filter.length()
- 1); //$NON-NLS-1$
+ }
} else {
//Value is set as expression itself, we cannot compute it
if(isMessages) {
@@ -979,10 +984,11 @@
String replacementString = proposal.getPresentation().substring(filter.length());
if (bSurroundWithQuotes) {
- replacementString = "'" + replacementString + "']";
//$NON-NLS-1$ //$NON-NLS-2$
+ replacementString = "'" + replacementString; //$NON-NLS-1$
//$NON-NLS-2$
}
kbProposal.setReplacementString(replacementString);
+ kbProposal.setLabel(proposal.getPresentationDisplayName());
kbProposal.setImage(getELProposalImage());
kbProposal.setType(typeName);
kbProposal.setSourceType(sourceTypeName);
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java 2011-06-01
15:26:16 UTC (rev 31732)
+++
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java 2011-06-01
15:44:56 UTC (rev 31733)
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ * Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.common.text.xml;
@@ -43,7 +43,7 @@
@SuppressWarnings("restriction")
public class XMLTextViewerConfiguration extends StructuredTextViewerConfigurationXML {
private static final char[] PROPOSAL_AUTO_ACTIVATION_CHARS = new char[] {
- '<', '=', '"', '\'', '.',
'{'
+ '<', '=', '"', '\'', '.',
'{', '['
};
SourceViewerConfiguration initial = null;
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java 2011-06-01
15:26:16 UTC (rev 31732)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java 2011-06-01
15:44:56 UTC (rev 31733)
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2010 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2010-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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ * Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.jst.jsp.contentassist.computers;
@@ -223,7 +223,7 @@
int paraIndex = restOfValue.indexOf(']');
// Is the quotation is in it?
int quoteIndex = restOfValue.indexOf('\'');
- if (quoteIndex == -1 || (paraIndex != -1 && quoteIndex > paraIndex)) {
+ if (quoteIndex == -1 || paraIndex == -1 || (paraIndex != -1 && quoteIndex
> paraIndex)) {
// Need to insert closing single-quote
replacementString += '\'';
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java 2011-06-01
15:26:16 UTC (rev 31732)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java 2011-06-01
15:44:56 UTC (rev 31733)
@@ -226,7 +226,7 @@
int paraIndex = restOfValue.indexOf(']');
// Is the quotation is in it?
int quoteIndex = restOfValue.indexOf('\'');
- if (quoteIndex == -1 || (paraIndex != -1 && quoteIndex > paraIndex)) {
+ if (quoteIndex == -1 || paraIndex == -1 || (paraIndex != -1 && quoteIndex
> paraIndex)) {
// Need to insert closing single-quote
replacementString += '\'';
}
@@ -895,7 +895,7 @@
return tr;
}
-
+
/**
* Returns EL Predicate Text Region Information Object
*
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-06-01
15:26:16 UTC (rev 31732)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2011-06-01
15:44:56 UTC (rev 31733)
@@ -195,12 +195,14 @@
if (key.indexOf('.') != -1) {
TextProposal proposal = new TextProposal();
proposal.setReplacementString("['" + key + "']");
+ proposal.setLabel("['" + key + "']");
proposal.setImage(SEAM_MESSAGES_PROPOSAL_IMAGE);
kbProposals.add(proposal);
} else {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(key);
+ proposal.setLabel(key);
proposal.setImage(SEAM_MESSAGES_PROPOSAL_IMAGE);
kbProposals.add(proposal);