3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.bulkeditor
;
12 import org
.eclipse
.jface
.text
.IDocument
;
13 import org
.eclipse
.jface
.text
.presentation
.IPresentationReconciler
;
14 import org
.eclipse
.jface
.text
.presentation
.PresentationReconciler
;
15 import org
.eclipse
.jface
.text
.rules
.DefaultDamagerRepairer
;
16 import org
.eclipse
.jface
.text
.source
.ISourceViewer
;
17 import org
.eclipse
.jface
.text
.source
.SourceViewerConfiguration
;
19 import eu
.etaxonomy
.taxeditor
.annotatedlineeditor
.ILineDisplayStrategy
;
20 import eu
.etaxonomy
.taxeditor
.annotatedlineeditor
.SupplementalTextScanner
;
24 * <p>BulkEditorViewerConfiguration class.</p>
30 public class BulkEditorViewerConfiguration
extends SourceViewerConfiguration
{
32 private ILineDisplayStrategy lineDisplayStrategy
;
35 * <p>Constructor for BulkEditorViewerConfiguration.</p>
37 * @param lineDisplayStrategy a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy} object.
39 public BulkEditorViewerConfiguration(ILineDisplayStrategy lineDisplayStrategy
) {
40 this.lineDisplayStrategy
= lineDisplayStrategy
;
45 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer)
49 public IPresentationReconciler
getPresentationReconciler(
50 final ISourceViewer sourceViewer
) {
52 PresentationReconciler reconciler
= new PresentationReconciler();
54 // Color supplemental text, e.g. markers
55 DefaultDamagerRepairer damageRepairer
= new DefaultDamagerRepairer(new SupplementalTextScanner(sourceViewer
, lineDisplayStrategy
));
56 reconciler
.setDamager(damageRepairer
, IDocument
.DEFAULT_CONTENT_TYPE
);
57 reconciler
.setRepairer(damageRepairer
, IDocument
.DEFAULT_CONTENT_TYPE
);
63 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getConfiguredContentTypes(org.eclipse.jface.text.source.ISourceViewer)
67 public String
[] getConfiguredContentTypes(ISourceViewer sourceViewer
) {
68 return new String
[] { IDocument
.DEFAULT_CONTENT_TYPE
, ILineDisplayStrategy
.SUPPLEMENTAL_TEXT
};