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
.eclipse
.swt
.graphics
.Font
;
13 import org
.eclipse
.swt
.graphics
.Image
;
16 * Methods for translating between the object in a line and
17 * its display in the editor.
23 public interface ILineDisplayStrategy
{
25 /** Constant <code>SUPPLEMENTAL_TEXT="supplemental_text"</code> */
26 public static final String SUPPLEMENTAL_TEXT
= "supplemental_text";
31 * @param entity a {@link java.lang.Object} object.
34 int getIndent(Object entity
);
39 * @param entity a {@link java.lang.Object} object.
40 * @return a {@link org.eclipse.swt.graphics.Image} object.
42 Image
getIcon(Object entity
);
47 * @param entity a {@link java.lang.Object} object.
48 * @return a {@link org.eclipse.swt.graphics.Font} object.
50 Font
getFont(Object entity
);
53 * For object's title cache output, mainly
55 * Note: if object's cache is empty, return "", not null
57 * @param entity a {@link java.lang.Object} object.
58 * @return a {@link java.lang.String} object.
60 String
getText(Object entity
);
63 * For object's supplemental information such as type, markers, etc.,
64 * usually stored in " [...]".
66 * @param entity a {@link java.lang.Object} object.
67 * @return a {@link java.lang.String} object.
69 String
getSupplementalText(Object entity
);
72 * <p>getEmptyCacheMessage</p>
74 * @param entity a {@link java.lang.Object} object.
75 * @return a {@link java.lang.String} object.
77 String
getEmptyCacheMessage(Object entity
);
82 * @param text a {@link java.lang.String} object.
83 * @param entity a {@link java.lang.Object} object.
85 void setText(String text
, Object entity
);
90 * @param entity a {@link java.lang.Object} object.
91 * @return a {@link java.lang.String} object.
93 String
getHoverText(Object entity
);
96 * <p>setStatusMessage</p>
98 * @param text a {@link java.lang.String} object.
99 * @param entity a {@link java.lang.Object} object.
101 void setStatusMessage(String text
, Object entity
);
104 * <p>isEntityCacheEmpty</p>
106 * @param entity a {@link java.lang.Object} object.
109 boolean isEntityCacheEmpty(Object entity
);
112 * <p>addDisplayListener</p>
114 * @param entity a {@link java.lang.Object} object.
115 * @param listener a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.EntityListener} object.
117 void addDisplayListener(Object entity
, EntityListener listener
);