Author: vrubezhny
Date: 2011-08-09 13:09:16 -0400 (Tue, 09 Aug 2011)
New Revision: 33721
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/AbstractXmlCompletionProposalComputer.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/JspELCompletionProposalComputer.java
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/XmlTagCompletionProposalComputer.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties
Log:
JBIDE-9270
JSP editor should allow using el in text nodes for JSP 2.0
Issue is fixed
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java 2011-08-09
16:51:59 UTC (rev 33720)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java 2011-08-09
17:09:16 UTC (rev 33721)
@@ -63,6 +63,7 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+@Deprecated
@SuppressWarnings("restriction")
abstract public class AbstractXMLContentAssistProcessor extends
AbstractContentAssistProcessor {
private static final char[] PROPOSAL_AUTO_ACTIVATION_CHARS = new char[] {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java 2011-08-09
16:51:59 UTC (rev 33720)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java 2011-08-09
17:09:16 UTC (rev 33721)
@@ -32,6 +32,7 @@
* @author Jeremy
*
*/
+@Deprecated
@SuppressWarnings("restriction")
public class FaceletPageContectAssistProcessor extends JspContentAssistProcessor {
private static final String JSFC_ATTRIBUTE_NAME = "jsfc"; //$NON-NLS-1$
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java 2011-08-09
16:51:59 UTC (rev 33720)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java 2011-08-09
17:09:16 UTC (rev 33721)
@@ -55,6 +55,7 @@
* @author Jeremy
*
*/
+@Deprecated
@SuppressWarnings("restriction")
public class JspContentAssistProcessor extends XmlContentAssistProcessor {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java 2011-08-09
16:51:59 UTC (rev 33720)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java 2011-08-09
17:09:16 UTC (rev 33721)
@@ -38,6 +38,7 @@
* @author Jeremy
*
*/
+@Deprecated
@SuppressWarnings("restriction")
public class XmlContentAssistProcessor extends AbstractXMLContentAssistProcessor {
protected static final Image JSF_EL_PROPOSAL_IMAGE =
JspEditorPlugin.getDefault().getImage(JspEditorPlugin.CA_JSF_EL_IMAGE_PATH);
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/AbstractXmlCompletionProposalComputer.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/AbstractXmlCompletionProposalComputer.java 2011-08-09
16:51:59 UTC (rev 33720)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/AbstractXmlCompletionProposalComputer.java 2011-08-09
17:09:16 UTC (rev 33721)
@@ -55,7 +55,10 @@
abstract public class AbstractXmlCompletionProposalComputer extends
AbstractXMLModelQueryCompletionProposalComputer {
protected static final ICompletionProposal[] EMPTY_PROPOSAL_LIST = new
ICompletionProposal[0];
private static final String[] EMPTY_TAGS = new String[0];
-
+ public static final String EL_DOLLAR_PREFIX = "${"; //$NON-NLS-1$
+ public static final String EL_NUMBER_PREFIX = "#{"; //$NON-NLS-1$
+ public static final String[] EL_PREFIXES = {EL_DOLLAR_PREFIX, EL_NUMBER_PREFIX};
+
protected CompletionProposalInvocationContext fCurrentContext;
protected ELContext fContext;
@@ -707,5 +710,23 @@
*/
abstract protected void addTextELProposals(ContentAssistRequest contentAssistRequest,
CompletionProposalInvocationContext context);
+
+ /**
+ * Returns default prefix for ELs
+ *
+ * @return default EL prefix
+ */
+ public String getDefaultELPrefix() {
+ return EL_DOLLAR_PREFIX;
+ }
+ /**
+ * Checks if the specified text begins with a one of possible EL prefixes
+ *
+ * @param text
+ * @return true if one of EL prefixes found
+ */
+ protected boolean startsWithELBeginning(String text) {
+ return (text != null && (text.startsWith(EL_DOLLAR_PREFIX) ||
text.startsWith(EL_NUMBER_PREFIX)));
+ }
}
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-08-09
16:51:59 UTC (rev 33720)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java 2011-08-09
17:09:16 UTC (rev 33721)
@@ -161,138 +161,8 @@
}
}
- @Override
- protected void addTextELProposals(ContentAssistRequest contentAssistRequest,
CompletionProposalInvocationContext context) {
- if (!isELCAToBeShown())
- return;
-
- TextRegion prefix = getELPrefix(contentAssistRequest);
- if (prefix == null || !prefix.isELStarted()) {
- AutoContentAssistantProposal proposal = new AutoContentAssistantProposal(true,
"#{}", //$NON-NLS-1$
- contentAssistRequest.getReplacementBeginPosition(),
- 0, 2, JSF_EL_PROPOSAL_IMAGE,
JstUIMessages.JspContentAssistProcessor_NewELExpression, null,
- JstUIMessages.FaceletPageContectAssistProcessor_NewELExpressionTextInfo,
TextProposal.R_TAG_INSERTION + 1);
-
- contentAssistRequest.addProposal(proposal);
- return;
- }
- String matchString = "#{" + prefix.getText(); //$NON-NLS-1$
- String query = matchString;
- String stringQuery = matchString;
-
- int beginChangeOffset = prefix.getStartOffset() + prefix.getOffset();
-
- KbQuery kbQuery = createKbQuery(Type.TEXT, query, stringQuery);
- TextProposal[] proposals = PageProcessor.getInstance().getProposals(kbQuery,
getContext());
- if (proposals == null || proposals.length == 0)
- return;
-
- for (TextProposal textProposal : proposals) {
- int replacementOffset = beginChangeOffset;
- int replacementLength = prefix.getLength();
- String replacementString = prefix.getText().substring(0, replacementLength);
- if (textProposal.getReplacementString().trim().startsWith("[") &&
replacementString.endsWith(".")) { //$NON-NLS-1$ //$NON-NLS-2$
- // Need to include last '.' (dot) char into the string to replace
- replacementString = replacementString.substring(0, replacementString.length() - 1);
- }
- replacementString += textProposal.getReplacementString();
-
- int cursorPosition = replacementString.length();
-
- // Check if it is a long named property to be inserted
- if (replacementString.indexOf('[') != -1) {
- // That's it - The long message property
-
- // Need to get the rest of line from context.getInvocationOffset()
- IDocument doc = context.getDocument();
-
- String restOfLine = "";
- String restOfValue = "";
- int endPosition = -1;
- try {
- int line = doc.getLineOfOffset(context.getInvocationOffset());
- int lineStart = doc.getLineOffset(line);
- int lineLength = doc.getLineLength(line);
- String sDoc = doc.get();
- restOfValue = restOfLine = sDoc.substring(context.getInvocationOffset(), lineStart +
lineLength);
- if (endPosition != -1) {
- // Use end of line
- restOfValue = restOfValue.substring(0, endPosition);
- }
- } catch (BadLocationException e) {
- // Ignore it
- }
-
- // Check if the replacementString is already configured
- if (replacementString.indexOf(']') == -1) {
- // Is closing ']' is in it?
- int paraIndex = restOfValue.indexOf(']');
- // Is the quotation is in it?
- int quoteIndex = restOfValue.indexOf('\'');
- if (quoteIndex == -1 || paraIndex == -1 || (paraIndex != -1 && quoteIndex
> paraIndex)) {
- // Need to insert closing single-quote
- replacementString += '\'';
- }
- if (paraIndex == -1) {
- // Closing ']' is to be added
- replacementString += ']';
- }
- } else {
- if (replacementString.endsWith("]") &&
restOfValue.indexOf(']') != -1) {
- replacementString = replacementString.substring(0, replacementString.length() -1);
- cursorPosition = replacementString.length(); // Cursor will be put right after the
replacement (not after the closing square bracket in this case)
- }
- }
-
- if (restOfLine.indexOf('}') == -1) {
- // Add closing }-char
- replacementString += '}';
- }
- } else {
- if (!prefix.isELClosed()) {
- replacementString += "}"; //$NON-NLS-1$
- }
- }
-
- Image image = textProposal.getImage();
-
- // JBIDE-512, JBIDE-2541 related changes ===>>>
-// String displayString = prefix.getText().substring(0, replacementLength) +
textProposal.getReplacementString();
- String displayString = textProposal.getLabel();
- if (displayString == null)
- displayString = textProposal.getReplacementString() == null ? replacementString :
textProposal.getReplacementString();
-
- // <<<=== JBIDE-512, JBIDE-2541 related changes
- int relevance = textProposal.getRelevance();
- if (relevance == TextProposal.R_NONE) {
- relevance = TextProposal.R_JSP_JSF_EL_VARIABLE_ATTRIBUTE_VALUE;
- }
-
- AutoContentAssistantProposal proposal = null;
- if (textProposal instanceof ELTextProposal) {
- IJavaElement[] javaElements = ((ELTextProposal)textProposal).getAllJavaElements();
-
- proposal = new AutoELContentAssistantProposal(replacementString,
- replacementOffset, replacementLength, cursorPosition, image, displayString,
- null, javaElements, relevance);
- } else {
- String additionalProposalInfo = (textProposal.getContextInfo() == null ? ""
: textProposal.getContextInfo()); //$NON-NLS-1$
-
- proposal = new AutoContentAssistantProposal(replacementString,
- replacementOffset, replacementLength, cursorPosition, image, displayString,
- null, additionalProposalInfo, relevance);
- }
-
- contentAssistRequest.addProposal(proposal);
- }
-
- if (prefix.isELStarted() && !prefix.isELClosed()) {
- AutoContentAssistantProposal proposal = new
AutoContentAssistantProposal("}", //$NON-NLS-1$
- getOffset(), 0, 1, JSF_EL_PROPOSAL_IMAGE,
JstUIMessages.JspContentAssistProcessor_CloseELExpression,
- null, JstUIMessages.JspContentAssistProcessor_CloseELExpressionInfo,
TextProposal.R_XML_ATTRIBUTE_VALUE_TEMPLATE);
-
- contentAssistRequest.addProposal(proposal);
- }
+ protected boolean startsWithELBeginning(String text) {
+ return (text != null && (text.startsWith(EL_DOLLAR_PREFIX) ||
text.startsWith(EL_NUMBER_PREFIX)));
}
@Override
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java 2011-08-09
16:51:59 UTC (rev 33720)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/JspELCompletionProposalComputer.java 2011-08-09
17:09:16 UTC (rev 33721)
@@ -90,11 +90,8 @@
return null;
}
- @Override
- protected void addTextELProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- // Do not return any EL proposals for the TEXT regions
+ protected boolean startsWithELBeginning(String text) {
+ return (text != null && text.startsWith("${")); //$NON-NLS-1$
//$NON-NLS-2$
}
protected void setVars(ELContextImpl context, IFile file) {
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-08-09
16:51:59 UTC (rev 33720)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java 2011-08-09
17:09:16 UTC (rev 33721)
@@ -163,14 +163,14 @@
if(!prefix.isELStarted()) {
AutoContentAssistantProposal proposal = new AutoContentAssistantProposal(true,
- "#{}" + (prefix.isAttributeValue() && prefix.hasOpenQuote()
&& !prefix.hasCloseQuote() ? String.valueOf(prefix.getQuoteChar()) :
""), //$NON-NLS-1$ //$NON-NLS-2$
+ getDefaultELPrefix() + "}" + (prefix.isAttributeValue() &&
prefix.hasOpenQuote() && !prefix.hasCloseQuote() ?
String.valueOf(prefix.getQuoteChar()) : ""), //$NON-NLS-1$ //$NON-NLS-2$
getOffset(), 0, 2, JSF_EL_PROPOSAL_IMAGE,
JstUIMessages.JspContentAssistProcessor_NewELExpression,
null, JstUIMessages.JspContentAssistProcessor_NewELExpressionAttrInfo,
TextProposal.R_XML_ATTRIBUTE_VALUE_TEMPLATE);
contentAssistRequest.addProposal(proposal);
return;
}
- String matchString = "#{" + prefix.getText(); //$NON-NLS-1$
+ String matchString = EL_NUMBER_PREFIX + prefix.getText(); //$NON-NLS-1$
String query = matchString;
if (query == null)
query = ""; //$NON-NLS-1$
@@ -305,16 +305,14 @@
}
}
- @SuppressWarnings("unused")
@Override
- protected void addTextELProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
+ protected void addTextELProposals(ContentAssistRequest contentAssistRequest,
CompletionProposalInvocationContext context) {
if (!isELCAToBeShown())
return;
TextRegion prefix = getELPrefix(contentAssistRequest);
if (prefix == null || !prefix.isELStarted()) {
- AutoContentAssistantProposal proposal = new AutoContentAssistantProposal(true,
"#{}", //$NON-NLS-1$
+ AutoContentAssistantProposal proposal = new AutoContentAssistantProposal(true,
getDefaultELPrefix()+ "}", //$NON-NLS-1$
contentAssistRequest.getReplacementBeginPosition(),
0, 2, JSF_EL_PROPOSAL_IMAGE,
JstUIMessages.JspContentAssistProcessor_NewELExpression, null,
JstUIMessages.FaceletPageContectAssistProcessor_NewELExpressionTextInfo,
TextProposal.R_TAG_INSERTION + 1);
@@ -322,24 +320,27 @@
contentAssistRequest.addProposal(proposal);
return;
}
- String matchString = "#{" + prefix.getText(); //$NON-NLS-1$
+ String matchString = EL_NUMBER_PREFIX + prefix.getText();
String query = matchString;
- if (query == null)
- query = ""; //$NON-NLS-1$
String stringQuery = matchString;
int beginChangeOffset = prefix.getStartOffset() + prefix.getOffset();
KbQuery kbQuery = createKbQuery(Type.TEXT, query, stringQuery);
TextProposal[] proposals = PageProcessor.getInstance().getProposals(kbQuery,
getContext());
-
if (proposals == null || proposals.length == 0)
return;
for (TextProposal textProposal : proposals) {
int replacementOffset = beginChangeOffset;
int replacementLength = prefix.getLength();
- String replacementString = prefix.getText().substring(0, replacementLength) +
textProposal.getReplacementString();
+ String replacementString = prefix.getText().substring(0, replacementLength);
+ if (textProposal.getReplacementString().trim().startsWith("[") &&
replacementString.endsWith(".")) { //$NON-NLS-1$ //$NON-NLS-2$
+ // Need to include last '.' (dot) char into the string to replace
+ replacementString = replacementString.substring(0, replacementString.length() - 1);
+ }
+ replacementString += textProposal.getReplacementString();
+
int cursorPosition = replacementString.length();
// Check if it is a long named property to be inserted
@@ -372,7 +373,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 += '\'';
}
@@ -380,6 +381,11 @@
// Closing ']' is to be added
replacementString += ']';
}
+ } else {
+ if (replacementString.endsWith("]") &&
restOfValue.indexOf(']') != -1) {
+ replacementString = replacementString.substring(0, replacementString.length() -1);
+ cursorPosition = replacementString.length(); // Cursor will be put right after the
replacement (not after the closing square bracket in this case)
+ }
}
if (restOfLine.indexOf('}') == -1) {
@@ -391,6 +397,7 @@
replacementString += "}"; //$NON-NLS-1$
}
}
+
Image image = textProposal.getImage();
// JBIDE-512, JBIDE-2541 related changes ===>>>
@@ -419,6 +426,7 @@
replacementOffset, replacementLength, cursorPosition, image, displayString,
null, additionalProposalInfo, relevance);
}
+
contentAssistRequest.addProposal(proposal);
}
@@ -448,7 +456,7 @@
if (prefix == null || prefix.isELStarted()) {
return;
}
- String matchString = "#{" + prefix.getText(); //$NON-NLS-1$
+ String matchString = EL_NUMBER_PREFIX + prefix.getText();
String query = matchString;
if (query == null)
query = ""; //$NON-NLS-1$
@@ -469,7 +477,7 @@
for (TextProposal textProposal : proposals) {
int replacementOffset = beginChangeOffset;
int replacementLength = prefix.getLength();
- String replacementString = "#{" + prefix.getText().substring(0,
replacementLength) + textProposal.getReplacementString(); //$NON-NLS-1$
+ String replacementString = getDefaultELPrefix() + prefix.getText().substring(0,
replacementLength) + textProposal.getReplacementString();
char quoteChar = prefix.isAttributeValue() && prefix.hasOpenQuote() ?
prefix.getQuoteChar() : '"';
int cursorPosition = replacementString.length();
@@ -893,8 +901,7 @@
ELInstance is = ELUtil.findInstance(model, inValueOffset);// ELInstance
ELInvocationExpression ie = ELUtil.findExpression(model, inValueOffset);//
ELExpression
- boolean isELStarted = (model != null && is != null &&
(model.toString().startsWith("#{") || //$NON-NLS-1$
- model.toString().startsWith("${"))); //$NON-NLS-1$
+ boolean isELStarted = (model != null && is != null &&
(startsWithELBeginning(model.toString()))); //$NON-NLS-1$
boolean isELClosed = (model != null && is != null &&
model.toString().endsWith("}")); //$NON-NLS-1$
// boolean insideEL = startOffset + model.toString().length()
@@ -961,10 +968,9 @@
ELModel model = p.parse(text);
ELInstance is = ELUtil.findInstance(model, inValueOffset);// ELInstance
- ELInvocationExpression ie = ELUtil.findExpression(model, inValueOffset);//
ELExpression
+// ELInvocationExpression ie = ELUtil.findExpression(model, inValueOffset);//
ELExpression
- boolean isELStarted = (model != null && is != null &&
(model.toString().startsWith("#{") || //$NON-NLS-1$
- model.toString().startsWith("${"))); //$NON-NLS-1$
+ boolean isELStarted = (model != null && is != null &&
startsWithELBeginning(model.toString()));
boolean isELClosed = (model != null && is != null &&
model.toString().endsWith("}")); //$NON-NLS-1$
TextRegion tr = new TextRegion(startOffset, getOffset() - matchString.length() -
startOffset,
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlTagCompletionProposalComputer.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlTagCompletionProposalComputer.java 2011-08-09
16:51:59 UTC (rev 33720)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlTagCompletionProposalComputer.java 2011-08-09
17:09:16 UTC (rev 33721)
@@ -573,8 +573,7 @@
ELInstance is = ELUtil.findInstance(model, inValueOffset);// ELInstance
ELInvocationExpression ie = ELUtil.findExpression(model, inValueOffset);//
ELExpression
- boolean isELStarted = (model != null && is != null &&
(model.toString().startsWith("#{") || //$NON-NLS-1$
- model.toString().startsWith("${"))); //$NON-NLS-1$
+ boolean isELStarted = (model != null && is != null &&
startsWithELBeginning(text));
boolean isELClosed = (model != null && is != null &&
model.toString().endsWith("}")); //$NON-NLS-1$
// boolean insideEL = startOffset + model.toString().length()
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties 2011-08-09
16:51:59 UTC (rev 33720)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties 2011-08-09
17:09:16 UTC (rev 33721)
@@ -21,7 +21,7 @@
ADD_FONT_FAMILY_TIP=Add font family
REMOVE_FONT_FAMILY_TIP=Remove font family
-FaceletPageContectAssistProcessor_NewELExpressionTextInfo=#{}
+FaceletPageContectAssistProcessor_NewELExpressionTextInfo=${}
FONT_FAMILY_DIALOG_TITLE=Choose font family
BUTTON_APPLY=Apply
BUTTON_CLEAR=Clear
@@ -87,8 +87,8 @@
DEFAULT_TEXT_FOR_BROWSER_PREVIEW=Double click to edit preview.
JspContentAssistProcessor_CloseELExpression=Close JSF EL Expression
JspContentAssistProcessor_CloseELExpressionInfo=}
-JspContentAssistProcessor_NewELExpression=New JSF EL Expression - Create a new attribute
value with #{}
-JspContentAssistProcessor_NewELExpressionAttrInfo=#{}
+JspContentAssistProcessor_NewELExpression=New JSF EL Expression - Create a new attribute
value with ${}
+JspContentAssistProcessor_NewELExpressionAttrInfo=${}
JSPDialogCellEditor_CodeAssist=code assist
JSPDialogCellEditor_EditAttribute=Edit {0}
JSPDialogContentProposalProvider_CloseELExpression=Close EL Expression