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:
authorpavery2005-11-09 22:30:20 +0000
committerpavery2005-11-09 22:30:20 +0000
commit5827d19670773f3daa7733ff059857ba85a80821 (patch)
treea8eded59d157d9031753175b2c8d852c0b8e91e8 /bundles/org.eclipse.wst.sse.ui/src
parentafbf1710f562bad45eb82505431733a68d9557b9 (diff)
downloadwebtools.sourceediting-5827d19670773f3daa7733ff059857ba85a80821.tar.gz
webtools.sourceediting-5827d19670773f3daa7733ff059857ba85a80821.tar.xz
webtools.sourceediting-5827d19670773f3daa7733ff059857ba85a80821.zip
[115531] removed getReconciler() from StructuredTextViewerConfiguration subclasses, and made the method final in StructuredTextViewerConfiguration.
Diffstat (limited to 'bundles/org.eclipse.wst.sse.ui/src')
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java43
1 files changed, 41 insertions, 2 deletions
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
index b43823fd92..73ba93a380 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
@@ -21,6 +21,7 @@ import org.eclipse.jface.text.IUndoManager;
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter;
import org.eclipse.jface.text.presentation.IPresentationReconciler;
+import org.eclipse.jface.text.reconciler.IReconciler;
import org.eclipse.jface.text.source.IAnnotationHover;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.ui.editors.text.EditorsUI;
@@ -31,7 +32,9 @@ import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
import org.eclipse.wst.sse.ui.internal.StructuredTextAnnotationHover;
import org.eclipse.wst.sse.ui.internal.contentassist.StructuredContentAssistant;
import org.eclipse.wst.sse.ui.internal.hyperlink.HighlighterHyperlinkPresenter;
+import org.eclipse.wst.sse.ui.internal.provisional.preferences.CommonEditorPreferenceNames;
import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+import org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor;
import org.eclipse.wst.sse.ui.internal.taginfo.AnnotationHoverProcessor;
import org.eclipse.wst.sse.ui.internal.taginfo.BestMatchHover;
import org.eclipse.wst.sse.ui.internal.taginfo.ProblemAnnotationHoverProcessor;
@@ -58,6 +61,7 @@ public class StructuredTextViewerConfiguration extends TextSourceViewerConfigura
* is added to a viewer can cause odd key-eating by the wrong one.
*/
private StructuredContentAssistant fContentAssistant = null;
+ private IReconciler fReconciler;
public StructuredTextViewerConfiguration() {
super();
@@ -213,7 +217,7 @@ public class StructuredTextViewerConfiguration extends TextSourceViewerConfigura
public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
return null;
}
-
+
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
/*
* This implementation returns null because StructuredTextViewer does
@@ -221,7 +225,7 @@ public class StructuredTextViewerConfiguration extends TextSourceViewerConfigura
*/
return null;
}
-
+
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
ITextHover textHover = null;
@@ -269,4 +273,39 @@ public class StructuredTextViewerConfiguration extends TextSourceViewerConfigura
* by executable extension
*/
}
+
+ /**
+ * Returns the reconciler ready to be used with the given source viewer.<br />
+ * Note: The same instance of IReconciler is returned regardless of the
+ * source viewer passed in.
+ * <p>
+ * Clients cannot override this method. Instead, clients wanting to add
+ * their own reconciling strategy should use the
+ * <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code>
+ * extension point.
+ * </p>
+ *
+ * @param sourceViewer
+ * the source viewer to be configured by this configuration
+ * @return a reconciler
+ */
+ final public IReconciler getReconciler(ISourceViewer sourceViewer) {
+ boolean reconcilingEnabled = fPreferenceStore.getBoolean(CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS);
+ if (sourceViewer == null || !reconcilingEnabled)
+ return null;
+
+ /*
+ * Only create reconciler if sourceviewer is present
+ */
+ if (fReconciler == null && sourceViewer != null) {
+ StructuredRegionProcessor reconciler = new StructuredRegionProcessor();
+
+ // reconciler configurations
+
+ reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
+
+ fReconciler = reconciler;
+ }
+ return fReconciler;
+ }
}

Back to the top