private static final Logger logger = Logger.getLogger(ReferencingObjectsViewE4.class);
- public static final String IS_LOADING = "Loading ...";
-// public static final String CANCELED = "Canceled ...";
-
private static final List<ReferencingObjectDto> EMPTY_LIST = Arrays.asList(); //immutable empty list
private static final RefObjectDtoComparator COMPARATOR = new RefObjectDtoComparator();
/**
* @author pplitzner
* @date 18.03.2014
- *
*/
public class DerivateDropListener extends EditViewerDropAdapter {
return LocalSelectionTransfer.getTransfer().isSupportedType(transferType) && target instanceof TreeNode;
}
- /**
- * {@inheritDoc}
- */
@Override
public void dragOver(DropTargetEvent event) {
super.dragOver(event);
event.feedback = DND.FEEDBACK_SELECT | DND.FEEDBACK_SCROLL;
}
-
-}
+}
\ No newline at end of file
* Override in subclasses if you want to have a different behaviour.
*/
protected void setSectionTitle() {
- Collection<ELEMENT> collection = getCollection(getEntity());
+ ENTITY entity = getEntity();
+ Collection<ELEMENT> collection = getCollection(entity);
if(collection != null && collection.size() > 0){
this.setText(getTitleString() + " +");
}else{
/**
* @author pplitzner
* @date 16.12.2013
- *
*/
public class MediaSpecimenGeneralDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> implements ITogglableMediaElement{
- private final TermVocabulary mediaSpecimenVocabulary = CdmStore.getService(IVocabularyService.class).find(VocabularyEnum.MediaSpecimenKindOfUnit.getUuid());
+ private final TermVocabulary<?> mediaSpecimenVocabulary = CdmStore.getService(IVocabularyService.class).find(VocabularyEnum.MediaSpecimenKindOfUnit.getUuid());
private TermComboElement<DefinedTerm> comboKindOfUnit;
private LanguageStringWithLabelElement textTitleLanguageString;
private CheckboxElement checkIsPublish;
private MediaDetailElement mediaDetailElement;
- /**
- * @param formFactory
- * @param formElement
- */
+
public MediaSpecimenGeneralDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
super(formFactory, formElement);
}
// spacer.setBackground(getPersistentBackground());
LabelElement label2 = formFactory.createLabel(formElement, "");
- selection_collection = formFactory.createSelectionElement(Collection.class,// getConversationHolder(),
+ selection_collection = formFactory.createSelectionElement(Collection.class,
formElement, "Collection", entity.getCollection(), EntitySelectionElement.ALL, style);
text_accessionNumber = formFactory.createTextWithLabelElement(formElement, "Accession Number", entity.getAccessionNumber(), style);
break;
}
}
- selection_publishedIn = formFactory.createSelectionElement(Reference.class, //getConversationHolder(),
+ selection_publishedIn = formFactory.createSelectionElement(Reference.class,
formElement, "Published in", publishedIn, EntitySelectionElement.ALL, style);
text_published_in_detail = formFactory.createTextWithLabelElement(formElement, "Published in Detail", publishedInDetail, style);
LabelElement label4 = formFactory.createLabel(formElement, "");
+/**
+* Copyright (C) 2013 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
package eu.etaxonomy.taxeditor.view.search.derivative;
import java.util.ArrayList;
@Override
public void dispose() {
// TODO Auto-generated method stub
-
}
public List<SpecimenOrObservationBase> getRootElements() {
- List<SpecimenOrObservationBase> elements = new ArrayList<SpecimenOrObservationBase>();
+ List<SpecimenOrObservationBase> elements = new ArrayList<>();
if(rootNodes != null) {
for(TreeNode node : rootNodes) {
- elements.add((SpecimenOrObservationBase)node.getValue());
+ elements.add((SpecimenOrObservationBase<?>)node.getValue());
}
}
return elements;
public Object[] getElements(Object inputElement) {
rootNodes = new ArrayList<>();
if(inputElement instanceof Collection){
- for (Object o: (Collection)inputElement) {
+ for (Object o: (Collection<?>)inputElement) {
if(o instanceof SpecimenOrObservationBase){
SpecimenOrObservationBase<?> rootElement = (SpecimenOrObservationBase<?>)o;
- if(rootElement!=null){
- rootNodes.add(new TreeNode(rootElement));
- }
+ rootNodes.add(new TreeNode(rootElement));
}
}
}
import java.util.Set;
import java.util.UUID;
+import org.apache.commons.lang3.StringUtils;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.swt.graphics.Image;
return sampleDesignationTerm;
}
-
- /** {@inheritDoc} */
@Override
public String getText(Object element) {
if(element instanceof TreeNode){
}
String text = null;
if(element instanceof IdentifiableEntity
- && ((IdentifiableEntity) element).isProtectedTitleCache()){
- return ((IdentifiableEntity) element).getTitleCache();
+ && ((IdentifiableEntity<?>) element).isProtectedTitleCache()){
+ return ((IdentifiableEntity<?>) element).getTitleCache();
}
-
//check if collection code does not exist -> use collection name then
FormatKey collectionKey = FormatKey.COLLECTION_CODE;
- text = CdmFormatterFactory.format(element,new FormatKey[]{FormatKey.COLLECTION_CODE});
+ text = CdmFormatterFactory.format(element, new FormatKey[]{FormatKey.COLLECTION_CODE});
if(CdmUtils.isBlank(text)){
collectionKey = FormatKey.COLLECTION_NAME;
}
}
else if(element instanceof IdentifiableEntity){
- IdentifiableEntity identifiableEntity = (IdentifiableEntity) element;
+ IdentifiableEntity<?> identifiableEntity = (IdentifiableEntity<?>) element;
if(identifiableEntity.isProtectedTitleCache()){
text = identifiableEntity.getTitleCache();
}
return text;
}
- /** {@inheritDoc} */
@Override
public String getToolTipText(Object element) {
return getDerivateText(element);
}
- /**
- * @param conversation the conversation to set
- */
public void setConversation(ConversationHolder conversation) {
this.conversation = conversation;
}
conversation.bind();
}
- final String emptyString = "";
+ final String emptyString = StringUtils.EMPTY;
final String separator = " ";
String label = emptyString;