2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.bulkeditor
;
11 import org
.eclipse
.jface
.text
.IDocument
;
12 import org
.eclipse
.jface
.text
.presentation
.IPresentationReconciler
;
13 import org
.eclipse
.jface
.text
.presentation
.PresentationReconciler
;
14 import org
.eclipse
.jface
.text
.rules
.DefaultDamagerRepairer
;
15 import org
.eclipse
.jface
.text
.source
.ISourceViewer
;
16 import org
.eclipse
.jface
.text
.source
.SourceViewerConfiguration
;
18 import eu
.etaxonomy
.taxeditor
.annotatedlineeditor
.ILineDisplayStrategy
;
19 import eu
.etaxonomy
.taxeditor
.annotatedlineeditor
.SupplementalTextScanner
;
23 * <p>BulkEditorViewerConfiguration class.</p>
29 public class BulkEditorViewerConfiguration
extends SourceViewerConfiguration
{
31 private ILineDisplayStrategy lineDisplayStrategy
;
34 * <p>Constructor for BulkEditorViewerConfiguration.</p>
36 * @param lineDisplayStrategy a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy} object.
38 public BulkEditorViewerConfiguration(ILineDisplayStrategy lineDisplayStrategy
) {
39 this.lineDisplayStrategy
= lineDisplayStrategy
;
44 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer)
48 public IPresentationReconciler
getPresentationReconciler(
49 final ISourceViewer sourceViewer
) {
51 PresentationReconciler reconciler
= new PresentationReconciler();
53 // Color supplemental text, e.g. markers
54 DefaultDamagerRepairer damageRepairer
= new DefaultDamagerRepairer(new SupplementalTextScanner(sourceViewer
, lineDisplayStrategy
));
55 reconciler
.setDamager(damageRepairer
, IDocument
.DEFAULT_CONTENT_TYPE
);
56 reconciler
.setRepairer(damageRepairer
, IDocument
.DEFAULT_CONTENT_TYPE
);
62 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getConfiguredContentTypes(org.eclipse.jface.text.source.ISourceViewer)
66 public String
[] getConfiguredContentTypes(ISourceViewer sourceViewer
) {
67 return new String
[] { IDocument
.DEFAULT_CONTENT_TYPE
, ILineDisplayStrategy
.SUPPLEMENTAL_TEXT
};