Revision e3a4a3ff
Added by Andreas Müller almost 7 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorLineDisplay.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.cdm.model.common.IAnnotatableEntity; |
25 | 25 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
26 | 26 |
import eu.etaxonomy.cdm.model.common.Marker; |
27 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
27 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
28 | 28 |
import eu.etaxonomy.cdm.model.reference.Reference; |
29 | 29 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.EntityListener; |
30 | 30 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy; |
... | ... | |
35 | 35 |
* |
36 | 36 |
* @author p.ciardelli |
37 | 37 |
* @created 07.07.2009 |
38 |
* @version 1.0 |
|
39 | 38 |
*/ |
40 | 39 |
public class BulkEditorLineDisplay implements ILineDisplayStrategy { |
41 | 40 |
|
... | ... | |
50 | 49 |
this.editor = editor; |
51 | 50 |
} |
52 | 51 |
|
53 |
/* (non-Javadoc) |
|
54 |
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#getIcon(java.lang.Object) |
|
55 |
*/ |
|
56 | 52 |
/** {@inheritDoc} */ |
57 | 53 |
@Override |
58 | 54 |
public Image getIcon(Object entity) { |
59 | 55 |
return null; |
60 | 56 |
} |
61 | 57 |
|
62 |
/* (non-Javadoc) |
|
63 |
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#getIndent(java.lang.Object) |
|
64 |
*/ |
|
65 | 58 |
/** {@inheritDoc} */ |
66 | 59 |
@Override |
67 | 60 |
public int getIndent(Object entity) { |
68 | 61 |
return 0; |
69 | 62 |
} |
70 | 63 |
|
71 |
/* (non-Javadoc) |
|
72 |
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#getText(java.lang.Object) |
|
73 |
*/ |
|
74 | 64 |
/** {@inheritDoc} */ |
75 | 65 |
@Override |
76 | 66 |
public String getText(Object entity) { |
77 | 67 |
return editor.getEditorInput().getText((ICdmBase) entity); |
78 | 68 |
} |
79 | 69 |
|
80 |
|
|
81 |
/* (non-Javadoc) |
|
82 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getSupplementalText(java.lang.Object) |
|
83 |
*/ |
|
84 | 70 |
/** {@inheritDoc} */ |
85 | 71 |
@Override |
86 | 72 |
public String getSupplementalText(Object entity) { |
... | ... | |
111 | 97 |
return supplementalText; |
112 | 98 |
} |
113 | 99 |
|
114 |
/* (non-Javadoc) |
|
115 |
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#setText(java.lang.String, java.lang.Object) |
|
116 |
*/ |
|
117 | 100 |
/** {@inheritDoc} */ |
118 | 101 |
@Override |
119 | 102 |
public void setText(String text, Object entity) { |
... | ... | |
122 | 105 |
} |
123 | 106 |
} |
124 | 107 |
|
125 |
/* (non-Javadoc) |
|
126 |
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#getHoverText(java.lang.Object) |
|
127 |
*/ |
|
128 | 108 |
/** {@inheritDoc} */ |
129 | 109 |
@Override |
130 | 110 |
public String getHoverText(Object entity) { |
... | ... | |
155 | 135 |
}).start(); |
156 | 136 |
} |
157 | 137 |
|
158 |
/* (non-Javadoc) |
|
159 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getEmptyText(java.lang.Object) |
|
160 |
*/ |
|
161 | 138 |
/** {@inheritDoc} */ |
162 | 139 |
@Override |
163 | 140 |
public String getEmptyCacheMessage(Object entity) { |
164 | 141 |
return entity.toString(); |
165 | 142 |
} |
166 | 143 |
|
167 |
/* (non-Javadoc) |
|
168 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#isEntityCacheEmpty(java.lang.Object) |
|
169 |
*/ |
|
170 | 144 |
/** {@inheritDoc} */ |
171 | 145 |
@Override |
172 | 146 |
public boolean isEntityCacheEmpty(Object entity) { |
... | ... | |
174 | 148 |
String text = ((Reference) entity).getTitleCache(); |
175 | 149 |
return (text == null || text.equals("")); |
176 | 150 |
} |
177 |
if (entity instanceof TaxonNameBase) {
|
|
178 |
String text = ((TaxonNameBase) entity).getTitleCache();
|
|
151 |
if (entity instanceof TaxonName) { |
|
152 |
String text = ((TaxonName) entity).getTitleCache(); |
|
179 | 153 |
return (text == null || text.equals("")); |
180 | 154 |
} |
181 | 155 |
if (entity instanceof AgentBase) { |
... | ... | |
185 | 159 |
return false; |
186 | 160 |
} |
187 | 161 |
|
188 |
/* (non-Javadoc) |
|
189 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#addDisplayListener(java.lang.Object) |
|
190 |
*/ |
|
191 | 162 |
/** {@inheritDoc} */ |
192 | 163 |
@Override |
193 | 164 |
public void addDisplayListener(Object entity, EntityListener listener) { |
Also available in: Unified diff
ref #6446 merge taxon name subclasses in TaxEditor