Revision 343fcdde
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditorPart.java | ||
---|---|---|
15 | 15 |
import java.util.UUID; |
16 | 16 |
|
17 | 17 |
import javax.annotation.PostConstruct; |
18 |
import javax.annotation.PreDestroy; |
|
18 | 19 |
import javax.inject.Inject; |
19 | 20 |
|
20 | 21 |
import org.eclipse.core.runtime.IProgressMonitor; |
... | ... | |
97 | 98 |
stackLayout = new StackLayout(); |
98 | 99 |
parent.setLayout(stackLayout); |
99 | 100 |
editor = new DistributionEditor(parent, this); |
100 |
// Label label = new Label(parent, SWT.NONE); |
|
101 |
// label.setText(Messages.CharacterMatrixPart_LOADING_MATRIX); |
|
102 |
// stackLayout.topControl = label; |
|
101 |
|
|
103 | 102 |
ContextInjectionFactory.inject(editor, context); |
104 | 103 |
} |
105 | 104 |
|
... | ... | |
131 | 130 |
// TODO Auto-generated method stub |
132 | 131 |
|
133 | 132 |
} |
133 |
@PreDestroy |
|
134 |
public void dispose(){ |
|
135 |
if (conversation != null) { |
|
136 |
conversation.close(); |
|
137 |
conversation = null; |
|
138 |
} |
|
139 |
if(cdmEntitySession != null) { |
|
140 |
cdmEntitySession.dispose(); |
|
141 |
cdmEntitySession = null; |
|
142 |
} |
|
143 |
dirty.setDirty(false); |
|
144 |
|
|
145 |
} |
|
146 |
|
|
134 | 147 |
|
135 | 148 |
/** |
136 | 149 |
* {@inheritDoc} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/StatusDataCellEditor.java | ||
---|---|---|
19 | 19 |
import org.eclipse.swt.widgets.Composite; |
20 | 20 |
import org.eclipse.swt.widgets.Control; |
21 | 21 |
|
22 |
import eu.etaxonomy.cdm.api.service.ITaxonService; |
|
23 | 22 |
import eu.etaxonomy.cdm.api.service.dto.TaxonDistributionDTO; |
24 | 23 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
25 | 24 |
import eu.etaxonomy.cdm.model.description.DescriptionElementSource; |
... | ... | |
27 | 26 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
28 | 27 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
29 | 28 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
30 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
31 | 29 |
|
32 | 30 |
/** |
33 | 31 |
* @author k.luther |
... | ... | |
37 | 35 |
public class StatusDataCellEditor extends ComboBoxCellEditor { |
38 | 36 |
private DistributionEditor editor; |
39 | 37 |
|
38 |
|
|
39 |
|
|
40 | 40 |
public StatusDataCellEditor(DistributionEditor editor, StatusComboBoxDataProvider statusComboBoxDataProvider) { |
41 | 41 |
super(statusComboBoxDataProvider, statusComboBoxDataProvider.getMaxVisibleItems()); |
42 | 42 |
this.editor = editor; |
43 | 43 |
setUseCheckbox(true); |
44 | 44 |
setMultiselect(false); |
45 | 45 |
|
46 |
|
|
47 | 46 |
} |
48 | 47 |
|
49 | 48 |
@Override |
... | ... | |
90 | 89 |
if (iterator.hasNext()){ |
91 | 90 |
iterator.next().addElement(newDistribution); |
92 | 91 |
}else{ |
93 |
Taxon taxon = (Taxon) CdmStore.getService(ITaxonService.class).findTaxonByUuid(((TaxonDistributionDTO) rowWrapper).getTaxonUuid(), null);
|
|
92 |
Taxon taxon = ((TaxonDistributionDTO) rowWrapper).getDescriptionsWrapper().getTaxon();
|
|
94 | 93 |
TaxonDescription desc = TaxonDescription.NewInstance(taxon); |
95 | 94 |
desc.addElement(newDistribution); |
96 | 95 |
((TaxonDistributionDTO) rowWrapper).getDescriptionsWrapper().getDescriptions().add(desc); |
Also available in: Unified diff
ref #7854: adapt to changes in DescriptionDTO