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