1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2007 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
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.
|
9
|
*/
|
10
|
|
11
|
package eu.etaxonomy.taxeditor.annotatedlineeditor;
|
12
|
|
13
|
import org.eclipse.swt.graphics.Font;
|
14
|
import org.eclipse.swt.graphics.Image;
|
15
|
|
16
|
/**
|
17
|
* Methods for translating between the object in a line and
|
18
|
* its display in the editor.
|
19
|
*
|
20
|
* @author p.ciardelli
|
21
|
* @created 07.07.2009
|
22
|
* @version 1.0
|
23
|
*/
|
24
|
public interface ILineDisplayStrategy {
|
25
|
|
26
|
/** Constant <code>SUPPLEMENTAL_TEXT="supplemental_text"</code> */
|
27
|
public static final String SUPPLEMENTAL_TEXT = "supplemental_text";
|
28
|
|
29
|
/**
|
30
|
* <p>getIndent</p>
|
31
|
*
|
32
|
* @param entity a {@link java.lang.Object} object.
|
33
|
* @return a int.
|
34
|
*/
|
35
|
int getIndent(Object entity);
|
36
|
|
37
|
/**
|
38
|
* <p>getIcon</p>
|
39
|
*
|
40
|
* @param entity a {@link java.lang.Object} object.
|
41
|
* @return a {@link org.eclipse.swt.graphics.Image} object.
|
42
|
*/
|
43
|
Image getIcon(Object entity);
|
44
|
|
45
|
/**
|
46
|
* <p>getFont</p>
|
47
|
*
|
48
|
* @param entity a {@link java.lang.Object} object.
|
49
|
* @return a {@link org.eclipse.swt.graphics.Font} object.
|
50
|
*/
|
51
|
Font getFont(Object entity);
|
52
|
|
53
|
/**
|
54
|
* For object's title cache output, mainly
|
55
|
*
|
56
|
* Note: if object's cache is empty, return "", not null
|
57
|
*
|
58
|
* @param entity a {@link java.lang.Object} object.
|
59
|
* @return a {@link java.lang.String} object.
|
60
|
*/
|
61
|
String getText(Object entity);
|
62
|
|
63
|
/**
|
64
|
* For object's supplemental information such as type, markers, etc.,
|
65
|
* usually stored in " [...]".
|
66
|
*
|
67
|
* @param entity a {@link java.lang.Object} object.
|
68
|
* @return a {@link java.lang.String} object.
|
69
|
*/
|
70
|
String getSupplementalText(Object entity);
|
71
|
|
72
|
/**
|
73
|
* <p>getEmptyCacheMessage</p>
|
74
|
*
|
75
|
* @param entity a {@link java.lang.Object} object.
|
76
|
* @return a {@link java.lang.String} object.
|
77
|
*/
|
78
|
String getEmptyCacheMessage(Object entity);
|
79
|
|
80
|
/**
|
81
|
* <p>setText</p>
|
82
|
*
|
83
|
* @param text a {@link java.lang.String} object.
|
84
|
* @param entity a {@link java.lang.Object} object.
|
85
|
*/
|
86
|
void setText(String text, Object entity);
|
87
|
|
88
|
/**
|
89
|
* <p>getHoverText</p>
|
90
|
*
|
91
|
* @param entity a {@link java.lang.Object} object.
|
92
|
* @return a {@link java.lang.String} object.
|
93
|
*/
|
94
|
String getHoverText(Object entity);
|
95
|
|
96
|
/**
|
97
|
* <p>setStatusMessage</p>
|
98
|
*
|
99
|
* @param text a {@link java.lang.String} object.
|
100
|
* @param entity a {@link java.lang.Object} object.
|
101
|
*/
|
102
|
void setStatusMessage(String text, Object entity);
|
103
|
|
104
|
/**
|
105
|
* <p>isEntityCacheEmpty</p>
|
106
|
*
|
107
|
* @param entity a {@link java.lang.Object} object.
|
108
|
* @return a boolean.
|
109
|
*/
|
110
|
boolean isEntityCacheEmpty(Object entity);
|
111
|
|
112
|
/**
|
113
|
* <p>addDisplayListener</p>
|
114
|
*
|
115
|
* @param entity a {@link java.lang.Object} object.
|
116
|
* @param listener a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.EntityListener} object.
|
117
|
*/
|
118
|
void addDisplayListener(Object entity, EntityListener listener);
|
119
|
}
|