Author: vrubezhny
Date: 2007-08-07 08:18:13 -0400 (Tue, 07 Aug 2007)
New Revision: 2927
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ExtendedStructuredTextViewerConfigurationHTML.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ExtendedStructuredTextViewerConfigurationJSP.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-670 xhtml code completion does not update it's
list of completions
Seam proposal calculation for XHTML editor is fixed
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ExtendedStructuredTextViewerConfigurationHTML.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ExtendedStructuredTextViewerConfigurationHTML.java 2007-08-07
11:57:34 UTC (rev 2926)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ExtendedStructuredTextViewerConfigurationHTML.java 2007-08-07
12:18:13 UTC (rev 2927)
@@ -28,6 +28,8 @@
import org.osgi.framework.Bundle;
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.jst.jsp.contentassist.RedHatHtmlContentAssistProcessor;
public class ExtendedStructuredTextViewerConfigurationHTML extends
StructuredTextViewerConfigurationHTML {
@@ -37,16 +39,31 @@
}
protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer
sourceViewer, String partitionType) {
- IContentAssistProcessor[] processors = null;
+// IContentAssistProcessor[] processors = null;
- if (partitionType == IHTMLPartitions.HTML_DEFAULT) {
- return new RedHatHtmlContentAssistProcessor[]{new
RedHatHtmlContentAssistProcessor()};
+ // if we have our own processors we need
+ // to define them in plugin.xml file of their
+ // plugins using extention point
+ // "org.jboss.tools.common.text.xml.contentAssistProcessor"
+
+ ContentAssistProcessorDefinition[] defs =
ContentAssistProcessorBuilder.getInstance().getContentAssistProcessorDefinitions(partitionType);
+
+ if(defs==null) return null;
+
+ List<IContentAssistProcessor> processors = new
ArrayList<IContentAssistProcessor>();
+ for(int i=0; i<defs.length; i++) {
+ IContentAssistProcessor processor = defs[i].createContentAssistProcessor();
+ if(!processors.contains(processor)) {
+ processors.add(processor);
+ }
}
- if(partitionType == IJSPPartitions.JSP_DEFAULT_EL) {
- return new RedHatHtmlContentAssistProcessor[]{new
RedHatHtmlContentAssistProcessor()};
+
+ if (partitionType == IHTMLPartitions.HTML_DEFAULT ||
+ partitionType == IJSPPartitions.JSP_DEFAULT_EL) {
+ processors.add(new RedHatHtmlContentAssistProcessor());
}
- return processors;
+ return (IContentAssistProcessor[])processors.toArray(new IContentAssistProcessor[0]);
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ExtendedStructuredTextViewerConfigurationJSP.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ExtendedStructuredTextViewerConfigurationJSP.java 2007-08-07
11:57:34 UTC (rev 2926)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ExtendedStructuredTextViewerConfigurationJSP.java 2007-08-07
12:18:13 UTC (rev 2927)
@@ -48,7 +48,8 @@
// to define them in plugin.xml file of their
// plugins using extention point
// "org.jboss.tools.common.text.xml.contentAssistProcessor"
-
+ IContentAssistProcessor[] superProcessors =
super.getContentAssistProcessors(sourceViewer, partitionType);
+
ContentAssistProcessorDefinition[] defs =
ContentAssistProcessorBuilder.getInstance().getContentAssistProcessorDefinitions(partitionType);
if(defs==null) return null;
@@ -69,10 +70,11 @@
(partitionType == IJSPPartitions.JSP_DEFAULT_EL) ||
(partitionType == IJSPPartitions.JSP_DEFAULT_EL2)) {
processors.add(new RedHatJSPContentAssistProcessor());
- return (IContentAssistProcessor[])processors.toArray(new IContentAssistProcessor[0]);
}
+ if (superProcessors != null && superProcessors.length > 0)
+ processors.add(superProcessors);
- return super.getContentAssistProcessors(sourceViewer, partitionType);
+ return (IContentAssistProcessor[])processors.toArray(new IContentAssistProcessor[0]);
}
/*