Author: vrubezhny
Date: 2008-10-13 13:50:52 -0400 (Mon, 13 Oct 2008)
New Revision: 10803
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2118 Cleanup/unify the EL code completion used in
JSF, Java, Seam completions
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2008-10-13
17:46:31 UTC (rev 10802)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2008-10-13
17:50:52 UTC (rev 10803)
@@ -32,6 +32,7 @@
import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
import org.jboss.tools.common.text.xml.contentassist.ContentAssistProcessorBuilder;
import org.jboss.tools.common.text.xml.contentassist.ContentAssistProcessorDefinition;
+import
org.jboss.tools.common.text.xml.contentassist.SortingCompoundContentAssistProcessor;
import org.jboss.tools.jst.jsp.contentassist.FaceletsHtmlContentAssistProcessor;
import org.jboss.tools.jst.jsp.format.HTMLFormatProcessor;
import org.osgi.framework.Bundle;
@@ -44,6 +45,15 @@
@SuppressWarnings("restriction")
protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer
sourceViewer, String partitionType) {
+ SortingCompoundContentAssistProcessor sortingCompoundProcessor = new
SortingCompoundContentAssistProcessor(sourceViewer, partitionType);
+ List<IContentAssistProcessor> processors = new
ArrayList<IContentAssistProcessor>();
+
+// if (sortingCompoundProcessor.size() > 0) {
+ if (sortingCompoundProcessor.supportsPartitionType(partitionType)) {
+ processors.add(sortingCompoundProcessor);
+ }
+
+/*
// IContentAssistProcessor[] processors = null;
// if we have our own processors we need
@@ -51,6 +61,7 @@
// plugins using extention point
// "org.jboss.tools.common.text.xml.contentAssistProcessor"
+
ContentAssistProcessorDefinition[] defs =
ContentAssistProcessorBuilder.getInstance().getContentAssistProcessorDefinitions(partitionType);
if(defs==null) return null;
@@ -73,6 +84,7 @@
processors.add(new CSSContentAssistProcessor());
}
+*/
return (IContentAssistProcessor[])processors.toArray(new IContentAssistProcessor[0]);
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2008-10-13
17:46:31 UTC (rev 10802)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2008-10-13
17:50:52 UTC (rev 10803)
@@ -31,6 +31,7 @@
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.text.xml.contentassist.ContentAssistProcessorBuilder;
import org.jboss.tools.common.text.xml.contentassist.ContentAssistProcessorDefinition;
+import
org.jboss.tools.common.text.xml.contentassist.SortingCompoundContentAssistProcessor;
import org.jboss.tools.jst.jsp.contentassist.FaceletsHtmlContentAssistProcessor;
import org.jboss.tools.jst.jsp.contentassist.ExtendedJSPContentAssistProcessor;
@@ -44,6 +45,16 @@
}
protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer
sourceViewer, String partitionType) {
+ SortingCompoundContentAssistProcessor sortingCompoundProcessor = new
SortingCompoundContentAssistProcessor(sourceViewer, partitionType);
+ List<IContentAssistProcessor> processors = new
ArrayList<IContentAssistProcessor>();
+
+// if (sortingCompoundProcessor.size() > 0) {
+ if (sortingCompoundProcessor.supportsPartitionType(partitionType)) {
+ processors.add(sortingCompoundProcessor);
+ return (IContentAssistProcessor[])processors.toArray(new IContentAssistProcessor[0]);
+ }
+
+ /*
// if we have our own processors we need
// to define them in plugin.xml file of their
// plugins using extention point
@@ -71,6 +82,8 @@
processors.add(new ExtendedJSPContentAssistProcessor());
return (IContentAssistProcessor[])processors.toArray(new IContentAssistProcessor[0]);
}
+ */
+
IContentAssistProcessor[] superProcessors =
super.getContentAssistProcessors(sourceViewer, partitionType);
if (superProcessors != null && superProcessors.length > 0) {