Revision e97b77c6
Added by Patrick Plitzner over 9 years ago
- added preference for displaying associated taxa in specimen details view
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java | ||
---|---|---|
121 | 121 |
|
122 | 122 |
public static final String SHOW_COLLECTING_AREAS_IN_GENERAL_SECTION = "eu.etaxonomy.taxeditor.specimen.showCollectingAreasInGeneralSection"; |
123 | 123 |
|
124 |
public static final String SHOW_TAXON_ASSOCIATIONS = "eu.etaxonomy.taxeditor.specimen.showTaxonAssociations"; |
|
124 | 125 |
|
125 | 126 |
public static final String DISTRIBUTION_AREA_PREFRENCES_ACTIVE = "eu.etaxonomy.taxeditor.checklist.distributionAreaPreferencesActive"; |
126 | 127 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java | ||
---|---|---|
40 | 40 |
addField(new BooleanFieldEditor(IPreferenceKeys.SHOW_COLLECTING_AREAS_IN_GENERAL_SECTION, |
41 | 41 |
"Show \"Collecting Areas\" in \"General\" section of details view", |
42 | 42 |
getFieldEditorParent())); |
43 |
addField(new BooleanFieldEditor(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS, |
|
44 |
"Show taxon associations of a specimen in the details view", |
|
45 |
getFieldEditorParent())); |
|
43 | 46 |
|
44 | 47 |
} |
45 | 48 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import java.util.Collection; |
13 | 13 |
|
14 |
import org.eclipse.core.commands.ExecutionException; |
|
15 |
import org.eclipse.core.commands.NotEnabledException; |
|
16 |
import org.eclipse.core.commands.NotHandledException; |
|
17 |
import org.eclipse.core.commands.common.NotDefinedException; |
|
18 | 14 |
import org.eclipse.jface.viewers.ArrayContentProvider; |
19 | 15 |
import org.eclipse.jface.viewers.DoubleClickEvent; |
20 | 16 |
import org.eclipse.jface.viewers.IDoubleClickListener; |
... | ... | |
81 | 77 |
*/ |
82 | 78 |
@Override |
83 | 79 |
public void doubleClick(DoubleClickEvent event) { |
84 |
String commandId = "eu.etaxonomy.taxeditor.navigation.command.update.editSelection"; |
|
85 |
|
|
86 |
IHandlerService handlerService = (IHandlerService) AbstractUtility.getService(IHandlerService.class); |
|
87 |
try { |
|
88 |
handlerService.executeCommand(commandId, null); |
|
89 |
} catch (ExecutionException e) { |
|
90 |
// TODO Auto-generated catch block |
|
91 |
e.printStackTrace(); |
|
92 |
} catch (NotDefinedException e) { |
|
93 |
// TODO Auto-generated catch block |
|
94 |
e.printStackTrace(); |
|
95 |
} catch (NotEnabledException e) { |
|
96 |
// TODO Auto-generated catch block |
|
97 |
e.printStackTrace(); |
|
98 |
} catch (NotHandledException e) { |
|
99 |
// TODO Auto-generated catch block |
|
100 |
e.printStackTrace(); |
|
101 |
} |
|
80 |
// String commandId = "eu.etaxonomy.taxeditor.navigation.command.update.editSelection";
|
|
81 |
// |
|
82 |
// IHandlerService handlerService = (IHandlerService) AbstractUtility.getService(IHandlerService.class);
|
|
83 |
// try {
|
|
84 |
// handlerService.executeCommand(commandId, null);
|
|
85 |
// } catch (ExecutionException e) {
|
|
86 |
// // TODO Auto-generated catch block
|
|
87 |
// e.printStackTrace();
|
|
88 |
// } catch (NotDefinedException e) {
|
|
89 |
// // TODO Auto-generated catch block
|
|
90 |
// e.printStackTrace();
|
|
91 |
// } catch (NotEnabledException e) {
|
|
92 |
// // TODO Auto-generated catch block
|
|
93 |
// e.printStackTrace();
|
|
94 |
// } catch (NotHandledException e) {
|
|
95 |
// // TODO Auto-generated catch block
|
|
96 |
// e.printStackTrace();
|
|
97 |
// }
|
|
102 | 98 |
|
103 | 99 |
|
104 | 100 |
// if(event.getSelection() instanceof StructuredSelection){ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java | ||
---|---|---|
656 | 656 |
private void createDerivedUnitBaseElementSection(RootElement parent) { |
657 | 657 |
destroySections(); |
658 | 658 |
|
659 |
//different order of sections (Specimen Details as second section and expanded) |
|
660 |
if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){ |
|
661 |
DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); |
|
662 |
addPart(derivedUnitGeneralDetailSection); |
|
663 |
|
|
664 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
|
665 |
|
|
666 |
DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); |
|
667 |
addPart(derivedUnitBaseDetailSection); |
|
668 |
|
|
669 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
|
670 |
|
|
671 |
OriginalLabelDataSection originalLabelDataSection = formFactory.createOriginalLabelDataSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); |
|
672 |
addPart(originalLabelDataSection); |
|
659 |
DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); |
|
660 |
addPart(derivedUnitGeneralDetailSection); |
|
673 | 661 |
|
674 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
|
675 |
|
|
676 |
TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); |
|
677 |
addPart(taxonAssociationDetailSection); |
|
678 |
} |
|
679 |
else{ |
|
680 |
DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); |
|
681 |
addPart(derivedUnitGeneralDetailSection); |
|
682 |
|
|
683 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
|
684 |
|
|
685 |
GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE); |
|
686 |
addPart(gatheringEventDetailSection); |
|
662 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
|
687 | 663 |
|
688 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
|
664 |
DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); |
|
665 |
addPart(derivedUnitBaseDetailSection); |
|
689 | 666 |
|
690 |
FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE); |
|
691 |
addPart(fieldUnitDetailSection); |
|
667 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
|
692 | 668 |
|
693 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
|
669 |
OriginalLabelDataSection originalLabelDataSection = formFactory.createOriginalLabelDataSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); |
|
670 |
addPart(originalLabelDataSection); |
|
694 | 671 |
|
695 |
DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE); |
|
696 |
addPart(derivedUnitBaseDetailSection); |
|
697 | 672 |
|
673 |
if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){ |
|
698 | 674 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
699 |
|
|
700 | 675 |
DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE); |
701 | 676 |
addPart(determinationDetailSection); |
702 | 677 |
} |
678 |
if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS)){ |
|
679 |
formFactory.createHorizontalSeparator(parent, SWT.BORDER); |
|
680 |
TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); |
|
681 |
addPart(taxonAssociationDetailSection); |
|
682 |
} |
|
703 | 683 |
|
704 | 684 |
} |
705 | 685 |
|
Also available in: Unified diff