[jbosstools-commits] JBoss Tools SVN: r22777 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Jun 11 15:55:05 EDT 2010


Author: vrubezhny
Date: 2010-06-11 15:55:05 -0400 (Fri, 11 Jun 2010)
New Revision: 22777

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
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/TextViewerConfigurationDelegate.java
Log:
JBIDE-6212: CA initialization fails on Eclipse 3.6M6 with WTP-SDK-S-3.2.0M6-20100315195309

The WTP CA processors are moved to the same level as JBoss CA compound processor is due to prevent initialization errors while using the CA

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	2010-06-11 14:10:43 UTC (rev 22776)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java	2010-06-11 19:55:05 UTC (rev 22777)
@@ -58,8 +58,17 @@
 
 	protected IContentAssistProcessor[] getContentAssistProcessors(
 			ISourceViewer sourceViewer, String partitionType) {
-		return configurationDelegate.getContentAssistProcessors(sourceViewer,
-				partitionType);
+		
+		IContentAssistProcessor[] superProcessors = super.getContentAssistProcessors(
+								sourceViewer, partitionType);
+		List<IContentAssistProcessor> processors = new ArrayList<IContentAssistProcessor>();
+		processors.addAll(
+				Arrays.asList(
+						configurationDelegate.getContentAssistProcessors(
+								sourceViewer,
+								partitionType)));
+		processors.addAll(Arrays.asList(superProcessors));
+		return processors.toArray(new IContentAssistProcessor[0]);
 	}
 
 	/*
@@ -94,15 +103,14 @@
 
 	public IContentAssistProcessor[] getContentAssistProcessorsForPartitionType(
 			ISourceViewer sourceViewer, String partitionType) {
-		IContentAssistProcessor[] results = super.getContentAssistProcessors(
-				sourceViewer, partitionType);
+//		IContentAssistProcessor[] results = super.getContentAssistProcessors(
+//				sourceViewer, partitionType);
 		// added by Maksim Areshkau
 		if ("org.eclipse.wst.html.HTML_DEFAULT".equalsIgnoreCase(partitionType)) { //$NON-NLS-1$
 			List<IContentAssistProcessor> contAssists = getVpeTestExtensions();
-			contAssists.addAll(Arrays.asList(results));
-			results = contAssists.toArray(new IContentAssistProcessor[0]);
+			return contAssists.toArray(new IContentAssistProcessor[0]);
 		}
-		return results;
+		return 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	2010-06-11 14:10:43 UTC (rev 22776)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java	2010-06-11 19:55:05 UTC (rev 22777)
@@ -10,6 +10,10 @@
  ******************************************************************************/ 
 package org.jboss.tools.jst.jsp;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
 import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
 import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
 import org.eclipse.jface.text.source.ISourceViewer;
@@ -74,7 +78,16 @@
 	}
 
 	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
-		return configurationDelegate.getContentAssistProcessors(sourceViewer, partitionType);
+		IContentAssistProcessor[] superProcessors = super.getContentAssistProcessors(
+				sourceViewer, partitionType);
+		List<IContentAssistProcessor> processors = new ArrayList<IContentAssistProcessor>();
+		processors.addAll(
+				Arrays.asList(
+						configurationDelegate.getContentAssistProcessors(
+								sourceViewer,
+								partitionType)));
+		processors.addAll(Arrays.asList(superProcessors));
+		return processors.toArray(new IContentAssistProcessor[0]);
 	}
 	
 	/*
@@ -90,6 +103,7 @@
 	public IContentAssistProcessor[] getContentAssistProcessorsForPartitionType(
 			ISourceViewer sourceViewer, String partitionType) {
 		// TODO Auto-generated method stub
-		return super.getContentAssistProcessors(sourceViewer, partitionType);
+//		return super.getContentAssistProcessors(sourceViewer, partitionType);
+		return new IContentAssistProcessor[0];
 	}
 }
\ No newline at end of file

Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/TextViewerConfigurationDelegate.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/TextViewerConfigurationDelegate.java	2010-06-11 14:10:43 UTC (rev 22776)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/TextViewerConfigurationDelegate.java	2010-06-11 19:55:05 UTC (rev 22777)
@@ -24,7 +24,8 @@
 		SortingCompoundContentAssistProcessor sortingCompoundProcessor = new SortingCompoundContentAssistProcessor(sourceViewer, partitionType);
 		
 		if (sortingCompoundProcessor.supportsPartitionType(partitionType)) {
-			// Add the default WTP CA processors to our SortingCompoundContentAssistProcessor
+			// No more default WTP CA processors are to be added to our SortingCompoundContentAssistProcessor
+
 			IContentAssistProcessor[] superProcessors = target.getContentAssistProcessorsForPartitionType(sourceViewer, partitionType);
 
 			if (superProcessors != null && superProcessors.length > 0) {



More information about the jbosstools-commits mailing list