Revision cbc54d4e
Added by Andreas Müller almost 3 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/derivative/DerivateLabelProvider.java | ||
---|---|---|
18 | 18 |
import java.util.Set; |
19 | 19 |
import java.util.UUID; |
20 | 20 |
|
21 |
import org.apache.commons.lang3.StringUtils; |
|
21 | 22 |
import org.eclipse.jface.viewers.ColumnLabelProvider; |
22 | 23 |
import org.eclipse.jface.viewers.TreeNode; |
23 | 24 |
import org.eclipse.swt.graphics.Image; |
... | ... | |
130 | 131 |
return sampleDesignationTerm; |
131 | 132 |
} |
132 | 133 |
|
133 |
|
|
134 |
/** {@inheritDoc} */ |
|
135 | 134 |
@Override |
136 | 135 |
public String getText(Object element) { |
137 | 136 |
if(element instanceof TreeNode){ |
... | ... | |
139 | 138 |
} |
140 | 139 |
String text = null; |
141 | 140 |
if(element instanceof IdentifiableEntity |
142 |
&& ((IdentifiableEntity) element).isProtectedTitleCache()){ |
|
143 |
return ((IdentifiableEntity) element).getTitleCache(); |
|
141 |
&& ((IdentifiableEntity<?>) element).isProtectedTitleCache()){
|
|
142 |
return ((IdentifiableEntity<?>) element).getTitleCache();
|
|
144 | 143 |
} |
145 | 144 |
|
146 |
|
|
147 | 145 |
//check if collection code does not exist -> use collection name then |
148 | 146 |
FormatKey collectionKey = FormatKey.COLLECTION_CODE; |
149 |
text = CdmFormatterFactory.format(element,new FormatKey[]{FormatKey.COLLECTION_CODE}); |
|
147 |
text = CdmFormatterFactory.format(element, new FormatKey[]{FormatKey.COLLECTION_CODE});
|
|
150 | 148 |
if(CdmUtils.isBlank(text)){ |
151 | 149 |
collectionKey = FormatKey.COLLECTION_NAME; |
152 | 150 |
} |
... | ... | |
195 | 193 |
} |
196 | 194 |
else if(element instanceof IdentifiableEntity){ |
197 | 195 |
|
198 |
IdentifiableEntity identifiableEntity = (IdentifiableEntity) element;
|
|
196 |
IdentifiableEntity<?> identifiableEntity = (IdentifiableEntity<?>) element;
|
|
199 | 197 |
if(identifiableEntity.isProtectedTitleCache()){ |
200 | 198 |
text = identifiableEntity.getTitleCache(); |
201 | 199 |
} |
... | ... | |
215 | 213 |
return text; |
216 | 214 |
} |
217 | 215 |
|
218 |
/** {@inheritDoc} */ |
|
219 | 216 |
@Override |
220 | 217 |
public String getToolTipText(Object element) { |
221 | 218 |
return getDerivateText(element); |
222 | 219 |
} |
223 | 220 |
|
224 |
/** |
|
225 |
* @param conversation the conversation to set |
|
226 |
*/ |
|
227 | 221 |
public void setConversation(ConversationHolder conversation) { |
228 | 222 |
this.conversation = conversation; |
229 | 223 |
} |
... | ... | |
248 | 242 |
conversation.bind(); |
249 | 243 |
} |
250 | 244 |
|
251 |
final String emptyString = "";
|
|
245 |
final String emptyString = StringUtils.EMPTY;
|
|
252 | 246 |
final String separator = " "; |
253 | 247 |
|
254 | 248 |
String label = emptyString; |
Also available in: Unified diff
cleanup