Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornitind2007-10-15 19:27:03 +0000
committernitind2007-10-15 19:27:03 +0000
commit85be41ef70079148ec296d07140b672039df30b3 (patch)
tree191f740913c2df0f285387d46a3d31221a34137e /bundles
parentee5669b77f8494aa79e3996524dc63bb238c87fc (diff)
downloadwebtools.sourceediting-85be41ef70079148ec296d07140b672039df30b3.tar.gz
webtools.sourceediting-85be41ef70079148ec296d07140b672039df30b3.tar.xz
webtools.sourceediting-85be41ef70079148ec296d07140b672039df30b3.zip
[206368] Allow subclasses of AbstractLineStyleProvider access to the region's collection when determining style information
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java21
1 files changed, 8 insertions, 13 deletions
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java
index a197d0e349..9f835f1284 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java
@@ -46,14 +46,6 @@ public abstract class AbstractLineStyleProvider {
}
}
- // protected IStructuredDocumentRegion currentStructuredDocumentRegion;
- // Note: the var=x.class contructs were put into this method
- // as a workaround for slow VAJava class lookups. They compiler
- // assigns them to a variable in the JDK, but Class.forName("x")
- // in VAJava. It is workaround specific for VAJava environment, so could
- // be simplified in future.
- static Class LineStyleProviderClass = LineStyleProvider.class;
-
private IStructuredDocument fDocument;
private Highlighter fHighlighter;
private boolean fInitialized;
@@ -149,6 +141,10 @@ public abstract class AbstractLineStyleProvider {
}
abstract protected TextAttribute getAttributeFor(ITextRegion region);
+
+ protected TextAttribute getAttributeFor(ITextRegionCollection collection, ITextRegion region) {
+ return getAttributeFor(region);
+ }
abstract protected IPreferenceStore getColorPreferences();
@@ -195,11 +191,10 @@ public abstract class AbstractLineStyleProvider {
}
/**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
+ * @deprecated - left because it's public, but we aren't adapters any more
*/
public boolean isAdapterForType(java.lang.Object type) {
- return type == LineStyleProviderClass;
+ return type == LineStyleProvider.class;
}
/**
@@ -251,7 +246,7 @@ public abstract class AbstractLineStyleProvider {
handled = prepareTextRegion((ITextRegionCollection) region, partitionStartOffset, partitionLength, holdResults);
} else {
- attr = getAttributeFor(region);
+ attr = getAttributeFor(blockedRegion, region);
if (attr != null) {
handled = true;
// if this region's attr is the same as previous one, then
@@ -304,7 +299,7 @@ public abstract class AbstractLineStyleProvider {
handled = prepareTextRegion((ITextRegionCollection) region, partitionStartOffset, partitionLength, holdResults);
} else {
- attr = getAttributeFor(region);
+ attr = getAttributeFor(structuredDocumentRegion, region);
if (attr != null) {
handled = true;
// if this region's attr is the same as previous one,

Back to the top