Revision 253231ca
Added by Andreas Müller over 1 year ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractGroupedContainer.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.editor.name.e4.container; |
11 | 10 |
|
12 | 11 |
import java.util.Iterator; |
... | ... | |
115 | 114 |
private LineBreakListener lineBreakListener; |
116 | 115 |
|
117 | 116 |
private int cursorPosition; |
118 |
|
|
117 |
|
|
119 | 118 |
private long lastEventTime; |
120 | 119 |
|
121 | 120 |
protected Composite control; |
... | ... | |
161 | 160 |
TaxonName name = (TaxonName)parseHandler.parse(text); |
162 | 161 |
getTaxonBase().setName(name); |
163 | 162 |
getTaxonBase().setTitleCache((getTaxonBase().generateTitle())); |
164 |
|
|
163 |
|
|
165 | 164 |
|
166 | 165 |
// show errors resulting from parsing |
167 | 166 |
calculateAnnotations(); |
168 | 167 |
// store the position of the cursor |
169 | 168 |
storeCursor(); |
170 | 169 |
// notify selection listener |
171 |
setDelayedSelection();
|
|
170 |
setDelayedSelection(); |
|
172 | 171 |
//EventUtility.postAsyncEvent(WorkbenchEventConstants.REFRESH_DETAILS, true); |
173 |
|
|
172 |
|
|
174 | 173 |
}; |
175 | 174 |
|
176 | 175 |
nameCompositeFocusListener = new FocusAdapter() { |
... | ... | |
577 | 576 |
private volatile boolean stop = false; |
578 | 577 |
private Display display; |
579 | 578 |
|
580 |
public Delay(Display display) {
|
|
579 |
private Delay(Display display) {
|
|
581 | 580 |
this.display = display; |
582 | 581 |
} |
583 | 582 |
@Override |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/MoveDefinedTermOperation.java | ||
---|---|---|
82 | 82 |
result.includeResult(CdmStore.getService(ITermService.class).moveTerm(term, parentUuid, termMovePosition)); |
83 | 83 |
} |
84 | 84 |
Collection<CdmBase> affectedObjects = result.getUpdatedObjects(); |
85 |
Collection<AbstractTermDto> affectedDtos = new HashSet(); |
|
85 |
Collection<AbstractTermDto> affectedDtos = new HashSet<>();
|
|
86 | 86 |
for (CdmBase base: affectedObjects){ |
87 | 87 |
if (base instanceof TermVocabulary){ |
88 |
TermVocabularyDto dto = new TermVocabularyDto(base.getUuid(), ((TermVocabulary)base).getRepresentations(), ((TermVocabulary)base).getTermType(), ((TermVocabulary)base).getTitleCache(), ((TermVocabulary)base).isAllowDuplicates(), ((TermVocabulary)base).isOrderRelevant(), ((TermVocabulary)base).isFlat()); |
|
88 |
TermVocabularyDto dto = new TermVocabularyDto(base.getUuid(), ((TermVocabulary<?>)base).getRepresentations(), ((TermVocabulary)base).getTermType(), ((TermVocabulary)base).getTitleCache(), ((TermVocabulary)base).isAllowDuplicates(), ((TermVocabulary)base).isOrderRelevant(), ((TermVocabulary)base).isFlat());
|
|
89 | 89 |
affectedDtos.add(dto); |
90 | 90 |
} |
91 | 91 |
if (base instanceof DefinedTermBase){ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/OriginalLabelDataElement.java | ||
---|---|---|
14 | 14 |
/** |
15 | 15 |
* @author pplitzner |
16 | 16 |
* @date 17.06.2014 |
17 |
* |
|
18 | 17 |
*/ |
19 | 18 |
public class OriginalLabelDataElement extends AbstractCdmDetailElement<DerivedUnitFacade> { |
20 | 19 |
|
21 | 20 |
private TextWithLabelElement textOriginalLabel; |
22 | 21 |
|
23 |
/** |
|
24 |
* @param formFactory |
|
25 |
* @param formElement |
|
26 |
*/ |
|
27 | 22 |
public OriginalLabelDataElement(CdmFormFactory formFactory, |
28 | 23 |
ICdmFormElement formElement) { |
29 | 24 |
super(formFactory, formElement); |
30 | 25 |
} |
31 | 26 |
|
32 |
/* |
|
33 |
* (non-Javadoc) |
|
34 |
* |
|
35 |
* @see |
|
36 |
* eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls |
|
37 |
* (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int) |
|
38 |
*/ |
|
39 | 27 |
@Override |
40 | 28 |
protected void createControls(ICdmFormElement formElement, |
41 | 29 |
DerivedUnitFacade entity, int style) { |
... | ... | |
43 | 31 |
textOriginalLabel.setText(entity.getOriginalLabelInfo()); |
44 | 32 |
} |
45 | 33 |
|
46 |
/* |
|
47 |
* (non-Javadoc) |
|
48 |
* |
|
49 |
* @see |
|
50 |
* eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java |
|
51 |
* .lang.Object) |
|
52 |
*/ |
|
53 | 34 |
@Override |
54 | 35 |
public void handleEvent(Object eventSource) { |
55 | 36 |
if(eventSource==textOriginalLabel){ |
... | ... | |
61 | 42 |
public void fillFields() { |
62 | 43 |
textOriginalLabel.setText(getEntity().getOriginalLabelInfo()); |
63 | 44 |
} |
64 |
|
|
65 |
} |
|
45 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/OriginalSourceElement.java | ||
---|---|---|
8 | 8 |
*/ |
9 | 9 |
package eu.etaxonomy.taxeditor.ui.section.reference; |
10 | 10 |
|
11 |
import java.awt.Component; |
|
12 |
|
|
13 | 11 |
import org.apache.commons.lang3.StringUtils; |
14 | 12 |
import org.eclipse.jface.util.IPropertyChangeListener; |
15 |
import org.eclipse.swt.widgets.Composite; |
|
16 | 13 |
import org.eclipse.ui.forms.widgets.TableWrapData; |
17 |
import org.hibernate.EntityMode; |
|
18 | 14 |
|
19 | 15 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
20 | 16 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
... | ... | |
35 | 31 |
import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement; |
36 | 32 |
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement; |
37 | 33 |
import eu.etaxonomy.taxeditor.ui.section.common.ExternalLinksSection; |
38 |
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonBaseDetailSection; |
|
39 | 34 |
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; |
40 | 35 |
|
41 | 36 |
/** |
... | ... | |
74 | 69 |
if (entity.getCitation() != null) { |
75 | 70 |
refType = entity.getCitation().getType(); |
76 | 71 |
} |
77 |
|
|
72 |
|
|
78 | 73 |
} |
79 | 74 |
selection_Ref.setBackground(this.getPersistentBackground()); |
80 | 75 |
microReference = formFactory.createTextWithLabelElement(formElement, "Details", entity != null? entity.getCitationMicroReference(): "", style); |
... | ... | |
117 | 112 |
@Override |
118 | 113 |
public void handleEvent(Object eventSource) { |
119 | 114 |
if (eventSource.equals(selection_Ref)){ |
120 |
|
|
115 |
|
|
121 | 116 |
getEntity().setCitation(selection_Ref.getEntity()); |
122 | 117 |
ReferenceType newRefType = getEntity().getCitation().getType(); |
123 | 118 |
if (refType != null && refType.isDynamic() ^ getEntity().getCitation().getType().isDynamic()) { |
... | ... | |
146 | 141 |
externalLinks.setIndent(indent+10); |
147 | 142 |
advancedSection.setIndent(indent+10); |
148 | 143 |
} |
149 |
|
|
144 |
|
|
150 | 145 |
@Override |
151 | 146 |
public void refresh() { |
152 | 147 |
updateContent(); |
... | ... | |
164 | 159 |
if (advancedSection != null) { |
165 | 160 |
advancedSection.setEntity(getEntity()); |
166 | 161 |
} |
167 |
|
|
162 |
|
|
168 | 163 |
externalLinks.setEntity(getEntity()); |
169 |
|
|
164 |
|
|
170 | 165 |
} |
171 |
|
|
166 |
|
|
172 | 167 |
} |
173 |
|
|
174 | 168 |
|
175 |
|
|
176 |
|
|
169 |
|
|
170 |
|
|
171 |
|
|
177 | 172 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractSourcedEntityElement.java | ||
---|---|---|
36 | 36 |
protected boolean isCommonNameReference = false; |
37 | 37 |
|
38 | 38 |
public AbstractSourcedEntityElement(CdmFormFactory formFactory, |
39 |
AbstractFormSection section, T entity, |
|
39 |
AbstractFormSection<?> section, T entity,
|
|
40 | 40 |
SelectionListener removeListener, String label, int style, boolean isCommonNameReference) { |
41 | 41 |
super(formFactory, section, entity, removeListener, null, style); |
42 | 42 |
// make this element selectable |
... | ... | |
44 | 44 |
selectionArbitrator = formFactory.createSelectionArbitrator(this); |
45 | 45 |
} |
46 | 46 |
this.isCommonNameReference = isCommonNameReference; |
47 |
|
|
48 |
|
|
49 |
|
|
50 | 47 |
} |
51 | 48 |
|
52 | 49 |
public AbstractSourcedEntityElement(CdmFormFactory formFactory, |
... | ... | |
55 | 52 |
this(formFactory, section, entity, removeListener, label, style, false); |
56 | 53 |
} |
57 | 54 |
|
58 |
|
|
59 | 55 |
@Override |
60 | 56 |
public void createControls(ICdmFormElement formElement, int style) { |
61 | 57 |
|
... | ... | |
67 | 63 |
sourceElement.setEntity(source); |
68 | 64 |
}else{ |
69 | 65 |
sourceElement.setEntity(entity.getSource()); |
70 |
|
|
71 | 66 |
} |
72 |
|
|
73 | 67 |
} |
74 | 68 |
|
75 | 69 |
@Override |
... | ... | |
89 | 83 |
this.sourceElement.refresh(); |
90 | 84 |
} |
91 | 85 |
} |
92 |
|
|
93 |
} |
|
86 |
} |
Also available in: Unified diff
cleanup