click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From take...@apache.org
Subject svn commit: r796136 - /incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java
Date Tue, 21 Jul 2009 04:06:03 GMT
Author: takezoe
Date: Tue Jul 21 04:06:02 2009
New Revision: 796136

URL: http://svn.apache.org/viewvc?rev=796136&view=rev
Log:
[CLKE-35]Fixed for Galileo.

Modified:
    incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java

Modified: incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java?rev=796136&r1=796135&r2=796136&view=diff
==============================================================================
--- incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java
(original)
+++ incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java
Tue Jul 21 04:06:02 2009
@@ -18,11 +18,13 @@
  */
 package org.apache.click.eclipse.ui.editor;
 
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-
 import org.apache.click.eclipse.ClickPlugin;
 import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.swt.custom.StyleRange;
@@ -44,31 +46,19 @@
 	@Override
 	@SuppressWarnings("unchecked")
 	public boolean prepareRegions(ITypedRegion currentRegion, int start, int length, Collection
styleRanges) {
-        boolean result = super.prepareRegions(currentRegion, start, length, styleRanges);
-        
+		List<Object> results = new ArrayList<Object>();
+		boolean result = super.prepareRegions(currentRegion, start, length, results);
+
         // TODO Is it possible to update colors when preferences changed...?
     	Color colorVariable  = ClickPlugin.getDefault().getColorManager().get(ClickPlugin.PREF_COLOR_VAR);
     	Color colorDirective = ClickPlugin.getDefault().getColorManager().get(ClickPlugin.PREF_COLOR_DIR);
     	Color colorComment   = ClickPlugin.getDefault().getColorManager().get(ClickPlugin.PREF_COLOR_CMT);
-        Object sr[] = styleRanges.toArray();
-		
+
         IStructuredDocument document = getDocument();
         
-//        String allText = document.get();
-//        int commentStart = allText.substring(0, start).lastIndexOf("#*");
-//        if(commentStart >= 0){
-//        	int commentEnd = allText.indexOf("*#", commentStart);
-//        	if(commentEnd > start){
-//                for(int i = 0; i < sr.length; i++){
-//                	styleRanges.remove(sr[i]);
-//                }
-//                styleRanges.add(new StyleRange(start, length, colorComment, colorDirective));
-//        		return result;
-//        	}
-//        }
-        
-        for(int i = 0; i < sr.length; i++){
-            StyleRange styleRange = (StyleRange)sr[i];
+        for(Iterator ite = results.iterator(); ite.hasNext();){
+            StyleRange styleRange = (StyleRange)ite.next();
+            
             IStructuredDocumentRegion region = document.getRegionAtCharacterOffset(styleRange.start);
             String text = region.getText();
             int mStart = styleRange.start - region.getStartOffset();
@@ -150,7 +140,7 @@
                 post.length = styleRange.length - pos;
                 styleRanges.add(post);
             }
-            styleRanges.remove(sr[i]);
+            //styleRanges.remove(styleRange);
         }
 
         return result;



Mime
View raw message