Revision cbc54d4e
Added by Andreas Müller almost 3 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/e4/ReferencingObjectsViewE4.java | ||
---|---|---|
115 | 115 |
|
116 | 116 |
private static final Logger logger = Logger.getLogger(ReferencingObjectsViewE4.class); |
117 | 117 |
|
118 |
public static final String IS_LOADING = "Loading ..."; |
|
119 |
// public static final String CANCELED = "Canceled ..."; |
|
120 |
|
|
121 | 118 |
private static final List<ReferencingObjectDto> EMPTY_LIST = Arrays.asList(); //immutable empty list |
122 | 119 |
private static final RefObjectDtoComparator COMPARATOR = new RefObjectDtoComparator(); |
123 | 120 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateDropListener.java | ||
---|---|---|
25 | 25 |
/** |
26 | 26 |
* @author pplitzner |
27 | 27 |
* @date 18.03.2014 |
28 |
* |
|
29 | 28 |
*/ |
30 | 29 |
public class DerivateDropListener extends EditViewerDropAdapter { |
31 | 30 |
|
... | ... | |
60 | 59 |
return LocalSelectionTransfer.getTransfer().isSupportedType(transferType) && target instanceof TreeNode; |
61 | 60 |
} |
62 | 61 |
|
63 |
/** |
|
64 |
* {@inheritDoc} |
|
65 |
*/ |
|
66 | 62 |
@Override |
67 | 63 |
public void dragOver(DropTargetEvent event) { |
68 | 64 |
super.dragOver(event); |
69 | 65 |
event.feedback = DND.FEEDBACK_SELECT | DND.FEEDBACK_SCROLL; |
70 | 66 |
} |
71 |
|
|
72 |
} |
|
67 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractEntityCollectionSection.java | ||
---|---|---|
186 | 186 |
* Override in subclasses if you want to have a different behaviour. |
187 | 187 |
*/ |
188 | 188 |
protected void setSectionTitle() { |
189 |
Collection<ELEMENT> collection = getCollection(getEntity()); |
|
189 |
ENTITY entity = getEntity(); |
|
190 |
Collection<ELEMENT> collection = getCollection(entity); |
|
190 | 191 |
if(collection != null && collection.size() > 0){ |
191 | 192 |
this.setText(getTitleString() + " +"); |
192 | 193 |
}else{ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java | ||
---|---|---|
39 | 39 |
/** |
40 | 40 |
* @author pplitzner |
41 | 41 |
* @date 16.12.2013 |
42 |
* |
|
43 | 42 |
*/ |
44 | 43 |
public class MediaSpecimenGeneralDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> implements ITogglableMediaElement{ |
45 | 44 |
|
46 |
private final TermVocabulary mediaSpecimenVocabulary = CdmStore.getService(IVocabularyService.class).find(VocabularyEnum.MediaSpecimenKindOfUnit.getUuid()); |
|
45 |
private final TermVocabulary<?> mediaSpecimenVocabulary = CdmStore.getService(IVocabularyService.class).find(VocabularyEnum.MediaSpecimenKindOfUnit.getUuid());
|
|
47 | 46 |
|
48 | 47 |
private TermComboElement<DefinedTerm> comboKindOfUnit; |
49 | 48 |
private LanguageStringWithLabelElement textTitleLanguageString; |
... | ... | |
57 | 56 |
private CheckboxElement checkIsPublish; |
58 | 57 |
|
59 | 58 |
private MediaDetailElement mediaDetailElement; |
60 |
/** |
|
61 |
* @param formFactory |
|
62 |
* @param formElement |
|
63 |
*/ |
|
59 |
|
|
64 | 60 |
public MediaSpecimenGeneralDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) { |
65 | 61 |
super(formFactory, formElement); |
66 | 62 |
} |
... | ... | |
93 | 89 |
// spacer.setBackground(getPersistentBackground()); |
94 | 90 |
LabelElement label2 = formFactory.createLabel(formElement, ""); |
95 | 91 |
|
96 |
selection_collection = formFactory.createSelectionElement(Collection.class,// getConversationHolder(),
|
|
92 |
selection_collection = formFactory.createSelectionElement(Collection.class, |
|
97 | 93 |
formElement, "Collection", entity.getCollection(), EntitySelectionElement.ALL, style); |
98 | 94 |
text_accessionNumber = formFactory.createTextWithLabelElement(formElement, "Accession Number", entity.getAccessionNumber(), style); |
99 | 95 |
|
... | ... | |
108 | 104 |
break; |
109 | 105 |
} |
110 | 106 |
} |
111 |
selection_publishedIn = formFactory.createSelectionElement(Reference.class, //getConversationHolder(),
|
|
107 |
selection_publishedIn = formFactory.createSelectionElement(Reference.class, |
|
112 | 108 |
formElement, "Published in", publishedIn, EntitySelectionElement.ALL, style); |
113 | 109 |
text_published_in_detail = formFactory.createTextWithLabelElement(formElement, "Published in Detail", publishedInDetail, style); |
114 | 110 |
LabelElement label4 = formFactory.createLabel(formElement, ""); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/derivative/DerivateContentProvider.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2013 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
1 | 9 |
package eu.etaxonomy.taxeditor.view.search.derivative; |
2 | 10 |
|
3 | 11 |
import java.util.ArrayList; |
... | ... | |
27 | 35 |
@Override |
28 | 36 |
public void dispose() { |
29 | 37 |
// TODO Auto-generated method stub |
30 |
|
|
31 | 38 |
} |
32 | 39 |
|
33 | 40 |
public List<SpecimenOrObservationBase> getRootElements() { |
34 |
List<SpecimenOrObservationBase> elements = new ArrayList<SpecimenOrObservationBase>();
|
|
41 |
List<SpecimenOrObservationBase> elements = new ArrayList<>(); |
|
35 | 42 |
|
36 | 43 |
if(rootNodes != null) { |
37 | 44 |
for(TreeNode node : rootNodes) { |
38 |
elements.add((SpecimenOrObservationBase)node.getValue()); |
|
45 |
elements.add((SpecimenOrObservationBase<?>)node.getValue());
|
|
39 | 46 |
} |
40 | 47 |
} |
41 | 48 |
return elements; |
... | ... | |
49 | 56 |
public Object[] getElements(Object inputElement) { |
50 | 57 |
rootNodes = new ArrayList<>(); |
51 | 58 |
if(inputElement instanceof Collection){ |
52 |
for (Object o: (Collection)inputElement) { |
|
59 |
for (Object o: (Collection<?>)inputElement) {
|
|
53 | 60 |
if(o instanceof SpecimenOrObservationBase){ |
54 | 61 |
SpecimenOrObservationBase<?> rootElement = (SpecimenOrObservationBase<?>)o; |
55 |
if(rootElement!=null){ |
|
56 |
rootNodes.add(new TreeNode(rootElement)); |
|
57 |
} |
|
62 |
rootNodes.add(new TreeNode(rootElement)); |
|
58 | 63 |
} |
59 | 64 |
} |
60 | 65 |
} |
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