Revision 0680729b
Added by Alex Theys about 12 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/userecords/UseRecordsViewer.java | ||
---|---|---|
6 | 6 |
import org.eclipse.swt.widgets.Composite; |
7 | 7 |
import org.eclipse.ui.forms.widgets.Section; |
8 | 8 |
|
9 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade; |
|
10 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException; |
|
9 | 11 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
10 | 12 |
import eu.etaxonomy.cdm.model.description.DescriptionBase; |
11 | 13 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
14 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase; |
|
12 | 15 |
import eu.etaxonomy.cdm.model.reference.Reference; |
13 | 16 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
17 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
|
18 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
|
14 | 19 |
import eu.etaxonomy.taxeditor.ui.element.RootElement; |
15 | 20 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType; |
16 | 21 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType; |
... | ... | |
47 | 52 |
public UseRecordsViewer(Composite parent, AbstractCdmViewPart viewPart) { |
48 | 53 |
super(parent, viewPart); |
49 | 54 |
} |
55 |
|
|
56 |
// START HACK TO MAKE THE DERIVED UNIT FACADE WORK |
|
57 |
// since we are getting implementations of DerivedUnitBase from the bulk |
|
58 |
// editor |
|
59 |
// and not derived unit facade objects, |
|
60 |
|
|
61 |
/* |
|
62 |
* (non-Javadoc) |
|
63 |
* |
|
64 |
* @see |
|
65 |
* eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java |
|
66 |
* .lang.Object) |
|
67 |
*/ |
|
68 |
@Override |
|
69 |
public void setInput(Object input) { |
|
70 |
if (input instanceof DerivedUnitBase) { |
|
71 |
try { |
|
72 |
input = DerivedUnitFacade.NewInstance((DerivedUnitBase) input, |
|
73 |
PreferencesUtil.getDerivedUnitConfigurator()); |
|
74 |
} catch (DerivedUnitFacadeNotSupportedException e) { |
|
75 |
StoreUtil.error(getClass(), e); |
|
76 |
} |
|
77 |
} |
|
78 |
super.setInput(input); |
|
79 |
} |
|
80 |
|
|
81 |
@Override |
|
82 |
protected void markViewPartDirty() { |
|
83 |
if (getInput() instanceof DerivedUnitFacade) { |
|
84 |
getViewPart().changed( |
|
85 |
((DerivedUnitFacade) getInput()).innerDerivedUnit()); |
|
86 |
} |
|
87 |
|
|
88 |
super.markViewPartDirty(); |
|
89 |
} |
|
90 |
|
|
91 |
// END HACK TO MAKE THE DERIVED UNIT FACADE WORK |
|
92 |
|
|
93 |
|
|
50 | 94 |
@Override |
51 | 95 |
protected void showParts() { |
52 | 96 |
if (getInput() instanceof TaxonBase) { |
Also available in: Unified diff
AT: Comminting bug fixing for TaxEditor, fixing the setup and tree viewer