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
.eclipse
.swt
.graphics
.Font
;
14 import org
.eclipse
.swt
.graphics
.Image
;
17 * Methods for translating between the object in a line and
18 * its display in the editor.
24 public interface ILineDisplayStrategy
{
26 /** Constant <code>SUPPLEMENTAL_TEXT="supplemental_text"</code> */
27 public static final String SUPPLEMENTAL_TEXT
= "supplemental_text";
32 * @param entity a {@link java.lang.Object} object.
35 int getIndent(Object entity
);
40 * @param entity a {@link java.lang.Object} object.
41 * @return a {@link org.eclipse.swt.graphics.Image} object.
43 Image
getIcon(Object entity
);
48 * @param entity a {@link java.lang.Object} object.
49 * @return a {@link org.eclipse.swt.graphics.Font} object.
51 Font
getFont(Object entity
);
54 * For object's title cache output, mainly
56 * Note: if object's cache is empty, return "", not null
58 * @param entity a {@link java.lang.Object} object.
59 * @return a {@link java.lang.String} object.
61 String
getText(Object entity
);
64 * For object's supplemental information such as type, markers, etc.,
65 * usually stored in " [...]".
67 * @param entity a {@link java.lang.Object} object.
68 * @return a {@link java.lang.String} object.
70 String
getSupplementalText(Object entity
);
73 * <p>getEmptyCacheMessage</p>
75 * @param entity a {@link java.lang.Object} object.
76 * @return a {@link java.lang.String} object.
78 String
getEmptyCacheMessage(Object entity
);
83 * @param text a {@link java.lang.String} object.
84 * @param entity a {@link java.lang.Object} object.
86 void setText(String text
, Object entity
);
91 * @param entity a {@link java.lang.Object} object.
92 * @return a {@link java.lang.String} object.
94 String
getHoverText(Object entity
);
97 * <p>setStatusMessage</p>
99 * @param text a {@link java.lang.String} object.
100 * @param entity a {@link java.lang.Object} object.
102 void setStatusMessage(String text
, Object entity
);
105 * <p>isEntityCacheEmpty</p>
107 * @param entity a {@link java.lang.Object} object.
110 boolean isEntityCacheEmpty(Object entity
);
113 * <p>addDisplayListener</p>
115 * @param entity a {@link java.lang.Object} object.
116 * @param listener a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.EntityListener} object.
118 void addDisplayListener(Object entity
, EntityListener listener
);