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.
10 package eu
.etaxonomy
.taxeditor
.annotatedlineeditor
;
12 import org
.apache
.log4j
.Logger
;
13 import org
.eclipse
.jface
.text
.source
.Annotation
;
14 import org
.eclipse
.jface
.text
.source
.IAnnotationModel
;
15 import org
.eclipse
.jface
.text
.source
.ISourceViewer
;
18 * <p>LineSelectionSource class.</p>
24 public class LineSelectionSource
implements ILineSelectionSource
{
25 @SuppressWarnings("unused")
26 private static final Logger logger
= Logger
27 .getLogger(LineSelectionSource
.class);
29 private ISourceViewer viewer
;
32 * <p>Constructor for LineSelectionSource.</p>
34 * @param viewer a {@link org.eclipse.jface.text.source.ISourceViewer} object.
36 public LineSelectionSource(ISourceViewer viewer
) {
41 * @see eu.etaxonomy.taxeditor.bulkeditor.ILineSelectionSource#getSelectedObjectAtLine(int)
44 public Object
getSelectedObjectAtLine(int line
) {
45 IAnnotationModel model
= viewer
.getAnnotationModel();
46 if (model
instanceof LineAnnotationModel
) {
47 Annotation annotation
= ((LineAnnotationModel
) model
).
48 getAnnotationAtLine(line
, viewer
.getDocument());
49 if (annotation
!= null) {
50 return ((LineAnnotation
) annotation
).getEntity();//getPropertySource();