Author: akazakov
Date: 2009-06-30 10:11:39 -0400 (Tue, 30 Jun 2009)
New Revision: 16296
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
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 2009-06-30
13:24:56 UTC (rev 16295)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java 2009-06-30
14:11:39 UTC (rev 16296)
@@ -483,44 +483,34 @@
* Calculates and adds the attribute value proposals to the Content Assist Request
object
*/
protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
-
// Need to check if an EL Expression is opened here.
// If it is true we don't need to start any new tag proposals
TextRegion prefix = getELPrefix();
if (prefix != null && prefix.isELStarted()) {
return;
}
-
- System.out.println("JspContentAssistProcessor: addAttributeValueProposals()
invoked");
try {
String matchString = contentAssistRequest.getMatchString();
String query = matchString;
if (query == null)
query = "";
String stringQuery = matchString;
-
+
KbQuery kbQuery = createKbQuery(Type.ATTRIBUTE_VALUE, query, stringQuery);
TextProposal[] proposals = PageProcessor.getInstance().getProposals(kbQuery,
getContext());
-
+
for (int i = 0; proposals != null && i < proposals.length; i++) {
TextProposal textProposal = proposals[i];
-
- System.out.println("Tag Attribute Value proposal [" + (i + 1) +
"/" + proposals.length + "]: " +
textProposal.getReplacementString());
-
- if (isExistingAttribute(textProposal.getLabel()))
- continue;
-
- String replacementString = textProposal.getReplacementString() +
"=\"\"";
-
int replacementOffset = contentAssistRequest.getReplacementBeginPosition();
int replacementLength = contentAssistRequest.getReplacementLength();
+ String replacementString = "\"" + textProposal.getReplacementString()
+ "\"";
int cursorPosition = getCursorPositionForProposedText(replacementString);
Image image = textProposal.getImage();
String displayString = textProposal.getLabel();
IContextInformation contextInformation = null;
String additionalProposalInfo = textProposal.getContextInfo();
int relevance = textProposal.getRelevance() + 10000;
-
+
CustomCompletionProposal proposal = new CustomCompletionProposal(replacementString,
replacementOffset, replacementLength, cursorPosition, image, displayString,
contextInformation, additionalProposalInfo, relevance);
contentAssistRequest.addProposal(proposal);
}
@@ -534,13 +524,6 @@
*/
@Override
protected void addTextELProposals(ContentAssistRequest contentAssistRequest) {
- // TODO Auto-generated method stub
- System.out.println("JspContentAssistProcessor: addTextELProposals()
invoked");
- try {
- System.out.println("JspContentAssistProcessor: No EL allowed in TEXT");
- } finally {
- System.out.println("JspContentAssistProcessor: addTextELProposals()
exited");
- }
}
/**