eu.etaxonomy.taxeditor.application/.classpath -text
eu.etaxonomy.taxeditor.application/.project -text
eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF -text
+eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin.properties -text
+eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_de.properties -text
+eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_en.properties -text
eu.etaxonomy.taxeditor.application/build.properties -text
eu.etaxonomy.taxeditor.application/icons/256color_16x16.gif -text
eu.etaxonomy.taxeditor.application/icons/256color_32x32.gif -text
eu.etaxonomy.taxeditor.application/icons/edit_16x16.gif -text
eu.etaxonomy.taxeditor.application/icons/specimen_derivate-16x16-32.png -text
eu.etaxonomy.taxeditor.application/p2.inf -text
-eu.etaxonomy.taxeditor.application/plugin.properties -text
eu.etaxonomy.taxeditor.application/plugin.xml -text
eu.etaxonomy.taxeditor.application/plugin_customization.ini -text
eu.etaxonomy.taxeditor.application/pom.xml -text
eu.etaxonomy.taxeditor.editor/.classpath -text
eu.etaxonomy.taxeditor.editor/.project -text
eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF -text
+eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties -text
+eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties -text
+eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_en.properties -text
eu.etaxonomy.taxeditor.editor/build.properties -text
eu.etaxonomy.taxeditor.editor/icons/address-book-new.png -text
eu.etaxonomy.taxeditor.editor/icons/camera-photo.png -text
eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar -text
eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar -text
eu.etaxonomy.taxeditor.editor/p2.inf -text
-eu.etaxonomy.taxeditor.editor/plugin.properties -text
eu.etaxonomy.taxeditor.editor/plugin.xml -text
eu.etaxonomy.taxeditor.editor/pom.xml -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/CdmDataTransfer.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditNewTaxonHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditor.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenDerivateViewHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenParentHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SaveAllHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteTaxonOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/RemoveHomotypicalGroupBasionymOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/SwapSynonymAndAcceptedOperation.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistContentProvider.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorComparator.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorInput.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/DistributionEditingSupport.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/RankEditingSupport.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/filter/ChecklistEditorFilter.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/CreateDescriptionElementHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/CreateDescriptionHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/OpenDistributionHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistDropdownSelectionListener.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistFocusListener.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistModifyListener.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptContentProvider.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptLabelProvider.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java -text
eu.etaxonomy.taxeditor.navigation/.classpath -text
eu.etaxonomy.taxeditor.navigation/.project -text
eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF -text
+eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle.properties -text
+eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle_de.properties -text
+eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle_en.properties -text
+eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages.properties -text
+eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_de.properties -text
+eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_en.properties -text
eu.etaxonomy.taxeditor.navigation/build.properties -text
eu.etaxonomy.taxeditor.navigation/icons/edit_16x16.gif -text
eu.etaxonomy.taxeditor.navigation/icons/preferences-system-windows.png -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreateClassification.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreatePolytomousKey.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreateTaxonNode.java -text
+eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/Messages.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchBar.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchResultLabelProvider.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchResultView.java -text
eu.etaxonomy.taxeditor.printpublisher/.classpath -text
eu.etaxonomy.taxeditor.printpublisher/.project -text
eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF -text
+eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle.properties -text
+eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle_de.properties -text
+eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle_en.properties -text
eu.etaxonomy.taxeditor.printpublisher/build.properties -text
eu.etaxonomy.taxeditor.printpublisher/p2.inf -text
eu.etaxonomy.taxeditor.printpublisher/plugin.xml -text
eu.etaxonomy.taxeditor.store/.classpath -text
eu.etaxonomy.taxeditor.store/.project -text
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF -text
+eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties -text
+eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties -text
+eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_en.properties -text
+eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties -text
+eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties -text
+eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_en.properties -text
eu.etaxonomy.taxeditor.store/build.properties -text
eu.etaxonomy.taxeditor.store/icons/256color_16x16.bmp -text
eu.etaxonomy.taxeditor.store/icons/256color_32x32.bmp -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/OpenFeatureTreeEditorWizardHandler.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/SelectFeatureTreeWizard.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/SelectFeatureTreeWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenDistributionEditorWizardHandler.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenPasswordWizzardHandler.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/ShowLoginWindowHandler.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/identificationkey/AbstractIdentificaitonKeyWizard.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractDataChangeBehaviour.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AuthorHelper.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmErrorDialog.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmObjectTransfer.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmProgressMonitorAdapter.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CommonHelper.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/LineSelection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MementoHelper.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MultiLanguageText.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/NameHelper.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/NomenclaturalCodeHelper.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/parser/MatchStrategyConfigurator.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/parser/ParseHandler.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CdmPreferences.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DefaultFeatureTreePreferenecs.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DescriptionPreferences.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/FeatureTreePreferences.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicEditorGeneralPreferences.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicPreferences.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TemplatePreferencePage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TypeDesignationPreferences.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/AbstractMatchingPreferences.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/NonViralNameMatchingPreference.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/SpecimenTypeDesignationStatusMenuPreferences.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/StageMenuPreferences.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/TaxonRelationshipTypeMenuPreferences.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionWizard.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/VocabularyTermWizard.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/VocabularyTermWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/security/AuthenticationSourceProvider.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewPart.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewerComparator.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmMetaDataAwareDataSourceContainer.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/Messages.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/AbstractDataSourceHandler.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/CloneDataSourceHandler.java -text
Bundle-Version: 3.3.7.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.TaxonomicEditorPlugin
Bundle-Vendor: EDIT
-Bundle-Localization: plugin
+Bundle-Localization: OSGI-INF/l10n/plugin
Export-Package: eu.etaxonomy.taxeditor
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
--- /dev/null
+productName=EDIT Taxonomic Editor\r
+productBlurb=EDIT Taxonomic Editor\n\Version: 3.3\n\n\Copyright (C) 2009 EDIT\n\European Distributed Institute of Taxonomy\n\http://www.e-taxonomy.eu\r
+\r
+extension.name = Taxonomic Editor\r
+perspective.name = Taxonomic\r
+perspective.name.0 = Polytomous Key\r
+perspective.name.1 = Uses\r
+perspective.name.2 = Derivates\r
+menu.label = General\r
+menu.label.0 = Edit\r
+menu.label.1 = Window\r
+menu.label.2 = Help\r
+menu.label.3 = New\r
+command.label = Close\r
+command.label.0 = Close All\r
+command.label.1 = Save\r
+command.label.2 = Save All\r
+command.label.3 = Import...\r
+command.label.4 = Export...\r
+command.label.5 = Exit\r
+command.label.6 = Undo\r
+command.label.7 = Redo\r
+command.label.8 = Cut\r
+command.label.9 = Copy\r
+command.label.10 = Paste\r
+command.label.11 = Delete\r
+command.label.12 = Preferences\r
+command.label.13 = Help Contents\r
+command.label.14 = Search\r
+command.label.15 = Dynamic Help\r
+command.label.16 = Parser Help Website\r
+command.label.17 = Check for Updates\r
+command.label.18 = Install New Software...\r
+command.label.19 = About Taxonomic Editor\r
+command.label.20 = About the EDIT Platform\r
+command.label.21 = New\r
+command.label.22 = Save\r
+product.name = EDIT Taxonomic Editor\r
+command.name = Parser Help\r
+command.name.0 = About the EDIT Platform\r
+activity.description = Disable unwanted eclipse UI\r
+activity.name = Disable\r
+product.name.0 = EDIT Taxonomic Editor
\ No newline at end of file
--- /dev/null
+productName=EDIT Taxonomischer Editor
+productBlurb=EDIT Taxonomischer Editor\n\Version: 3.3\n\n\Copyright (C) 2009 EDIT\n\European Distributed Institute of Taxonomy\n\http://www.e-taxonomy.eu
+
+extension.name = Taxonomischer Editor
+perspective.name = Taxonomisch
+perspective.name.0 = Polytomer Key
+perspective.name.1 = Anwendungen
+perspective.name.2 = Derivate
+menu.label = Datei
+menu.label.0 = Bearbeiten
+menu.label.1 = Extras
+menu.label.2 = Hilfe
+menu.label.3 = Neu
+command.label = Schlie\u00dfen
+command.label.0 = Schlie\u00dfe alle
+command.label.1 = Speichern
+command.label.2 = Speichere alle
+command.label.3 = Import...
+command.label.4 = Export...
+command.label.5 = Beenden
+command.label.6 = R\u00fcckg\u00e4ngig
+command.label.7 = Letzen Befehl wiederholen
+command.label.8 = Ausschneiden
+command.label.9 = Kopieren
+command.label.10 = Einf\u00fcgen
+command.label.11 = L\u00f6schen
+command.label.12 = Einstellungen
+command.label.13 = Hilfeinhalt
+command.label.14 = Suchen
+command.label.15 = Dynamische Hilfe
+command.label.16 = Parser Hilfe Webseite (in Englisch)
+command.label.17 = Suche nach Updates
+command.label.18 = Installiere Neue Software...
+command.label.19 = \u00dcber den Taxonomischen Editor
+command.label.20 = \u00dcber die EDIT Platform
+command.label.21 = Neu
+command.label.22 = Speichern
+product.name = EDIT Taxonomischer Editor
+command.name = Parser Hilfe
+command.name.0 = \u00dcber die EDIT Platform
+activity.description = Schalte unerw\u00fcnschte eclipse UI aus
+activity.name = Ausschalten
+product.name.0 = EDIT Taxonomischer Editor
--- /dev/null
+productName=EDIT Taxonomic Editor\r
+productBlurb=EDIT Taxonomic Editor\n\Version: 3.3\n\n\Copyright (C) 2009 EDIT\n\European Distributed Institute of Taxonomy\n\http://www.e-taxonomy.eu\r
+\r
+extension.name = Taxonomic Editor\r
+perspective.name = Taxonomic\r
+perspective.name.0 = Polytomous Key\r
+perspective.name.1 = Uses\r
+perspective.name.2 = Derivates\r
+menu.label = General\r
+menu.label.0 = Edit\r
+menu.label.1 = Window\r
+menu.label.2 = Help\r
+menu.label.3 = New\r
+command.label = Close\r
+command.label.0 = Close All\r
+command.label.1 = Save\r
+command.label.2 = Save All\r
+command.label.3 = Import...\r
+command.label.4 = Export...\r
+command.label.5 = Exit\r
+command.label.6 = Undo\r
+command.label.7 = Redo\r
+command.label.8 = Cut\r
+command.label.9 = Copy\r
+command.label.10 = Paste\r
+command.label.11 = Delete\r
+command.label.12 = Preferences\r
+command.label.13 = Help Contents\r
+command.label.14 = Search\r
+command.label.15 = Dynamic Help\r
+command.label.16 = Parser Help Website\r
+command.label.17 = Check for Updates\r
+command.label.18 = Install New Software...\r
+command.label.19 = About Taxonomic Editor\r
+command.label.20 = About the EDIT Platform\r
+command.label.21 = New\r
+command.label.22 = Save\r
+product.name = EDIT Taxonomic Editor\r
+command.name = Parser Help\r
+command.name.0 = About the EDIT Platform\r
+activity.description = Disable unwanted eclipse UI\r
+activity.name = Disable\r
+product.name.0 = EDIT Taxonomic Editor
\ No newline at end of file
plugin.xml,\
plugin_customization.ini,\
icons/,\
- plugin.properties,\
+ OSGI-INF/l10n/plugin.properties,\
splash.bmp,\
- p2.inf
+ p2.inf,\
+ OSGI-INF/l10n/plugin_de.properties,\
+ OSGI-INF/l10n/plugin_en.properties
+++ /dev/null
-productName=EDIT Taxonomic Editor\r
-productBlurb=EDIT Taxonomic Editor\n\Version: 3.3\n\n\Copyright (C) 2009 EDIT\n\European Distributed Institute of Taxonomy\n\http://www.e-taxonomy.eu\r
<plugin>\r
<extension\r
id="application"\r
- name="Taxonomic Editor"\r
+ name="%extension.name"\r
point="org.eclipse.core.runtime.applications">\r
<application\r
cardinality="singleton-global"\r
<perspective\r
class="eu.etaxonomy.taxeditor.perspective.Taxonomic"\r
id="eu.etaxonomy.taxeditor.application.perspective.taxonomic"\r
- name="Taxonomic">\r
+ name="%perspective.name">\r
</perspective>\r
<!--perspective\r
class="eu.etaxonomy.taxeditor.perspective.BulkEditing"\r
<perspective\r
class="eu.etaxonomy.taxeditor.perspective.PolytomousKey"\r
id="eu.etaxonomy.taxeditor.application.perspective.polytomous"\r
- name="Polytomous Key">\r
+ name="%perspective.name.0">\r
</perspective>\r
<perspective\r
class="eu.etaxonomy.taxeditor.perspective.Uses"\r
id="eu.etaxonomy.taxeditor.application.perspective.uses"\r
- name="Uses">\r
+ name="%perspective.name.1">\r
</perspective>\r
<perspective\r
class="eu.etaxonomy.taxeditor.perspective.DerivatePerspective"\r
icon="icons/specimen_derivate-16x16-32.png"\r
id="eu.etaxonomy.taxeditor.application.perspective.derivates"\r
- name="Derivates">\r
+ name="%perspective.name.2">\r
</perspective>\r
\r
</extension>\r
locationURI="menu:org.eclipse.ui.main.menu">\r
<menu\r
id="org.eclipse.ui.main.menu.file"\r
- label="General">\r
+ label="%menu.label">\r
</menu>\r
<menu\r
id="org.eclipse.ui.main.menu.edit"\r
- label="Edit">\r
+ label="%menu.label.0">\r
</menu>\r
<menu\r
id="org.eclipse.ui.main.menu.window"\r
- label="Window">\r
+ label="%menu.label.1">\r
</menu>\r
<menu\r
id="org.eclipse.ui.main.menu.help"\r
- label="Help">\r
+ label="%menu.label.2">\r
</menu>\r
</menuContribution>\r
<menuContribution\r
locationURI="menu:org.eclipse.ui.main.menu.file">\r
<menu\r
id="eu.etaxonomy.navigation.menu.new"\r
- label="New">\r
+ label="%menu.label.3">\r
</menu>\r
<separator\r
name="eu.etaxonomy.taxeditor.application.filemenu.new"\r
</separator>\r
<command\r
commandId="org.eclipse.ui.file.close"\r
- label="Close"\r
+ label="%command.label"\r
style="push">\r
</command>\r
<command\r
commandId="org.eclipse.ui.file.closeAll"\r
- label="Close All"\r
+ label="%command.label.0"\r
style="push">\r
</command>\r
<separator\r
</separator>\r
<command\r
commandId="org.eclipse.ui.file.save"\r
- label="Save"\r
+ label="%command.label.1"\r
style="push">\r
</command>\r
<command\r
commandId="org.eclipse.ui.file.saveAll"\r
- label="Save All"\r
+ label="%command.label.2"\r
style="push">\r
</command>\r
<separator\r
</separator>\r
<command\r
commandId="org.eclipse.ui.file.import"\r
- label="Import..."\r
+ label="%command.label.3"\r
style="push">\r
</command>\r
<command\r
commandId="org.eclipse.ui.file.export"\r
- label="Export..."\r
+ label="%command.label.4"\r
style="push">\r
</command>\r
<separator\r
<command\r
commandId="org.eclipse.ui.file.exit"\r
id="eu.etaxonomy.taxeditor.application.menu.exit"\r
- label="Exit"\r
+ label="%command.label.5"\r
style="push">\r
</command>\r
</menuContribution>\r
locationURI="menu:org.eclipse.ui.main.menu.edit">\r
<command\r
commandId="org.eclipse.ui.edit.undo"\r
- label="Undo">\r
+ label="%command.label.6">\r
</command>\r
<command\r
commandId="org.eclipse.ui.edit.redo"\r
- label="Redo"\r
+ label="%command.label.7"\r
style="push">\r
</command>\r
<separator\r
</separator>\r
<command\r
commandId="org.eclipse.ui.edit.cut"\r
- label="Cut"\r
+ label="%command.label.8"\r
style="push">\r
</command>\r
<command\r
commandId="org.eclipse.ui.edit.copy"\r
- label="Copy"\r
+ label="%command.label.9"\r
style="push">\r
</command>\r
<command\r
commandId="org.eclipse.ui.edit.paste"\r
- label="Paste"\r
+ label="%command.label.10"\r
style="push">\r
</command>\r
<separator\r
</separator>\r
<command\r
commandId="org.eclipse.ui.edit.delete"\r
- label="Delete"\r
+ label="%command.label.11"\r
style="push">\r
</command>\r
</menuContribution>\r
</separator>\r
<command\r
commandId="org.eclipse.ui.window.preferences"\r
- label="Preferences"\r
+ label="%command.label.12"\r
style="push">\r
</command>\r
</menuContribution>\r
locationURI="menu:org.eclipse.ui.main.menu.help">\r
<command\r
commandId="org.eclipse.ui.help.helpContents"\r
- label="Help Contents"\r
+ label="%command.label.13"\r
style="push">\r
</command>\r
<command\r
commandId="org.eclipse.ui.help.helpSearch"\r
- label="Search"\r
+ label="%command.label.14"\r
style="push">\r
</command>\r
<separator\r
</separator>\r
<command\r
commandId="org.eclipse.ui.help.dynamicHelp"\r
- label="Dynamic Help"\r
+ label="%command.label.15"\r
style="push">\r
</command>\r
<command\r
commandId="eu.etaxonomy.taxeditor.application.help.parser"\r
- label="Parser Help Website"\r
+ label="%command.label.16"\r
style="push">\r
</command>\r
<separator\r
</separator>\r
<command\r
commandId="org.eclipse.equinox.p2.ui.sdk.update"\r
- label="Check for Updates"\r
+ label="%command.label.17"\r
style="push">\r
</command>\r
<command\r
commandId="org.eclipse.equinox.p2.ui.sdk.install"\r
- label="Install New Software..."\r
+ label="%command.label.18"\r
style="push">\r
</command>\r
<separator\r
</separator>\r
<command\r
commandId="org.eclipse.ui.help.aboutAction"\r
- label="About Taxonomic Editor">\r
+ label="%command.label.19">\r
</command>\r
<command\r
commandId="eu.etaxonomy.taxeditor.application.help.aboutPlatform"\r
- label="About the EDIT Platform"\r
+ label="%command.label.20"\r
style="push">\r
</command>\r
</menuContribution>\r
id="eu.etaxonomy.taxeditor.editor.main">\r
<command\r
commandId="org.eclipse.ui.newWizard"\r
- label="New"\r
+ label="%command.label.21"\r
style="push">\r
</command>\r
<command\r
commandId="org.eclipse.ui.file.save"\r
- label="Save"\r
+ label="%command.label.22"\r
style="push">\r
</command>\r
</toolbar>\r
point="org.eclipse.core.runtime.products">\r
<product\r
application="eu.etaxonomy.taxeditor.application.application"\r
- name="EDIT Taxonomic Editor">\r
+ name="%product.name">\r
<property\r
name="windowImages"\r
value="icons/256color_16x16.gif,icons/256color_32x32.gif,icons/256color_48x48.gif">\r
<command\r
defaultHandler="eu.etaxonomy.taxeditor.OpenExternalParserHelpHandler"\r
id="eu.etaxonomy.taxeditor.application.help.parser"\r
- name="Parser Help">\r
+ name="%command.name">\r
</command>\r
<command\r
defaultHandler="eu.etaxonomy.taxeditor.OpenExternalAboutPlatformHandler"\r
id="eu.etaxonomy.taxeditor.application.help.aboutPlatform"\r
- name="About the EDIT Platform">\r
+ name="%command.name.0">\r
</command>\r
</extension>\r
\r
<extension\r
point="org.eclipse.ui.activities">\r
<activity\r
- description="Disable unwanted eclipse UI"\r
+ description="%activity.description"\r
id="eu.etaxonomy.taxeditor.disable"\r
- name="Disable">\r
+ name="%activity.name">\r
</activity>\r
<activityPatternBinding\r
activityId="eu.etaxonomy.taxeditor.disable"\r
point="org.eclipse.core.runtime.products">\r
<product\r
application="eu.etaxonomy.taxeditor.application.application"\r
- name="EDIT Taxonomic Editor">\r
+ name="%product.name.0">\r
<property\r
name="appName"\r
value="EDIT Taxonomic Editor">\r
package eu.etaxonomy.taxeditor;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.rmi.activation.Activator;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.application.IWorkbenchConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+import org.eclipse.ui.statushandlers.AbstractStatusHandler;
+import org.eclipse.ui.statushandlers.StatusAdapter;
+import org.eclipse.ui.statushandlers.StatusManager;
+
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+
/**
*/
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
+ private CdmStatusHandler cdmStatusHandler;
/*
* (non-Javadoc)
* @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)
// return workspace.getRoot();
// }
+// @Override
+// public void eventLoopException(Throwable exception) {
+// super.eventLoopException(exception);
+// StoreUtil.messageDialog("Unexpected error", null, exception.getMessage(), exception);
+// }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.application.WorkbenchAdvisor#getWorkbenchErrorHandler()
+ */
+ @Override
+ public synchronized AbstractStatusHandler getWorkbenchErrorHandler() {
+ if (cdmStatusHandler == null) {
+ cdmStatusHandler = new CdmStatusHandler();
+ }
+ return cdmStatusHandler;
+ }
+
+
+ /**
+ * Custom status handler for handling scenarios which are
+ * not handled by the editor (e.g. runtime exceptions).
+ *
+ * The default {@link org.eclipse.ui.statushandlers.WorkbenchErrorHandler}
+ * is not used or extended because we need a handler for specific scenarios
+ * which displays a custom built error dialog.
+ *
+ * @author cmathew
+ *
+ */
+ class CdmStatusHandler extends AbstractStatusHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.statushandlers.AbstractStatusHandler#handle(org.eclipse.ui.statushandlers.StatusAdapter, int)
+ */
+ @Override
+ public void handle(StatusAdapter statusAdapter, int style)
+ {
+ if(statusAdapter.getStatus().matches(IStatus.ERROR)) {
+
+ IStatus status = statusAdapter.getStatus();
+ Throwable t = statusAdapter.getStatus().getException();
+ // NOTE : Currently we only allow RuntimeExceptions since
+ // allowing all kinds of exceptions would also include
+ // those in generated status objects coming from from logging triggers
+ // leading to a recursive infinite loop of :
+ // initial exception thrown -> status handling -> dialog opening + logging of status ->
+ // status handling -> dialog opening + logging of status ... and so on
+ if(t != null && t instanceof RuntimeException) {
+ MessagingUtils.errorDialog("Unexpected error",
+ null,
+ MessagingUtils.UNEXPECTED_ERROR_MESSAGE,
+ statusAdapter.getStatus().getPlugin(),
+ t,
+ true);
+ }
+ }
+ }
+ }
+
}
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
import org.osgi.framework.ServiceReference;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.dialog.LoginDialog;
try {
agent = agentProvider.createAgent(null);//new URI("file:/Applications/eclipse36/p2"));
if (agent == null) {
- ApplicationUtil.error(this.getClass(), "No provisioning agent found. This application is not set up for updates.", null);
+ MessagingUtils.error(this.getClass(), "No provisioning agent found. This application is not set up for updates.", null);
return;
}
IStatus status = P2Util.checkForUpdates(agent, null);
- ApplicationUtil.info(status);
+ MessagingUtils.info(status);
} catch (ProvisionException e) {
- ApplicationUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
} finally {
if(agent != null) agent.stop();
}
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.packageadmin.PackageAdmin;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+
/**
* The activator class controls the plug-in life cycle
*
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
- ApplicationUtil.info("Taxonomic Editor stopped.");
+ MessagingUtils.info("Taxonomic Editor stopped.");
}
/**
import org.eclipse.ui.texteditor.AbstractDocumentProvider;
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
try {
createAnnotatedLine(input, entity);
} catch (BadLocationException e) {
- AbstractUtility.error(getClass(), "Problems creating annotated line: ", e);
+ MessagingUtils.error(getClass(), "Problems creating annotated line: ", e);
}
}
}
}
document.replace(offset, lineLength, text);
} catch (BadLocationException e) {
- AbstractUtility.error(getClass(), "Problem updating annotated line: " ,e);
+ MessagingUtils.error(getClass(), "Problem updating annotated line: " ,e);
}
}
length += 2;
}
} catch (BadLocationException e1) {
- AbstractUtility.error(getClass(), "Problems removing annotated line", e1);
+ MessagingUtils.error(getClass(), "Problems removing annotated line", e1);
}
try {
document.replace(offset, length, "");
} catch (BadLocationException e) {
- AbstractUtility.error(getClass(), "Problems removing annotated line", e);
+ MessagingUtils.error(getClass(), "Problems removing annotated line", e);
}
}
}
import org.eclipse.jface.text.source.IVerticalRuler;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.TextEditor;
import org.eclipse.ui.texteditor.IDocumentProvider;
if (getConversationHolder() != null) {
getConversationHolder().bind();
}
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setFocus();
// TODO pass focus to underlying widgets
}
import org.eclipse.jface.text.source.AnnotationModel;
import org.eclipse.jface.text.source.AnnotationModelEvent;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* An <code>AnnotationModel</code> which holds <code>LineAnnotation</code>'s.
* <p>printAnnotations</p>
*/
public void printAnnotations() {
- Logger logger = BulkEditorUtil.getLog4JLogger(getClass());
+ Logger logger = MessagingUtils.getLog4JLogger(getClass());
logger.debug("------------------------");
logger.debug("Active annotations");
logger.debug("------------------------");
package eu.etaxonomy.taxeditor.annotatedlineeditor.handler;
+import java.net.URI;
+import java.net.URISyntaxException;
+
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Event;
if (key != null) {
if(!(key instanceof SpecimenOrObservationType)) {
String text = ((Event)event.getTrigger()).text;
- InputDialog dialog = new InputDialog(HandlerUtil.getActiveShell(event), "Create " + text, "Enter new " + text, "", null);
+
+ //FIXME : This should probably go into some ValidatorFactory
+ IInputValidator nonEmptyInputValidator = null;
+ //FIXME : This is a workaround to not allow empty strings in the
+ // input dialog for User and Group entities.
+ // Normally this should be default
+ // behaviour, so we need to discuss whether this handler
+ // should be used to handle the creating new entities of
+ // type other than User and Group.
+ // Once #4348 is fixed this check can be removed.
+ if(text.equals("User") || text.equals("Group")) {
+ nonEmptyInputValidator = new IInputValidator() {
+ public String isValid(String text) {
+ if(text == null || text.isEmpty()) {
+ return "Input cannot be empty";
+ }
+ return null;
+ }
+ };
+ }
+ InputDialog dialog = new InputDialog(HandlerUtil.getActiveShell(event),
+ "Create " + text,
+ "Enter new " + text, "",
+ nonEmptyInputValidator);
+
if (dialog.open() != Window.CANCEL) {
((AnnotatedLineEditor) editor).createAnnotatedLineNewObject(key, dialog.getValue());
}
public class BulkEditorQuery {
private String searchString;
- private Comparator comparator;
+ private Comparator<?> comparator;
private IIdentifiableEntityServiceConfigurator searchConfigurator;
public BulkEditorQuery (String searchString, Comparator comparator) {
import org.eclipse.ui.handlers.IHandlerService;
import eu.etaxonomy.cdm.model.common.MarkerType;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
event.data = new Object[]{markerType, flag};
handlerService.executeCommand("taxeditor-bulkeditor.command.setMarkerFlag", event);
} catch (ExecutionException e) {
- BulkEditorUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
} catch (NotDefinedException e) {
- BulkEditorUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
} catch (NotEnabledException e) {
- BulkEditorUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
} catch (NotHandledException e) {
- BulkEditorUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
import eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation.AddDerivedUnitFacadeMediaOperation;
import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
AbstractPostOperation operation = new AddDerivedUnitFacadeMediaOperation(event.getCommand().getName(), BulkEditorUtil.getUndoContext(), (DerivedUnit) element, getMode(), postOperationEnabled);
BulkEditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
- BulkEditorUtil.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
}
}
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
createImageGallery(facade);
} catch (DerivedUnitFacadeNotSupportedException e) {
- BulkEditorUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
return postExecute(derivedUnit);
import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation;
import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
result = service.delete((TeamOrPersonBase)object);
}
} catch (Exception e){
- BulkEditorUtil.errorDialog("Could not delete", getClass(), e.getMessage(), null);
+ MessagingUtils.messageDialog("Could not delete", getClass(), e.getMessage(), null);
}
if (result.isError()){
- BulkEditorUtil.errorDialog("Could not delete", getClass(), result.getExceptions().get(0).getMessage(), null);
+ MessagingUtils.messageDialog("Could not delete", getClass(), result.getExceptions().get(0).getMessage(), null);
}
((BulkEditor) editor).removeAnnotatedLine(annotation);
}
}
}else{
- BulkEditorUtil.warningDialog("Feature not enabled", getClass(), "Deletion is currently an experimental feature." +
+ MessagingUtils.warningDialog("Feature not enabled", getClass(), "Deletion is currently an experimental feature." +
"Enable it via Preferences at your own risk.");
}
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.CdmBaseSortProvider;
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.TitleCacheComparator;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
public boolean merge(T entity, T mergeTarget) {
if (entity instanceof IMergable) {
try {
- CdmStore.getService(ICommonService.class).merge((IMergable)mergeTarget, (IMergable)entity, null);
+ CdmStore.getService(ICommonService.class).merge((IMergable)mergeTarget, (IMergable)entity, null);
} catch (MergeException e) {
- AbstractUtility.error(getClass(), e);
+ MessagingUtils.errorDialog("Bulk Editor Merge Error",
+ this,
+ "Could not merge chosen objects of type " + entity.getClass().getName(),
+ TaxeditorBulkeditorPlugin.PLUGIN_ID,
+ e,
+ true);
}
}
return true;
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
import eu.etaxonomy.cdm.model.name.NameRelationship;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
*/
@Override
protected IEntityCreator<NameRelationship> createEntityCreator() {
- BulkEditorUtil.notImplementedMessage(getClass());
+ MessagingUtils.notImplementedMessage(getClass());
return null;
}
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
import eu.etaxonomy.cdm.model.reference.ReferenceType;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* <p>ReferenceCreator class.</p>
reference = ReferenceFactory.newWebPage();
}
if (reference == null) {
- BulkEditorUtil.warn(getClass(), "Reference type " + key + " not found. Creating reference with default type.");
+ MessagingUtils.warn(getClass(), "Reference type " + key + " not found. Creating reference with default type.");
reference = ReferenceFactory.newGeneric();
}
reference.setTitleCache(text, true);
import eu.etaxonomy.cdm.api.service.IUserService;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
CdmStore.getService(IUserService.class).createUser(user);
return user;
} catch (AccessDeniedException e){
- BulkEditorUtil.errorDialog("Access denied", getClass(), e.getMessage(), e);
+ MessagingUtils.messageDialog("Access denied", getClass(), e.getMessage(), e);
return null;
}
}
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src/main/java/"/>
- <classpathentry kind="src" path="src/main/resources/"/>
- <classpathentry kind="src" path="src/test/java/"/>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry kind="src" path="src/main/resources"/>
+ <classpathentry kind="src" path="src/test/resources"/>
<classpathentry exported="true" kind="lib" path="lib/activation-1.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/antlr-2.7.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/aopalliance-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.8.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-codec-20041127.091804.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.4.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.4.jar" sourcepath="lib/commons-dbcp-1.4-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-io-2.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-lang-2.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.2.2.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.2.2.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.2.2.RELEASE.jar" sourcepath="lib/org.springframework.jdbc-3.2.2.RELEASE-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.2.2.RELEASE.jar" sourcepath="lib/org.springframework.orm-3.2.2.RELEASE-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/org.springframework.oxm-3.2.2.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="lib/org.springframework.test-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.2.2.RELEASE.jar" sourcepath="lib/org.springframework.transaction-3.2.2.RELEASE-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.2.2.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="lib/org.springframework.web.servlet-3.2.2.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="lib/osgi-3.6.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/odfdom-0.8.jar"/>
<classpathentry exported="true" kind="lib" path="lib/h2mig_pagestore_addon.jar"/>
<classpathentry exported="true" kind="lib" path="lib/spring-security-remoting-3.1.3.RELEASE.jar"/>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="output" path="target/classes"/>
</classpath>
org.apache.lucene.util,
org.apache.sanselan;uses:="org.apache.sanselan.common,org.apache.sanselan.common.byteSources",
org.apache.xerces.dom,
+ org.eclipse.osgi.util,
org.h2.jdbc,
org.hamcrest,
org.hibernate,
Bundle-Version: 3.3.7.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin
Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
+Bundle-Localization: OSGI-INF/l10n/plugin
Export-Package: eu.etaxonomy.taxeditor.editor,
eu.etaxonomy.taxeditor.editor.handler,
eu.etaxonomy.taxeditor.editor.internal,
--- /dev/null
+#Properties file for taxeditor-editor\r
+Bundle-Vendor.0 = EDIT\r
+Bundle-Name.0 = EDIT Taxonomic Editor - Editor Bundle\r
+command.name.17 = Set Basionym\r
+command.name.18 = Remove Basionym\r
+editor.name = Multipage Taxon Editor\r
+editor.name.0 = Taxon Name Editor\r
+editor.name.1 = Key\r
+editor.name.2 = Polytomous Key Graph Editor\r
+editor.name.3 = Polytomous Key List Editor\r
+editor.name.4 = Cdm Authority Editor\r
+editor.name.5 = Derivate View\r
+view.name = Factual Data\r
+view.name.0 = Uses\r
+view.name.1 = Media\r
+view.name.2 = Concept Relations\r
+view.name.3 = Concept Graph\r
+category.name = Taxonomic Editor\r
+command.label = Reference\r
+command.label.0 = Name\r
+command.label.1 = Team\r
+command.label.2 = Person\r
+command.label.3 = Specimen\r
+command.label.4 = Factual Data\r
+command.label.5 = Media\r
+command.label.6 = Concept\r
+command.label.7 = Concept Graph\r
+command.label.8 = Open Parent\r
+menu.label = New\r
+command.label.9 = Heterotypic Synonym\r
+command.label.10 = Homotypic Synonym\r
+command.label.11 = Synonym In Homotypical Group\r
+menu.label.0 = Change To\r
+command.label.12 = Accepted Taxon\r
+command.label.13 = Synonym\r
+command.label.14 = Misapplication\r
+command.label.15 = Delete\r
+command.label.16 = Delete All Empty Names\r
+command.label.17 = Swap Synonym With Accepted\r
+command.label.18 = Show Details\r
+command.label.19 = Save\r
+command.label.20 = New Node\r
+command.label.21 = Delete\r
+command.label.22 = Apply Layout\r
+command.label.23 = New Key Number\r
+command.label.24 = New Alternative\r
+command.label.25 = Refresh Nodes\r
+command.label.26 = Delete\r
+command.label.27 = New Factual Data\r
+menu.label.1 = New\r
+command.label.28 = Move Description to Taxon\r
+command.label.29 = Move Elements to Taxon\r
+command.label.30 = Delete\r
+command.label.31 = Save\r
+menu.label.2 = New Derivate\r
+command.label.32 = New Use\r
+command.label.33 = New Use Summary\r
+command.label.34 = New Use Record\r
+command.label.35 = Delete\r
+command.label.36 = Save\r
+command.label.37 = New Image Gallery\r
+command.label.38 = New Image\r
+command.label.39 = Move Image Up In List\r
+command.label.40 = Move Image Down In List\r
+command.label.41 = Delete\r
+command.label.42 = Save\r
+menu.label.3 = New\r
+command.label.43 = Open Related Concept\r
+command.label.44 = Delete\r
+command.label.45 = Edit Authorities\r
+extension.name = Name Commands\r
+category.name.0 = -- Name Editor\r
+command.name = Open Parent\r
+command.name.0 = Create Homotypic Synonym\r
+command.name.1 = Create Heterotypic Synonym\r
+command.name.2 = Create Synonym In Homotypical Group\r
+command.name.3 = Change To Synonym\r
+command.name.4 = Change To Accepted Taxon\r
+command.name.5 = Change To Misapplication\r
+command.name.6 = Swap Synonym With Accepted\r
+command.name.7 = Set Basionym / Original Combination\r
+command.name.8 = Remove Basionym / Original Combination\r
+command.name.9 = Delete All Empty Names\r
+category.name.1 = -- Factual\r
+command.name.10 = Create Description Element\r
+command.name.11 = New Description\r
+command.name.12 = Move Description Elements to Taxon\r
+command.name.13 = Move Description to Taxon\r
+category.name.2 = -- New Uses\r
+command.name.14 = New Use\r
+command.name.15 = New Use Summary\r
+command.name.16 = New Use Record\r
+category.name.3 = -- Media\r
+command.name.19 = Move Image Down In List\r
+command.name.20 = New Image Gallery\r
+command.name.21 = New Image\r
+command.name.22 = Move Image Up In List\r
+category.name.4 = -- New Entity\r
+command.name.23 = New Reference\r
+command.name.24 = New Name\r
+command.name.25 = New Team\r
+command.name.26 = New Person\r
+command.name.27 = New Specimen\r
+category.name.5 = -- Polytomous Keys\r
+command.name.28 = New Child Node\r
+command.name.29 = New Sibling Node\r
+command.name.30 = Refresh Node Numbering\r
+command.name.31 = Apply Layout\r
+category.name.6 = -- Concept Relations\r
+command.name.32 = Create Concept Relation\r
+command.name.33 = Open Related Concept\r
+category.name.7 = -- Group\r
+command.name.34 = Edit CDM Authorities\r
+command.name.35 = Open Derivate View\r
+scheme.description = The default key binding scheme for the Taxonomic Editor\r
+scheme.name = Taxonomic Editor Default Key Bindings
\ No newline at end of file
--- /dev/null
+# Properties file for taxeditor-editor
+Bundle-Vendor.0 = EDIT
+Bundle-Name.0 = EDIT Taxonomischer Editor - Editor Bundle
+command.name.17 = Setze Basionym
+command.name.18 = Entferne Basionym
+editor.name = Multipage Taxon Editor
+editor.name.0 = Editor Taxonname
+editor.name.1 = Bestimmungsschl\u00fcssel
+editor.name.2 = Polytomer Bestimmungsschl\u00fcssel Graph Editor
+editor.name.3 = Polytomer Bestimmungsschl\u00fcssel List Editor
+editor.name.4 = CDM Rechtemanagement
+editor.name.5 = Ansicht Derivate
+view.name = Faktendaten
+view.name.0 = Nutzung
+view.name.1 = Medien
+view.name.2 = Konzeptrelationen
+view.name.3 = Konzeptgraph
+category.name = Taxonomischer Editor
+command.label = Referenz
+command.label.0 = Name
+command.label.1 = Team
+command.label.2 = Person
+command.label.3 = Beleg
+command.label.4 = Faktendaten
+command.label.5 = Medien
+command.label.6 = Konzept
+command.label.7 = Konzeptgraph
+command.label.8 = \u00d6ffne Parent
+menu.label = Neue
+command.label.9 = Heterotypisches Synonym
+command.label.10 = Homotypisches Synonym
+command.label.11 = Synonym in Homotypischer Gruppe
+menu.label.0 = \u00c4ndere zu
+command.label.12 = Akzeptiertes Taxon
+command.label.13 = Synonym
+command.label.14 = Misapplication
+command.label.15 = L\u00f6schen
+command.label.16 = L\u00f6sche alle leeren Namen
+command.label.17 = Tausche Synonym mit akzeptiertem Namen
+command.label.18 = Zeige Details
+command.label.19 = Speichern
+command.label.20 = Neue Knoten
+command.label.21 = L\u00f6schen
+command.label.22 = Wende Layout an
+command.label.23 = Neue Bestimmungsschl\u00fcsselnummer
+command.label.24 = Neue Alternative
+command.label.25 = Erneuere Knoten
+command.label.26 = L\u00f6schen
+command.label.27 = Neue Faktendaten
+menu.label.1 = Neue
+command.label.28 = Bewege Eigenschaften zu Taxon
+command.label.29 = Bewege Elemente zu Taxon
+command.label.30 = L\u00f6schen
+command.label.31 = Speichern
+menu.label.2 = Neue Derivate
+command.label.32 = Neue Nutzung
+command.label.33 = Neue Zusammenfassung
+command.label.34 = Neuer Nutzungsdatensatz
+command.label.35 = L\u00f6schen
+command.label.36 = Speichern
+command.label.37 = Neue Bildergalerie
+command.label.38 = Neues Bild
+command.label.39 = Bewege Bild nach oben
+command.label.40 = Bewege Bild nach unten
+command.label.41 = L\u00f6schen
+command.label.42 = Speichern
+menu.label.3 = Neue
+command.label.43 = \u00d6ffne verbundenes Konzept
+command.label.44 = L\u00f6schen
+command.label.45 = Bearbeite Rechte
+extension.name = Namensbefehle
+category.name.0 = -- Namenseditor
+command.name = \u00d6ffne Elter
+command.name.0 = Erstelle Homotypisches Synonym
+command.name.1 = Erstelle Heterotypisches Synonym
+command.name.2 = Erstelle Synonym in Homotypischer Gruppe
+command.name.3 = \u00c4ndere zu Synonym
+command.name.4 = \u00c4ndere zu akzeptiertem Taxon
+command.name.5 = \u00c4ndere zu Misapplication
+command.name.6 = Tausche Synonym mit Akzeptiertem Namen
+command.name.7 = Setze Basionym / Originalkombination
+command.name.8 = Entferne Basionym / Originalkombination
+command.name.9 = L\u00f6sche alle leeren Namen
+category.name.1 = -- Fakten
+command.name.10 = erstelle Beschreibungselement
+command.name.11 = Neue Beschreibung
+command.name.12 = Bewege Beschreibungselement zu Taxon
+command.name.13 = Bewege Beschreibung zu Taxon
+category.name.2 = -- Neue Nutzung
+command.name.14 = Neue Nutzung
+command.name.15 = Neue Zusammenfassung
+command.name.16 = Neuer Nutzungsdatensatz
+category.name.3 = -- Media
+command.name.19 = Bewege Bild nach unten
+command.name.20 = Neue Bildergalerie
+command.name.21 = Neues Bild
+command.name.22 = Bewege Bild nach oben
+category.name.4 = -- Neue Entit\u00e4t
+command.name.23 = Neue Referenz
+command.name.24 = Neuer Name
+command.name.25 = Neues Team
+command.name.26 = Neue Person
+command.name.27 = Neuer Beleg
+category.name.5 = -- Polytomer Bestimmungsschl\u00fcssel
+command.name.28 = Neue Kinderknoten
+command.name.29 = Neuer Geschwisterknoten
+command.name.30 = Refreshknoten Numbering
+command.name.31 = Wende Layout an
+category.name.6 = -- Konzeptbeziehungen
+command.name.32 = Erstelle Konzeptrelationen
+command.name.33 = \u00d6ffne verbundenes Konzept
+category.name.7 = -- Gruppe
+command.name.34 = Bearbeite CDM Rechte
+command.name.35 = \u00d6ffne Derivate Ansicht
+scheme.description = Die Standard Tastenbindungsschema f\u00fcr den Taxonomischen Editor
+scheme.name = Taxonomic Editor Standard Tastenbindung
--- /dev/null
+#Properties file for taxeditor-editor\r
+Bundle-Vendor.0 = EDIT\r
+Bundle-Name.0 = EDIT Taxonomic Editor - Editor Bundle\r
+command.name.17 = Set Basionym\r
+command.name.18 = Remove Basionym\r
+editor.name = Multipage Taxon Editor\r
+editor.name.0 = Taxon Name Editor\r
+editor.name.1 = Key\r
+editor.name.2 = Polytomous Key Graph Editor\r
+editor.name.3 = Polytomous Key List Editor\r
+editor.name.4 = Cdm Authority Editor\r
+editor.name.5 = Derivate View\r
+view.name = Factual Data\r
+view.name.0 = Uses\r
+view.name.1 = Media\r
+view.name.2 = Concept Relations\r
+view.name.3 = Concept Graph\r
+category.name = Taxonomic Editor\r
+command.label = Reference\r
+command.label.0 = Name\r
+command.label.1 = Team\r
+command.label.2 = Person\r
+command.label.3 = Specimen\r
+command.label.4 = Factual Data\r
+command.label.5 = Media\r
+command.label.6 = Concept\r
+command.label.7 = Concept Graph\r
+command.label.8 = Open Parent\r
+menu.label = New\r
+command.label.9 = Heterotypic Synonym\r
+command.label.10 = Homotypic Synonym\r
+command.label.11 = Synonym In Homotypical Group\r
+menu.label.0 = Change To\r
+command.label.12 = Accepted Taxon\r
+command.label.13 = Synonym\r
+command.label.14 = Misapplication\r
+command.label.15 = Delete\r
+command.label.16 = Delete All Empty Names\r
+command.label.17 = Swap Synonym With Accepted\r
+command.label.18 = Show Details\r
+command.label.19 = Save\r
+command.label.20 = New Node\r
+command.label.21 = Delete\r
+command.label.22 = Apply Layout\r
+command.label.23 = New Key Number\r
+command.label.24 = New Alternative\r
+command.label.25 = Refresh Nodes\r
+command.label.26 = Delete\r
+command.label.27 = New Factual Data\r
+menu.label.1 = New\r
+command.label.28 = Move Description to Taxon\r
+command.label.29 = Move Elements to Taxon\r
+command.label.30 = Delete\r
+command.label.31 = Save\r
+menu.label.2 = New Derivate\r
+command.label.32 = New Use\r
+command.label.33 = New Use Summary\r
+command.label.34 = New Use Record\r
+command.label.35 = Delete\r
+command.label.36 = Save\r
+command.label.37 = New Image Gallery\r
+command.label.38 = New Image\r
+command.label.39 = Move Image Up In List\r
+command.label.40 = Move Image Down In List\r
+command.label.41 = Delete\r
+command.label.42 = Save\r
+menu.label.3 = New\r
+command.label.43 = Open Related Concept\r
+command.label.44 = Delete\r
+command.label.45 = Edit Authorities\r
+extension.name = Name Commands\r
+category.name.0 = -- Name Editor\r
+command.name = Open Parent\r
+command.name.0 = Create Homotypic Synonym\r
+command.name.1 = Create Heterotypic Synonym\r
+command.name.2 = Create Synonym In Homotypical Group\r
+command.name.3 = Change To Synonym\r
+command.name.4 = Change To Accepted Taxon\r
+command.name.5 = Change To Misapplication\r
+command.name.6 = Swap Synonym With Accepted\r
+command.name.7 = Set Basionym / Original Combination\r
+command.name.8 = Remove Basionym / Original Combination\r
+command.name.9 = Delete All Empty Names\r
+category.name.1 = -- Factual\r
+command.name.10 = Create Description Element\r
+command.name.11 = New Description\r
+command.name.12 = Move Description Elements to Taxon\r
+command.name.13 = Move Description to Taxon\r
+category.name.2 = -- New Uses\r
+command.name.14 = New Use\r
+command.name.15 = New Use Summary\r
+command.name.16 = New Use Record\r
+category.name.3 = -- Media\r
+command.name.19 = Move Image Down In List\r
+command.name.20 = New Image Gallery\r
+command.name.21 = New Image\r
+command.name.22 = Move Image Up In List\r
+category.name.4 = -- New Entity\r
+command.name.23 = New Reference\r
+command.name.24 = New Name\r
+command.name.25 = New Team\r
+command.name.26 = New Person\r
+command.name.27 = New Specimen\r
+category.name.5 = -- Polytomous Keys\r
+command.name.28 = New Child Node\r
+command.name.29 = New Sibling Node\r
+command.name.30 = Refresh Node Numbering\r
+command.name.31 = Apply Layout\r
+category.name.6 = -- Concept Relations\r
+command.name.32 = Create Concept Relation\r
+command.name.33 = Open Related Concept\r
+category.name.7 = -- Group\r
+command.name.34 = Edit CDM Authorities\r
+command.name.35 = Open Derivate View\r
+scheme.description = The default key binding scheme for the Taxonomic Editor\r
+scheme.name = Taxonomic Editor Default Key Bindings
\ No newline at end of file
bin.includes = META-INF/,\
.,\
plugin.xml,\
- plugin.properties,\
+ OSGI-INF/l10n/plugin.properties,\
icons/,\
p2.inf,\
+ OSGI-INF/l10n/plugin_de.properties,\
+ OSGI-INF/l10n/plugin_en.properties,\
lib/biojava3-alignment-3.0.7.jar,\
lib/biojava3-core-3.0.7.jar,\
lib/core-1.8.5.jar,\
+++ /dev/null
-#Properties file for taxeditor-editor\r
-Bundle-Vendor.0 = EDIT\r
-Bundle-Name.0 = EDIT Taxonomic Editor - Editor Bundle\r
-command.name.17 = Set Basionym\r
-command.name.18 = Remove Basionym
\ No newline at end of file
class="eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor"
icon="icons/edit_16x16.gif"
id="eu.etaxonomy.taxeditor.editor.taxon"
- name="Multipage Taxon Editor">
+ name="%editor.name">
</editor>
<editor
class="eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor"
default="true"
id="eu.etaxonomy.taxeditor.editor.taxon.name"
- name="Taxon Name Editor">
+ name="%editor.name.0">
</editor>
<editor
class="eu.etaxonomy.taxeditor.editor.key.KeyEditor"
default="false"
id="eu.etaxonomy.taxeditor.editor.key"
- name="Key">
+ name="%editor.name.1">
</editor>
<editor
class="eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyGraphEditor"
default="false"
id="eu.etaxonomy.taxeditor.editor.key.polytomous.graph"
- name="Polytomous Key Graph Editor">
+ name="%editor.name.2">
</editor>
<editor
class="eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor"
default="false"
id="eu.etaxonomy.taxeditor.editor.key.polytomous.list"
- name="Polytomous Key List Editor">
+ name="%editor.name.3">
</editor>
<editor
class="eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor"
default="false"
id="eu.etaxonomy.taxeditor.editor.group.authority"
- name="Cdm Authority Editor">
+ name="%editor.name.4">
</editor>
<editor
class="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
default="false"
icon="icons/derivate_view-16x16-32.png"
id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
- name="Derivate View">
+ name="%editor.name.5">
</editor>
<editor
class="eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportEditor"
default="false"
id="eu.etaxonomy.taxeditor.editor.view.dataimport.GbifImportEditor"
name="Gbif Import Editor">
+ </editor>
+ <editor
+ class="eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor"
+ icon="icons/address-book-new.png"
+ id="eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor"
+ name="Checklist Editor">
</editor>
<editor
class="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor"
class="eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart"
icon="icons/address-book-new.png"
id="eu.etaxonomy.taxeditor.editor.view.descriptive"
- name="Factual Data"
+ name="%view.name"
restorable="true">
</view>
<view
class="eu.etaxonomy.taxeditor.editor.view.uses.UsesViewPart"
icon="icons/leaf.png"
id="eu.etaxonomy.taxeditor.editor.view.uses"
- name="Uses"
+ name="%view.name.0"
restorable="true">
</view>
<view
class="eu.etaxonomy.taxeditor.editor.view.media.MediaViewPart"
icon="icons/camera-photo.png"
id="eu.etaxonomy.taxeditor.editor.view.media"
- name="Media"
+ name="%view.name.1"
restorable="true">
</view>
<view
category="eu.etaxonomy.taxeditor.editor.category"
class="eu.etaxonomy.taxeditor.editor.view.concept.ConceptViewPart"
id="eu.etaxonomy.taxeditor.editor.view.concept"
- name="Concept Relations"
+ name="%view.name.2"
restorable="true">
</view>
<view
class="eu.etaxonomy.taxeditor.editor.view.concept.graph.ConceptGraphView"
icon="icons/address-book-new.png"
id="eu.etaxonomy.taxeditor.editor.view.concept.graph"
- name="Concept Graph"
+ name="%view.name.3"
restorable="true">
</view>
<category
id="eu.etaxonomy.taxeditor.editor.category"
- name="Taxonomic Editor">
+ name="%category.name">
</category>
</extension>
<extension
</command>
<command
commandId="eu.etaxonomy.taxeditor.editor.command.new.team"
- label="Team"
+ label="%command.label.1"
style="push">
</command>
<command
commandId="eu.etaxonomy.taxeditor.editor.command.new.person"
- label="Person"
+ label="%command.label.2"
style="push">
</command>
<separator
</separator>
<command
commandId="eu.etaxonomy.taxeditor.editor.command.new.specimen"
- label="Specimen"
+ label="%command.label.3"
style="push">
</command>
<separator
</separator>
<command
commandId="org.eclipse.ui.views.showView"
- label="Factual Data"
+ label="%command.label.4"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
</command>
<command
commandId="org.eclipse.ui.views.showView"
- label="Media"
+ label="%command.label.5"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
</command>
<command
commandId="org.eclipse.ui.views.showView"
- label="Concept"
+ label="%command.label.6"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
</command>
<command
commandId="org.eclipse.ui.views.showView"
- label="Concept Graph"
+ label="%command.label.7"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
locationURI="menu:org.eclipse.ui.main.menu.navigate">
<command
commandId="eu.etaxonomy.taxeditor.editor.command.openParent"
- label="Open Parent"
+ label="%command.label.8"
style="push">
</command>
</menuContribution>
<menuContribution
locationURI="popup:eu.etaxonomy.taxeditor.editor.taxon.name">
<menu
- label="New">
+ label="%menu.label">
<command
commandId="eu.etaxonomy.taxeditor.editor.name.createHeterotypicSynoym"
- label="Heterotypic Synonym"
+ label="%command.label.9"
style="push">
<visibleWhen>
<reference
</command>
<command
commandId="eu.etaxonomy.taxeditor.editor.name.createHomotypicSynoym"
- label="Homotypic Synonym"
+ label="%command.label.10"
style="push">
<visibleWhen>
<reference
</command>
<command
commandId="eu.etaxonomy.taxeditor.editor.name.createSynonymInHomotypicalGroup"
- label="Synonym In Homotypical Group"
+ label="%command.label.11"
style="push">
<visibleWhen>
<reference
</visibleWhen>
</command>-->
<menu
- label="Change To">
+ label="%menu.label.0">
<command
commandId="eu.etaxonomy.taxeditor.editor.name.changeToAcceptedTaxon"
- label="Accepted Taxon"
+ label="%command.label.12"
style="push">
<visibleWhen>
<not>
</command>
<command
commandId="eu.etaxonomy.taxeditor.editor.name.changeToSynonym"
- label="Synonym"
+ label="%command.label.13"
style="push">
<visibleWhen>
<not>
</command>
<command
commandId="eu.etaxonomy.taxeditor.editor.name.changeToMisapplication"
- label="Misapplication"
+ label="%command.label.14"
style="push">
<visibleWhen>
<not>
</separator>
<command
commandId="org.eclipse.ui.edit.delete"
- label="Delete"
+ label="%command.label.15"
style="push">
<visibleWhen>
<or>
</command>
<command
commandId="eu.etaxonomy.taxeditor.editor.name.deleteAllEmptyNames"
- label="Delete All Empty Names"
+ label="%command.label.16"
style="push">
<visibleWhen>
<reference
</dynamic>
<command
commandId="eu.etaxonomy.taxeditor.editor.name.swapSynonymAndAccepted"
- label="Swap Synonym With Accepted"
+ label="%command.label.17"
style="push">
<visibleWhen>
<reference
</separator>
<command
commandId="org.eclipse.ui.views.showView"
- label="Show Details"
+ label="%command.label.18"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
</separator>
<command
commandId="org.eclipse.ui.file.save"
- label="Save"
+ label="%command.label.19"
style="push">
</command>
</menuContribution>
locationURI="popup:eu.etaxonomy.taxeditor.editor.key.polytomous">
<command
commandId="eu.etaxonomy.taxeditor.key.polytomous.command.new"
- label="New Node"
+ label="%command.label.20"
style="push">
</command>
<separator
</separator>
<command
commandId="org.eclipse.ui.edit.delete"
- label="Delete"
+ label="%command.label.21"
style="push">
</command>
<separator
</separator>
<command
commandId="eu.etaxonomy.taxeditor.key.command.applyLayout"
- label="Apply Layout"
+ label="%command.label.22"
style="push">
</command>
<separator
locationURI="popup:eu.etaxonomy.taxeditor.editor.key.polytomous.list">
<command
commandId="eu.etaxonomy.taxeditor.key.polytomous.command.new.child"
- label="New Key Number"
+ label="%command.label.23"
style="push">
</command>
<command
commandId="eu.etaxonomy.taxeditor.key.polytomous.command.new.sibling"
- label="New Alternative"
+ label="%command.label.24"
style="push">
</command>
<command
commandId="eu.etaxonomy.taxeditor.key.polytomous.command.refresh"
- label="Refresh Nodes"
+ label="%command.label.25"
style="push">
</command>
<command
commandId="org.eclipse.ui.edit.delete"
- label="Delete"
+ label="%command.label.26"
style="push">
</command>
</menuContribution>
locationURI="popup:eu.etaxonomy.taxeditor.editor.view.descriptive">
<command
commandId="eu.etaxonomy.taxeditor.description.commands.adddescription"
- label="New Factual Data"
+ label="%command.label.27"
style="push">
</command>
<separator
visible="true">
</separator>
<menu
- label="New">
+ label="%menu.label.1">
<dynamic
class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DynamicFeatureMenu"
id="eu.etaxonomy.taxeditor.dynamicFeatureMenu">
</separator>
<command
commandId="eu.etaxonomy.taxeditor.editor.commands.description.moveDescriptionToTaxon"
- label="Move Description to Taxon"
+ label="%command.label.28"
style="push">
<visibleWhen
checkEnabled="true">
</command>
<command
commandId="eu.etaxonomy.taxeditor.description.commands.moveDescriptionElements"
- label="Move Elements to Taxon"
+ label="%command.label.29"
style="push">
<visibleWhen
checkEnabled="true">
</separator>
<command
commandId="org.eclipse.ui.edit.delete"
- label="Delete"
+ label="%command.label.30"
style="push">
</command>
<separator
</separator>
<command
commandId="org.eclipse.ui.file.save"
- label="Save"
+ label="%command.label.31"
style="push">
</command>
</menuContribution>
locationURI="popup:eu.etaxonomy.taxeditor.editor.view.uses">
<command
commandId="eu.etaxonomy.taxeditor.use.commands.adduse"
- label="New Use"
+ label="%command.label.32"
style="push">
</command>
<command
commandId="eu.etaxonomy.taxeditor.editor.use.createUseSummary"
- label="New Use Summary"
+ label="%command.label.33"
style="push">
<visibleWhen
checkEnabled="true">
</command>
<command
commandId="eu.etaxonomy.taxeditor.editor.use.createUseRecord"
- label="New Use Record"
+ label="%command.label.34"
style="push">
<visibleWhen
checkEnabled="true">
</separator>
<command
commandId="org.eclipse.ui.edit.delete"
- label="Delete"
+ label="%command.label.35"
style="push">
</command>
<separator
</separator>
<command
commandId="org.eclipse.ui.file.save"
- label="Save"
+ label="%command.label.36"
style="push">
</command>
</menuContribution>
locationURI="popup:eu.etaxonomy.taxeditor.editor.view.media">
<command
commandId="taxeditor-editor.command.newimagegallery"
- label="New Image Gallery"
+ label="%command.label.37"
style="push">
</command>
<separator
</separator>
<command
commandId="taxeditor-editor.newimage"
- label="New Image"
+ label="%command.label.38"
style="push">
<visibleWhen>
<reference
</command>
<command
commandId="taxeditor-editor.command.moveimgdown"
- label="Move Image Up In List"
+ label="%command.label.39"
style="push">
<visibleWhen>
<reference
</command>
<command
commandId="taxeditor-editor.command.moveimgup"
- label="Move Image Down In List"
+ label="%command.label.40"
style="push">
<visibleWhen>
<reference
</separator>
<command
commandId="org.eclipse.ui.edit.delete"
- label="Delete"
+ label="%command.label.41"
style="push">
</command>
<command
commandId="org.eclipse.ui.file.save"
- label="Save"
+ label="%command.label.42"
style="push">
</command>
</menuContribution>
<menuContribution
locationURI="popup:eu.etaxonomy.taxeditor.editor.view.concept">
<menu
- label="New">
+ label="%menu.label.3">
<dynamic
class="eu.etaxonomy.taxeditor.editor.view.concept.handler.CreateConceptRelationMenu"
id="eu.etaxonomy.taxeditor.editor.view.concept.menus.new">
</menu>
<command
commandId="eu.etaxonomy.taxeditor.editor.view.concept.command.open"
- label="Open Related Concept"
+ label="%command.label.43"
style="push">
</command>
<separator
</separator>
<command
commandId="org.eclipse.ui.edit.delete"
- label="Delete"
+ label="%command.label.44"
style="push">
</command>
</menuContribution>
locationURI="popup:#BulkEditorContext?before=taxeditor-bulkeditor.separator1">
<command
commandId="eu.etaxonomy.taxeditor.group.cdmauthorities.edit"
- label="Edit Authorities"
+ label="%command.label.45"
style="push">
<visibleWhen>
<reference
</with>
</activeWhen>
</handler>
+ <handler
+ class="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler"
+ commandId="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler">
+ </handler>
</extension>
<extension
- name="Name Commands"
+ name="%extension.name"
point="org.eclipse.ui.commands">
<category
id="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
- name="-- Name Editor">
+ name="%category.name.0">
</category>
<command
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenParentHandler"
id="eu.etaxonomy.taxeditor.editor.command.openParent"
- name="Open Parent">
+ name="%command.name">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.CreateHomotypicSynonymHandler"
id="eu.etaxonomy.taxeditor.editor.name.createHomotypicSynoym"
- name="Create Homotypic Synonym">
+ name="%command.name.0">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.CreateHeterotypicSynonymHandler"
id="eu.etaxonomy.taxeditor.editor.name.createHeterotypicSynoym"
- name="Create Heterotypic Synonym">
+ name="%command.name.1">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.CreateSynonymInHomotypicalGroupHandler"
id="eu.etaxonomy.taxeditor.editor.name.createSynonymInHomotypicalGroup"
- name="Create Synonym In Homotypical Group">
+ name="%command.name.2">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.ChangeToSynonymHandler"
id="eu.etaxonomy.taxeditor.editor.name.changeToSynonym"
- name="Change To Synonym">
+ name="%command.name.3">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.ChangeSynonymToAcceptedTaxonHandler"
id="eu.etaxonomy.taxeditor.editor.name.changeToAcceptedTaxon"
- name="Change To Accepted Taxon">
+ name="%command.name.4">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.ChangeToMisapplicationHandler"
id="eu.etaxonomy.taxeditor.editor.name.changeToMisapplication"
- name="Change To Misapplication">
+ name="%command.name.5">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.SwapSynonymAndAcceptedHandler"
id="eu.etaxonomy.taxeditor.editor.name.swapSynonymAndAccepted"
- name="Swap Synonym With Accepted">
+ name="%command.name.6">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.SetBasionymHandler"
id="eu.etaxonomy.taxeditor.editor.name.setBasionym"
- name="Set Basionym / Original Combination">
+ name="%command.name.7">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.RemoveBasionymHandler"
id="eu.etaxonomy.taxeditor.editor.name.removeBasionym"
- name="Remove Basionym / Original Combination">
+ name="%command.name.8">
</command>
<!-- <command
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.DeleteAllEmptyNamesHandler"
id="eu.etaxonomy.taxeditor.editor.name.deleteAllEmptyNames"
- name="Delete All Empty Names">
+ name="%command.name.9">
</command>
<category
id="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
- name="-- Factual">
+ name="%category.name.1">
</category>
<command
categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionElementHandler"
id="eu.etaxonomy.taxeditor.editor.description.createDescriptionElement"
- name="Create Description Element">
+ name="%command.name.10">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionHandler"
id="eu.etaxonomy.taxeditor.description.commands.adddescription"
- name="New Description">
+ name="%command.name.11">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.MoveDescriptionElementsHandler"
id="eu.etaxonomy.taxeditor.description.commands.moveDescriptionElements"
- name="Move Description Elements to Taxon">
+ name="%command.name.12">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.MoveDescriptionToOtherTaxonHandler"
id="eu.etaxonomy.taxeditor.editor.commands.description.moveDescriptionToTaxon"
- name="Move Description to Taxon">
+ name="%command.name.13">
</command>
<category
id="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
- name="-- New Uses">
+ name="%category.name.2">
</category>
<command
categoryId="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.uses.handler.CreateUseHandler"
id="eu.etaxonomy.taxeditor.use.commands.adduse"
- name="New Use">
+ name="%command.name.14">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.uses.handler.CreateUseSummaryHandler"
id="eu.etaxonomy.taxeditor.editor.use.createUseSummary"
- name="New Use Summary">
+ name="%command.name.15">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.uses.handler.CreateUseRecordHandler"
id="eu.etaxonomy.taxeditor.editor.use.createUseRecord"
- name="New Use Record">
+ name="%command.name.16">
</command>
<category
id="eu.etaxonomy.taxeditor.editor.media.category"
- name="-- Media">
+ name="%category.name.3">
</category>
<command
categoryId="eu.etaxonomy.taxeditor.editor.media.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.media.handler.MoveImageDownInListHandler"
id="taxeditor-editor.command.moveimgdown"
- name="Move Image Down In List">
+ name="%command.name.19">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.media.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.media.handler.AddImageGalleryHandler"
id="taxeditor-editor.command.newimagegallery"
- name="New Image Gallery">
+ name="%command.name.20">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.media.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.media.handler.CreateMediaHandler"
id="taxeditor-editor.newimage"
- name="New Image">
+ name="%command.name.21">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.media.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.media.handler.MoveImageUpInListHandler"
id="taxeditor-editor.command.moveimgup"
- name="Move Image Up In List">
+ name="%command.name.22">
</command>
<category
id="eu.etaxonomy.taxeditor.editor.new.category"
- name="-- New Entity">
+ name="%category.name.4">
</category>
<command
categoryId="eu.etaxonomy.taxeditor.editor.new.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.handler.create.NewReferenceHandler"
id="eu.etaxonomy.taxeditor.editor.command.new.reference"
- name="New Reference">
+ name="%command.name.23">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.new.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.handler.create.NewNameHandler"
id="eu.etaxonomy.taxeditor.editor.command.new.name"
- name="New Name">
+ name="%command.name.24">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.new.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.handler.create.NewTeamHandler"
id="eu.etaxonomy.taxeditor.editor.command.new.team"
- name="New Team">
+ name="%command.name.25">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.new.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.handler.create.NewPersonHandler"
id="eu.etaxonomy.taxeditor.editor.command.new.person"
- name="New Person">
+ name="%command.name.26">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.new.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.handler.create.NewSpecimenHandler"
id="eu.etaxonomy.taxeditor.editor.command.new.specimen"
- name="New Specimen">
+ name="%command.name.27">
</command>
<category
id="eu.etaxonomy.taxeditor.editor.key.category"
- name="-- Polytomous Keys">
+ name="%category.name.5">
</category>
<command
categoryId="eu.etaxonomy.taxeditor.editor.key.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.key.polytomous.handler.CreateChildNodeHandler"
id="eu.etaxonomy.taxeditor.key.polytomous.command.new.child"
- name="New Child Node">
+ name="%command.name.28">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.key.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.key.polytomous.handler.CreateSiblingNodeHandler"
id="eu.etaxonomy.taxeditor.key.polytomous.command.new.sibling"
- name="New Sibling Node">
+ name="%command.name.29">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.key.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.key.polytomous.handler.RefreshNodeNumberingHandler"
id="eu.etaxonomy.taxeditor.key.polytomous.command.refresh"
- name="Refresh Node Numbering">
+ name="%command.name.30">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.key.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.key.handler.ApplyLayoutHandler"
id="eu.etaxonomy.taxeditor.key.command.applyLayout"
- name="Apply Layout">
+ name="%command.name.31">
</command>
<category
id="eu.etaxonomy.taxeditor.editor.view.concept.category"
- name="-- Concept Relations">
+ name="%category.name.6">
</category>
<command
categoryId="eu.etaxonomy.taxeditor.editor.view.concept.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.concept.handler.CreateConceptRelationHandler"
id="eu.etaxonomy.taxeditor.editor.name.createConceptRelation"
- name="Create Concept Relation">
+ name="%command.name.32">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.view.concept.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.concept.handler.OpenRelatedConceptHandler"
id="eu.etaxonomy.taxeditor.editor.view.concept.command.open"
- name="Open Related Concept">
+ name="%command.name.33">
</command>
<category
id="eu.etaxonomy.taxeditor.bulkeditor.group.category"
- name="-- Group">
+ name="%category.name.7">
</category>
<command
categoryId="eu.etaxonomy.taxeditor.bulkeditor.group.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.group.authority.handler.EditCdmAuthoritiesHandler"
id="eu.etaxonomy.taxeditor.group.cdmauthorities.edit"
- name="Edit CDM Authorities">
+ name="%command.name.34">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler"
id="eu.etaxonomy.taxeditor.editor.handler.openDerivateView"
- name="Open Derivate View">
+ name="%command.name.35">
+ </command>
+ <command
+ defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler"
+ id="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistViewHandler"
+ name="Open Checklist Editor">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.new.category"
<extension
point="org.eclipse.ui.bindings">
<scheme
- description="The default key binding scheme for the Taxonomic Editor"
+ description="%scheme.description"
id="eu.etaxonomy.taxeditor.bindings.scheme.default"
- name="Taxonomic Editor Default Key Bindings">
+ name="%scheme.name">
</scheme>
</extension>
<extension
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
import eu.etaxonomy.taxeditor.editor.view.media.MediaViewPart;
import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
/**
try {
EditorUtil.open(input);
} catch (PartInitException e) {
- EditorUtil.error(getClass(), "Error opening an editor window", e);
+ MessagingUtils.error(getClass(), "Error opening an editor window", e);
}
}
subProgressMonitor.worked(1);
import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditorInput;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditorInput;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
import eu.etaxonomy.taxeditor.editor.view.dataimport.BioCaseEditorInput;
import eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportEditor;
import eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportEditorInput;
open(input, DerivateView.ID);
}
+
+ /**
+ * Opens a new ChecklistView for the given input
+ * @param input a {@link ChecklistEditorInput} representing the selected checklist
+ * @throws PartInitException
+ */
+ public static void open(ChecklistEditorInput input)
+ throws PartInitException {
+ open(input, ChecklistEditor.ID);
+ }
+
/**
* Opens a new AlignmentEditor for the given input
* @param input
import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
/**
// EditorUtil.showPropertySheet();
} catch (PartInitException e) {
- AbstractUtility.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
monitor.worked(1);
this.setDirty(false);
- monitor.worked(1);
+ monitor.worked(1);
} catch (Exception e) {
setFocus();
- AbstractUtility.dialogForAbortedOperation(e, this, "saving a taxon", " Please close and reopen the taxon again.");
+ MessagingUtils.operationDialog(this, e, "saving a taxon", " Please close and reopen the taxon again.");
disableEditor(true);
} finally {
monitor.done();
if (editor instanceof IPostOperationEnabled) {
((IPostOperationEnabled) editor).postOperation(objectAffectedByOperation);
} else {
- AbstractUtility.warn(getClass(), "postOperation not enabled for editor " + editor);
+ MessagingUtils.warn(getClass(), "postOperation not enabled for editor " + editor);
}
}
- AbstractUtility.warn(getClass(), "postOperation called on MultiPageTaxonEditor. Can you make it more specific?");
+ MessagingUtils.warn(getClass(), "postOperation called on MultiPageTaxonEditor. Can you make it more specific?");
return false;
}
*/
public void reload() {
if (isDirty()) {
- AbstractUtility.warningDialog("Editor has unsaved data", getClass(), "This editor can not be "
+ MessagingUtils.warningDialog("Editor has unsaved data", getClass(), "This editor can not be "
+ "refreshed because it contains unsaved data. Refreshing "
+ "this editor would discard the changes. Please save this editor, "
+ "close and reopen it manually in order to get the latest content");
editorPart.redraw();
}
} catch (Exception e) {
- AbstractUtility.errorDialog("Error refreshing editor", getClass(), "Could not refresh this editor", e);
+ MessagingUtils.messageDialog("Error refreshing editor", getClass(), "Could not refresh this editor", e);
}
}
}
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.model.DataChangeBridge;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(taxonNodeUuid, null);
if(taxonNode == null){
- EditorUtil.warningDialog("Not yet implemented", TaxonEditorInput.class, "Selected element is not type TaxonBase.");
+ MessagingUtils.warningDialog("Not yet implemented", TaxonEditorInput.class, "Selected element is not type TaxonBase.");
return null;
}
TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).find(taxonBaseUuid);
if (taxonBase != null){
if(taxonBase.isOrphaned()) {
- EditorUtil.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon i.e. a taxon that is not connected to a classification and not having any taxonomic relationships. Editing of orphaned taxon is currently not supported.");
+ MessagingUtils.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon i.e. a taxon that is not connected to a classification and not having any taxonomic relationships. Editing of orphaned taxon is currently not supported.");
}
else if(taxonBase.isInstanceOf(Taxon.class)){
Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
if (taxon.getTaxonNodes().size() == 0 && taxon.isMisapplication()){
// TODO get accepted taxon
- EditorUtil.info("trying to open Mispplied Name ");
+ MessagingUtils.info("trying to open Mispplied Name ");
Set<Taxon> acceptedTaxa = new HashSet<Taxon>();
Set<TaxonRelationship> relations = taxon.getRelationsFromThisTaxon();
}
}else if(taxonNodes.size() == 0){
// this is an undesired state
- EditorUtil.warningDialog("Incorrect state", TaxonEditorInput.class, "The accepted taxon is not part of any classification. This should not have happened.");
+ MessagingUtils.warningDialog("Incorrect state", TaxonEditorInput.class, "The accepted taxon is not part of any classification. This should not have happened.");
}
return null;
}
return getInputForMultipleNodes(conversation, taxonNodes);
}else if(taxa.size() == 0){
// this is an undesired state
- EditorUtil.warningDialog("Incorrect state", TaxonEditorInput.class, "Trying to open accepted taxon for a synonym or misapplication but" +
+ MessagingUtils.warningDialog("Incorrect state", TaxonEditorInput.class, "Trying to open accepted taxon for a synonym or misapplication but" +
" no accepted taxa are present. This should not have happened.");
}
return null;
import org.eclipse.ui.IMemento;
import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
return null;
}
if (taxonNodeUuid == null || CdmStore.getService(IClassificationService.class).getTaxonNodeByUuid(UUID.fromString(taxonNodeUuid)) == null) {
- EditorUtil.warn(this.getClass(), "Couldn't find taxon node with UUID " + taxonNodeUuid);
+ MessagingUtils.warn(this.getClass(), "Couldn't find taxon node with UUID " + taxonNodeUuid);
return null;
}
try {
return TaxonEditorInput.NewInstance(UUID.fromString(taxonNodeUuid));
} catch (Exception e) {
- EditorUtil.warningDialog("Could not create element", TaxonEditorInputFactory.class, e.getMessage());
+ MessagingUtils.warningDialog("Could not create element", TaxonEditorInputFactory.class, e.getMessage());
}
return null;
}
import eu.etaxonomy.cdm.model.description.FeatureTree;\r
import eu.etaxonomy.cdm.model.description.State;\r
import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
import eu.etaxonomy.taxeditor.store.CdmStore;\r
-import eu.etaxonomy.taxeditor.store.StoreUtil;\r
\r
/**\r
* The context listener will call this class when the uses view is being loaded.\r
@Override\r
public void contextRefresh(IProgressMonitor monitor) {\r
monitor.subTask("Refreshing the Uses View");\r
- StoreUtil.warn(getClass(), "Refreshing Uses View warn");\r
+ MessagingUtils.warn(getClass(), "Refreshing Uses View warn");\r
setupNecessaryItems(monitor);\r
}\r
\r
@Override\r
public void contextStart(IMemento memento, IProgressMonitor monitor) {\r
monitor.subTask("Starting the Uses View");\r
- StoreUtil.warn(getClass(), "Starting Uses View warn");\r
+ MessagingUtils.warn(getClass(), "Starting Uses View warn");\r
setupNecessaryItems(monitor);\r
}\r
\r
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.EditorPart;
-import org.eclipse.swt.layout.FillLayout;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
/**
* Editor responsible for editing authorities related to a particular {@link Group} entity.
- *
+ *
* @author cmathew
* @created Mar 28, 2013
*
private boolean dirty;
private ConversationHolder conversation;
private CdmAuthorityCompositeViewer viewer;
-
- public CdmAuthorityEditor() {
-
+
+ public CdmAuthorityEditor() {
+
}
/**
public void createPartControl(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new FillLayout(SWT.HORIZONTAL));
-
+
this.viewer = new CdmAuthorityCompositeViewer(container, this,((CdmAuthorityEditorInput) getEditorInput()).getGroup());
conversation = ((CdmAuthorityEditorInput) getEditorInput()).getConversationHolder();
- setPartName(getEditorInput().getName());
+ setPartName(getEditorInput().getName());
}
*/
@Override
public void setFocus() {
-
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setFocus();
}
/* (non-Javadoc)
public void doSave(IProgressMonitor monitor) {
try {
monitor.beginTask("Saving CDM Authority Editor", 1);
- getConversationHolder().commit(true);
+ getConversationHolder().commit(true);
dirty = false;
firePropertyChange(PROP_DIRTY);
monitor.worked(1);
throws PartInitException {
setSite(site);
setInput(input);
- }
+ }
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#isDirty()
@Override
public void update(CdmDataChangeMap changeEvents) {
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
*/
@Override
public void changed(Object element) {
- //FIXME : should be optimised to split changes into adding / removing authorities
+ //FIXME : should be optimised to split changes into adding / removing authorities
// vs updating authorites
dirty = viewer.isDirty();
firePropertyChange(PROP_DIRTY);
// if the change has happened on the group then refresh the table
if(element instanceof Group) {
-
+
//FIXME: activating (setting focus) on the editor happens on every change
// This should be changed to only when the drop is successful
getSite().getPage().activate(this);
}
-
+
}
/* (non-Javadoc)
public ConversationHolder getConversationHolder() {
return conversation;
}
-
+
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.forms.editor.FormEditor#dispose()
*/
@Override
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor;
import eu.etaxonomy.taxeditor.model.LineSelection;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
try {
EditorUtil.openCdmAuthorities(((Group)selectedObject).getUuid());
} catch (Exception e) {
- EditorUtil.warningDialog("Could not open CDM Authority Editor", EditorUtil.class, e.getMessage());
+ MessagingUtils.warningDialog("Could not open CDM Authority Editor", EditorUtil.class, e.getMessage());
}
}
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.handler;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditorInput;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
+public class OpenChecklistEditorHandler extends AbstractHandler {
+
+ private static final Logger logger = Logger.getLogger(OpenChecklistEditorHandler.class);
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
+ * ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ boolean isChecklistEditorActivated = PreferencesUtil.getPreferenceStore().getBoolean(
+ IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE);
+ if (isChecklistEditorActivated) {
+ ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
+ if (currentSelection instanceof IStructuredSelection) {
+ Object selectedElement = ((IStructuredSelection) currentSelection).getFirstElement();
+ if (selectedElement instanceof Classification) {
+ ChecklistEditorInput input = new ChecklistEditorInput(((Classification) selectedElement));
+ try {
+ EditorUtil.open(input);
+ } catch (PartInitException e) {
+ MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open ChecklistView", e);
+ } catch (NullPointerException npe) {
+ MessagingUtils.messageDialog("Failed to open Editor", OpenChecklistEditorHandler.class,
+ "Could not open ChecklistView. The hierarchy is corrupted!", npe);
+ }
+ } else if (selectedElement instanceof TaxonNode) {
+ ChecklistEditorInput input = new ChecklistEditorInput(((TaxonNode) selectedElement));
+ try {
+ EditorUtil.open(input);
+ } catch (PartInitException e) {
+ MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open ChecklistView", e);
+ } catch (NullPointerException npe) {
+ MessagingUtils.messageDialog("Failed to open Editor", OpenChecklistEditorHandler.class,
+ "Could not open ChecklistView. The hierarchy is corrupted!", npe);
+ }
+ }
+ }
+ }
+ return null;
+ }
+}
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
public class OpenDerivateViewHandler extends AbstractHandler {
try {
EditorUtil.open(input);
} catch (PartInitException e) {
- AbstractUtility.error(OpenDerivateViewHandler.class, "Could not open DerivateView", e);
+ MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open DerivateView", e);
} catch (NullPointerException npe){
- AbstractUtility.errorDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open DerivateView. The derivate hierarchy is corrupted!", npe);
+ MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open DerivateView. The derivate hierarchy is corrupted!", npe);
}
}
}
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* <p>OpenParentHandler class.</p>
} catch (PartInitException e) {
throw new RuntimeException("Error opening parent taxon", e);
} catch (Exception e) {
- EditorUtil.warningDialog("Could not create Taxon", this, e.getMessage());
+ MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
}
}
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyGraphEditor;
import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor;
import eu.etaxonomy.taxeditor.model.DataChangeBridge;
import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* @author n.hoffmann
addPage(1, new PolytomousKeyGraphEditor(this), input);
setPageText(1, "Graph");
} catch (PartInitException e) {
- EditorUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* @author n.hoffmann
try {
EditorUtil.openTaxonBase((taxon).getUuid());
} catch (PartInitException e) {
- EditorUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
}
import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage;
import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor;
import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.CreateNodeOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
/**
label, undoContext, pk.getRoot(), editorPage);
EditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
- EditorUtil.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
} else {
label, undoContext, keyNode, editorPage);
EditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
- EditorUtil.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
} else {
MessageDialog.openInformation(
import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage;
import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor;
import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.CreateNodeOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
/**
label, undoContext, keyNode.getParent(), editorPage);
EditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
- EditorUtil.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
} else {
MessageDialog.openInformation(
import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage;
import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.DeleteNodeOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
/**
}
} catch (NotDefinedException e) {
- EditorUtil.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
} else {
MessageDialog.openInformation(
import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor;
import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.CreateNodeOperation;
import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.RefreshNodeNumberingOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
public class RefreshNodeNumberingHandler extends AbstractHandler {
label, undoContext, keyNode, editorPage);
EditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
- EditorUtil.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
}
}
/**
* Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
+ * European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
- *
+ *
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartReference;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.ManagedForm;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import eu.etaxonomy.taxeditor.editor.name.container.HomotypicalSynonymGroup;
import eu.etaxonomy.taxeditor.editor.name.container.MisappliedGroup;
import eu.etaxonomy.taxeditor.editor.name.dnd.NameEditorDropTargetListener;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.IPartChangeListener;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
import eu.etaxonomy.taxeditor.model.TaxeditorPartService;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.security.RequiredPermissions;
import eu.etaxonomy.taxeditor.store.CdmStore;
* <p>
* TaxonNameEditor class.
* </p>
- *
+ *
* @author p.ciardelli
* @author n.hoffmann
* @created 15.05.2008
* @version 1.0
*/
public class TaxonNameEditor extends EditorPart implements
- IMultiPageTaxonEditorPage, IAdaptable, IConversationEnabled,
- IPostOperationEnabled, IPartContentHasDetails, IPartChangeListener,
+ IMultiPageTaxonEditorPage, IConversationEnabled,
+ IPartContentHasDetails, IPartChangeListener,
ISelectionListener, IDropTargetable, ISecuredEditor {
/** Constant <code>ID="eu.etaxonomy.taxeditor.editor.taxon.name"</code> */
* <p>
* Constructor for TaxonNameEditor.
* </p>
- *
+ *
* @param editor
* a {@link eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor}
* object.
* <p>
* getUndoContext
* </p>
- *
+ *
* @return a {@link org.eclipse.core.commands.operations.IUndoContext}
* object.
*/
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets
* .Composite)
* <p>
* createManagedForm
* </p>
- *
+ *
* @param composite
* a {@link org.eclipse.swt.widgets.Composite} object.
*/
selection = null;
getSite().getSelectionProvider().setSelection(new StructuredSelection());
}
-
-
+
+
return super.setInput(input);
}
};
layout.horizontalSpacing = 0;
parent.setLayout(layout);
- parent.setBackground(EditorUtil
+ parent.setBackground(AbstractUtility
.getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
createOrUpdateNameComposites();
* <p>
* Getter for the field <code>taxon</code>.
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
*/
public Taxon getTaxon() {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.part.WorkbenchPart#setFocus()
*/
/** {@inheritDoc} */
@Override
public void setFocus() {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setFocus();
if (getSelectedContainer() == null) {
throw new IllegalStateException(
"There should always be a selected object.");
}
getSelectedContainer().setSelected();
-
+
// check permissions
boolean doEnable = permissionsSatisfied();
setEnabled(doEnable);
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder
* ()
* <p>
* getConversationHolder
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
* object.
*/
- public ConversationHolder getConversationHolder() {
+ @Override
+ public ConversationHolder getConversationHolder() {
return conversation;
}
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.cdm.persistence.hibernate.ICdmPostCrudObserver#update(eu
* .etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
*/
/** {@inheritDoc} */
- public void update(CdmDataChangeMap events) {
+ @Override
+ public void update(CdmDataChangeMap events) {
// redraw();
}
/**
* Redraws this editor return true on success
- *
+ *
* @return a boolean.
*/
- public boolean redraw() {
+ @Override
+ public boolean redraw() {
return redraw(true);
}
/**
* {@inheritDoc}
- *
+ *
* Redraws the editor controls
*/
- public boolean redraw(boolean focus) {
+ @Override
+ public boolean redraw(boolean focus) {
createOrUpdateNameComposites();
* <p>
* getMultiPageTaxonEditor
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor}
* object.
*/
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.store.operations.IPostOperationEnabled#postOperation
* ()
*/
/** {@inheritDoc} */
- public boolean postOperation(CdmBase objectAffectedByOperation) {
+ @Override
+ public boolean postOperation(CdmBase objectAffectedByOperation) {
editor.changed(objectAffectedByOperation);
-
+
redraw(false);
if (objectAffectedByOperation instanceof TaxonBase) {
* <p>
* Getter for the field <code>managedForm</code>.
* </p>
- *
+ *
* @return the managedForm
*/
public ManagedForm getManagedForm() {
* <p>
* getControl
* </p>
- *
+ *
* @return a {@link org.eclipse.swt.widgets.Composite} object.
*/
- public Composite getControl() {
+ @Override
+ public Composite getControl() {
return this.getManagedForm().getForm().getBody();
}
* <p>
* Getter for the field <code>menu</code>.
* </p>
- *
+ *
* @return the menu
*/
public Menu getMenu() {
* <p>
* checkForEmptyNames
* </p>
- *
+ *
* @return true if there are empty names
*/
public boolean checkForEmptyNames() {
public void init(IEditorSite site, IEditorInput input)
throws PartInitException {
- if (!(input instanceof IEditorInput))
- throw new PartInitException("Invalid Input: Must be IEditorInput");
+ if (!(input != null)) {
+ throw new PartInitException("Invalid Input: Must be IEditorInput");
+ }
if (input.getAdapter(Taxon.class) != null) {
taxon = (Taxon) input.getAdapter(Taxon.class);
/**
- *
+ *
*/
private void createDragSupport() {
// Listen for names being dragged outside of existing homotypic groups -
* <p>
* Getter for the field <code>acceptedNameContainer</code>.
* </p>
- *
+ *
* @return a
* {@link eu.etaxonomy.taxeditor.editor.name.container.AcceptedNameContainer}
* object.
* <p>
* getSynonymGroup
* </p>
- *
+ *
* @param homotypicalGroup
* a {@link eu.etaxonomy.cdm.model.name.HomotypicalGroup} object.
* @return a
* <p>
* getDirtyNames
* </p>
- *
+ *
* @return a Set containing all composites that have been edited
*/
public Set<AbstractGroupedContainer> getDirtyNames() {
* <p>
* getGroupedContainers
* </p>
- *
+ *
* @return a {@link java.util.List} object.
*/
public List<AbstractGroupedContainer> getGroupedContainers() {
* <p>
* getAllGroups
* </p>
- *
+ *
* @return a {@link java.util.List} object.
*/
public List<AbstractGroup> getAllGroups() {
allGroups.add(getAcceptedGroup());
// List<HomotypicalSynonymGroup> grps = getHeterotypicSynonymGroups(); // UNUSED => remove
-
+
heterotypicSynonymGroups = getHeterotypicSynonymGroups();
-
+
if (heterotypicSynonymGroups != null) {
allGroups.addAll(heterotypicSynonymGroups);
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.part.EditorPart#isDirty()
*/
/** {@inheritDoc} */
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.part.WorkbenchPart#dispose()
*/
/** {@inheritDoc} */
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
*/
/** {@inheritDoc} */
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.
* IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
/** {@inheritDoc} */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ @Override
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
}
* <p>
* getNameEditor
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor}
* object.
*/
- public TaxonNameEditor getEditor() {
+ @Override
+ public TaxonNameEditor getEditor() {
return this;
}
* <p>
* Getter for the field <code>selectedObject</code>.
* </p>
- *
+ *
* @return a
* {@link eu.etaxonomy.taxeditor.editor.name.container.AbstractGroupedContainer}
* object.
* dragEntered
* </p>
*/
- public void dragEntered() {
+ @Override
+ public void dragEntered() {
// TODO change this
getControl().setBackground(
- EditorUtil.getColor(Resources.COLOR_DRAG_ENTER));
+ AbstractUtility.getColor(Resources.COLOR_DRAG_ENTER));
}
/**
* dragLeft
* </p>
*/
- public void dragLeft() {
+ @Override
+ public void dragLeft() {
getControl().setBackground(
- EditorUtil.getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+ AbstractUtility.getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
}
* <p>
* setMisapplicationsGroup
* </p>
- *
+ *
* @param misappliedGroup
* a
* {@link eu.etaxonomy.taxeditor.editor.name.container.MisappliedGroup}
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.editor.IMultiPageTaxonEditorPage#isRedrawing()
*/
* <p>
* isRedrawing
* </p>
- *
+ *
* @return a boolean.
*/
- public boolean isRedrawing() {
+ @Override
+ public boolean isRedrawing() {
return false;
}
* <p>
* getToolkit
* </p>
- *
+ *
* @return a {@link org.eclipse.ui.forms.widgets.FormToolkit} object.
*/
public FormToolkit getToolkit() {
* <p>
* getHeterotypicSynonymGroups
* </p>
- *
+ *
* @return a {@link java.util.List} object.
*/
public List<HomotypicalSynonymGroup> getHeterotypicSynonymGroups() {
* <p>
* addHeterotypicSynonymGroup
* </p>
- *
+ *
* @param group
* a
* {@link eu.etaxonomy.taxeditor.editor.name.container.HomotypicalSynonymGroup}
* <p>
* getHomotypicSynonymGroup
* </p>
- *
+ *
* @return a
* {@link eu.etaxonomy.taxeditor.editor.name.container.HomotypicalSynonymGroup}
* object.
}
/**
- *
+ *
* @param acceptedGroup
*/
public void setAcceptedGroup(AcceptedGroup acceptedGroup) {
* <p>
* Getter for the field <code>misappliedGroup</code>.
* </p>
- *
+ *
* @return a
* {@link eu.etaxonomy.taxeditor.editor.name.container.MisappliedGroup}
* object.
* <p>
* isActive
* </p>
- *
+ *
* @return a boolean.
*/
public boolean isActive() {
- IWorkbenchPart activePart = EditorUtil.getActivePart();
+ IWorkbenchPart activePart = AbstractUtility.getActivePart();
return editor.equals(activePart);
}
* <p>
* onComplete
* </p>
- *
+ *
* @return a boolean.
*/
- public boolean onComplete() {
+ @Override
+ public boolean onComplete() {
getContainer(objectAffectedByLastOperation).setSelected();
return true;
}
/** {@inheritDoc} */
- public void partChanged(Integer eventType, IWorkbenchPartReference partRef) {
+ @Override
+ public void partChanged(Integer eventType, IWorkbenchPartReference partRef) {
if (!partRef.getPart(false).equals(editor)) {
// getSelectedObject().colorSelected(AbstractGroupedContainer.SELECTED_NO_FOCUS);
}
public void removeGroup(AbstractGroup group) {
if (group != null) {
group.dispose();
-
+
//if (heterotypicSynonymGroups != null) {
heterotypicSynonymGroups.remove(group);
//}
}
return getAcceptedNameContainer();
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.editor.IMultiPageTaxonEditorPage#setOnError()
*/
- public void setOnError() {
- Color disabledColor = StoreUtil.getColor(Resources.COLOR_EDITOR_ERROR);
+ @Override
+ public void setOnError() {
+ Color disabledColor = AbstractUtility.getColor(Resources.COLOR_EDITOR_ERROR);
setEnabled(false, disabledColor);
}
*/
@Override
public void setDisabled(){
- Color disabledColor = StoreUtil.getColor(Resources.COLOR_TEXT_DISABLED_BACKGROUND);
+ Color disabledColor = AbstractUtility.getColor(Resources.COLOR_TEXT_DISABLED_BACKGROUND);
setEnabled(false);
}
-
+
protected void setEnabled(boolean enabled, Color background) {
-
+
for(AbstractGroupedContainer groupedContainer : getGroupedContainers()){
groupedContainer.setEnabled(enabled);
}
-
+
// send an empty selection to the current provider - TODO only on error ???
if (!enabled) {
getManagedForm().setInput(null);
}
getControl().setBackground(background);
}
-
+
@Override
public void setEnabled(boolean enabled) {
- Color background = StoreUtil.getColor(enabled ? Resources.COLOR_COMPOSITE_BACKGROUND : Resources.COLOR_TEXT_DISABLED_BACKGROUND);
+ Color background = AbstractUtility.getColor(enabled ? Resources.COLOR_COMPOSITE_BACKGROUND : Resources.COLOR_TEXT_DISABLED_BACKGROUND);
setEnabled(enabled, background);
}
}
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.Resources;
/**
setFont(getViewerFont());
if(getName() == null){
- EditorUtil.warn(getClass(), "Synonym with a null name detected. This should never happen.");
+ MessagingUtils.warn(getClass(), "Synonym with a null name detected. This should never happen.");
}
initTextViewer();
import eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptToSynonymOperation;
import eu.etaxonomy.taxeditor.editor.name.operation.ChangeHomotypicGroupOperation;
import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToMisapplicationOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
/**
// Execute operation if it has been initiated
if (operation == null) {
- EditorUtil.warn(getClass(), "User unsuccessfully tried to drop: " + taxonBase.getClass() +
+ MessagingUtils.warn(getClass(), "User unsuccessfully tried to drop: " + taxonBase.getClass() +
". Target: " + target);
dropTargetEvent.detail = DND.DROP_NONE;
} else {
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToAcceptedTaxonOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
- EditorUtil.warningDialog("Could not create Taxon", this, e.getMessage());
+ MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
}
}
return true;
import eu.etaxonomy.taxeditor.editor.Page;
import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.parser.ParseHandler;
editor.getUndoContext(), taxon, group, newSynonymName, editor);
EditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
- EditorUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
import eu.etaxonomy.taxeditor.editor.name.operation.DeleteMisapplicationOperation;
import eu.etaxonomy.taxeditor.editor.name.operation.DeleteSynonymOperation;
import eu.etaxonomy.taxeditor.editor.name.operation.DeleteTaxonOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
try {
commandName = event.getCommand().getName();
} catch (NotDefinedException e) {
- EditorUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
// synonym
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
import eu.etaxonomy.taxeditor.editor.name.operation.SwapSynonymAndAcceptedOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
/**
EditorUtil.openTaxonBase(taxon.getUuid());
} catch (Exception e) {
- EditorUtil.warningDialog("Could not open editor for taxon", this, e.getMessage());
+ MessagingUtils.warningDialog("Could not open editor for taxon", this, e.getMessage());
}
}
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>ChangeConceptRelationshipTypeOperation class.</p>
Set<TaxonRelationship> taxonRelationships = taxon.getTaxonRelations(relatedTaxon);
if(taxonRelationships.size() > 1){
- StoreUtil.warningDialog("Multiple relations between taxa", this, "There are multiple relations between the " +
+ MessagingUtils.warningDialog("Multiple relations between taxa", this, "There are multiple relations between the " +
"accepted and the related taxon. This case is not handled by the software yet");
return;
}
public IStatus undo(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
// see FIXME in execute()
- StoreUtil.warn(this.getClass(), "Not implemented yet. See developer documentation for details");
+ MessagingUtils.warn(this.getClass(), "Not implemented yet. See developer documentation for details");
return null;
}
}
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>ChangeConceptToSynonymOperation class.</p>
Set<TaxonRelationship> taxonRelationships = taxon.getTaxonRelations(concept);
if(taxonRelationships.size() > 1){
- StoreUtil.warningDialog("Multiple relations between taxa", this, "There are multiple relations between the " +
+ MessagingUtils.warningDialog("Multiple relations between taxa", this, "There are multiple relations between the " +
"accepted and the related taxon. This case is not handled by the software yet");
return;
}
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
try {
newTaxon = CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym, element, true, true, null, null);
} catch (HomotypicalGroupChangeException e) {
- AbstractUtility.warningDialog("Operation may lead to inconsistent data", getClass(), e.getMessage());
+ MessagingUtils.warningDialog("Operation may lead to inconsistent data", getClass(), e.getMessage());
return postExecute(null);
}
monitor.worked(20);
throws ExecutionException {
// TODO implement - biggest problem is that any window open for new taxon must be closed first
- AbstractUtility.warn(this.getClass(), "Not yet implemented");
+ MessagingUtils.warn(this.getClass(), "Not yet implemented");
return postExecute(element);
}
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Taxon;
throws ExecutionException {
// Find misapplication relation, save citation information
+
for (TaxonRelationship relationship : element.getTaxonRelations()) {
if (relationship.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())
&& relationship.getFromTaxon().equals(misapplication)) {
ITaxonService service = controller.getTaxonService();
TaxonDeletionConfigurator config = new TaxonDeletionConfigurator();
-
+ NameDeletionConfigurator nameConfig = new NameDeletionConfigurator();
+ nameConfig.setRemoveAllNameRelationships(true);
+ config.setNameDeletionConfig(nameConfig);
service.deleteTaxon(misapplication, config, null);
monitor.worked(40);
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>SwapSynonymAndAcceptedOperation class.</p>
@Override
public IStatus undo(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
- StoreUtil.error(this.getClass(), "Not yet implemented", null);
+ MessagingUtils.error(this.getClass(), "Not yet implemented", null);
return null;
}
}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.editor.view.checklist;
+
+import java.util.List;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ *
+ * @author a.oppermann
+ * @created 30.04.2014
+ * @version 1.0
+ */
+public class ChecklistContentProvider implements IStructuredContentProvider {
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ /**
+ * <p>dispose</p>
+ */
+ @Override
+ public void dispose() {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof List){
+ return ((List) inputElement).toArray();
+ }
+ return new Object[]{};
+ }
+}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+
+package eu.etaxonomy.taxeditor.editor.view.checklist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedSet;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.SimpleSelectionProvider;
+import eu.etaxonomy.taxeditor.editor.view.checklist.edit.DistributionEditingSupport;
+import eu.etaxonomy.taxeditor.editor.view.checklist.edit.RankEditingSupport;
+import eu.etaxonomy.taxeditor.editor.view.checklist.filter.ChecklistEditorFilter;
+import eu.etaxonomy.taxeditor.editor.view.checklist.listener.ChecklistDropdownSelectionListener;
+import eu.etaxonomy.taxeditor.editor.view.checklist.listener.ChecklistFocusListener;
+import eu.etaxonomy.taxeditor.editor.view.checklist.listener.ChecklistModifyListener;
+import eu.etaxonomy.taxeditor.model.IContextListener;
+import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
+import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * <p>
+ * ChecklistViewPart class.
+ * </p>
+ *
+ * @author a.oppermann
+ * @created 30.04.2014
+ * @version 1.0
+ */
+public class ChecklistEditor extends EditorPart implements ISelectionListener, IPartContentHasFactualData,
+ IConversationEnabled, IContextListener, IPartContentHasDetails, IDirtyMarkableSelectionProvider {
+
+ private static final Logger logger = Logger.getLogger(ChecklistEditor.class);
+ /**
+ * Key used for storing Checklist Editor View
+ */
+ private static final String CHECKLIST_EDITOR_MEMENTO_KEY = "checklistEditor";
+
+ private class ChecklistJob extends Job {
+
+ private List<TaxonNode> taxonNodes;
+
+ /**
+ * @param name
+ */
+ public ChecklistJob(String title, List<TaxonNode> listTaxonNodes) {
+ super(title);
+ this.taxonNodes = listTaxonNodes;
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.
+ * IProgressMonitor)
+ */
+ @Override
+ public IStatus run(final IProgressMonitor monitor) {
+ try {
+ logger.debug("Begin of eclipse core runtime Job to Retrieve datasources");
+ monitor.beginTask("Retrieving TaxonNodes", taxonNodes.size() + 1);
+
+ final List<Taxon> taxonList = new ArrayList<Taxon>();
+
+ for (TaxonNode taxonNode : taxonNodes) {
+ HibernateProxyHelper hh = new HibernateProxyHelper();
+ Taxon taxon = hh.deproxy(taxonNode.getTaxon(), Taxon.class);
+ taxonList.add(taxon);
+ }
+ // set View input
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ viewer.setInput(taxonList);
+ }
+ });
+ monitor.worked(1);
+
+ } finally {
+ monitor.done();
+ taxonNodes = null;
+ }
+ return Status.OK_STATUS;
+ }
+ }
+
+ /**
+ * Constant
+ * <code>ID="eu.etaxonomy.taxeditor.store.datasource"{trunked}</code>
+ */
+ public static String ID = "eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor";
+
+ private TableViewer viewer;
+
+ private String partNameCache;
+
+ private IWorkbenchSiteProgressService service;
+
+ private ITaxonNodeService taxonNodeService;
+
+ private ChecklistEditorComparator comparator;
+
+ private ChecklistEditorInput checklistEditorInput;
+
+ private SimpleSelectionProvider simpleSelectionProvider;
+
+ private ISelectionService selectionService;
+
+ private ConversationHolder conversation;
+
+ private Integer countNodes;
+
+ private List<TaxonNode> selectedTaxonNodes;
+
+ private boolean dirty;
+
+ private ChecklistEditorFilter filter;
+
+ private Menu headerMenu;
+
+ private Label statusLabel;
+
+ private SortedSet<DefinedTermBase> terms = null;
+
+ /**
+ * @return the selectedTaxonNodes
+ */
+ public List<TaxonNode> getSelectedTaxonNodes() {
+ return selectedTaxonNodes;
+ }
+
+ /**
+ * @param selectedTaxonNodes
+ * the selectedTaxonNodes to set
+ */
+ public void setSelectedTaxonNodes(List<TaxonNode> selectedTaxonNodes) {
+ this.selectedTaxonNodes = selectedTaxonNodes;
+ }
+
+ /**
+ * <p>
+ * Constructor for CdmDataSourceViewPart.
+ * </p>
+ */
+ public ChecklistEditor() {
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void createPartControl(Composite parent) {
+ service = (IWorkbenchSiteProgressService) getSite().getAdapter(IWorkbenchSiteProgressService.class);
+ taxonNodeService = CdmStore.getService(ITaxonNodeService.class);
+ selectionService = getSite().getWorkbenchWindow().getSelectionService();
+ selectionService.addSelectionListener(this);
+ filter = new ChecklistEditorFilter();
+ ChecklistLabelProvider labelProvider = new ChecklistLabelProvider();
+ terms = (SortedSet<DefinedTermBase>) labelProvider.getTermsOrderedByLabels(labelProvider.getNamedAreas(),
+ CdmStore.getDefaultLanguage());
+ createTopComposite(parent);
+ loadDataInput();
+ }
+
+ /**
+ * @param parent
+ */
+ private void createTopComposite(Composite parent) {
+ GridLayout gridLayout = new GridLayout(3, false);
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ parent.setLayout(gridLayout);
+
+ final Text searchText = createSearchBar(parent);
+
+ if (terms != null && !terms.isEmpty()) {
+ createToolbar(parent);
+ }
+ viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
+ getSite().setSelectionProvider(viewer);
+
+ final ModifyListener modifyListener = new ChecklistModifyListener(viewer, filter, searchText);
+
+ searchText.addFocusListener(new ChecklistFocusListener(searchText, modifyListener));
+ searchText.addModifyListener(modifyListener);
+
+ // Layout the viewer
+ GridData gridData = new GridData();
+ gridData.verticalAlignment = GridData.FILL;
+ gridData.horizontalSpan = 3;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.grabExcessVerticalSpace = true;
+ gridData.horizontalAlignment = GridData.FILL;
+ viewer.getControl().setLayoutData(gridData);
+
+ viewer.addFilter(filter);
+ createColumns(viewer);
+
+ viewer.setContentProvider(new ChecklistContentProvider());
+ viewer.setLabelProvider(new ChecklistLabelProvider());
+ comparator = new ChecklistEditorComparator();
+ viewer.setComparator(comparator);
+
+ createStatusBar(parent);
+ }
+
+ /**
+ * @param parent
+ * @return
+ */
+ private Text createSearchBar(Composite parent) {
+ Label searchLabel = new Label(parent, SWT.NONE);
+ searchLabel.setText("Search: ");
+ final Text searchText = new Text(parent, SWT.BORDER | SWT.SEARCH | SWT.ICON_SEARCH | SWT.CANCEL);
+ searchText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
+ searchText.setForeground(EditorUtil.getColor(Resources.SEARCH_VIEW_FOREGROUND));
+ searchText.setText("type filter text");
+ return searchText;
+ }
+
+ /**
+ * @param parent
+ */
+ private void createToolbar(Composite parent) {
+ ToolBar toolBar = new ToolBar(parent, SWT.NONE);
+ ToolItem toolItem = new ToolItem(toolBar, SWT.DROP_DOWN | SWT.BORDER);
+ toolItem.setText("Distribution Status");
+ toolItem.setToolTipText("Show Distribution Status for selected Areas");
+ ChecklistDropdownSelectionListener dropListener = new ChecklistDropdownSelectionListener(toolItem, this, terms);
+ for (DefinedTermBase<DefinedTermBase> term : terms) {
+ if(term!=null){
+ dropListener.add(term);
+ }
+ }
+ toolItem.addSelectionListener(dropListener);
+ toolBar.pack();
+ }
+
+ private void createStatusBar(Composite composite) {
+ GridData gridData = new GridData();
+ gridData.horizontalSpan = 3;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.horizontalAlignment = GridData.FILL;
+
+ statusLabel = new Label(composite, SWT.LEFT);
+ statusLabel.setText("Anzahl der Elemente: " + (countNodes != null ? countNodes : "uknown"));
+ statusLabel.setLayoutData(gridData);
+ }
+
+ // This will create the columns for the table
+ private void createColumns(TableViewer viewer) {
+ Table table = viewer.getTable();
+ List<String> titles = new ArrayList<String>();
+ Collections.addAll(titles, "Taxon", "Author", "Reference", "Rank");
+ List<Integer> bounds = new ArrayList<Integer>();
+ Collections.addAll(bounds, 300, 200, 200, 200);
+ Map<Integer, Boolean>restoreColumnWidth = new HashMap<Integer, Boolean>();
+ if (terms != null) {
+ int i = 4;
+ for (DefinedTermBase<DefinedTermBase> term : terms) {
+ if(term != null){
+ restoreColumnWidth.put(i, PreferencesUtil.getPreferenceStore().getBoolean(term.getUuid().toString()));
+ titles.add(term.getTitleCache());
+ bounds.add(200);
+ i++;
+ }
+ }
+ }
+
+ for (int i = 0; i < titles.size(); i++) {
+ TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
+ column.getColumn().setText(titles.get(i));
+ column.getColumn().setWidth(bounds.get(i));
+ column.getColumn().setResizable(true);
+ column.getColumn().setMoveable(true);
+ column.getColumn().addSelectionListener(getSelectionAdapter(column.getColumn(), i));
+ if (i == 1) {
+ table.setSortColumn(column.getColumn());
+ }
+ if (i == 3) {
+ column.setEditingSupport(new RankEditingSupport(viewer, this));
+ }
+ if (i >= 4) {
+ //read PrefrenceStore to setWidth according to last saved state
+ if(restoreColumnWidth.get(i)){
+ column.getColumn().setWidth(100);
+ }else{
+ column.getColumn().setWidth(0);
+ }
+ column.setEditingSupport(new DistributionEditingSupport(viewer, this, i));
+ }
+ }
+ table.setSortDirection(SWT.DOWN);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ }
+
+ /**
+ *
+ * pull data from database and set input for view
+ *
+ */
+ private void loadDataInput() {
+ Classification classification = checklistEditorInput.getClassification();
+ TaxonNode taxonNode = checklistEditorInput.getTaxonNode();
+ if (classification != null && taxonNode == null) {
+ countNodes = taxonNodeService.countAllNodesForClassification(classification);
+ statusLabel.setText("Anzahl der Elemente: " + (countNodes != null ? countNodes : "uknown"));
+ // This should not kill the view nor the editor if something goes
+ // wrong
+ // TODO: don't load the whole taxonNode Object but rather a small
+ // and simple Solution
+ // FIXME: May be don't open classification which are greater than
+ // 3000 Taxa
+ selectedTaxonNodes = taxonNodeService.listAllNodesForClassification(classification, 0, countNodes);
+ getService().schedule(new ChecklistJob("loading Taxa", selectedTaxonNodes), Job.LONG);
+ }
+ if (taxonNode != null) {
+ selectedTaxonNodes = taxonNodeService.loadChildNodesOfTaxonNode(taxonNode, NODE_INIT_STRATEGY, true, false);
+ getService().schedule(new ChecklistJob("loading Taxa", selectedTaxonNodes), Job.LONG);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void dispose() {
+ super.dispose();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.WorkbenchPart#showBusy(boolean)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void showBusy(boolean busy) {
+ super.showBusy(busy);
+ // viewer.getTable().setEnabled(!busy);
+ if (busy) {
+ partNameCache = getPartName();
+ setPartName("Loading " + countNodes + " Taxa...");
+ } else {
+ if (partNameCache != null) {
+ setPartName(partNameCache);
+ }
+ }
+ }
+
+ /**
+ * <p>
+ * Getter for the field <code>viewer</code>.
+ * </p>
+ *
+ * @return a {@link org.eclipse.jface.viewers.StructuredViewer} object.
+ */
+ public StructuredViewer getViewer() {
+ return viewer;
+ }
+
+ public void refresh() {
+ viewer.refresh();
+ }
+
+ /**
+ * <p>
+ * Getter for the field <code>service</code>.
+ * </p>
+ *
+ * @return the service
+ */
+ public IWorkbenchSiteProgressService getService() {
+ return service;
+ }
+
+ private SelectionAdapter getSelectionAdapter(final TableColumn column, final int index) {
+ SelectionAdapter selectionAdapter = new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ comparator.setColumn(index);
+ int dir = viewer.getTable().getSortDirection();
+ if (viewer.getTable().getSortColumn() == column) {
+ dir = dir == SWT.UP ? SWT.DOWN : SWT.UP;
+ } else {
+ dir = SWT.DOWN;
+ }
+ viewer.getTable().setSortDirection(dir);
+ viewer.getTable().setSortColumn(column);
+ viewer.refresh();
+ }
+ };
+ return selectionAdapter;
+ }
+
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ try {
+ monitor.beginTask("Saving Editor", 1);
+ getConversationHolder().bind();
+ getConversationHolder().commit(true);
+ setDirty(false);
+ monitor.worked(1);
+ } finally {
+ monitor.done();
+ }
+
+ }
+
+ @Override
+ public void doSaveAs() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+ setSite(site);
+ setInput(input);
+ if (input instanceof ChecklistEditorInput) {
+ checklistEditorInput = (ChecklistEditorInput) input;
+ setPartName(getPartName() + ": " + checklistEditorInput.getName());
+ conversation = ((ChecklistEditorInput) input).getConversationHolder();
+ }
+ simpleSelectionProvider = new SimpleSelectionProvider();
+ getSite().setSelectionProvider(simpleSelectionProvider);
+ }
+
+ @Override
+ public boolean isSaveAsAllowed() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.
+ * IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+ */
+ @Override
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update
+ * (eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
+ */
+ @Override
+ public void update(CdmDataChangeMap changeEvents) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder
+ * ()
+ */
+ @Override
+ public ConversationHolder getConversationHolder() {
+ return conversation;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.model.IContextListener#contextAboutToStop(org.
+ * eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
+ */
+
+ @Override
+ public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.model.IContextListener#contextStop(org.eclipse
+ * .ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void contextStop(IMemento memento, IProgressMonitor monitor) {
+ // TODO Auto-generated method stub
+// IStructuredSelection sel = (IStructuredSelection) this.viewer.getSelection();
+// if (sel.isEmpty()) {
+// return;
+// }
+// memento = memento.createChild("tree-selections");
+// Iterator iter = sel.iterator();
+// while (iter.hasNext()) {
+// String nodeName = (String) iter.next();
+// memento.createChild("selected-nodes", nodeName);
+// }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.model.IContextListener#contextStart(org.eclipse
+ * .ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void contextStart(IMemento memento, IProgressMonitor monitor) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.model.IContextListener#contextRefresh(org.eclipse
+ * .core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void contextRefresh(IProgressMonitor monitor) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.model.IContextListener#workbenchShutdown(org.eclipse
+ * .ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
+ conversation.clear();
+ conversation.close();
+ conversation = null;
+ }
+
+ private static final List<String> NODE_INIT_STRATEGY = Arrays.asList(new String[] { "descriptions",
+ "descriptions.*", "description.state", "feature", "feature.*", "childNodes", "childNodes.taxon",
+ "childNodes.taxon.name", "taxonNodes", "taxonNodes.*", "taxonNodes.taxon.*", "taxon.*",
+ "taxon.descriptions", "taxon.sec", "taxon.name.*", "taxon.synonymRelations", "terms", "name.*",
+ "name.rank.representations", "name.status.type.representations", "sources.$", "stateData.$" });
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#changed(
+ * java.lang.Object)
+ */
+ @Override
+ public void changed(Object element) {
+ if (element != null) {
+ viewer.update(element, null);
+ setDirty(true);
+ firePropertyChange(PROP_DIRTY);
+ }
+ }
+
+ public void setDirty(boolean dirty) {
+ this.dirty = dirty;
+ firePropertyChange(PROP_DIRTY);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#isDirty()
+ */
+ @Override
+ public boolean isDirty() {
+ return dirty;
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.editor.view.checklist;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+
+/**
+ * @author a.oppermann
+ * @created 30.04.2014
+ * @version 1.0
+ */
+public class ChecklistEditorComparator extends ViewerComparator {
+
+ private int propertyIndex;
+ private static final int ASCENDING = 0;
+ private static final int DESCENDING = 1;
+ private int direction = ASCENDING;
+
+ public ChecklistEditorComparator() {
+ this.propertyIndex = 1;
+ direction = ASCENDING;
+ }
+
+ public void setColumn(int column) {
+ if (column == this.propertyIndex) {
+ // Same column as last sort; toggle the direction
+ direction = 1 - direction;
+ } else {
+ // New column; do an ascending sort
+ this.propertyIndex = column;
+ direction = DESCENDING;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ Taxon d1 = (Taxon) e1;
+ Taxon d2 = (Taxon) e2;
+
+ int result = 0;
+
+ switch (propertyIndex) {
+
+ default:
+ result = d1.getTitleCache().compareTo(d2.getTitleCache());
+ }
+
+ // If descending order, flip the direction
+ if (direction == DESCENDING) {
+ result = -result;
+ }
+ return result;
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.view.checklist;
+
+import java.util.UUID;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPersistable;
+import org.eclipse.ui.IPersistableElement;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ *
+ * @author a.oppermann
+ * @date 25.04.2014
+ *
+ */
+public class ChecklistEditorInput implements IEditorInput, IPersistable {
+
+ /**
+ * The selected classification
+ */
+ private TaxonNode taxonNode = null;
+
+ private Classification classification = null;
+
+ private final ConversationHolder conversationHolder;
+
+
+ /**
+ * Creates an editor input for the {@link ChecklistView} with the currently selected TaxonNode
+ * and its childNodes.
+ * @param taxonNode
+ */
+ public ChecklistEditorInput(TaxonNode taxonNode){
+ super();
+ this.conversationHolder = CdmStore.createConversation();
+ this.taxonNode = CdmStore.getCurrentApplicationConfiguration().getTaxonNodeService().load(taxonNode.getUuid());
+ classification = taxonNode.getClassification();
+ }
+
+ /**
+ * Creates an editor input for the {@link ChecklistView} with the currently selected classification.
+ * @param classificationUuid
+ */
+ public ChecklistEditorInput(Classification classification) {
+ super();
+ this.conversationHolder = CdmStore.createConversation();
+ this.classification = CdmStore.getCurrentApplicationConfiguration().getClassificationService().load(classification.getUuid());
+
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#exists()
+ */
+ @Override
+ public boolean exists() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+ */
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getName()
+ */
+ @Override
+ public String getName() {
+ if(taxonNode != null){
+ return taxonNode.getTaxon().getName().getTitleCache();
+ }else{
+ return classification.getTitleCache();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getPersistable()
+ */
+ @Override
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getToolTipText()
+ */
+ @Override
+ public String getToolTipText() {
+ return classification.getTitleCache();
+ }
+
+ /**
+ * @return the taxonNode
+ */
+ public TaxonNode getTaxonNode() {
+ return taxonNode;
+ }
+
+ /**
+ * @return classification
+ */
+ public Classification getClassification(){
+ return classification;
+ }
+
+ /**
+ * @return the conversationHolder
+ */
+ public ConversationHolder getConversationHolder() {
+ return conversationHolder;
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((classification == null) ? 0 : classification.hashCode());
+ result = prime * result + ((taxonNode == null) ? 0 : taxonNode.hashCode());
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ ChecklistEditorInput other = (ChecklistEditorInput) obj;
+ if (classification == null) {
+ if (other.classification != null) {
+ return false;
+ }
+ } else if (!classification.equals(other.classification)) {
+ return false;
+ }
+ if (taxonNode == null) {
+ if (other.taxonNode != null) {
+ return false;
+ }
+ } else if (!taxonNode.equals(other.taxonNode)) {
+ return false;
+ }
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public void saveState(IMemento memento) {
+ UUID uuid = classification.getUuid();
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+
+package eu.etaxonomy.taxeditor.editor.view.checklist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import java.util.UUID;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+import eu.etaxonomy.cdm.api.service.IDescriptionService;
+import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.TermLanguageComparator;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.Distribution;
+import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ *
+ * @author a.oppermann
+ * @created 30.04.2014
+ * @version 1.0
+ */
+public class ChecklistLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+ public static final String DEFAULT_ENTRY = "-";
+ private IDescriptionService descriptionService;
+ private final List<DefinedTermBase<?>> namedAreas;
+
+
+
+ /**
+ *
+ */
+ public ChecklistLabelProvider() {
+ namedAreas = loadNamedAreas();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang
+ * .Object, int)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public Image getColumnImage(Object element, int columnIndex) {
+ // TODO
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang
+ * .Object, int)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public String getColumnText(Object element, int columnIndex) {
+ descriptionService = CdmStore.getService(IDescriptionService.class);
+ Taxon taxon = (Taxon) element;
+ //TODO load areas by this list
+ SortedSet<DefinedTermBase<?>> sortedNamedAreas = (SortedSet<DefinedTermBase<?>>) getTermsOrderedByLabels(namedAreas, CdmStore.getDefaultLanguage());
+
+ List<TaxonDescription> listTaxonDescriptions = descriptionService.listTaxonDescriptions(taxon, null, null, null, null, null, DESC_INIT_STRATEGY);;
+ NonViralName<?> nonVirlaName = HibernateProxyHelper.deproxy(taxon.getName(), NonViralName.class);
+
+ switch (columnIndex) {
+ case 0:
+ String taxonName = null;
+ taxonName = (nonVirlaName != null) ? nonVirlaName.getNameCache() : null;
+ return (taxonName != null) ? taxonName : DEFAULT_ENTRY;
+
+ case 1:
+ String authorship = null;
+ authorship = (nonVirlaName != null) ? nonVirlaName.getAuthorshipCache() : null;
+ return (authorship != null) ? authorship : DEFAULT_ENTRY;
+ case 2:
+ String ref = null;
+ if (taxon.getName() != null) {
+ INomenclaturalReference nomenclaturalReference = HibernateProxyHelper.deproxy(
+ nonVirlaName.getNomenclaturalReference(), Reference.class);
+ ref = (nomenclaturalReference != null) ? nomenclaturalReference.getAbbrevTitleCache() : null;
+ }
+ return (ref != null) ? ref : DEFAULT_ENTRY;
+ case 3:
+ String rank = null;
+ if (taxon.getName().getRank() != null) {
+ rank = taxon.getName().getRank().toString();
+ }
+ return (rank != null) ? rank : DEFAULT_ENTRY;
+ }
+
+ if(columnIndex >3){
+
+ for (TaxonDescription td : listTaxonDescriptions) {
+ for (DescriptionElementBase deb : td.getElements()) {
+ if (deb instanceof Distribution) {
+ Distribution distribution = (Distribution) deb;
+ String area = distribution.toString();
+ if(sortedNamedAreas != null){
+ Object[] array = sortedNamedAreas.toArray();
+ DefinedTermBase<DefinedTermBase> term = (DefinedTermBase<DefinedTermBase>) array[columnIndex-4];
+ if(term != null){
+ if (area.equalsIgnoreCase(term.getTitleCache())) {
+ return (distribution.getStatus().getTitleCache() != null)?distribution.getStatus().getTitleCache():DEFAULT_ENTRY;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return DEFAULT_ENTRY;
+
+ }
+
+ private static final List<String> DESC_INIT_STRATEGY = Arrays.asList(new String[] { "descriptions",
+ "descriptions.*", "description.state" });
+
+
+ private List<DefinedTermBase<?>> loadNamedAreas() {
+ IPreferenceStore preferenceStore = PreferencesUtil.getPreferenceStore();
+ String values = preferenceStore.getString(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS);
+ if (values != null && values != "") {
+ String[] split = values.split(",");
+ List<String> listValue = Arrays.asList(split);
+ ArrayList<DefinedTermBase<?>> termlist = new ArrayList<DefinedTermBase<?>>();
+ for(String s : listValue){
+ UUID uuid = UUID.fromString(s);
+ ITermService service = CdmStore.getService(ITermService.class);
+ DefinedTermBase definedTermBase = service.load(uuid);
+ termlist.add(definedTermBase);
+ }
+ return termlist;
+ }
+ return null;
+ }
+
+ public SortedSet<?> getTermsOrderedByLabels(List<DefinedTermBase<?>> listTerm,Language language){
+ TermLanguageComparator comp = new TermLanguageComparator();
+ comp.setCompareLanguage(language);
+ SortedSet result = new TreeSet(comp);
+ if(listTerm != null){
+ result.addAll(listTerm);
+ }
+ return result;
+ }
+
+ /**
+ * @return the namedAreas
+ */
+ public List<DefinedTermBase<?>> getNamedAreas() {
+ return namedAreas;
+ }
+}
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.view.checklist.edit;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import java.util.SortedSet;
+
+import org.apache.log4j.Logger;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ComboBoxViewerCellEditor;
+import org.eclipse.jface.viewers.EditingSupport;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TableColumn;
+
+import eu.etaxonomy.cdm.api.service.IDescriptionService;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.Distribution;
+import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
+import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistLabelProvider;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public final class DistributionEditingSupport extends EditingSupport {
+
+ private ComboBoxViewerCellEditor cellEditor = null;
+ private final TableViewer viewer;
+ private final ChecklistEditor editor;
+ private final IDescriptionService descriptionService;
+ private final int columnIndex;
+
+ private static final Logger logger = Logger.getLogger(DistributionEditingSupport.class);
+
+ public DistributionEditingSupport(TableViewer viewer, ChecklistEditor checklistEditor, int columnIndex) {
+ super(viewer);
+ this.viewer = viewer;
+ this.columnIndex = columnIndex;
+ descriptionService = CdmStore.getService(IDescriptionService.class);
+ editor = checklistEditor;
+ cellEditor = new ComboBoxViewerCellEditor((Composite) viewer.getControl(), SWT.READ_ONLY);
+ cellEditor.setLabelProvider(new LabelProvider());
+ cellEditor.setContentProvider(new ArrayContentProvider());
+ // TODO set input
+ List<PresenceAbsenceTermBase> input = CdmStore.getTermManager()
+ .getPreferredTerms(PresenceAbsenceTermBase.class);
+ cellEditor.setInput(input);
+ }
+
+ @Override
+ protected CellEditor getCellEditor(Object element) {
+ return cellEditor;
+ }
+
+ @Override
+ protected boolean canEdit(Object element) {
+ return true;
+ }
+
+ @Override
+ protected Object getValue(Object element) {
+ if (element instanceof Taxon) {
+ Taxon taxon = (Taxon) element;
+ Distribution distributionForColumn = getDistributionForColumn(taxon);
+ if (distributionForColumn != null) {
+ distributionForColumn.getStatus().getTitleCache();
+ }
+ // return PresenceAbsenceTerms
+ }
+ return null;
+ }
+
+ @Override
+ protected void setValue(Object element, Object value) {
+ if (element instanceof Taxon && value instanceof PresenceAbsenceTermBase) {
+ Taxon taxon = (Taxon) element;
+ PresenceAbsenceTermBase occurenceStatus = (PresenceAbsenceTermBase) value;
+ Distribution distribution = getDistributionForColumn(taxon);
+ if (distribution != null) {
+ // change status for already exsiting distribution
+ distribution.setStatus(occurenceStatus);
+ } else {
+ createDistributionForColumn(taxon, occurenceStatus);
+ }
+ // viewer.update(distribution, null);
+ viewer.update(element, null);
+ viewer.refresh();
+ editor.setDirty(true);
+ editor.changed(element);
+ viewer.refresh();
+ }
+ }
+
+ private static final List<String> DESC_INIT_STRATEGY = Arrays.asList(new String[] { "descriptions",
+ "descriptions.*", "description.state" });
+
+ /**
+ *
+ * @param taxon
+ * @return
+ */
+ private Distribution getDistributionForColumn(Taxon taxon) {
+ List<TaxonDescription> listTaxonDescriptions = descriptionService.listTaxonDescriptions(taxon, null, null,
+ null, null, null, DESC_INIT_STRATEGY);
+ TableColumn column = viewer.getTable().getColumn(columnIndex);
+ for (TaxonDescription td : listTaxonDescriptions) {
+ for (DescriptionElementBase deb : td.getElements()) {
+ if (deb instanceof Distribution) {
+ Distribution distribution = (Distribution) deb;
+ if (column.getText().equalsIgnoreCase(distribution.getArea().getTitleCache())) {
+ return distribution;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private void createDistributionForColumn(Taxon taxon, PresenceAbsenceTermBase occurenceStatus) {
+ TableColumn column = viewer.getTable().getColumn(columnIndex);
+
+ ChecklistLabelProvider labelProvider = new ChecklistLabelProvider();
+ List<DefinedTermBase<?>> namedAreas = labelProvider.getNamedAreas();
+ SortedSet<DefinedTermBase<?>> terms = (SortedSet<DefinedTermBase<?>>) labelProvider.getTermsOrderedByLabels(
+ namedAreas, CdmStore.getDefaultLanguage());
+
+ if (terms != null) {
+ for (DefinedTermBase term : terms) {
+ if (column.getText().equalsIgnoreCase(term.getTitleCache())) {
+ NamedArea area = (NamedArea) term;
+ Distribution distribution = Distribution.NewInstance(area, occurenceStatus);
+ Set<TaxonDescription> descriptions = taxon.getDescriptions();
+ if (descriptions != null) {
+ for (TaxonDescription desc : descriptions) {
+ // add to first taxon description
+ desc.addElement(distribution);
+ break;
+ }
+ } else {// there are no TaxonDescription yet.
+ TaxonDescription td = TaxonDescription.NewInstance(taxon);
+ td.addElement(distribution);
+ }
+ }
+ }
+ }
+
+ return;
+ }
+}
\ No newline at end of file
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.view.checklist.edit;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ComboBoxViewerCellEditor;
+import org.eclipse.jface.viewers.EditingSupport;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+
+import eu.etaxonomy.cdm.model.name.Rank;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public final class RankEditingSupport extends EditingSupport{
+
+ private ComboBoxViewerCellEditor cellEditor = null;
+ private final TableViewer viewer;
+ private final ChecklistEditor editor;
+
+
+ private static final Logger logger = Logger.getLogger(RankEditingSupport.class);
+
+ public RankEditingSupport(TableViewer viewer, ChecklistEditor checklistEditor) {
+ super(viewer);
+ this.viewer = viewer;
+ editor = checklistEditor;
+ cellEditor = new ComboBoxViewerCellEditor((Composite) viewer.getControl(), SWT.READ_ONLY);
+ cellEditor.setLabelProvider(new LabelProvider());
+ cellEditor.setContentProvider(new ArrayContentProvider());
+ //TODO set input
+ List<Rank> input = CdmStore.getTermManager().getPreferredTerms(Rank.class);
+ cellEditor.setInput(input);
+ }
+
+ @Override
+ protected CellEditor getCellEditor(Object element) {
+ return cellEditor;
+ }
+
+ @Override
+ protected boolean canEdit(Object element) {
+ return true;
+ }
+
+ @Override
+ protected Object getValue(Object element) {
+ if (element instanceof Taxon) {
+ Taxon taxon = (Taxon)element;
+ Rank rank = (taxon.getName().getRank() != null)?taxon.getName().getRank() : null;
+ return rank;
+ }
+ return null;
+ }
+
+ @Override
+ protected void setValue(Object element, Object value) {
+ if (element instanceof Taxon && value instanceof Rank) {
+ Taxon taxon = (Taxon)element;
+ Rank rank = (Rank) value;
+ taxon.getName().setRank(rank);
+ viewer.update(element, null);
+ viewer.refresh();
+ editor.setDirty(true);
+ editor.changed(element);
+ }
+ }
+
+}
\ No newline at end of file
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.view.checklist.filter;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+
+public class ChecklistEditorFilter extends ViewerFilter {
+
+ private String searchString;
+
+ public void setSearchText(String s) {
+ // Search must be a substring of the existing value
+ if(s.contains("*")){
+ s=s.replace("*", "");
+ }
+ this.searchString = "(?i).*" + s + ".*";
+ }
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (searchString == null || searchString.length() == 0) {
+ return true;
+ }
+ Taxon taxon = (Taxon) element;
+ NonViralName<?> nonVirlaName = HibernateProxyHelper.deproxy(taxon.getName(), NonViralName.class);
+ Reference reference = HibernateProxyHelper.deproxy(nonVirlaName.getNomenclaturalReference(), Reference.class);
+ String rank = taxon.getName().getRank().toString();
+ //TaxonName
+ if (nonVirlaName.getNameCache()!=null && nonVirlaName.getNameCache().matches(searchString)) {
+ return true;
+ }
+ //Author
+ if (nonVirlaName.getAuthorshipCache() != null && nonVirlaName.getAuthorshipCache().matches(searchString)) {
+ return true;
+ }
+ //Reference
+ if(reference != null && reference.getAbbrevTitleCache().matches(searchString)){
+ return true;
+ }
+ //Rank
+ if (rank != null && rank.matches(searchString)) {
+ return true;
+ }
+ return false;
+ }
+
+}
\ No newline at end of file
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+
+package eu.etaxonomy.taxeditor.editor.view.checklist.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+
+/**
+ * <p>CreateDescriptionElementHandler class.</p>
+ *
+ * @author n.hoffmann
+ * @created 16.04.2009
+ * @version 1.0
+ */
+public class CreateDescriptionElementHandler extends AbstractHandler {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
+ * ExecutionEvent)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchPart part = HandlerUtil.getActivePart(event);
+ IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part
+ : null;
+
+
+ DescriptionBase<?> description = null;
+
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+ Object selectedElement = null;
+ if (selection instanceof ITreeSelection) {
+ TreePath[] paths = ((ITreeSelection) selection).getPaths();
+ selectedElement = paths[0].getFirstSegment();
+ }
+ else if (selection instanceof IStructuredSelection) {
+ selectedElement = ((IStructuredSelection) selection).getFirstElement();
+ }
+ if (selectedElement instanceof DescriptionBase<?>) {
+ description = (DescriptionBase<?>) selectedElement;
+ }
+
+ if (description != null) {
+ AbstractPostOperation operation = null;
+ try {
+ // TODO use undo context specific to editor
+ operation = operationCreationInstance(event.getCommand().getName(), event, description, postOperationEnabled);
+ AbstractUtility.executeOperation(operation);
+ } catch (NotDefinedException e) {
+ MessagingUtils.warn(getClass(), "Command name not set");
+ }
+ } else {
+ MessagingUtils.error(getClass(), new IllegalArgumentException("Could not determine the taxon description"));
+ return null;
+ }
+ return null;
+
+ }
+
+ /**
+ * Added to make the Class more generic and limit the amount of code changes required
+ * @param label
+ * @param event
+ * @param taxon
+ * @param description
+ * @param postOperationEnabled
+ * @return
+ */
+ protected AbstractPostOperation operationCreationInstance(String label, ExecutionEvent event, DescriptionBase<?> description, IPostOperationEnabled postOperationEnabled) {
+ Feature feature = (Feature) ((Event) event.getTrigger()).data;
+ return new CreateDescriptionElementOperation(label, EditorUtil.getUndoContext(), description, feature, postOperationEnabled);
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2011 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.view.checklist.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateSpecimenDescriptionOperation;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+
+/**
+ * <p>AddDescriptionHandler class.</p>
+ *
+ * @author p.ciardelli
+ * @created 11.08.2009
+ * @version 1.0
+ */
+public class CreateDescriptionHandler extends AbstractHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchPart part = HandlerUtil.getActivePart(event);
+ IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null;
+
+ IEditorPart editor = HandlerUtil.getActiveEditor(event);
+ if (editor instanceof FormEditor) {
+ editor = ((FormEditor) editor).getActiveEditor();
+ }
+ IEditorInput input = editor.getEditorInput();
+ AbstractPostOperation<?> operation;
+
+ // taxon description
+ if (input instanceof TaxonEditorInput) {
+ Taxon taxon = ((TaxonEditorInput) input).getTaxon();
+ try {
+ operation = createTaxonOperation(event.getCommand().getName(), taxon, postOperationEnabled);
+ AbstractUtility.executeOperation(operation);
+ } catch (NotDefinedException e) {
+ MessagingUtils.warn(getClass(), "Command name not set.");
+ }
+ }
+ // specimen description
+ else if(part instanceof DescriptiveViewPart){
+ Object viewerInput = ((DescriptiveViewPart)part).getViewer().getInput();
+ if(viewerInput instanceof SpecimenOrObservationBase<?>){
+ try {
+ operation = new CreateSpecimenDescriptionOperation(event.getCommand().getName(), EditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>) viewerInput, postOperationEnabled);
+ AbstractUtility.executeOperation(operation);
+ } catch (NotDefinedException e) {
+ MessagingUtils.warn(getClass(), "Command name not set.");
+ }
+ }
+ }
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ protected CreateTaxonDescriptionOperation createTaxonOperation(String eventLabel, Taxon taxon, IPostOperationEnabled postOperationEnabled) {
+ return new CreateTaxonDescriptionOperation(eventLabel, EditorUtil.getUndoContext(), taxon, postOperationEnabled);
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.editor.view.checklist.handler;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
+
+/**
+ * @author a.oppermann
+ * @date 15.05.2014
+ *
+ */
+public class OpenDistributionHandler extends AbstractHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
+ ChecklistEditor editor = (ChecklistEditor) EditorUtil.getActiveEditor();
+
+ if (currentSelection instanceof IStructuredSelection) {
+
+ Object selectedElement = ((IStructuredSelection) currentSelection).getFirstElement();
+ if (selectedElement instanceof Taxon) {
+ TableViewer viewer = (TableViewer)editor.getViewer();
+ final Table table = viewer.getTable();
+
+ TableColumn column2 = table.getColumn(4);
+ column2.setWidth(100);
+ viewer.refresh();
+
+ }
+ }
+ return null;
+ }
+ private static final List<String> DESC_INIT_STRATEGY = Arrays.asList(new String[]{
+ "descriptions",
+ "descriptions.*",
+ "description.state"
+ });
+
+
+
+}
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.view.checklist.listener;
+
+import java.util.SortedSet;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.ToolItem;
+
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
+/**
+ * Handles drop down menu selection. Available items are defined in the
+ * enumeration SearchOption.
+ *
+ * @author n.hoffmann
+ * @created Feb 2, 2010
+ * @version 1.0
+ */
+public class ChecklistDropdownSelectionListener extends SelectionAdapter {
+
+ private final Menu menu;
+ private final ToolItem dropdown;
+ private final ChecklistEditor editor;
+ private final SortedSet<DefinedTermBase> termSet;
+
+ public ChecklistDropdownSelectionListener(ToolItem dropdown, ChecklistEditor editor,
+ SortedSet<DefinedTermBase> termSet) {
+ this.dropdown = dropdown;
+ this.editor = editor;
+ this.termSet = termSet;
+ menu = new Menu(dropdown.getParent().getShell());
+ }
+
+ // SearchOption option
+ public void add(DefinedTermBase<DefinedTermBase> term) {
+ MenuItem menuItem = new MenuItem(menu, SWT.CHECK);
+ menuItem.setText(term.getTitleCache());
+ if (PreferencesUtil.getPreferenceStore().getBoolean(term.getUuid().toString())) {
+ menuItem.setSelection(true);
+ } else {
+ menuItem.setSelection(false);
+ }
+ menuItem.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ MenuItem selected = (MenuItem) event.widget;
+
+ TableViewer viewer = (TableViewer) editor.getViewer();
+ final Table table = viewer.getTable();
+ // TODO make it selectable according to selection event
+ TableColumn column = null;
+ DefinedTermBase<DefinedTermBase> selectedTerm = null;
+ if (termSet != null) {
+ int i = 0;
+ for (DefinedTermBase<DefinedTermBase> term : termSet) {
+ if (term != null) {
+ if (selected.getText().equalsIgnoreCase(term.getTitleCache())) {
+ selectedTerm = term;
+ column = table.getColumn(4 + i);
+ }
+ i++;
+ }
+ }
+ }
+ if (column != null && column.getWidth() == 0) {
+ // save column status if shown or not
+ if (selectedTerm != null) {
+ PreferencesUtil.getPreferenceStore().setValue(selectedTerm.getUuid().toString(), true);
+ }
+ column.setWidth(100);
+ } else if (column != null) {
+ if (selectedTerm != null) {
+ PreferencesUtil.getPreferenceStore().setValue(selectedTerm.getUuid().toString(), false);
+ }
+ column.setWidth(0);
+ }
+ viewer.refresh();
+ }
+ });
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ if (event.detail == SWT.ARROW) {
+ ToolItem item = (ToolItem) event.widget;
+ Rectangle rect = item.getBounds();
+ Point pt = item.getParent().toDisplay(new Point(rect.x, rect.y));
+ menu.setLocation(pt.x, pt.y + rect.height);
+ menu.setVisible(true);
+ } else {
+ menu.setVisible(true);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.view.checklist.listener;
+
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Text;
+
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.preference.Resources;
+
+public class ChecklistFocusListener implements FocusListener{
+
+ private final Text searchText;
+ private final ModifyListener modifyListener;
+
+ /**
+ *
+ */
+ public ChecklistFocusListener(Text searchText, ModifyListener modifyListener) {
+ this.searchText = searchText;
+ this.modifyListener = modifyListener;
+ }
+
+
+ @Override
+ public void focusGained(FocusEvent e) {
+ if ("type filter text".equals(searchText.getText())) {
+ searchText.setForeground(EditorUtil.getColor(Resources.SEARCH_VIEW_FOCUS));
+ searchText.setText("");
+ }
+ }
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ if ("".equals(searchText.getText())) {
+ //TODO: set demo string
+ searchText.removeModifyListener(modifyListener);
+
+ searchText.setForeground(EditorUtil.getColor(Resources.SEARCH_VIEW_FOREGROUND));
+ searchText.setText("type filter text");
+
+ searchText.addModifyListener(modifyListener);
+ }
+ }
+
+
+
+}
\ No newline at end of file
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.view.checklist.listener;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Text;
+
+import eu.etaxonomy.taxeditor.editor.view.checklist.filter.ChecklistEditorFilter;
+
+/**
+ * @author alex
+ * @date 27.06.2014
+ *
+ */
+public class ChecklistModifyListener implements ModifyListener {
+
+ private final Text searchText;
+ private final TableViewer viewer;
+ private final ChecklistEditorFilter filter;
+
+ /**
+ *
+ */
+ public ChecklistModifyListener(TableViewer viewer, ChecklistEditorFilter filter, Text searchText) {
+ this.viewer = viewer;
+ this.filter = filter;
+ this.searchText = searchText;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText(ModifyEvent e) {
+ filter.setSearchText(searchText.getText());
+ viewer.refresh();
+ }
+
+}
import org.eclipse.ui.IWorkbenchPart;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
* @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
@Override
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if(EditorUtil.getActiveEditor() == null){
+ protected void internal_selectionChanged(IWorkbenchPart part, ISelection selection) {
+ if(AbstractUtility.getActiveEditor() == null){
showEmptyPage();
return;
}
/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.editor.view.concept.graph;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
-import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
/**
*
*/
public class ConceptGraphView extends AbstractCdmEditorViewPart {
-
+
public static final String ID = "eu.etaxonomy.taxeditor.editor.view.concept.graph";
private GraphViewer viewer;
* @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
@Override
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ protected void internal_selectionChanged(IWorkbenchPart part, ISelection selection) {
// if(part instanceof ConceptGraphView){
// // ConceptGraphView is maximized
// return;
// }
-
+
if(EditorUtil.getActiveEditor() == null){
showEmptyPage();
return;
}
-
+
if(part instanceof BulkEditor){
showEmptyPage();
return;
}
-
-
+
+
if(part instanceof MultiPageTaxonEditor){
if(! part.equals(this.part)){
IEditorInput input = ((IEditorPart) part).getEditorInput();
*/
@Override
public void createViewer(Composite parent) {
-
+
viewer = new GraphViewer(parent, SWT.NONE);
getSite().setSelectionProvider(viewer);
import org.eclipse.ui.handlers.IHandlerService;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
import eu.etaxonomy.taxeditor.store.CdmStore;
try {
handlerService.executeCommand(getCommandName(), event);
} catch (Exception e) {
- EditorUtil.error(getClass(), "Error executing command", e);
+ MessagingUtils.error(getClass(), "Error executing command", e);
}
}
});
package eu.etaxonomy.taxeditor.editor.view.concept.handler;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.Status;
import org.eclipse.swt.widgets.Event;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.handlers.HandlerUtil;
import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.Page;
import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
import eu.etaxonomy.taxeditor.editor.view.concept.operation.CreateConceptRelationOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
/** {@inheritDoc} */
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
TaxonNameEditor editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(
Page.NAME);
if(relatedConcept == null){
return Status.CANCEL_STATUS;
}
-
- TaxonRelationshipTypeInverseContainer typeInverseContainer = (TaxonRelationshipTypeInverseContainer) ((Event)event.getTrigger()).data;
+ TaxonRelationshipType type = (TaxonRelationshipType) ((Event)event.getTrigger()).data;
+ boolean isInverse = type.getInverseLabel().isEmpty()?false:true;
+ TaxonRelationshipTypeInverseContainer typeInverseContainer =new TaxonRelationshipTypeInverseContainer(type, isInverse) ;
IPostOperationEnabled postOperationEnabled = (activePart instanceof IPostOperationEnabled) ? (IPostOperationEnabled) activePart : null;
try {
AbstractPostOperation operation = new CreateConceptRelationOperation(event.getCommand().getName(),
editor.getUndoContext(), editor.getTaxon(), relatedConcept, typeInverseContainer, postOperationEnabled);
- EditorUtil.executeOperation(operation);
+ AbstractUtility.executeOperation(operation);
} catch (NotDefinedException e) {
- EditorUtil.warn(getClass(), "Command name not set");
+ MessagingUtils.warn(getClass(), "Command name not set");
}
return null;
import eu.etaxonomy.taxeditor.editor.Page;
import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
import eu.etaxonomy.taxeditor.editor.view.concept.operation.DeleteConceptRelationOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
editor.getUndoContext(), editor.getTaxon(), relations, postOperationEnabled);
EditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
- EditorUtil.warn(getClass(), "Command name not set");
+ MessagingUtils.warn(getClass(), "Command name not set");
}
return null;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* @author n.hoffmann
try {
EditorUtil.openTaxonBase(relatedTaxon.getUuid());
} catch (PartInitException e) {
- EditorUtil.errorDialog("Could not open taxon", getClass(),
+ MessagingUtils.messageDialog("Could not open taxon", getClass(),
String.format("Could not open the taxon: %s" ,relatedTaxon), e);
}
}
*/
@Override
public void setFocus() {
+ tableViewer.getControl().setFocus();
//make sure to bind again if maybe in another view the conversation was unbound
if(!conversation.isBound()){
conversation.bind();
return defaultTaxonService.findWithoutFlush(uuid);
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxaByName(eu.etaxonomy.cdm.api.service.config.MatchingTaxonConfigurator)
+ */
+ @Override
+ public List<TaxonBase> findTaxaByName(MatchingTaxonConfigurator config) {
+ return defaultTaxonService.findTaxaByName(config);
+ }
+
import org.eclipse.swt.dnd.DragSourceEvent;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* @author pplitzner
public void dragStart(DragSourceEvent event) {
if(derivateView.isDirty()){
event.doit = false;
- AbstractUtility.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+ MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
return;
}
ISelection selection = derivateView.getViewer().getSelection();
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
@Override
public boolean performDrop(Object data) {
if(derivateView.isDirty()){
- AbstractUtility.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+ MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
return false;
}
Object target = getCurrentTarget();
return true;
}
else{
- AbstractUtility.warningDialog("Moving derivate not possible!", derivateView, "Moving \""+DerivateLabelProvider.getDerivateText(draggednode)+"\" to \""+DerivateLabelProvider.getDerivateText(targetNode)+"\" is not possible!");
+ MessagingUtils.warningDialog("Moving derivate not possible!", derivateView, "Moving \""+DerivateLabelProvider.getDerivateText(draggednode)+"\" to \""+DerivateLabelProvider.getDerivateText(targetNode)+"\" is not possible!");
}
}
}
*/
@Override
public void setFocus() {
+ viewer.getControl().setFocus();
//make sure to bind again if maybe in another view the conversation was unbound
if(!conversation.isBound()){
conversation.bind();
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
}
}
if(root==null){
- AbstractUtility.errorDialog("Failed initializing editor", DerivateViewEditorInput.class, "No root element found!");
+ MessagingUtils.messageDialog("Failed initializing editor", DerivateViewEditorInput.class, "No root element found!");
}
}
import eu.etaxonomy.cdm.model.molecular.SingleRead;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
switch (commandType) {
case REMOVE_FROM_SEQUENCE:
if(activeEditor.isDirty()){
- AbstractUtility.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+ MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
return;
}
if(selectedTreeNode!=null && selectedTreeNode.getParent()!=null &&
break;
case ADD_TO_SEQUENCE:
if(activeEditor.isDirty()){
- AbstractUtility.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+ MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
return;
}
if(clipBoardTreeNode!=null && clipBoardTreeNode.getValue() instanceof SingleRead
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionElementsOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* @author n.hoffmann
// cannot drop a feature node onto itself
for (Object droppedElement : droppedElements) {
if (droppedElement == null){
- StoreUtil.warningDialog("Operation not supported yet", this, "We are currently unable to drag and drop a newly created element. Please save the editor to make this work.");
+ MessagingUtils.warningDialog("Operation not supported yet", this, "We are currently unable to drag and drop a newly created element. Please save the editor to make this work.");
return false;
}
if(! (droppedElement instanceof DescriptionElementBase)){
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.cdm.model.description.IDescribable;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
/** {@inheritDoc} */
@Override
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ protected void internal_selectionChanged(IWorkbenchPart part, ISelection selection) {
if(AbstractUtility.getActiveEditor() == null){
showEmptyPage();
return;
selection = new StructuredSelection(treeNodeOfSelection.getValue());
}
}
-
+ else if(part instanceof ChecklistEditor){
+ if(selection instanceof StructuredSelection && ((IStructuredSelection) selection).getFirstElement() instanceof Taxon){
+ Taxon taxon = (Taxon)((IStructuredSelection) selection).getFirstElement();
+ selection = new StructuredSelection(taxon);
+ }
+ }
if(selection instanceof IStructuredSelection
&& ((IStructuredSelection) selection).getFirstElement() instanceof IDescribable<?>
&& part instanceof IPartContentHasFactualData){
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
operation = operationCreationInstance(event.getCommand().getName(), event, description, postOperationEnabled);
AbstractUtility.executeOperation(operation);
} catch (NotDefinedException e) {
- AbstractUtility.warn(getClass(), "Command name not set");
+ MessagingUtils.warn(getClass(), "Command name not set");
}
} else {
- AbstractUtility.error(getClass(), new IllegalArgumentException("Could not determine the taxon description"));
+ MessagingUtils.error(getClass(), new IllegalArgumentException("Could not determine the taxon description"));
return null;
}
return null;
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateSpecimenDescriptionOperation;
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
operation = createTaxonOperation(event.getCommand().getName(), taxon, postOperationEnabled);
AbstractUtility.executeOperation(operation);
} catch (NotDefinedException e) {
- AbstractUtility.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
}
// specimen description
operation = new CreateSpecimenDescriptionOperation(event.getCommand().getName(), EditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>) viewerInput, postOperationEnabled);
AbstractUtility.executeOperation(operation);
} catch (NotDefinedException e) {
- AbstractUtility.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
}
}
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.DeleteTaxonDescriptionOperation;
import eu.etaxonomy.taxeditor.editor.view.media.operation.DeleteMediaOperation;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
operations.add(new DeleteMediaOperation(label, undoContext, imageGallery, (Media) object, postOperationEnabled));
}
else{
- EditorUtil.error(getClass(), "Selection is not valid for this delete handler", null);
+ MessagingUtils.error(getClass(), "Selection is not valid for this delete handler", null);
}
}
}
} catch (NotDefinedException e) {
- EditorUtil.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
handlerService.executeCommand(
CreateDescriptionElementOperation.ID, event);
} catch (Exception e) {
- EditorUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
});
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionElementsOperation;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
CdmStore.getService(ITaxonService.class).saveOrUpdate(targetTaxon);
} catch (NotDefinedException e) {
- EditorUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionToOtherTaxonOperation;
//import eu.etaxonomy.taxeditor.navigator.operation.ChangeAcceptedTaxonToSynonymOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
}
EditorUtil.openTaxonNode(newAcceptedTaxonNodeUuid);
} catch (PartInitException e) {
- EditorUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
throw new RuntimeException(e);
} catch (Exception e) {
- EditorUtil.warningDialog("Could not create Taxon", this, e.getMessage());
+ MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
}
}
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>DeleteDescriptionElementOperation class.</p>
// Remove element from description
if (description == null) {
- StoreUtil.error(this.getClass(), "Couldn't find element's description!", null);
+ MessagingUtils.error(this.getClass(), "Couldn't find element's description!", null);
} else {
description.removeElement(element);
}
import org.eclipse.core.commands.ExecutionEvent;\r
import org.eclipse.core.commands.ExecutionException;\r
\r
-import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
\r
/**\r
* @author n.hoffmann\r
*/\r
@Override\r
public Object execute(ExecutionEvent event) throws ExecutionException {\r
- EditorUtil.warningDialog("Operation not supported yet", getClass(), "This operation is not supported yet.");\r
+ MessagingUtils.warningDialog("Operation not supported yet", getClass(), "This operation is not supported yet.");\r
return null;\r
}\r
\r
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* <p>MediaContentProvider class.</p>
if (parentElement instanceof TaxonEditorInput) {
Taxon taxon = ((TaxonEditorInput) parentElement).getTaxon();
if(taxon == null){
- EditorUtil.error(getClass(), "Taxon is null", null);
+ MessagingUtils.error(getClass(), "Taxon is null", null);
return NO_CHILDREN;
}
HashSet<DescriptionBase> imageGalleries = new HashSet<DescriptionBase>();
return derivedUnitFacadeImageGalleries.toArray();
} catch (DerivedUnitFacadeNotSupportedException e) {
- EditorUtil.error(this.getClass(), "DerivedUnitFacadeNotSupportedException when trying to instantiate DerivedUnitFacade", e);
+ MessagingUtils.error(this.getClass(), "DerivedUnitFacadeNotSupportedException when trying to instantiate DerivedUnitFacade", e);
}
}
if (elements != null) {
// by definition, image galleries have only one description element
if(elements.size() > 1){
- EditorUtil.error(this.getClass(), "There should be one and only one description element to hold the images. Found: " + elements.size() + " InDescription ID: " + description.getUuid(), null);
+ MessagingUtils.error(this.getClass(), "There should be one and only one description element to hold the images. Found: " + elements.size() + " InDescription ID: " + description.getUuid(), null);
}
DescriptionElementBase element = elements.iterator().next();
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
import org.eclipse.ui.IWorkbenchPart;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
public static final String ID = "eu.etaxonomy.taxeditor.editor.view.media";
private TreeViewer viewer;
-
+
/*
* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createViewer(org.eclipse.swt.widgets.Composite)
/** {@inheritDoc} */
@Override
public void createViewer(Composite parent) {
-
+
viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.FULL_SELECTION));
-
+
viewer.setContentProvider(new MediaContentProvider());
viewer.setLabelProvider(new MediaLabelProvider());
viewer.setAutoExpandLevel(2);
-
+
// Propagate selection from viewer
getSite().setSelectionProvider(viewer);
-
+
// Add context menu to tree
MenuManager menuMgr = new MenuManager();
menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
getSite().registerContextMenu(menuMgr, viewer);
-
+
Control control = viewer.getControl();
Menu menu = menuMgr.createContextMenu(control);
- control.setMenu(menu);
-
+ control.setMenu(menu);
+
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#getInitialSelection()
*/
protected ISelection getInitialSelection() {
if(getEditor() != null){
return new StructuredSelection(getEditor().getEditorInput());
- }
-
+ }
+
return super.getInitialSelection();
}
/** {@inheritDoc} */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if(EditorUtil.getActiveEditor() == null){
+ @Override
+ protected void internal_selectionChanged(IWorkbenchPart part, ISelection selection) {
+ if(AbstractUtility.getActiveEditor() == null){
showEmptyPage();
return;
}
-
+
if(part instanceof MultiPageTaxonEditor){
IEditorInput input = ((IEditorPart) part).getEditorInput();
showViewer(part, new StructuredSelection(input));
*
* @return a boolean.
*/
- public boolean onComplete() {
+ @Override
+ public boolean onComplete() {
return true;
}
}
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
EditorUtil.getUndoContext(), taxon, postOperationEnabled, true);
EditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
- EditorUtil.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
}
return null;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.view.media.operation.AddMediaToImageGalleryOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
EditorUtil.getUndoContext(), description, postOperationEnabled);
EditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
- EditorUtil.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
}
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
import eu.etaxonomy.taxeditor.editor.view.media.operation.RemoveImageFromDescriptionElementOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
EditorUtil.getUndoContext(), taxon, image, element, postOperationEnabled);
EditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
- EditorUtil.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
}
}
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
import eu.etaxonomy.taxeditor.editor.view.media.operation.MoveMediaInListOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
EditorUtil.getUndoContext(), taxon, description, media, MoveMediaInListOperation.DOWN, postOperationEnabled);
EditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
- EditorUtil.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
}
}
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
import eu.etaxonomy.taxeditor.editor.view.media.operation.MoveMediaInListOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
EditorUtil.getUndoContext(), taxon, element, media, MoveMediaInListOperation.UP, postOperationEnabled);
EditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
- EditorUtil.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set.");
}
}
}
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>MoveMediaInListOperation class.</p>
Set<DescriptionElementBase> elements = description.getElements();
if(elements.size() != 1){
- StoreUtil.error(this.getClass(), "More than one description element in this image gallery", null);
+ MessagingUtils.error(this.getClass(), "More than one description element in this image gallery", null);
}
DescriptionElementBase element = elements.iterator().next();
try{
Collections.swap(medias, newIndex, index);
}catch(ArrayIndexOutOfBoundsException e){
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
}
}
}
--- /dev/null
+#Properties file for eu.etaxonomy.taxeditor.navigation\r
+view.name = Search Result\r
+view.name.0 = Taxon Navigator\r
+view.name.1 = Polytomous Keys\r
+command.label = Taxon Navigator\r
+command.label.0 = Polytomous Keys\r
+command.label.1 = Edit\r
+menu.label = New\r
+command.label.2 = Taxon\r
+command.label.3 = Classification\r
+command.label.4 = Open in Checklist Editor\r
+command.label.5 = Edit\r
+command.label.6 = Change Accepted Taxon to Synonym\r
+command.label.7 = Move Taxon (with child taxa)\r
+command.label.8 = Import...\r
+command.label.9 = Export...\r
+command.label.10 = Delete\r
+command.label.11 = Refresh\r
+command.label.12 = Copy\r
+command.label.13 = Taxon\r
+command.label.14 = Classification\r
+command.label.15 = New\r
+command.label.16 = Edit\r
+menu.label.0 = Refresh\r
+command.label.17 = List\r
+command.label.18 = Key Nodes\r
+command.label.19 = Delete\r
+command.name = New Taxon Node\r
+command.name.0 = New Classification\r
+command.name.1 = Edit\r
+command.name.2 = Move Taxon\r
+command.name.3 = Refresh\r
+command.name.4 = Copy\r
+command.name.5 = Change Accepted Taxon to Synonym\r
+command.name.6 = New Polytomous Key\r
+command.name.7 = Edit Polytomous Key Nodes\r
+command.name.8 = Refresh Polytomous Key List\r
+command.name.9 = Refresh Polytomous Key Nodes\r
+view.name.2 = Taxonomic Tree\r
+navigatorContent.name = Classification\r
+navigatorContent.name.0 = TaxonNode\r
+navigatorContent.name.1 = Synonyms (experimental)
\ No newline at end of file
--- /dev/null
+#Properties file for eu.etaxonomy.taxeditor.navigation\r
+view.name = Suchergebnis\r
+view.name.0 = Taxon Navigator\r
+view.name.1 = Polytomous Keys\r
+command.label = Taxon Navigator\r
+command.label.0 = Polytomous Keys\r
+command.label.1 = Edit\r
+menu.label = Neu\r
+command.label.2 = Taxon\r
+command.label.3 = Klassifikation\r
+command.label.4 = \u00D6ffne im Checklisten Editor\r
+command.label.5 = Bearbeiten\r
+command.label.6 = Akzeptiertes Taxon zum Synonym umwandeln\r
+command.label.7 = Verschiebe Taxon (with child taxa)\r
+command.label.8 = Importieren\r
+command.label.9 = Exportieren\r
+command.label.10 = L\u00F6schen\r
+command.label.11 = Aktualisieren\r
+command.label.12 = Kopieren\r
+command.label.13 = Taxon\r
+command.label.14 = Klassifikation\r
+command.label.15 = Neu\r
+command.label.16 = Bearbeiten\r
+menu.label.0 = Aktualisieren\r
+command.label.17 = Liste\r
+command.label.18 = Key Nodes\r
+command.label.19 = L\u00F6schen\r
+command.name = Neuer Taxonknoten\r
+command.name.0 = Neue Klassifikation\r
+command.name.1 = Bearbeiten\r
+command.name.2 = Verschiebe Taxon\r
+command.name.3 = Refresh\r
+command.name.4 = Copy\r
+command.name.5 = Change Accepted Taxon to Synonym\r
+command.name.6 = New Polytomous Key\r
+command.name.7 = Edit Polytomous Key Nodes\r
+command.name.8 = Aktualisieren Polytomous Key List\r
+command.name.9 = Aktualisieren Polytomous Key Knoten\r
+view.name.2 = Taxonomiebaum\r
+navigatorContent.name = Klassifikation\r
+navigatorContent.name.0 = Taxonknoten\r
+navigatorContent.name.1 = Synonyme (experimental)
\ No newline at end of file
--- /dev/null
+#Properties file for eu.etaxonomy.taxeditor.navigation\r
+view.name = Search Result\r
+view.name.0 = Taxon Navigator\r
+view.name.1 = Polytomous Keys\r
+command.label = Taxon Navigator\r
+command.label.0 = Polytomous Keys\r
+command.label.1 = Edit\r
+menu.label = New\r
+command.label.2 = Taxon\r
+command.label.3 = Classification\r
+command.label.4 = Open in Checklist Editor\r
+command.label.5 = Edit\r
+command.label.6 = Change Accepted Taxon to Synonym\r
+command.label.7 = Move Taxon (with child taxa)\r
+command.label.8 = Import...\r
+command.label.9 = Export...\r
+command.label.10 = Delete\r
+command.label.11 = Refresh\r
+command.label.12 = Copy\r
+command.label.13 = Taxon\r
+command.label.14 = Classification\r
+command.label.15 = New\r
+command.label.16 = Edit\r
+menu.label.0 = Refresh\r
+command.label.17 = List\r
+command.label.18 = Key Nodes\r
+command.label.19 = Delete\r
+command.name = New Taxon Node\r
+command.name.0 = New Classification\r
+command.name.1 = Edit\r
+command.name.2 = Move Taxon\r
+command.name.3 = Refresh\r
+command.name.4 = Copy\r
+command.name.5 = Change Accepted Taxon to Synonym\r
+command.name.6 = New Polytomous Key\r
+command.name.7 = Edit Polytomous Key Nodes\r
+command.name.8 = Refresh Polytomous Key List\r
+command.name.9 = Refresh Polytomous Key Nodes\r
+view.name.2 = Taxonomic Tree\r
+navigatorContent.name = Classification\r
+navigatorContent.name.0 = TaxonNode\r
+navigatorContent.name.1 = Synonyms (experimental)
\ No newline at end of file
--- /dev/null
+SearchBar_0=Use "*" for wildcard searching\r
+SearchBar_1=Search\r
+SearchBar_2=Could not execute search\r
+SearchBar_3=Please type at least one character when using the "*" wildcard.\r
+SearchBar_4=Error opening search result.\r
+SearchBar_5=configuration menu clicked\r
+SearchBar_6=Taxa\r
+SearchBar_7=Synonyms\r
+SearchBar_8=Names (without taxa)\r
+SearchBar_9=Common Names\r
--- /dev/null
+SearchBar_0=Benutze "*" f\u00FCr Platzhalter-Suche\r
+SearchBar_1=Suche\r
+SearchBar_2=Suche konnte nicht ausgef\u00FChrt werden\r
+SearchBar_3=Bitte geben Sie mindestens ein Zeichen, wenn Sie die "*" Platzhalter benutzen wollen\r
+SearchBar_4=Fehler beim f\u00fcffnen des Suchergebnisses\r
+SearchBar_5=Konfigurationsmenü angeklickt\r
+SearchBar_6=Taxa\r
+SearchBar_7=Synonyme\r
+SearchBar_8=Namen (ohne Taxa)\r
+SearchBar_9=Umgangsprachliche Namen\r
--- /dev/null
+SearchBar_0=Use "*" for wildcard searching\r
+SearchBar_1=Search\r
+SearchBar_2=Could not execute search\r
+SearchBar_3=Please type at least one character when using the "*" wildcard.\r
+SearchBar_4=Error opening search result.\r
+SearchBar_5=configuration menu clicked\r
+SearchBar_6=Taxa\r
+SearchBar_7=Synonyms\r
+SearchBar_8=Names (without taxa)\r
+SearchBar_9=Common Names\r
.,\
plugin.xml,\
icons/,\
- p2.inf
+ p2.inf,\
+ OSGI-INF/
+
class="eu.etaxonomy.taxeditor.navigation.search.SearchResultView"
icon="icons/system-search.png"
id="eu.etaxonomy.taxeditor.navigation.search.searchResultView"
- name="Search Result"
+ name="%view.name"
restorable="false">
</view>
<view
class="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator"
icon="icons/preferences-system-windows.png"
id="eu.etaxonomy.taxeditor.navigation.navigator"
- name="Taxon Navigator"
+ name="%view.name.0"
restorable="true">
</view>
<view
allowMultiple="false"
class="eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewPart"
id="eu.etaxonomy.taxeditor.navigation.key.polytomous.polytomousKeyViewPart"
- name="Polytomous Keys"
+ name="%view.name.1"
restorable="true">
</view>
</extension>
locationURI="menu:eu.etaxonomy.taxeditor.menu.showView?before=eu.etaxonomy.taxeditor.editor.showViewMenu">
<command
commandId="org.eclipse.ui.views.showView"
- label="Taxon Navigator"
+ label="%command.label"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
</command>
<command
commandId="org.eclipse.ui.views.showView"
- label="Polytomous Keys"
+ label="%command.label.0"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
locationURI="popup:eu.etaxonomy.taxeditor.navigation.search.searchResultView">
<command
commandId="eu.etaxonomy.taxeditor.navigation.command.editTaxon"
- label="Edit"
+ label="%command.label.1"
style="push">
</command>
</menuContribution>
locationURI="popup:eu.etaxonomy.taxeditor.navigation.navigatorpopup">
<menu
id="eu.etaxonomy.navigation.menu.new"
- label="New">
+ label="%menu.label">
<command
commandId="eu.etaxonomy.taxeditor.navigation.command.create.taxonNode"
- label="Taxon"
+ label="%command.label.2"
style="push">
</command>
<separator
<command
commandId="eu.etaxonomy.taxeditor.navigation.create.classification"
id="eu.etaxonomy.taxeditor.navigation.create.classificationHandler"
- label="Classification"
+ label="%command.label.3"
style="push">
</command>
</menu>
+ <command
+ commandId="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistViewHandler"
+ icon="icons/edit_16x16.gif"
+ label="%command.label.4"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <and>
+ <reference
+ definitionId="isChecklistEditorEnabled">
+ </reference>
+ <or>
+ <reference
+ definitionId="isClassification">
+ </reference>
+ <reference
+ definitionId="isTaxonNode">
+ </reference>
+ </or>
+ </and>
+ </visibleWhen>
+ </command>
<separator
name="taxeditor-navigation.separator1"
visible="true">
</separator>
<command
commandId="eu.etaxonomy.taxeditor.navigation.command.update.editSelection"
- label="Edit"
+ label="%command.label.5"
style="push">
<visibleWhen
checkEnabled="true">
</command>
<command
commandId="eu.etaxonomy.taxeditor.navigator.command.update.changeAcceptedToSynonym"
- label="Change Accepted Taxon to Synonym"
+ label="%command.label.6"
style="push">
<visibleWhen
checkEnabled="true">
</command>
<command
commandId="eu.etaxonomy.taxeditor.navigation.command.update.moveTaxon"
- label="Move Taxon (with child taxa)"
+ label="%command.label.7"
style="push">
<visibleWhen
checkEnabled="true">
</command-->
<command
commandId="org.eclipse.ui.file.import"
- label="Import..."
+ label="%command.label.8"
style="push">
</command>
<command
commandId="org.eclipse.ui.file.export"
- label="Export..."
+ label="%command.label.9"
style="push">
</command>
<separator
</separator>
<command
commandId="org.eclipse.ui.edit.delete"
- label="Delete"
+ label="%command.label.10"
style="push">
<visibleWhen>
<not>
</separator>
<command
commandId="org.eclipse.ui.file.refresh"
- label="Refresh"
+ label="%command.label.11"
style="push">
</command>
<command
commandId="eu.etaxonomy.taxeditor.navigation.command.copyTaxonName"
- label="Copy"
+ label="%command.label.12"
style="push">
</command>
</menuContribution>
<menuContribution
locationURI="menu:eu.etaxonomy.navigation.menu.new">
<command
- commandId="eu.etaxonomy.taxeditor.navigation.create.classification"
- id="eu.etaxonomy.taxeditor.navigation.create.classificationHandler"
- label="Classification"
+ commandId="eu.etaxonomy.taxeditor.navigation.command.create.taxonNode"
+ label="%command.label.13"
style="push">
</command>
<separator
- name="eu.etaxonomy.navigation.menu.new.separator0"
+ name="eu.etaxonomy.navigation.menu.new.separator1"
visible="true">
</separator>
<command
- commandId="eu.etaxonomy.taxeditor.navigation.command.create.taxonNode"
- label="Taxon"
+ commandId="eu.etaxonomy.taxeditor.navigation.create.classification"
+ id="eu.etaxonomy.taxeditor.navigation.create.classificationHandler"
+ label="%command.label.14"
style="push">
</command>
- <separator
- name="eu.etaxonomy.navigation.menu.new.separator1"
- visible="true">
- </separator>
</menuContribution>
<menuContribution
locationURI="popup:eu.etaxonomy.taxeditor.navigation.key.polytomous.polytomousKeyViewPart">
<command
commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.newKey"
- label="New"
+ label="%command.label.15"
style="push">
</command>
<command
commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.editNodes"
- label="Edit"
+ label="%command.label.16"
style="push">
</command>
<menu
- label="Refresh">
+ label="%menu.label.0">
<command
commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.refreshKeyList"
- label="List"
+ label="%command.label.17"
style="push">
</command>
<command
commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.refreshKeyNodes"
- label="Key Nodes"
+ label="%command.label.18"
style="push">
</command>
</menu>
</separator>
<command
commandId="org.eclipse.ui.edit.delete"
- label="Delete"
+ label="%command.label.19"
style="push">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.NewTaxonNodeHandler"
id="eu.etaxonomy.taxeditor.navigation.command.create.taxonNode"
- name="New Taxon Node">
+ name="%command.name">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.NewClassificationHandler"
id="eu.etaxonomy.taxeditor.navigation.create.classification"
- name="New Classification">
+ name="%command.name.0">
</command>
</extension>
<extension
<command
defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.EditHandler"
id="eu.etaxonomy.taxeditor.navigation.command.update.editSelection"
- name="Edit">
+ name="%command.name.1">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.MoveTaxonHandler"
id="eu.etaxonomy.taxeditor.navigation.command.update.moveTaxon"
- name="Move Taxon">
+ name="%command.name.2">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.RefreshTreeHandler"
id="org.eclipse.ui.file.refresh"
- name="Refresh">
+ name="%command.name.3">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.CopyHandler"
id="eu.etaxonomy.taxeditor.navigation.command.copyTaxonName"
- name="Copy">
+ name="%command.name.4">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.ChangeAcceptedTaxonToSynonymHandler"
id="eu.etaxonomy.taxeditor.navigator.command.update.changeAcceptedToSynonym"
- name="Change Accepted Taxon to Synonym">
+ name="%command.name.5">
</command>
</extension>
<extension
<command
defaultHandler="eu.etaxonomy.taxeditor.navigation.key.polytomous.handler.NewPolytomousKeyHandler"
id="eu.etaxonomy.taxeditor.navigation.key.polytomous.newKey"
- name="New Polytomous Key">
+ name="%command.name.6">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.navigation.key.polytomous.handler.EditPolytomousKeyNodesHandler"
id="eu.etaxonomy.taxeditor.navigation.key.polytomous.editNodes"
- name="Edit Polytomous Key Nodes">
+ name="%command.name.7">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.navigation.key.polytomous.handler.RefreshPolytomousKeyListHandler"
id="eu.etaxonomy.taxeditor.navigation.key.polytomous.refreshKeyList"
- name="Refresh Polytomous Key List">
+ name="%command.name.8">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.navigation.key.polytomous.handler.RefreshPolytomousKeyNodesHandler"
id="eu.etaxonomy.taxeditor.navigation.key.polytomous.refreshKeyNodes"
- name="Refresh Polytomous Key Nodes">
+ name="%command.name.9">
</command>
</extension>
<extension
class="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator"
icon="icons/edit_16x16.gif"
id="eu.etaxonomy.taxeditor.navigation.navigator"
- name="Taxonomic Tree"/>
+ name="%view.name.2"/>
</extension>
<extension
point="org.eclipse.ui.navigator.navigatorContent">
contentProvider="eu.etaxonomy.taxeditor.navigation.navigator.ClassificationContentProvider"
id="eu.etaxonomy.taxeditor.navigation.classificationContent"
labelProvider="eu.etaxonomy.taxeditor.navigation.navigator.ClassificationLabelProvider"
- name="Classification">
+ name="%navigatorContent.name">
<triggerPoints>
<instanceof
value="eu.etaxonomy.taxeditor.navigation.navigator.Root">
contentProvider="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodeContentProvider"
id="eu.etaxonomy.taxeditor.navigation.taxonNodeContent"
labelProvider="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodeLabelProvider"
- name="TaxonNode">
+ name="%navigatorContent.name.0">
<triggerPoints>
<or>
<instanceof
</instanceof>
<and>
<instanceof
- value="eu.etaxonomy.cdm.model.taxon.TaxonomicTree">
+ value="eu.etaxonomy.cdm.model.taxon.Classification">
</instanceof>
<test
forcePluginActivation="true"
value="eu.etaxonomy.cdm.model.taxon.TaxonNode">
</instanceof>
<instanceof
- value="eu.etaxonomy.cdm.model.taxon.TaxonomicTree">
+ value="eu.etaxonomy.cdm.model.taxon.Classification">
</instanceof>
</or>
</possibleDropTargets>
contentProvider="eu.etaxonomy.taxeditor.navigation.navigator.SynonymContentProvider"
id="eu.etaxonomy.taxeditor.navigation.synonymContent"
labelProvider="eu.etaxonomy.taxeditor.navigation.navigator.SynonymLabelProvider"
- name="Synonyms (experimental)"
+ name="%navigatorContent.name.1"
priority="highest">
<triggerPoints>
<and>
</adapter>
</factory>
</extension>
- <extension
+ <extension
point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
class="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodePropertyTester"
properties="hasTaxa"
type="eu.etaxonomy.cdm.model.taxon.TaxonomicTree">
</propertyTester>
+ <propertyTester
+ class="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodePropertyTester"
+ id="eu.etaxonomy.taxeditor.propertytests.navigatorPropertyTester"
+ namespace="eu.etaxonomy.taxeditor.propertytests"
+ properties="hasTaxa"
+ type="eu.etaxonomy.cdm.model.taxon.Classification">
+ </propertyTester>
+ <propertyTester
+ class="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester"
+ id="eu.etaxonomy.taxeditor.preferences.propertyTester"
+ namespace="eu.etaxonomy.taxeditor.preferences.propertyTester"
+ properties="isChecklistEditorEnabled"
+ type="org.eclipse.jface.viewers.IStructuredSelection">
+ </propertyTester>
</extension>
<extension
point="org.eclipse.core.expressions.definitions">
id="isTaxonNode">
<with
variable="selection">
- <iterate>
+ <iterate
+ ifEmpty="false">
<instanceof
value="eu.etaxonomy.cdm.model.taxon.TaxonNode">
</instanceof>
</with>
</definition>
<definition
- id="isTaxonomicTree">
+ id="isSynonymNode">
<with
variable="selection">
- <iterate>
+ <iterate
+ ifEmpty="false">
<instanceof
- value="eu.etaxonomy.cdm.model.taxon.TaxonomicTree">
+ value="eu.etaxonomy.cdm.model.taxon.Synonym">
</instanceof>
</iterate>
</with>
</definition>
<definition
- id="isSynonymNode">
+ id="isClassification">
<with
variable="selection">
- <iterate>
+ <iterate
+ ifEmpty="false">
<instanceof
- value="eu.etaxonomy.cdm.model.taxon.Synonym">
+ value="eu.etaxonomy.cdm.model.taxon.Classification">
</instanceof>
</iterate>
</with>
</definition>
+ <definition
+ id="isChecklistEditorEnabled">
+ <with
+ variable="selection">
+ <test
+ property="eu.etaxonomy.taxeditor.preferences.propertyTester.isChecklistEditorEnabled">
+ </test>
+ </with>
+ </definition>
</extension>
</plugin>
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin;
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
try {
handlerService.executeCommand(commandId, null);
} catch (ExecutionException e) {
- AbstractUtility.error(NavigationUtil.class, e);
+ MessagingUtils.error(NavigationUtil.class, e);
} catch (NotDefinedException e) {
- AbstractUtility.error(NavigationUtil.class, e);
+ MessagingUtils.error(NavigationUtil.class, e);
} catch (NotEnabledException e) {
- AbstractUtility.error(NavigationUtil.class, e);
+ MessagingUtils.error(NavigationUtil.class, e);
} catch (NotHandledException e) {
- AbstractUtility.error(NavigationUtil.class, e);
+ MessagingUtils.error(NavigationUtil.class, e);
}
}
EditorUtil.openTaxonBase(entityUuid);
}else if(selectedObject instanceof TaxonNameBase){
// TODO open bulk editor
- warningDialog("Not implemented yet", NavigationUtil.class, "You tried to open a name. This is not handled by the software yet.");
+ MessagingUtils.warningDialog("Not implemented yet", NavigationUtil.class, "You tried to open a name. This is not handled by the software yet.");
}else if(selectedObject instanceof PolytomousKey){
EditorUtil.openPolytomousKey(entityUuid);
}else{
- warningDialog("Unsupported Type", NavigationUtil.class, "No editor exists for the current selection: " + selectedObject);
+ MessagingUtils.warningDialog("Unsupported Type", NavigationUtil.class, "No editor exists for the current selection: " + selectedObject);
}
} catch (PartInitException e) {
- AbstractUtility.error(NavigationUtil.class, "Error opening the editor", e);
+ MessagingUtils.error(NavigationUtil.class, "Error opening the editor", e);
} catch (Exception e) {
- AbstractUtility.warningDialog("Could not create Taxon", NavigationUtil.class, e.getMessage());
+ MessagingUtils.warningDialog("Could not create Taxon", NavigationUtil.class, e.getMessage());
}
}
try {
EditorUtil.openTaxonBase(((UuidAndTitleCache) selectedObject).getUuid());
} catch (PartInitException e) {
- AbstractUtility.error(NavigationUtil.class, "Error opening the editor", e);
+ MessagingUtils.error(NavigationUtil.class, "Error opening the editor", e);
}
}
}else if(selectedObject instanceof ICdmBase){
openEditor((ICdmBase) selectedObject);
}else{
- AbstractUtility.error(NavigationUtil.class, new IllegalArgumentException("Selected object is not supported: " + selectedObject));
+ MessagingUtils.error(NavigationUtil.class, new IllegalArgumentException("Selected object is not supported: " + selectedObject));
}
}
try {
EditorUtil.openEmpty(parentNodeUuid);
} catch (PartInitException e) {
- AbstractUtility.error(NavigationUtil.class, "Error opening the editor", e);
+ MessagingUtils.error(NavigationUtil.class, "Error opening the editor", e);
}
}
}
}
} catch (PartInitException e) {
- AbstractUtility.error(NavigationUtil.class, e.getMessage(), e);
+ MessagingUtils.error(NavigationUtil.class, e.getMessage(), e);
throw new RuntimeException(e);
}
handleOpeningOfMultipleTaxa(synonym.getAcceptedTaxa());
}else{
- warningDialog("Not implemented yet", NavigationUtil.class, "You chose to open a name that has no connection to a taxon. The Editor does not support editing of such a content type at the moment.");
+ MessagingUtils.warningDialog("Not implemented yet", NavigationUtil.class, "You chose to open a name that has no connection to a taxon. The Editor does not support editing of such a content type at the moment.");
}
}
openEditor(acceptedTaxa.iterator().next());
}else if(acceptedTaxa.size() > 1){
// FIXME implement a dialog that shows all possible taxa and let the user choose which he wants to open.
- warningDialog("Not implemented yet", NavigationUtil.class, "The accepted taxon is in multiple taxonomic trees. We currently do not know which one you want to open." +
+ MessagingUtils.warningDialog("Not implemented yet", NavigationUtil.class, "The accepted taxon is in multiple taxonomic trees. We currently do not know which one you want to open." +
" This case is not handled yet by the software.");
}else if(acceptedTaxa.size() == 0){
// this is an undesired state
- warningDialog("Not implemented yet", NavigationUtil.class, "This taxon is not connected to a classification. Currently editing of such taxa is not supported yet.");
+ MessagingUtils.warningDialog("Not implemented yet", NavigationUtil.class, "This taxon is not connected to a classification. Currently editing of such taxa is not supported yet.");
}
}
openEditor(taxonNodes.iterator().next());
}else if(taxonNodes.size() > 1){
// FIXME implement a dialog that shows all possible taxa and let the user choose which he wants to open.
- warningDialog("Not implemented yet", NavigationUtil.class, "The accepted taxon is in multiple taxonomic trees. We currently do not know which one you want to open." +
+ MessagingUtils.warningDialog("Not implemented yet", NavigationUtil.class, "The accepted taxon is in multiple taxonomic trees. We currently do not know which one you want to open." +
" This case is not handled yet by the software.");
}else if(taxonNodes.size() == 0){
// this is an undesired state
- warningDialog("Incorrect state", NavigationUtil.class, "The accepted taxon is not in a taxonomic view. This should not have happened.");
+ MessagingUtils.warningDialog("Incorrect state", NavigationUtil.class, "The accepted taxon is not in a taxonomic view. This should not have happened.");
}
}
/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.navigation.key.polytomous;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.SWT;
import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
import eu.etaxonomy.taxeditor.model.DataChangeBridge;
import eu.etaxonomy.taxeditor.model.IContextListener;
-import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@Override
public boolean select(Viewer viewer, Object parentElement,
Object element) {
-
+
if(element instanceof PolytomousKey){
PolytomousKey key = (PolytomousKey) element;
if(key.getTitleCache().contains(text_filter.getText())){
return true;
}
}
-
+
return false;
}
-
+
};
-
+
viewer.setFilters(new ViewerFilter[]{filter});
}
}
-
-
+
+
public static final String ID = "eu.etaxonomy.taxeditor.navigation.key.polytomous.polytomousKeyViewPart";
public static final String OPEN_COMMAND_ID = "eu.etaxonomy.taxeditor.navigation.key.polytomous.editNodes";
-
+
private class ContextListener extends ContextListenerAdapter{
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.model.IContextListener#contextStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
@Override
public void contextStop(IMemento memento, IProgressMonitor monitor) {
monitor.subTask("Shutting down Polytomous Key Viewer");
- viewer.setInput(null);
+ if(!viewer.getControl().isDisposed()){
+ viewer.setInput(null);
+ }
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.model.ContextListenerAdapter#contextStart(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
*/
setInput();
}
}
-
+
private ListViewer viewer;
private ConversationHolder conversation;
private IContextListener contextListener;
public PolytomousKeyViewPart(){
formFactory = new CdmFormFactory(Display.getDefault());
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new GridLayout());
-
+
contextListener = new ContextListener();
CdmStore.getContextManager().addContextListener(contextListener);
-
+
text_filter = formFactory.createText(container, "");
text_filter.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
text_filter.addModifyListener(new FilterModifyListener());
-
+
viewer = new ListViewer(container, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
+
viewer.setContentProvider(new PolytomousKeyContentProvider());
viewer.setLabelProvider(new PolytomousKeyLabelProvider());
-
+
viewer.addDoubleClickListener(new IDoubleClickListener() {
-
+
@Override
- public void doubleClick(DoubleClickEvent event) {
+ public void doubleClick(DoubleClickEvent event) {
openSelectedKeyNodes();
}
});
-
-
+
+
getSite().setSelectionProvider(viewer);
-
+
createMenu();
-
+
if(CdmStore.isActive()){
setInput();
}
}
-
+
public void openSelectedKeyNodes() {
ICommandService commandService = (ICommandService)getSite().getService(ICommandService.class);
-
- Command command = commandService.getCommand(OPEN_COMMAND_ID);
+
+ Command command = commandService.getCommand(OPEN_COMMAND_ID);
if(command.isEnabled()) {
IHandlerService handlerService = (IHandlerService)getSite().getService(IHandlerService.class);
- try {
+ try {
handlerService.executeCommand(OPEN_COMMAND_ID, null);
} catch (NotDefinedException e) {
throw new RuntimeException("Could not find open command: " + OPEN_COMMAND_ID);
} catch (Exception e) {
- NavigationUtil.error(getClass(), "An exception occured while trying to open a selection", e);
+ MessagingUtils.error(getClass(), "An exception occured while trying to open a selection", e);
}
}
}
-
- public void setViewerSelection(ISelection selection, boolean reveal) {
- getSite().setSelectionProvider(viewer);
- viewer.setSelection(selection,reveal);
- viewer.getList().notifyListeners(SWT.Selection,new Event());
+
+ public void setViewerSelection(ISelection selection, boolean reveal) {
+ getSite().setSelectionProvider(viewer);
+ viewer.setSelection(selection,reveal);
+ viewer.getList().notifyListeners(SWT.Selection,new Event());
}
-
+
private void createMenu(){
MenuManager menuManager = new MenuManager();
menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-
+
getSite().registerContextMenu(menuManager, viewer);
-
+
Control control = viewer.getControl();
Menu menu = menuManager.createContextMenu(control);
-
- control.setMenu(menu);
+
+ control.setMenu(menu);
}
private void setInput() {
conversation = CdmStore.createConversation();
conversation.registerForDataStoreChanges(this);
- List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);
- viewer.setInput(input);
+ List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);
+ if(!viewer.getControl().isDisposed()){
+ viewer.setInput(input);
+ }
}
/* (non-Javadoc)
public void setFocus() {
viewer.getControl().setFocus();
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
*/
public ConversationHolder getConversationHolder() {
return conversation;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#dispose()
*/
@Override
public void dispose() {
- conversation.unregisterForDataStoreChanges(this);
- conversation.close();
- CdmStore.getContextManager().removeContextListener(contextListener);
+ if(conversation!=null){
+ conversation.unregisterForDataStoreChanges(this);
+ conversation.close();
+ CdmStore.getContextManager().removeContextListener(contextListener);
+ }
super.dispose();
}
}
/**
- *
+ *
*/
public void refresh() {
getConversationHolder().bind();
//FIXME : Need to make sure this is a stable fix (ticket 3822)
getConversationHolder().commit();
- List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);
- viewer.setInput(input);
+ List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);
+ if(!viewer.getControl().isDisposed()){
+ viewer.setInput(input);
+ }
}
-
+
public List<PolytomousKey> getKeys() {
return (List<PolytomousKey>)viewer.getInput();
}
import org.eclipse.ui.handlers.HandlerUtil;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
import eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewPart;
import eu.etaxonomy.taxeditor.navigation.key.polytomous.operation.DeleteOperation;
return null;
}
- boolean confirmation = NavigationUtil.confirmDialog("Confirm deletaion", "Do you want to delete the selected key" + (keys.size() == 1 ? "" : "s") + "?");
+ boolean confirmation = MessagingUtils.confirmDialog("Confirm deletaion", "Do you want to delete the selected key" + (keys.size() == 1 ? "" : "s") + "?");
if(confirmation){
(PolytomousKeyViewPart) NavigationUtil.getView(PolytomousKeyViewPart.ID, false));
NavigationUtil.executeOperation(operation);
} catch (NotDefinedException e) {
- NavigationUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
}
import org.eclipse.ui.navigator.ILinkHelper;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* When a taxon is open in an editor and this editor has focus, its entry in the
}
}
} catch (Exception e) {
- EditorUtil.warningDialog("Could not create Taxon", this, e.getMessage());
+ MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
}
}
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.model.DataChangeBridge;
import eu.etaxonomy.taxeditor.model.IDataChangeBehavior;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
path += ((CdmBase) segment).getUuid().toString() + " ";
monitor.worked(1);
} else {
- NavigationUtil.warn(getClass(),
+ MessagingUtils.warn(getClass(),
"Non-taxon tree path segment " + segment);
}
}
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.security.RequiredPermissions;
import eu.etaxonomy.taxeditor.store.CdmStore;
try{
Taxon taxon = (Taxon) HibernateProxyHelper.deproxy(taxonNode.getTaxon());
if(taxon == null){
- NavigationUtil.error(getClass(), "The taxon node does not have a taxon attached to it. Please check your import. TaxonNode: " + element, null);
+ MessagingUtils.error(getClass(), "The taxon node does not have a taxon attached to it. Please check your import. TaxonNode: " + element, null);
// throw new RuntimeException("The data your are trying to view is corrupt. Please check your import.");
}else{
try{
return taxon.getName() != null ? ((IIdentifiableEntity) HibernateProxyHelper.deproxy(taxon.getName())).getTitleCache() : new String();
}catch(Exception e){
- NavigationUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
}catch (LazyInitializationException e){
- NavigationUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
import eu.etaxonomy.taxeditor.editor.Page;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
import eu.etaxonomy.taxeditor.navigation.navigator.operation.ChangeAcceptedTaxonToSynonymOperation;
import eu.etaxonomy.taxeditor.navigation.navigator.operation.DeleteOperation;
// check if taxon has no children
if(((TaxonNode)oldAcceptedTaxonNode).getCountChildren() > 0) {
- EditorUtil.warningDialog("Prerequisite not met", this,
+ MessagingUtils.warningDialog("Prerequisite not met", this,
"The accepted taxon must not have any childen. You need to move all childen to " +
"another taxon node in the TaxonNavigator before attempting to turn the accepted " +
"taxon into a synonym.");
} catch (NotDefinedException e) {
- NavigationUtil.warn(getClass(), "Command name not set");
+ MessagingUtils.warn(getClass(), "Command name not set");
}
} else{
if( MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Moving to synonymy", "The operation move accepted taxon to synonymy is available only for a single taxon.")){
}
EditorUtil.openTaxonNode(newAcceptedTaxonNodeUuid);
} catch (PartInitException e) {
- EditorUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
throw new RuntimeException(e);
} catch (Exception e) {
- EditorUtil.warningDialog("Could not create Taxon", this, e.getMessage());
+ MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
}
}
import org.eclipse.ui.handlers.HandlerUtil;\r
\r
import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;\r
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;\r
import eu.etaxonomy.taxeditor.navigation.navigator.operation.CopyOperation;\r
IStatus status = NavigationUtil.executeOperation(operation);\r
\r
} catch (NotDefinedException e) {\r
- NavigationUtil.warn(getClass(), "Command name not set");\r
+ MessagingUtils.warn(getClass(), "Command name not set");\r
}\r
}\r
}\r
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
import eu.etaxonomy.taxeditor.navigation.navigator.operation.DeleteOperation;
} catch (NotDefinedException e) {
- NavigationUtil.warn(getClass(), "Command name not set");
+ MessagingUtils.warn(getClass(), "Command name not set");
}
} else{
try{
NavigationUtil.executeOperation(operation);
}
}catch (NotDefinedException e) {
- NavigationUtil.warn(getClass(), "Command name not set");
+ MessagingUtils.warn(getClass(), "Command name not set");
}
}
return null;
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.IllegalAncestryException;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* Change the taxonomic parent of a given taxon.
monitor.worked(2);
}
} catch(IllegalAncestryException e) {
- StoreUtil.warningDialog("Illegal ancestry", this, e.getMessage());
+ MessagingUtils.warningDialog("Illegal ancestry", this, e.getMessage());
}
monitor.worked(40);
@Override
public IStatus undo(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
- StoreUtil.warn(this.getClass(), "Not implemented yet.");
+ MessagingUtils.warn(this.getClass(), "Not implemented yet.");
// iterate over oldParentTreeNodes, delete each TaxonNode from its actual parent and add to its former parent
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>CreateTaxonNodeOperation class.</p>
return postExecute(childTaxonNode);
}catch(Exception e){
- NavigationUtil.errorDialog("Could not create taxon node", getClass(), e.getLocalizedMessage(), e);
+ MessagingUtils.messageDialog("Could not create taxon node", getClass(), e.getLocalizedMessage(), e);
return Status.CANCEL_STATUS;
}
}
public IStatus undo(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
- StoreUtil.warn(this.getClass(), "Not yet implemented.");
+ MessagingUtils.warn(this.getClass(), "Not yet implemented.");
return null;
}
}
--- /dev/null
+// $Id$\r
+/**\r
+ * Copyright (C) 2014 EDIT\r
+ * European Distributed Institute of Taxonomy\r
+ * http://www.e-taxonomy.eu\r
+ *\r
+ * The contents of this file are subject to the Mozilla Public License Version 1.1\r
+ * See LICENSE.TXT at the top of this package for the full license terms.\r
+ */\r
+package eu.etaxonomy.taxeditor.navigation.search;\r
+\r
+import org.eclipse.osgi.util.NLS;\r
+\r
+/**\r
+ * @author d.schild\r
+ * @date 18.06.2014\r
+ *\r
+ */\r
+public class Messages extends NLS {\r
+ private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$\r
+ public static String SearchBar_0;\r
+ public static String SearchBar_1;\r
+ public static String SearchBar_2;\r
+ public static String SearchBar_3;\r
+ public static String SearchBar_4;\r
+ public static String SearchBar_5;\r
+ public static String SearchBar_6;\r
+ public static String SearchBar_7;\r
+ public static String SearchBar_8;\r
+ public static String SearchBar_9;\r
+ static {\r
+ // initialize resource bundle\r
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);\r
+ }\r
+\r
+ private Messages() {\r
+ }\r
+}\r
import org.eclipse.ui.swt.IFocusService;
import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
import eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin;
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
private Text text_search;
private String secondaryId;
- private final String defaultText = "Use \"*\" for wildcard searching";
+ private final String defaultText = Messages.SearchBar_0;
final private ConfigurationSelectionListener configurationListener = new ConfigurationSelectionListener();
final ToolBar toolBar = new ToolBar(composite, SWT.NULL);
ToolItem toolItem = new ToolItem(toolBar, SWT.DROP_DOWN | SWT.BORDER);
- toolItem.setText("Search");
+ toolItem.setText(Messages.SearchBar_1);
DropdownSelectionListener dropdownListener = new DropdownSelectionListener(
toolItem);
}
if("*".equals(searchString.trim())){
- NavigationUtil.warningDialog("Could not execute search", this, "Please type at least one character when using the \"*\" wildcard.");
+ MessagingUtils.warningDialog(Messages.SearchBar_2, this, Messages.SearchBar_3);
return;
}
IWorkbenchPage.VIEW_ACTIVATE);
((SearchResultView) resultsView).performSearch(configurator);
} catch (PartInitException e) {
- NavigationUtil.error(this.getClass(), "Error opening search result.", e);
+ MessagingUtils.error(this.getClass(), Messages.SearchBar_4, e);
}
}
*/
@Override
public void widgetSelected(SelectionEvent e) {
- NavigationUtil.info("configuration menu clicked");
+ MessagingUtils.info(Messages.SearchBar_5);
SearchOption option = (SearchOption) e.widget.getData();
switch (option){
* @version 1.0
*/
enum SearchOption {
- TAXON("Taxa"),
- SYNONYM("Synonyms"),
- NAME("Names (without taxa)"),
- COMMON_NAME("Common Names");
+ TAXON(Messages.SearchBar_6),
+ SYNONYM(Messages.SearchBar_7),
+ NAME(Messages.SearchBar_8),
+ COMMON_NAME(Messages.SearchBar_9);
private final String label;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
import org.osgi.framework.Bundle;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+
@SuppressWarnings("restriction")
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
// IWorkspace workspace = ResourcesPlugin.getWorkspace();
// return workspace.getRoot();
// }
+
+// @Override
+// public void eventLoopException(Throwable exception) {
+// super.eventLoopException(exception);
+// MessagingUtils.messageDialog("Unexpected Errorr", "Please contact EDIT Support and provide contents of the trace log", null , exception);
+// }
}
--- /dev/null
+#Properties file for eu.etaxonomy.taxeditor.printpublisher\r
+category.name = Print Publishing\r
+command.label = Generate PDF\r
+command.name = Generate PDF
\ No newline at end of file
--- /dev/null
+#Properties file for eu.etaxonomy.taxeditor.printpublisher\r
+category.name = Print Publishing\r
+command.label = Erzeuge PDF\r
+command.name = Erzeuge PDF
\ No newline at end of file
--- /dev/null
+#Properties file for eu.etaxonomy.taxeditor.printpublisher\r
+category.name = Print Publishing\r
+command.label = Generate PDF\r
+command.name = Generate PDF
\ No newline at end of file
bin.includes = META-INF/,\
.,\
plugin.xml,\
- p2.inf
+ p2.inf,\
+ OSGI-INF/l10n/bundle.properties,\
+ OSGI-INF/l10n/bundle_de.properties,\
+ OSGI-INF/l10n/bundle_en.properties
point="org.eclipse.ui.exportWizards">
<category
id="print-publisher.category"
- name="Print Publishing">
+ name="%category.name">
</category>
<wizard
category="print-publisher.category"
<command
defaultHandler="eu.etaxonomy.taxeditor.printpublisher.handler.GeneratePdfHandler"
id="eu.etaxonomy.printpublisher.plugin.generatePdf"
- name="Generate PDF">
+ name="%command.name">
</command>
</extension>
-->
import eu.etaxonomy.cdm.print.out.pdf.PdfOutputModule;
import eu.etaxonomy.cdm.print.out.xml.XMLOutputModule;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
import eu.etaxonomy.taxeditor.printpublisher.wizard.DirectPublishingWizard;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>GeneratePdfHandler class.</p>
IEditorInput input = editor.getEditorInput();
if(!(input instanceof TaxonEditorInput)){
- StoreUtil.warningDialog("PDF generation not supported for selected input", this, "Generating PDF output is not supported for the current active editor");
+ MessagingUtils.warningDialog("PDF generation not supported for selected input", this, "Generating PDF output is not supported for the current active editor");
return null;
}
import eu.etaxonomy.cdm.print.Publisher;
import eu.etaxonomy.cdm.print.out.IPublishOutputModule;
import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
-import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.printpublisher.internal.PrintpublisherPlugin;
import eu.etaxonomy.taxeditor.store.CdmStore;
*/
/** {@inheritDoc} */
public void init(IWorkbench workbench, IStructuredSelection selection) {
- PrintUtil.info("Instantiating wizard: " + this.getClass().getSimpleName());
+ MessagingUtils.info("Instantiating wizard: " + this.getClass().getSimpleName());
}
import eu.etaxonomy.cdm.print.XMLHelper;
import eu.etaxonomy.cdm.print.XMLHelper.EntityType;
import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>SelectServiceWizardPage class.</p>
try {
getContainer().run(true, false, runnable);
} catch (InvocationTargetException e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
} catch (InterruptedException e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
}
}
}
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
-import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* @author n.hoffmann
stylesheets = getOutputModule().getStylesheets();
viewer.setInput(stylesheets);
} catch (IOException e) {
- PrintUtil.errorDialog("Problems reading stylesheet", getClass(), e.getMessage(), e);
+ MessagingUtils.messageDialog("Problems reading stylesheet", getClass(), e.getMessage(), e);
}
}
import eu.etaxonomy.cdm.print.IXMLEntityFactory;
import eu.etaxonomy.cdm.print.XMLHelper;
import eu.etaxonomy.cdm.print.XMLHelper.EntityType;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* <p>SelectTaxaWizardPage class.</p>
try {
getContainer().run(true, false, runnable);
} catch (InvocationTargetException e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
} catch (InterruptedException e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
}
}
}
xpp3_min-1.1.4c.jar,
xstream-1.4.4.jar,
yjp-controller-api-redist-9.0.8.jar
+Bundle-Localization: OSGI-INF/l10n/bundle
--- /dev/null
+#Properties file for eu.etaxonomy.taxeditor.store\r
+page.name = Taxonomic Editor\r
+page.name.0 = Description\r
+page.name.1 = Features\r
+page.name.2 = Distribution Status\r
+page.name.3 = Taxonomic\r
+page.name.4 = Nomenclatural Code\r
+page.name.5 = Ranks\r
+page.name.6 = Nomenclatural Status Type\r
+page.name.7 = Name Relationship Type\r
+page.name.8 = Taxon Relationship Type\r
+page.name.9 = Specimen Type Designation Status\r
+page.name.10 = Available Languages\r
+page.name.11 = Marker Types\r
+page.name.12 = Extension Types\r
+page.name.13 = Name Type Designation Status\r
+page.name.14 = Named Area Type\r
+page.name.15 = Matching (Experimental)\r
+page.name.16 = NonViralName Matching Strategy\r
+page.name.17 = Reference Matching Strategy\r
+page.name.18 = Team or Person Matching Strategy\r
+page.name.19 = Stage\r
+page.name.20 = Preservation Method\r
+page.name.21 = Feature Tree\r
+page.name.22 = Default Feature Trees\r
+page.name.23 = Language\r
+page.name.24 = Mobot Open Url\r
+page.name.25 = Type Designations\r
+view.name = Datasource\r
+view.name.0 = Progress\r
+view.name.1 = Message\r
+view.name.2 = Reporting\r
+view.name.3 = Supplemental Data\r
+view.name.4 = Details\r
+view.name.5 = Use Records\r
+view.name.6 = Derivate Search\r
+editor.name = Defined Term Editor\r
+menu.label = Show View\r
+command.label = Derivate Search\r
+command.label.0 = Details\r
+command.label.1 = Supplemental\r
+command.label.2 = Datasource\r
+command.label.3 = Messages\r
+command.label.4 = Reporting\r
+command.label.5 = Switch User\r
+command.label.6 = Connect\r
+command.label.7 = New\r
+command.label.8 = Edit\r
+command.label.9 = Delete\r
+command.label.10 = Close Active Connection\r
+command.label.11 = Update Datamodel\r
+menu.label.0 = New\r
+command.label.12 = Vocabulary\r
+command.label.13 = Defined Term\r
+command.label.14 = Delete\r
+extension.name = Popup Menu Commands\r
+command.name = Connect Datasource\r
+command.name.0 = Edit Datasource\r
+command.name.1 = Create Datasource\r
+command.name.2 = Close Active Connection\r
+command.name.3 = Update Datasource\r
+command.name.4 = Show Login Window\r
+command.name.5 = Open Defined Term Editor\r
+commandParameter.name = inputType\r
+commandParameter.name.0 = inputType\r
+command.name.6 = New Defined Term\r
+command.name.7 = New Term Vocabulary\r
+category.name = CDM\r
+wizard.name = TCS\r
+wizard.name.0 = Berlin Model\r
+wizard.name.1 = Endnote\r
+wizard.name.2 = Excel Normal Explicit Taxa\r
+wizard.name.3 = ABCD\r
+wizard.name.4 = SDD\r
+wizard.name.5 = Specimen CDM Excel\r
+category.name.0 = CDM\r
+wizard.name.6 = JAXB\r
+wizard.name.7 = Berlin Model\r
+category.name.1 = Excel\r
+wizard.name.8 = SDD\r
+wizard.name.9 = DwC-A\r
+wizard.name.10 = Reference\r
+wizard.name.11 = Name\r
+wizard.name.12 = Team\r
+wizard.name.13 = Person\r
+wizard.name.14 = Specimen\r
+wizard.name.15 = Polytomous Key\r
+category.name.2 = CDM\r
+wizard.name.16 = Taxon\r
+wizard.name.17 = Classification\r
+themeElementCategory.label = Taxonomic Editor\r
+themeElementCategory.description = Color and font definitions for the EDIT Taxonomic Editor\r
+colorDefinition.label = List Background\r
+colorDefinition.label.0 = Global Text Color\r
+colorDefinition.label.1 = Global Color Composite Background\r
+colorDefinition.label.2 = Global Color Composite Irrelevant\r
+colorDefinition.label.3 = Global Text Color Disabled\r
+colorDefinition.label.4 = Global Background Color Disabled\r
+themeElementCategory.label.0 = Details View\r
+themeElementCategory.description.0 = Colors and fonts for the details view\r
+colorDefinition.label.5 = Entity Element List Background Odd\r
+colorDefinition.label.6 = Entity Element List Background Even\r
+themeElementCategory.label.1 = Name Editor\r
+themeElementCategory.description.1 = Colors and fonts for the name editor\r
+colorDefinition.label.7 = Container Background\r
+colorDefinition.label.8 = Container Selected Focus\r
+colorDefinition.label.9 = Container Selected\r
+colorDefinition.label.10 = Container Drag Enter\r
+fontDefinition.label = Accepted Taxon Font\r
+fontDefinition.label.0 = Synonym Font\r
+fontDefinition.label.1 = Misapplication Font\r
+fontDefinition.label.2 = Concept Font\r
+fontDefinition.label.3 = Default Font\r
+themeElementCategory.label.2 = Search View\r
+themeElementCategory.description.2 = Colors and fonts for the search view\r
+colorDefinition.label.11 = Search View Foreground\r
+colorDefinition.label.12 = Search View Focus\r
+fontDefinition.label.4 = Accepted font\r
+fontDefinition.description = The font that is used for accepted taxa in the search result list.\r
+fontDefinition.label.5 = Synonym font\r
+fontDefinition.description.0 = The font that is used for synonyms in the search result list.\r
+fontDefinition.label.6 = Other font\r
+fontDefinition.description.1 = The font used by default in the search result list.\r
+colorDefinition.label.13 = Parse Error\r
+colorDefinition.label.14 = Disabled Name Editor Field\r
+colorDefinition.label.15 = Editor On Error
\ No newline at end of file
--- /dev/null
+#Properties file for eu.etaxonomy.taxeditor.store, German
+page.name = Taxonomischer Editor
+page.name.0 = Beschreibung
+page.name.1 = Merkmal
+page.name.2 = Verbreitungsstatus
+page.name.3 = Taxonomisch
+page.name.4 = Nomenklaturcode
+page.name.5 = R\u00e4nge
+page.name.6 = Nomenklaturstatus Typ
+page.name.7 = Beziehungstyp Name
+page.name.8 = Beziehungstyp Taxon
+page.name.9 = Belegtyp Bezeichnungsstatus
+page.name.10 = Verf\u00fcgbare Sprachen
+page.name.11 = Markertypen
+page.name.12 = Erweiterungstypen
+page.name.13 = Namenstyp Bezeichnungsstatus
+page.name.14 = Benannte Gebiete
+page.name.15 = Matching (Experimental)
+page.name.16 = NonViralName Matching Strategie
+page.name.17 = Referenz Matching Strategie
+page.name.18 = Team oder Person Matching Strategie
+page.name.19 = Stufe (Stage)
+page.name.20 = Erhaltungs-(Preservation) Methode
+page.name.21 = Merkmalsbaum
+page.name.22 = Standard Merkmalsbaum
+page.name.23 = Sprache
+page.name.24 = Mobot Open Url
+page.name.25 = Typ Bezeichnungen
+view.name = Datenquelle
+view.name.0 = Fortschritt
+view.name.1 = Nachrichten
+view.name.2 = Berichte
+view.name.3 = Zusatzdaten
+view.name.4 = Details
+view.name.5 = Benutze Datensatz
+view.name.6 = Suche Derivate
+editor.name = Editor f\u00fcr definierte Begriffe
+menu.label = Zeige Ansicht
+command.label = Derivatsuche
+command.label.0 = Details
+command.label.1 = Zusatz
+command.label.2 = Datenquelle
+command.label.3 = Fehlermeldungen
+command.label.4 = Berichte
+command.label.5 = Benutzer wechseln
+command.label.6 = Verbinden
+command.label.7 = Neu
+command.label.8 = Bearbeiten
+command.label.9 = L\u00f6schen
+command.label.10 = Schlie\u00dfe aktive Verbindung
+command.label.11 = Aktualisiere Datenmodel
+menu.label.0 = Neu
+command.label.12 = Vokabular
+command.label.13 = Definierter Begriff
+command.label.14 = L\u00f6schen
+extension.name = Popup Men\u00fc Befehle
+command.name = Verbinde Datenquelle
+command.name.0 = Bearbeite Datenquelle
+command.name.1 = Erstelle Datenquelle
+command.name.2 = Schie\u00dfe aktive Verbindungen
+command.name.3 = Aktualisiere Datenquellen
+command.name.4 = Zeige Login Window
+command.name.5 = \u00d6ffne Editor f\u00fcr definierte Begriffe
+commandParameter.name = inputTyp
+commandParameter.name.0 = inputTyp
+command.name.6 = Neuer definierter Begriff
+command.name.7 = Neues Begriffsvokabular
+category.name = CDM
+wizard.name = TCS
+wizard.name.0 = Berlin Modell
+wizard.name.1 = Endnote
+wizard.name.2 = Excel Normal Explicit Taxa
+wizard.name.3 = ABCD
+wizard.name.4 = SDD
+wizard.name.5 = Beleg CDM Excel
+category.name.0 = CDM
+wizard.name.6 = JAXB
+wizard.name.7 = Berlin Model
+category.name.1 = Excel
+wizard.name.8 = SDD
+wizard.name.9 = DwC-A
+wizard.name.10 = Referenz
+wizard.name.11 = Name
+wizard.name.12 = Team
+wizard.name.13 = Person
+wizard.name.14 = Beleg
+wizard.name.15 = Polytomous Key
+category.name.2 = CDM
+wizard.name.16 = Taxon
+wizard.name.17 = Klassifikation
+themeElementCategory.label = Taxonomischer Editor
+themeElementCategory.description = Farb- und Schriftdefinitionen f\u00fcr den EDIT Taxonomischen Editor
+colorDefinition.label = Liste Hintergrund
+colorDefinition.label.0 = Globale Textfarbe
+colorDefinition.label.1 = Globale Farbe Composite Hintergrund
+colorDefinition.label.2 = Globale Composite Farbe irrelevant
+colorDefinition.label.3 = Globale Textfarbe gesperrt
+colorDefinition.label.4 = Globale Hintergrundfarbe gesperrt
+themeElementCategory.label.0 = Ansicht Details
+themeElementCategory.description.0 = Farben und Schriften f\u00fcr die Detailansicht
+colorDefinition.label.5 = Entity Element List Background Odd
+colorDefinition.label.6 = Entity Element List Background Even
+themeElementCategory.label.1 = Namenseditor
+themeElementCategory.description.1 = Farben und Schriften f\u00fcr den Namenseditor
+colorDefinition.label.7 = Container Hintergrund
+colorDefinition.label.8 = Container ausgew\u00e4hlter Fokus
+colorDefinition.label.9 = Container ausgew\u00e4hlt
+colorDefinition.label.10 = Container Drag Enter
+fontDefinition.label = Schrift akzeptiertes Taxon
+fontDefinition.label.0 = Schrift Synonyme
+fontDefinition.label.1 = Schrift Fehlanwendungen
+fontDefinition.label.2 = Schrift Konzepte
+fontDefinition.label.3 = Schrift Normal
+themeElementCategory.label.2 = Suche Ansicht
+themeElementCategory.description.2 = Farben und Schriften f\u00fcr die Suchansicht
+colorDefinition.label.11 = Suche Ansicht Fordergrund
+colorDefinition.label.12 = Suche Ansicht Fokus
+fontDefinition.label.4 = Schrift f\u00fcr Akzeptierte
+fontDefinition.description = Die Schrift f\u00fcr akzeptierte Taxa in den Suchergebnissen.
+fontDefinition.label.5 = Synonymschrift
+fontDefinition.description.0 = Die Schrift f\u00fcr Synonyme in den Suchergebnissen.
+fontDefinition.label.6 = Andere Schrift
+fontDefinition.description.1 = Die Schrift die normalerweise in den Suchergebnissen benutzt wird.
+colorDefinition.label.13 = Fehler beim Parsing
+colorDefinition.label.14 = Gesperrtes Namenseditierfeld
+colorDefinition.label.15 = Editor fehlerhaft
--- /dev/null
+#Properties file for eu.etaxonomy.taxeditor.store\r
+page.name = Taxonomic Editor\r
+page.name.0 = Description\r
+page.name.1 = Features\r
+page.name.2 = Distribution Status\r
+page.name.3 = Taxonomic\r
+page.name.4 = Nomenclatural Code\r
+page.name.5 = Ranks\r
+page.name.6 = Nomenclatural Status Type\r
+page.name.7 = Name Relationship Type\r
+page.name.8 = Taxon Relationship Type\r
+page.name.9 = Specimen Type Designation Status\r
+page.name.10 = Available Languages\r
+page.name.11 = Marker Types\r
+page.name.12 = Extension Types\r
+page.name.13 = Name Type Designation Status\r
+page.name.14 = Named Area Type\r
+page.name.15 = Matching (Experimental)\r
+page.name.16 = NonViralName Matching Strategy\r
+page.name.17 = Reference Matching Strategy\r
+page.name.18 = Team or Person Matching Strategy\r
+page.name.19 = Stage\r
+page.name.20 = Preservation Method\r
+page.name.21 = Feature Tree\r
+page.name.22 = Default Feature Trees\r
+page.name.23 = Language\r
+page.name.24 = Mobot Open Url\r
+page.name.25 = Type Designations\r
+view.name = Datasource\r
+view.name.0 = Progress\r
+view.name.1 = Message\r
+view.name.2 = Reporting\r
+view.name.3 = Supplemental Data\r
+view.name.4 = Details\r
+view.name.5 = Use Records\r
+view.name.6 = Derivate Search\r
+editor.name = Defined Term Editor\r
+menu.label = Show View\r
+command.label = Derivate Search\r
+command.label.0 = Details\r
+command.label.1 = Supplemental\r
+command.label.2 = Datasource\r
+command.label.3 = Messages\r
+command.label.4 = Reporting\r
+command.label.5 = Switch User\r
+command.label.6 = Connect\r
+command.label.7 = New\r
+command.label.8 = Edit\r
+command.label.9 = Delete\r
+command.label.10 = Close Active Connection\r
+command.label.11 = Update Datamodel\r
+menu.label.0 = New\r
+command.label.12 = Vocabulary\r
+command.label.13 = Defined Term\r
+command.label.14 = Delete\r
+extension.name = Popup Menu Commands\r
+command.name = Connect Datasource\r
+command.name.0 = Edit Datasource\r
+command.name.1 = Create Datasource\r
+command.name.2 = Close Active Connection\r
+command.name.3 = Update Datasource\r
+command.name.4 = Show Login Window\r
+command.name.5 = Open Defined Term Editor\r
+commandParameter.name = inputType\r
+commandParameter.name.0 = inputType\r
+command.name.6 = New Defined Term\r
+command.name.7 = New Term Vocabulary\r
+category.name = CDM\r
+wizard.name = TCS\r
+wizard.name.0 = Berlin Model\r
+wizard.name.1 = Endnote\r
+wizard.name.2 = Excel Normal Explicit Taxa\r
+wizard.name.3 = ABCD\r
+wizard.name.4 = SDD\r
+wizard.name.5 = Specimen CDM Excel\r
+category.name.0 = CDM\r
+wizard.name.6 = JAXB\r
+wizard.name.7 = Berlin Model\r
+category.name.1 = Excel\r
+wizard.name.8 = SDD\r
+wizard.name.9 = DwC-A\r
+wizard.name.10 = Reference\r
+wizard.name.11 = Name\r
+wizard.name.12 = Team\r
+wizard.name.13 = Person\r
+wizard.name.14 = Specimen\r
+wizard.name.15 = Polytomous Key\r
+category.name.2 = CDM\r
+wizard.name.16 = Taxon\r
+wizard.name.17 = Classification\r
+themeElementCategory.label = Taxonomic Editor\r
+themeElementCategory.description = Color and font definitions for the EDIT Taxonomic Editor\r
+colorDefinition.label = List Background\r
+colorDefinition.label.0 = Global Text Color\r
+colorDefinition.label.1 = Global Color Composite Background\r
+colorDefinition.label.2 = Global Color Composite Irrelevant\r
+colorDefinition.label.3 = Global Text Color Disabled\r
+colorDefinition.label.4 = Global Background Color Disabled\r
+themeElementCategory.label.0 = Details View\r
+themeElementCategory.description.0 = Colors and fonts for the details view\r
+colorDefinition.label.5 = Entity Element List Background Odd\r
+colorDefinition.label.6 = Entity Element List Background Even\r
+themeElementCategory.label.1 = Name Editor\r
+themeElementCategory.description.1 = Colors and fonts for the name editor\r
+colorDefinition.label.7 = Container Background\r
+colorDefinition.label.8 = Container Selected Focus\r
+colorDefinition.label.9 = Container Selected\r
+colorDefinition.label.10 = Container Drag Enter\r
+fontDefinition.label = Accepted Taxon Font\r
+fontDefinition.label.0 = Synonym Font\r
+fontDefinition.label.1 = Misapplication Font\r
+fontDefinition.label.2 = Concept Font\r
+fontDefinition.label.3 = Default Font\r
+themeElementCategory.label.2 = Search View\r
+themeElementCategory.description.2 = Colors and fonts for the search view\r
+colorDefinition.label.11 = Search View Foreground\r
+colorDefinition.label.12 = Search View Focus\r
+fontDefinition.label.4 = Accepted font\r
+fontDefinition.description = The font that is used for accepted taxa in the search result list.\r
+fontDefinition.label.5 = Synonym font\r
+fontDefinition.description.0 = The font that is used for synonyms in the search result list.\r
+fontDefinition.label.6 = Other font\r
+fontDefinition.description.1 = The font used by default in the search result list.\r
+colorDefinition.label.13 = Parse Error\r
+colorDefinition.label.14 = Disabled Name Editor Field\r
+colorDefinition.label.15 = Editor On Error
\ No newline at end of file
--- /dev/null
+CdmDataSourceViewPart_1=Loading datasources\r
+CdmDataSourceViewPart_10=Server\r
+CdmDataSourceViewPart_11=Name\r
+CdmDataSourceViewPart_12=Connected\r
+CdmDataSourceViewPart_2=Notes\r
+CdmDataSourceViewPart_3=Compatible\r
+CdmDataSourceViewPart_4=CDM Version\r
+CdmDataSourceViewPart_5=Created\r
+CdmDataSourceViewPart_6=Nomenclatural Code\r
+CdmDataSourceViewPart_7=Database\r
+CdmDataSourceViewPart_8=Type\r
+CdmDataSourceViewPart_9=Up\r
--- /dev/null
+CdmDataSourceViewPart_1=Datenquelle wird geladen\r
+CdmDataSourceViewPart_10=Server\r
+CdmDataSourceViewPart_11=Name\r
+CdmDataSourceViewPart_12=Verbunden\r
+CdmDataSourceViewPart_2=Notizen\r
+CdmDataSourceViewPart_3=Kompatibel\r
+CdmDataSourceViewPart_4=CDM Version\r
+CdmDataSourceViewPart_5=Erstellt\r
+CdmDataSourceViewPart_6=Nomenklaturcode\r
+CdmDataSourceViewPart_7=Datenquelle\r
+CdmDataSourceViewPart_8=Typ\r
+CdmDataSourceViewPart_9=Verf\u00FCgbar\r
--- /dev/null
+CdmDataSourceViewPart_1=Loading datasources\r
+CdmDataSourceViewPart_10=Server\r
+CdmDataSourceViewPart_11=Name\r
+CdmDataSourceViewPart_12=Connected\r
+CdmDataSourceViewPart_2=Notes\r
+CdmDataSourceViewPart_3=Compatible\r
+CdmDataSourceViewPart_4=CDM Version\r
+CdmDataSourceViewPart_5=Created\r
+CdmDataSourceViewPart_6=Nomenclatural Code\r
+CdmDataSourceViewPart_7=Database\r
+CdmDataSourceViewPart_8=Type\r
+CdmDataSourceViewPart_9=Up\r
.,\
plugin.xml,\
icons/,\
- p2.inf
+ p2.inf,\
+ OSGI-INF/
+
<page
class="eu.etaxonomy.taxeditor.preference.TaxonomicEditorGeneralPreferences"
id="eu.etaxonomy.taxeditor.preferences.general"
- name="Taxonomic Editor">
+ name="%page.name">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.DescriptionPreferences"
id="eu.etaxonomy.taxeditor.preferences.description"
- name="Description">
+ name="%page.name.0">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.description"
class="eu.etaxonomy.taxeditor.preference.menu.FeatureMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.feature"
- name="Features">
+ name="%page.name.1">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.description"
class="eu.etaxonomy.taxeditor.preference.menu.PresenceAbsenceMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.distributionStatus"
- name="Distribution Status">
+ name="%page.name.2">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.TaxonomicPreferences"
id="eu.etaxonomy.taxeditor.preferences.taxonomic"
- name="Taxonomic">
+ name="%page.name.3">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.taxonomic"
class="eu.etaxonomy.taxeditor.preference.NomenclaturalCodePreferences"
id="eu.etaxonomy.taxeditor.preferences.nomenclatural"
- name="Nomenclatural Code">
+ name="%page.name.4">
</page>
<!--page
class="eu.etaxonomy.taxeditor.store.preference.CdmPreferences"
category="eu.etaxonomy.taxeditor.preferences.taxonomic"
class="eu.etaxonomy.taxeditor.preference.menu.RankMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.ranks"
- name="Ranks">
+ name="%page.name.5">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.taxonomic"
class="eu.etaxonomy.taxeditor.preference.menu.NomenclaturalStatusTypeMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.nomenclaturalStatusType"
- name="Nomenclatural Status Type">
+ name="%page.name.6">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.taxonomic"
class="eu.etaxonomy.taxeditor.preference.menu.NameRelationshipTypeMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.nameRelationshipType"
- name="Name Relationship Type">
+ name="%page.name.7">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.taxonomic"
class="eu.etaxonomy.taxeditor.preference.menu.TaxonRelationshipTypeMenuPreferences"
id="taxeditor-store.page1"
- name="Taxon Relationship Type">
+ name="%page.name.8">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.taxonomic"
class="eu.etaxonomy.taxeditor.preference.menu.SpecimenTypeDesignationStatusMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.specimenTypeDesignationStatus"
- name="Specimen Type Designation Status">
+ name="%page.name.9">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.language"
class="eu.etaxonomy.taxeditor.preference.menu.LanguageMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.languages"
- name="Available Languages">
+ name="%page.name.10">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.menu.MarkerTypeMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.markerTypes"
- name="Marker Types">
+ name="%page.name.11">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.menu.ExtensionTypeMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.extensionTypes"
- name="Extension Types">
+ name="%page.name.12">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.taxonomic"
class="eu.etaxonomy.taxeditor.preference.menu.NameTypeDesignationStatusMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.nameTypeDesignationStatus"
- name="Name Type Designation Status">
+ name="%page.name.13">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.description"
class="eu.etaxonomy.taxeditor.preference.menu.NamedAreaTypeMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.namedAreaType"
- name="Named Area Type">
+ name="%page.name.14">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.MatchingPreferences"
id="eu.etaxonomy.taxeditor.preferences.matching"
- name="Matching (Experimental)">
+ name="%page.name.15">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.matching"
class="eu.etaxonomy.taxeditor.preference.matching.NonViralNameMatchingPreference"
id="eu.etaxonomy.taxeditor.preferences.matching.nonViralName"
- name="NonViralName Matching Strategy">
+ name="%page.name.16">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.matching"
class="eu.etaxonomy.taxeditor.preference.matching.ReferenceMatchingPreference"
id="eu.etaxonomy.taxeditor.preferences.matching"
- name="Reference Matching Strategy">
+ name="%page.name.17">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.matching"
class="eu.etaxonomy.taxeditor.preference.matching.TeamOrPersonMatchingPreference"
id="eu.etaxonomy.taxeditor.preferences.matching"
- name="Team or Person Matching Strategy">
+ name="%page.name.18">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.description"
class="eu.etaxonomy.taxeditor.preference.menu.StageMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.stage"
- name="Stage">
+ name="%page.name.19">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.description"
class="eu.etaxonomy.taxeditor.preference.menu.PreservationMethodMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.preservationMethod"
- name="Preservation Method">
+ name="%page.name.20">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.feature"
class="eu.etaxonomy.taxeditor.preference.FeatureTreePreferences"
id="eu.etaxonomy.taxeditor.preferences.featureTree"
- name="Feature Tree">
+ name="%page.name.21">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.feature"
class="eu.etaxonomy.taxeditor.preference.DefaultFeatureTreePreferenecs"
id="eu.etaxonomy.taxeditor.preferences.defaultFeatureTreePreferenecs"
- name="Default Feature Trees">
+ name="%page.name.22">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.LanguagePreferencePage"
id="eu.etaxonomy.taxeditor.preferences.language"
- name="Language">
+ name="%page.name.23">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.MobotOpenUrlPreferences"
id="eu.etaxonomy.taxeditor.preferences.mobotOpenUrl"
- name="Mobot Open Url">
+ name="%page.name.24">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.TypeDesignationPreferences"
id="eu.etaxonomy.taxeditor.preferences.typeDesignation"
- name="Type Designations">
+ name="%page.name.25">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
id="eu.etaxonomy.taxeditor.preference.SpecimenOrObservationPreferences"
name="Specimens and FieldUnits">
</page>
+ <page
+ category="eu.etaxonomy.taxeditor.preferences.general"
+ class="eu.etaxonomy.taxeditor.preference.ChecklistEditorGeneralPreference"
+ id="eu.etaxonomy.taxeditor.preference.ChecklistEditorGeneralPreferencePage"
+ name="Checklist Editor">
+ </page>
+ <page
+ category="eu.etaxonomy.taxeditor.preferences.general"
+ class="eu.etaxonomy.taxeditor.preference.TemplatePreferencePage"
+ id="eu.etaxonomy.taxeditor.preference.TemplatePreferencePage"
+ name="Editor Profile">
+ </page>
</extension>
<extension
point="org.eclipse.ui.views">
class="eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart"
icon="icons/system-file-manager.png"
id="eu.etaxonomy.taxeditor.view.datasource"
- name="Datasource"
+ name="%view.name"
restorable="true">
</view>
<view
- name="Progress View"
+ name="%view.name.0"
category="org.eclipse.ui"
class="org.eclipse.ui.ExtensionFactory:progressView"
id="org.eclipse.ui.views.ProgressView">
</view>
<view
- name="Message View"
+ name="%view.name.1"
icon="icons/console.gif"
category="org.eclipse.ui"
class="org.eclipse.ui.ExtensionFactory:logView"
<view
class="eu.etaxonomy.taxeditor.view.reporting.ReportingViewPart"
id="eu.etaxonomy.taxeditor.reporting.viewPart"
- name="Reporting"
+ name="%view.name.2"
restorable="true">
</view>
<view
class="eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart"
icon="icons/applications-office.png"
id="eu.etaxonomy.taxeditor.view.supplementalData"
- name="Supplemental Data"
+ name="%view.name.3"
restorable="true">
</view>
<view
class="eu.etaxonomy.taxeditor.view.detail.DetailsViewPart"
icon="icons/accessories-text-editor.png"
id="eu.etaxonomy.taxeditor.view.detail"
- name="Details"
+ name="%view.name.4"
restorable="true">
</view>
<view
class="eu.etaxonomy.taxeditor.view.userecords.UseRecordsViewPart"
icon="icons/leaf_detail.png"
id="eu.etaxonomy.taxeditor.view.userecords"
- name="Use Records"
+ name="%view.name.5"
restorable="true">
</view>
<view
class="eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView"
icon="icons/derivate_search_view-16x16-32.png"
id="eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView"
- name="Derivate Search"
+ name="%view.name.6"
restorable="true">
</view>
</extension>
class="eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor"
default="false"
id="eu.etaxonomy.taxeditor.editor.definedTerm"
- name="Defined Term Editor">
+ name="%editor.name">
</editor>
</extension>
<extension
locationURI="menu:org.eclipse.ui.main.menu.window?before=eu.etaxonomy.taxeditor.application.windowMenu.last">
<menu
id="eu.etaxonomy.taxeditor.menu.showView"
- label="Show View">
+ label="%menu.label">
<command
commandId="org.eclipse.ui.views.showView"
- label="Derivate Search View"
+ label="%command.label"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
</separator>
<command
commandId="org.eclipse.ui.views.showView"
- label="Details"
+ label="%command.label.0"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
</command>
<command
commandId="org.eclipse.ui.views.showView"
- label="Supplemental"
+ label="%command.label.1"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
</separator>
<command
commandId="org.eclipse.ui.views.showView"
- label="Datasource"
+ label="%command.label.2"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
</command>
<command
commandId="org.eclipse.ui.views.showView"
- label="Messages"
+ label="%command.label.3"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
</command>
<command
commandId="org.eclipse.ui.views.showView"
- label="Reporting"
+ label="%command.label.4"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
locationURI="menu:org.eclipse.ui.main.menu.file?after=eu.etaxonomy.taxeditor.application.filemenu.io">
<command
commandId="eu.etaxonomy.taxeditor.store.operations.showLoginWindow"
- label="Switch User"
- style="push">
- </command>
- <command
- commandId="eu.etaxonomy.taxeditor.store.openPasswordWizzard"
- label="Change Password"
+ label="%command.label.5"
style="push">
</command>
<separator
locationURI="popup:eu.etaxonomy.taxeditor.view.datasource">
<command
commandId="eu.etaxonomy.taxeditor.store.datasource.change"
- label="Connect"
+ label="%command.label.6"
style="push">
<visibleWhen>
<with
</command>
<command
commandId="eu.etaxonomy.taxeditor.store.datasource.create"
- label="New"
+ label="%command.label.7"
style="push">
</command>
<command
commandId="eu.etaxonomy.taxeditor.store.datasource.edit"
- label="Edit"
+ label="%command.label.8"
style="push">
<visibleWhen>
<with
</separator>
<command
commandId="org.eclipse.ui.edit.delete"
- label="Delete"
+ label="%command.label.9"
style="push">
<visibleWhen>
<with
</separator>
<command
commandId="eu.etaxonomy.taxeditor.store.datasource.close"
- label="Close Active Connection"
+ label="%command.label.10"
style="push">
<visibleWhen>
<with
</command>
<command
commandId="eu.etaxonomy.taxeditor.store.datasource.update"
- label="Update Datamodel"
+ label="%command.label.11"
style="push">
<visibleWhen
checkEnabled="true">
<menuContribution
locationURI="popup:eu.etaxonomy.taxeditor.editor.definedTerm">
<menu
- label="New">
+ label="%menu.label.0">
<command
commandId="eu.etaxonomy.taxeditor.editor.definedTerms.newTermVocabulary"
- label="Vocabulary"
+ label="%command.label.12"
style="push">
</command>
<command
commandId="eu.etaxonomy.taxeditor.editor.definedTerms.newDefinedTerm"
- label="Defined Term"
+ label="%command.label.13"
style="push">
<visibleWhen
checkEnabled="true">
</menu>
<command
commandId="org.eclipse.ui.edit.delete"
- label="Delete"
+ label="%command.label.14"
style="push">
<visibleWhen
checkEnabled="true">
definitionId="isUserLoggedIn">
</reference></enabledWhen>
</handler>
+ <handler
+ class="eu.etaxonomy.taxeditor.handler.OpenDistributionEditorWizardHandler"
+ commandId="eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardHandler">
+ <activeWhen>
+ <reference
+ definitionId="hasROLE_PROJECT_MANAGER">
+ </reference>
+ </activeWhen>
+ </handler>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.ChangeConnectionHandler"
id="eu.etaxonomy.taxeditor.store.datasource.change"
- name="Connect Datasource">
+ name="%command.name">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.EditDataSourceHandler"
id="eu.etaxonomy.taxeditor.store.datasource.edit"
- name="Edit Datasource">
+ name="%command.name.0">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.CloneDataSourceHandler"
<command
defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.CreateDataSourceHandler"
id="eu.etaxonomy.taxeditor.store.datasource.create"
- name="Create Datasource">
+ name="%command.name.1">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.CloseConnectionHandler"
id="eu.etaxonomy.taxeditor.store.datasource.close"
- name="Close Active Connection">
+ name="%command.name.2">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.UpdateDataSourceHandler"
id="eu.etaxonomy.taxeditor.store.datasource.update"
- name="Update Datasource">
+ name="%command.name.3">
</command>
<command
id="eu.etaxonomy.taxeditor.store.operations.showLoginWindow"
- name="Show Login Window">
+ name="%command.name.4">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.editor.definedterm.handler.OpenDefinedTermEditorHandler"
id="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
- name="Open Defined Term Editor">
+ name="%command.name.5">
<commandParameter
id="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid"
- name="inputType"
+ name="%commandParameter.name.0"
optional="true">
</commandParameter>
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.editor.definedterm.handler.CreateDefinedTermHandler"
id="eu.etaxonomy.taxeditor.editor.definedTerms.newDefinedTerm"
- name="New Defined Term">
+ name="%command.name.6">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.editor.definedterm.handler.CreateTermVocabularyHandler"
id="eu.etaxonomy.taxeditor.editor.definedTerms.newTermVocabulary"
- name="New Term Vocabulary">
+ name="%command.name.7">
</command>
<command
id="eu.etaxonomy.taxeditor.store.open.FeatureTreeEditorWizard"
id="eu.etaxonomy.taxeditor.store.openPasswordWizzard"
name="Open Password Wizzard">
</command>
+ <command
+ id="eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardHandler"
+ name="Open Distribution Editor Wizard">
+ </command>
</extension>
<extension
point="org.eclipse.ui.importWizards">
<category
id="eu.etaxonomy.taxeditor.import.category.cdm"
- name="CDM">
+ name="%category.name">
</category>
<wizard
category="eu.etaxonomy.taxeditor.import.category.cdm"
class="eu.etaxonomy.taxeditor.io.wizard.TcsImportWizard"
id="eu.etaxonomy.taxeditor.io.import.tcs"
- name="TCS">
+ name="%wizard.name">
</wizard>
<!-- <wizard
category="eu.etaxonomy.taxeditor.import.category.cdm"
category="eu.etaxonomy.taxeditor.import.category.cdm"
class="eu.etaxonomy.taxeditor.io.wizard.BerlinModelImportWizard"
id="eu.etaxonomy.taxeditor.io.import.berlinModel"
- name="Berlin Model">
+ name="%wizard.name.0">
</wizard>
<wizard
category="eu.etaxonomy.taxeditor.import.category.cdm"
class="eu.etaxonomy.taxeditor.io.wizard.EndnoteImportWizard"
id="eu.etaxonomy.taxeditor.io.import.endnote"
- name="Endnote">
+ name="%wizard.name.1">
</wizard>-->
<wizard
category="eu.etaxonomy.taxeditor.import.category.cdm"
class="eu.etaxonomy.taxeditor.io.wizard.ExcelNormalExplicitTaxaImportWizard"
id="eu.etaxonomy.taxeditor.io.import.excel.taxa"
- name="Excel Normal Explicit Taxa">
+ name="%wizard.name.2">
</wizard>
<wizard
category="eu.etaxonomy.taxeditor.import.category.cdm"
class="eu.etaxonomy.taxeditor.io.wizard.AbcdImportWizard"
id="eu.etaxonomy.taxeditor.io.import.abcd"
- name="ABCD">
+ name="%wizard.name.3">
</wizard>
<wizard
category="eu.etaxonomy.taxeditor.import.category.cdm"
class="eu.etaxonomy.taxeditor.io.wizard.SddImportWizard"
id="eu.etaxonomy.taxeditor.io.import.sdd"
- name="SDD">
+ name="%wizard.name.4">
</wizard>
<wizard
category="eu.etaxonomy.taxeditor.import.category.cdm"
class="eu.etaxonomy.taxeditor.io.wizard.SpecimenCdmExcelImportWizard"
id="eu.etaxonomy.taxeditor.io.import.specimenCdmExcel"
- name="Specimen CDM Excel">
+ name="%wizard.name.5">
</wizard>
</extension>
<extension
point="org.eclipse.ui.exportWizards">
<category
id="eu.etaxonomy.taxeditor.export.category.cdm"
- name="CDM">
+ name="%category.name.0">
</category>
<wizard
category="eu.etaxonomy.taxeditor.export.category.cdm"
class="eu.etaxonomy.taxeditor.io.wizard.JaxbExportWizard"
id="eu.etaxonomy.taxeditor.io.export.jaxb"
- name="JAXB">
+ name="%wizard.name.6">
</wizard>
<!--<wizard
category="eu.etaxonomy.taxeditor.export.category.cdm"
class="eu.etaxonomy.taxeditor.io.wizard.BerlinModelExportWizard"
id="eu.etaxonomy.taxeditor.io.export.berlinModel"
- name="Berlin Model">
+ name="%wizard.name.7">
</wizard>-->
<category
id="eu.etaxonomy.taxeditor.export.category.excel"
- name="Excel">
+ name="%category.name.1">
</category>
<wizard
category="eu.etaxonomy.taxeditor.export.category.cdm"
class="eu.etaxonomy.taxeditor.io.wizard.SddExportWizard"
id="eu.etaxonomy.taxeditor.io.export.sdd"
- name="SDD">
+ name="%wizard.name.8">
</wizard>
<wizard
category="eu.etaxonomy.taxeditor.export.category.cdm"
class="eu.etaxonomy.taxeditor.io.wizard.DarwinCoreArchiveExportWizard"
id="eu.etaxonomy.taxeditor.io.export.dwca"
- name="DwC-A">
+ name="%wizard.name.9">
</wizard>
</extension>
<extension
class="eu.etaxonomy.taxeditor.newWizard.NewReferenceWizard"
hasPages="true"
id="eu.etaxonomy.taxeditor.new.reference"
- name="Reference">
+ name="%wizard.name.10">
</wizard>
<wizard
category="eu.etaxonomy.taxeditor.new.category.cdm"
class="eu.etaxonomy.taxeditor.newWizard.NewNonViralNameWizard"
hasPages="true"
id="eu.etaxonomy.taxeditor.new.nonViralName"
- name="Name">
+ name="%wizard.name.11">
</wizard>
<wizard
category="eu.etaxonomy.taxeditor.new.category.cdm"
class="eu.etaxonomy.taxeditor.newWizard.NewTeamWizard"
hasPages="true"
id="eu.etaxonomy.taxeditor.new.team"
- name="Team">
+ name="%wizard.name.12">
</wizard>
<wizard
category="eu.etaxonomy.taxeditor.new.category.cdm"
class="eu.etaxonomy.taxeditor.newWizard.NewPersonWizard"
hasPages="true"
id="eu.etaxonomy.taxeditor.new.person"
- name="Person">
+ name="%wizard.name.13">
</wizard>
<wizard
category="eu.etaxonomy.taxeditor.new.category.cdm"
class="eu.etaxonomy.taxeditor.newWizard.NewDerivedUnitBaseWizard"
hasPages="true"
id="eu.etaxonomy.taxeditor.new.specimen"
- name="Specimen">
+ name="%wizard.name.14">
</wizard>
<wizard
category="eu.etaxonomy.taxeditor.new.category.cdm"
class="eu.etaxonomy.taxeditor.newWizard.NewPolytomousKeyWizard"
hasPages="true"
id="eu.etaxonomy.taxeditor.new.key.polytomous"
- name="Polytomous Key">
+ name="%wizard.name.15">
</wizard>
<category
id="eu.etaxonomy.taxeditor.new.category.cdm"
- name="CDM">
+ name="%category.name.2">
</category>
<wizard
category="eu.etaxonomy.taxeditor.new.category.cdm"
class="eu.etaxonomy.taxeditor.newWizard.NewTaxonNodeWizard"
hasPages="true"
id="eu.etaxonomy.taxeditor.new.taxonNode"
- name="Taxon">
+ name="%wizard.name.16">
</wizard>
<wizard
category="eu.etaxonomy.taxeditor.new.category.cdm"
hasPages="true"
icon="icons/tree_icon_small.jpg"
id="eu.etaxonomy.taxeditor.new.classification"
- name="Classification">
+ name="%wizard.name.17">
</wizard>
</extension>
<extension
point="org.eclipse.ui.themes">
<themeElementCategory
id="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
- label="Taxonomic Editor">
+ label="%themeElementCategory.label">
<description>
- Color and font definitions for the EDIT Taxonomic Editor
+ %themeElementCategory.description
</description>
</themeElementCategory>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.listBackground"
- label="List Background"
+ label="%colorDefinition.label"
value="150,150,150">
</colorDefinition>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.textDefault"
- label="Global Text Color"
+ label="%colorDefinition.label.0"
value="0,0,0">
</colorDefinition>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.colorCompositeBackground"
- label="Global Color Composite Background"
+ label="%colorDefinition.label.1"
value="255,255,255">
</colorDefinition>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.colorCompositeIrrelevant"
- label="Global Color Composite Irrelevant"
+ label="%colorDefinition.label.2"
value="241,139,18">
</colorDefinition>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.textDisabled"
- label="Global Text Color Disabled"
+ label="%colorDefinition.label.3"
value="150,150,150">
</colorDefinition>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.textBackgroundDisabled"
- label="Global Background Color Disabled"
+ label="%colorDefinition.label.4"
value="230,230,230">
</colorDefinition>
<themeElementCategory
id="eu.etaxonomy.taxeditor.preferences.themeElementCategory.detailsView"
- label="Details View"
+ label="%themeElementCategory.label.0"
parentId="eu.etaxonomy.taxeditor.preferences.themeElementCategory">
<description>
- Colors and fonts for the details view
+ %themeElementCategory.description.0
</description>
</themeElementCategory>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.detailsView"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.listBackgroundOdd"
- label="Entity Element List Background Odd"
+ label="%colorDefinition.label.5"
value="230,230,230">
</colorDefinition>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.detailsView"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.listBackgroundEven"
- label="Entity Element List Background Even"
+ label="%colorDefinition.label.6"
value="255,255,255">
</colorDefinition>
<themeElementCategory
id="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
- label="Name Editor"
+ label="%themeElementCategory.label.1"
parentId="eu.etaxonomy.taxeditor.preferences.themeElementCategory">
<description>
- Colors and fonts for the name editor
+ %themeElementCategory.description.1
</description>
</themeElementCategory>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.nameEditor.colorContainerBackground"
- label="Container Background"
+ label="%colorDefinition.label.7"
value="220, 220, 220">
</colorDefinition>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.nameEditor.colorContainerSelectedFocus"
- label="Container Selected Focus"
+ label="%colorDefinition.label.8"
value="232,242,254">
</colorDefinition>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.nameEditor.colorContainerSelected"
- label="Container Selected"
+ label="%colorDefinition.label.9"
value="210, 210, 210">
</colorDefinition>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.nameEditor.colorContainerDragEnter"
- label="Container Drag Enter"
+ label="%colorDefinition.label.10"
value="185,255,133">
</colorDefinition>
<fontDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
id="eu.etaxonomy.taxeditor.preferences.fontDefinition.nameEditor.accepted"
- label="Accepted Taxon Font"
+ label="%fontDefinition.label"
value="Georgia-regular-12">
</fontDefinition>
<fontDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
id="eu.etaxonomy.taxeditor.preferences.fontDefinition.nameEditor.synonym"
- label="Synonym Font"
+ label="%fontDefinition.label.0"
value="Georgia-regular-10">
</fontDefinition>
<fontDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
id="eu.etaxonomy.taxeditor.preferences.fontDefinition.nameEditor.misapplication"
- label="Misapplication Font"
+ label="%fontDefinition.label.1"
value="Georgia-regular-10">
</fontDefinition>
<fontDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
id="eu.etaxonomy.taxeditor.preferences.fontDefinition.nameEditor.concept"
- label="Concept Font"
+ label="%fontDefinition.label.2"
value="Georgia-regular-10">
</fontDefinition>
<fontDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
id="eu.etaxonomy.taxeditor.preferences.fontDefinition.nameEditor.default"
- label="Default Font"
+ label="%fontDefinition.label.3"
value="Georgia-regular-10">
</fontDefinition>
<themeElementCategory
id="eu.etaxonomy.taxeditor.preferences.themeElementCategory.searchView"
- label="Search View"
+ label="%themeElementCategory.label.2"
parentId="eu.etaxonomy.taxeditor.preferences.themeElementCategory">
<description>
- Colors and fonts for the search view
+ %themeElementCategory.description.2
</description>
</themeElementCategory>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.searchView"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.searchView.foreground"
- label="Search View Foreground"
+ label="%colorDefinition.label.11"
value="192, 192, 192">
</colorDefinition>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.searchView"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.searchView.focus"
- label="Search View Focus"
+ label="%colorDefinition.label.12"
value="0, 0, 0">
</colorDefinition>
<fontDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.searchView"
id="eu.etaxonomy.taxeditor.preferences.fontDefinition.searchView.accepted"
isEditable="true"
- label="Accepted font"
+ label="%fontDefinition.label.4"
value="Arial-regular-10">
<description>
- The font that is used for accepted taxa in the search result list.
+ %fontDefinition.description
</description>
</fontDefinition>
<fontDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.searchView"
id="eu.etaxonomy.taxeditor.preferences.fontDefinition.searchView.synonym"
isEditable="true"
- label="Synonym font"
+ label="%fontDefinition.label.5"
value="Arial-italic-10">
<description>
- The font that is used for synonyms in the search result list.
+ %fontDefinition.description.0
</description>
</fontDefinition>
<fontDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.searchView"
id="eu.etaxonomy.taxeditor.preferences.fontDefinition.searchView.other"
isEditable="true"
- label="Other font"
+ label="%fontDefinition.label.6"
value="Lucida Grande-regular-11">
<description>
- The font used by default in the search result list.
+ %fontDefinition.description.1
</description>
</fontDefinition>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.detailsView"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.parseError"
- label="Parse Error"
+ label="%colorDefinition.label.13"
value="255,0,0">
</colorDefinition>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.disabledEditor"
- label="Disabled Name Editor Field"
+ label="%colorDefinition.label.14"
value="105,114,124">
</colorDefinition>
<colorDefinition
categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
id="eu.etaxonomy.taxeditor.preferences.colorDefinition.editorError"
- label="Editor On Error"
+ label="%colorDefinition.label.15"
value="255,0,0">
</colorDefinition>
</extension>
import eu.etaxonomy.cdm.remote.CdmRemoteSourceException;
import eu.etaxonomy.cdm.remote.ICdmRemoteSource;
import eu.etaxonomy.taxeditor.model.MementoHelper;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
public class CdmDataSourceRepository{
try {
remoteSources.add(CdmPersistentDataSource.NewInstance(dataSource.getName()));
} catch (DataSourceNotFoundException e) {
- StoreUtil.error(CdmDataSourceRepository.class, "Could not find dataSource", e);
+ MessagingUtils.error(CdmDataSourceRepository.class, "Could not find dataSource", e);
}
}
remoteSources.add(remoteSource);
}
} catch (CdmRemoteSourceException e) {
- StoreUtil.error(CdmDataSourceRepository.class, "Error retrieving remote sources", e);
+ MessagingUtils.error(CdmDataSourceRepository.class, "Error retrieving remote sources", e);
}
// TODO sort by database name
return CdmPersistentDataSource.NewInstance(dataSource.getName());
}
} catch (DataSourceNotFoundException e) {
- StoreUtil.error(CdmDataSourceRepository.class, "Could not find dataSource", e);
+ MessagingUtils.error(CdmDataSourceRepository.class, "Could not find dataSource", e);
}
}
if( dataSourceNomenclaturalCode != null && ! dataSourceNomenclaturalCode.equals(applicationNomenclaturalCode)){
PreferencesUtil.setPreferredNomenclaturalCode(dataSourceNomenclaturalCode);
- StoreUtil.informationDialog("Nomenclatural Code Change", "The Datasource that was just " +
+ MessagingUtils.informationDialog("Nomenclatural Code Change", "The Datasource that was just " +
"loaded has a different nomenclatural code than the one stored in Preferences. " +
"The nomenclatural code was changed in the application.");
}
try {
return CdmPersistentDataSource.update(strCdmSourceName, cdmSource);
} catch (Exception e) {
- StoreUtil.error(CdmDataSourceRepository.class, "Error updating CDM Source", e);
+ MessagingUtils.error(CdmDataSourceRepository.class, "Error updating CDM Source", e);
}
return null;
}
try {
return CdmPersistentDataSource.replace(strCdmSourceName, cdmSource);
} catch (Exception e) {
- StoreUtil.error(CdmDataSourceRepository.class, "Error updating CDM Source", e);
+ MessagingUtils.error(CdmDataSourceRepository.class, "Error updating CDM Source", e);
}
return null;
}
try {
return CdmPersistentRemoteSource.update(strCdmSourceName, cdmSource);
} catch (Exception e) {
- StoreUtil.error(CdmDataSourceRepository.class, "Error updating CDM Source", e);
+ MessagingUtils.error(CdmDataSourceRepository.class, "Error updating CDM Source", e);
}
return null;
// $Id$\r
/**\r
* Copyright (C) 2009 EDIT\r
- * European Distributed Institute of Taxonomy \r
+ * European Distributed Institute of Taxonomy\r
* http://www.e-taxonomy.eu\r
- * \r
+ *\r
* The contents of this file are subject to the Mozilla Public License Version 1.1\r
* See LICENSE.TXT at the top of this package for the full license terms.\r
*/\r
public static final String ID = "eu.etaxonomy.taxeditor.editor.definedTerm";\r
\r
public static final String OPEN_COMMAND_ID = "eu.etaxonomy.taxeditor.store.openDefinedTermEditor";\r
- \r
+\r
protected TreeViewer viewer;\r
protected ConversationHolder conversation;\r
private ISelectionService selectionService;\r
\r
\r
\r
- private int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;\r
+ private final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;\r
/**\r
- * \r
+ *\r
*/\r
public DefinedTermEditor() {\r
super();\r
\r
@Override\r
public void createPartControl(Composite parent) {\r
- \r
+\r
// parent.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));\r
- \r
+\r
FillLayout layout = new FillLayout();\r
layout.marginHeight = 0;\r
layout.marginWidth = 0;\r
layout.type = SWT.VERTICAL;\r
- \r
+\r
parent.setLayout(layout);\r
viewer = new TreeViewer(parent);\r
viewer.getControl().setLayoutData(LayoutConstants.FILL());\r
viewer.setContentProvider(new TermContentProvider());\r
viewer.setLabelProvider(new TermLabelProvider());\r
viewer.setSorter(new ViewerSorter());\r
- \r
+\r
Transfer[] transfers = new Transfer[] { TermTransfer.getInstance() };\r
viewer.addDragSupport(dndOperations, transfers, new DefinedTermDragListener(viewer));\r
viewer.addDropSupport(dndOperations, transfers, new DefinedTermDropAdapter(this));\r
- \r
+\r
getDefinedTermEditorInput().initialiseVocabularies();\r
viewer.setInput(getDefinedTermEditorInput().getVocabularies());\r
- \r
+\r
getSite().setSelectionProvider(viewer);\r
- \r
+\r
selectionService = getSite().getWorkbenchWindow().getSelectionService();\r
selectionService.addSelectionListener(this);\r
- \r
+\r
setPartName(getEditorInput().getName());\r
createMenu();\r
}\r
- \r
- \r
\r
- \r
+\r
+\r
+\r
/**\r
- * \r
+ *\r
*/\r
public TermEditorInput getDefinedTermEditorInput() {\r
return (TermEditorInput) getEditorInput();\r
*/\r
@Override\r
public boolean postOperation(CdmBase objectAffectedByOperation) {\r
- \r
- \r
- viewer.refresh(); \r
- \r
+\r
+\r
+ viewer.refresh();\r
+\r
if(objectAffectedByOperation != null){\r
viewer.setSelection(new StructuredSelection(objectAffectedByOperation));\r
}\r
setDirty(true);\r
\r
return true;\r
- } \r
+ }\r
\r
private void createMenu() {\r
// register context menu\r
menuManager\r
.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));\r
getSite().registerContextMenu(ID, menuManager, viewer);\r
- \r
+\r
Control control = viewer.getControl();\r
Menu menu = menuManager.createContextMenu(control);\r
control.setMenu(menu);\r
}\r
- \r
\r
- \r
+\r
+\r
\r
@Override\r
public void doSave(IProgressMonitor monitor) {\r
setDirty(false);\r
getDefinedTermEditorInput().initialiseVocabularies();\r
}\r
- \r
+\r
\r
@Override\r
public void doSaveAs() {}\r
public void init(IEditorSite site, IEditorInput input) throws PartInitException {\r
setSite(site);\r
setInput(input);\r
- \r
+\r
}\r
\r
@Override\r
\r
@Override\r
public void setFocus() {\r
+ viewer.getControl().setFocus();\r
getConversationHolder().bind();\r
}\r
\r
@Override\r
public void update(CdmDataChangeMap changeEvents) {\r
// TODO Auto-generated method stub\r
- \r
+\r
}\r
\r
@Override\r
@Override\r
public void selectionChanged(IWorkbenchPart part, ISelection selection) {\r
// TODO Auto-generated method stub\r
- \r
+\r
}\r
\r
@Override\r
}\r
\r
/**\r
- * \r
+ *\r
*/\r
public TreeViewer getViewer() {\r
return viewer;\r
// $Id$\r
/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
+ * Copyright (C) 2009 EDIT\r
+ * European Distributed Institute of Taxonomy\r
+ * http://www.e-taxonomy.eu\r
+ *\r
+ * The contents of this file are subject to the Mozilla Public License Version 1.1\r
+ * See LICENSE.TXT at the top of this package for the full license terms.\r
+ */\r
package eu.etaxonomy.taxeditor.editor.definedterm;\r
\r
import org.apache.commons.lang.StringUtils;\r
*/\r
public class TermLabelProvider extends StyledCellLabelProvider {\r
\r
- private static Color vocColor = Display.getCurrent().getSystemColor(\r
- SWT.COLOR_BLUE);\r
- private Styler vocStyler;\r
- /* (non-Javadoc)\r
- * @see org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider#getStyledText(java.lang.Object)\r
- */\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see\r
- * org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.\r
- * jface.viewers.ViewerCell)\r
- */\r
- @Override\r
- public void update(ViewerCell cell) {\r
- Object element = cell.getElement();\r
- int columnIndex = cell.getColumnIndex();\r
-\r
- String text = getText(element);\r
- cell.setText(text);\r
-\r
- if (element instanceof TermVocabulary) {\r
- StyledString styledString = new StyledString(text, getVocabularyStyler());\r
- StyleRange[] styleRanges;\r
- styleRanges = styledString.getStyleRanges();\r
- cell.setStyleRanges(styleRanges);\r
- }\r
- super.update(cell);\r
- }\r
-\r
- public StyledString getStyledText(Object element) {\r
-\r
- if(element instanceof TermVocabulary){\r
- new StyledString(getText(element), getVocabularyStyler());\r
- }\r
- return new StyledString(getText(element), StyledString.QUALIFIER_STYLER);\r
- }\r
-\r
- /* (non-Javadoc)\r
- * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)\r
- */\r
-\r
- public String getText(Object element) {\r
-\r
- if(element instanceof DefinedTermBase){\r
- DefinedTermBase<?> dtb = (DefinedTermBase<?>)element;\r
- if (StringUtils.isNotBlank(dtb.getIdInVocabulary())){\r
- return dtb.getIdInVocabulary() + " : " + dtb.getTitleCache();\r
- } else{\r
- return dtb.getTitleCache();\r
- }\r
- } else if (element instanceof TermBase){\r
- return ((TermBase)element).getTitleCache();\r
- }\r
-\r
- //FIXME : must throw an exception here\r
- return element.toString();\r
- }\r
-\r
- private Styler getVocabularyStyler() {\r
- if (vocStyler == null) {\r
- vocStyler = new Styler() {\r
- @Override\r
- public void applyStyles(TextStyle textStyle) {\r
- textStyle.foreground = vocColor;\r
- }\r
- };\r
- }\r
- return vocStyler;\r
- }\r
+ private static Color vocColor = Display.getCurrent().getSystemColor(SWT.COLOR_BLUE);\r
+ private Styler vocStyler;\r
+\r
+ public TermLabelProvider() {\r
+ }\r
+\r
+ public TermLabelProvider(Styler vocStyler){\r
+ this.vocStyler = vocStyler;\r
+ }\r
+\r
+ /*\r
+ * (non-Javadoc)\r
+ *\r
+ * @see\r
+ * org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.\r
+ * jface.viewers.ViewerCell)\r
+ */\r
+ @Override\r
+ public void update(ViewerCell cell) {\r
+ Object element = cell.getElement();\r
+ int columnIndex = cell.getColumnIndex();\r
+\r
+ String text = getText(element);\r
+ cell.setText(text);\r
+\r
+ if (element instanceof TermVocabulary) {\r
+ StyledString styledString = new StyledString(text, getVocabularyStyler());\r
+ StyleRange[] styleRanges;\r
+ styleRanges = styledString.getStyleRanges();\r
+ cell.setStyleRanges(styleRanges);\r
+ }\r
+ super.update(cell);\r
+ }\r
+\r
+ public StyledString getStyledText(Object element) {\r
+\r
+ if (element instanceof TermVocabulary) {\r
+ new StyledString(getText(element), getVocabularyStyler());\r
+ }\r
+ return new StyledString(getText(element), StyledString.QUALIFIER_STYLER);\r
+ }\r
+\r
+ /*\r
+ * (non-Javadoc)\r
+ *\r
+ * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)\r
+ */\r
+\r
+ public String getText(Object element) {\r
+\r
+ if (element instanceof DefinedTermBase) {\r
+ DefinedTermBase<?> dtb = (DefinedTermBase<?>) element;\r
+ if (StringUtils.isNotBlank(dtb.getIdInVocabulary())) {\r
+ return dtb.getIdInVocabulary() + " : " + dtb.getTitleCache();\r
+ } else {\r
+ return dtb.getTitleCache();\r
+ }\r
+ } else if (element instanceof TermBase) {\r
+ return ((TermBase) element).getTitleCache();\r
+ }\r
+\r
+ // FIXME : must throw an exception here\r
+ return element.toString();\r
+ }\r
+\r
+ private Styler getVocabularyStyler() {\r
+ if (vocStyler == null) {\r
+ vocStyler = new Styler() {\r
+ @Override\r
+ public void applyStyles(TextStyle textStyle) {\r
+ textStyle.foreground = vocColor;\r
+ }\r
+ };\r
+ }\r
+ return vocStyler;\r
+ }\r
\r
}\r
import eu.etaxonomy.cdm.model.common.TermBase;\r
import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
import eu.etaxonomy.taxeditor.editor.definedterm.operation.CreateDefinedTermOperation;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
import eu.etaxonomy.taxeditor.store.StoreUtil;\r
StoreUtil.executeOperation(operation);\r
\r
} catch (NotDefinedException e) {\r
- StoreUtil.error(getClass(), e);\r
+ MessagingUtils.error(getClass(), e);\r
}\r
}\r
}\r
\r
import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
import eu.etaxonomy.taxeditor.editor.definedterm.operation.CreateTermVocabularyOperation;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
import eu.etaxonomy.taxeditor.store.StoreUtil;\r
StoreUtil.executeOperation(operation);\r
\r
} catch (NotDefinedException e) {\r
- StoreUtil.error(getClass(), e);\r
+ MessagingUtils.error(getClass(), e);\r
} \r
}\r
return null;\r
import eu.etaxonomy.cdm.model.common.TermBase;\r
import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
import eu.etaxonomy.taxeditor.editor.definedterm.operation.DeleteTermBaseOperation;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
import eu.etaxonomy.taxeditor.store.StoreUtil;\r
\r
\r
} \r
} catch (NotDefinedException e) {\r
- StoreUtil.error(getClass(), e);\r
+ MessagingUtils.error(getClass(), e);\r
}\r
}\r
return null;\r
import eu.etaxonomy.cdm.model.common.TermType;\r
import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
import eu.etaxonomy.taxeditor.store.StoreUtil;\r
\r
// $Id$\r
String PID = "eu.etaxonomy.taxeditor.application";\r
MultiStatus info = new MultiStatus(PID, 1, "You might be missing sufficient permissions to open the Defined Term Editor", null);\r
info.add(new Status(IStatus.WARNING, PID, 1, e.getMessage(), null));\r
- StoreUtil.errorDialog("Cannot open Defined Term Editor", getClass(), info);\r
- StoreUtil.error(getClass(), e);\r
+ MessagingUtils.errorDialog("Cannot open Defined Term Editor", getClass(), info);\r
+ MessagingUtils.error(getClass(), e);\r
}\r
\r
return null;\r
import eu.etaxonomy.cdm.model.common.TermBase;\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;\r
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
import eu.etaxonomy.taxeditor.store.StoreUtil;\r
new Status(IStatus.CANCEL, \r
StoreUtil.getPluginId(), \r
"Creation of term corresponding to type '" + definedTermInput.getTermType().getMessage() + "' is not yet supported");\r
- StoreUtil.warningDialog("Cannot create term", newTerm, status);\r
+ MessagingUtils.warningDialog("Cannot create term", newTerm, status);\r
return status;\r
}\r
\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;\r
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
import eu.etaxonomy.taxeditor.store.CdmStore;\r
if (termBase instanceof TermVocabulary) {\r
if (((TermVocabulary)termBase).getCreatedBy() == null) {\r
IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "This is a CDM system vocabulary");\r
- StoreUtil.warningDialog("Cannot delete vocabulary", termBase, status);\r
+ MessagingUtils.warningDialog("Cannot delete vocabulary", termBase, status);\r
return status;\r
}\r
\r
if (!((TermVocabulary)termBase).getTerms().isEmpty()) {\r
IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "Delete all terms from this vocaulary before deleting the vocabulary.");\r
- StoreUtil.warningDialog("Vocabulary not empty", termBase, status);\r
+ MessagingUtils.warningDialog("Vocabulary not empty", termBase, status);\r
return status;\r
} \r
\r
\r
if (((DefinedTermBase)termBase).getCreatedBy() == null) {\r
IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "This is a CDM system defined term");\r
- StoreUtil.warningDialog("Cannot delete defined term", termBase, status);\r
+ MessagingUtils.warningDialog("Cannot delete defined term", termBase, status);\r
return status;\r
}\r
if(!definedTermBase.getIncludes().isEmpty()){\r
IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "This term includes other terms. Please delete the included terms before deleting this term."); \r
- StoreUtil.warningDialog("Term has included terms", termBase, status);\r
+ MessagingUtils.warningDialog("Term has included terms", termBase, status);\r
return status;\r
} \r
\r
import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
import eu.etaxonomy.cdm.model.common.TermBase;\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;\r
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
import eu.etaxonomy.taxeditor.store.StoreUtil;\r
// do nothing when moving it on itself\r
if(targetTermOrVocabulary.equals(term)){\r
Status status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "Term can not be added to itself");\r
- StoreUtil.informationDialog("", status);\r
+ MessagingUtils.informationDialog("", status);\r
return status;\r
}\r
\r
// do nothing when term is top level and gets added to the same vocabulary\r
if(term.getPartOf() == null && termVocabulary.equals(term.getVocabulary())){\r
Status status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "Term is already in this vocabulary");\r
- StoreUtil.informationDialog("", status);\r
+ MessagingUtils.informationDialog("", status);\r
return status;\r
}\r
\r
import eu.etaxonomy.cdm.model.description.Feature;
import eu.etaxonomy.cdm.model.description.FeatureNode;
import eu.etaxonomy.cdm.model.description.FeatureTree;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>
// cannot drop a feature node onto itself
for (Object droppedObject : droppedObjects) {
if (droppedObject == null) {
- StoreUtil.warningDialog(
+ MessagingUtils.warningDialog(
"Operation not supported yet",
this,
"We are currently unable to change the order of freshly created "
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.wizard.WizardDialog;
+
+import eu.etaxonomy.taxeditor.preference.wizard.AvailableDistributionWizard;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
+
+/**
+ * @author a.oppermann
+ * @date 21.07.2014
+ *
+ */
+public class OpenDistributionEditorWizardHandler extends AbstractHandler{
+
+ String commandID = "eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardHandler";
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ AvailableDistributionWizard availableDistributionWizard = new AvailableDistributionWizard();
+ WizardDialog dialog = new WizardDialog(StoreUtil.getShell(),
+ availableDistributionWizard);
+
+ dialog.open();
+ return null;
+ }
+
+ }
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.password.PasswordWizard;
} else {
// should never happen, log an error
- AbstractUtility.error(OpenPasswordWizzardHandler.class, "The principal currently authenticated is not a eu.etaxonomy.cdm.model.common.User", null);
+ MessagingUtils.error(OpenPasswordWizzardHandler.class, "The principal currently authenticated is not a eu.etaxonomy.cdm.model.common.User", null);
}
return null;
import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
exporter.invoke(configurator);
monitor.worked(60);
} catch (RuntimeException e) {
- StoreUtil.errorDialog("Error exporting data", this,
+ MessagingUtils.messageDialog("Error exporting data", this,
"An error occured while"
+ "exporting to destination '"
+ configurator.getDestinationNameString()
conversationEnabled.getConversationHolder()
.commit();
}catch(RuntimeException e){
- StoreUtil.errorDialog("Error starting conversation handling", this, "" +
+ MessagingUtils.messageDialog("Error starting conversation handling", this, "" +
"Conversation Error: "+ e);
}
}
case Sdd:
return SDDExportConfigurator.NewInstance(null, null, null);
default:
- StoreUtil.notImplementedMessage(this);
+ MessagingUtils.notImplementedMessage(this);
throw new IllegalArgumentException("Export not supported yet");
}
}
import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator;
import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>
importer.invoke(configurator);
monitor.worked(80);
} catch (RuntimeException e) {
- StoreUtil.errorDialog(
+ MessagingUtils.messageDialog(
"Error importing data",
this,
"An error occured while"
case SpecimenCdmExcel:
return SpecimenCdmExcelImportConfigurator.NewInstance(null, null);
default:
- StoreUtil.notImplementedMessage(this);
+ MessagingUtils.notImplementedMessage(this);
throw new IllegalArgumentException("Import not supported yet");
}
}
import eu.etaxonomy.cdm.io.common.IIoConfigurator;
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* <p>
break;
} catch (Exception e) {
- StoreUtil.warn(this.getClass(), "Could not invoke method");
+ MessagingUtils.warn(this.getClass(), "Could not invoke method");
}
}
break;
} catch (Exception e) {
- StoreUtil.warn(this.getClass(), "Could not invoke method");
+ MessagingUtils.warn(this.getClass(), "Could not invoke method");
}
}
}
import java.util.List;
import java.util.TreeSet;
-import org.apache.log4j.Logger;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.operations.IOperationHistory;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.resource.FontRegistry;
.getActivePage()
.showView(id, null, IWorkbenchPage.VIEW_VISIBLE);
} catch (PartInitException e) {
- errorDialog("Error opening view", AbstractUtility.class, "Could not open view: " + id, e);
+ MessagingUtils.messageDialog("Error opening view", AbstractUtility.class, "Could not open view: " + id, e);
return null;
}
}
return getColorRegistry().get(symbolicName);
}
- /**
- * Open a message box that informs the user about unimplemented
- * functionality. This method is for developer convenience.
- *
- * @param source
- * a {@link java.lang.Object} object.
- */
- public static void notImplementedMessage(Object source) {
- warningDialog("Not yet implemented", source,
- "This functionality is not yet implemented.");
- }
-
- /**
- * <p>
- * informationDialog
- * </p>
- *
- * @param title
- * a {@link java.lang.String} object.
- * @param message
- * a {@link java.lang.String} object.
- */
- public static void informationDialog(final String title,
- final String message) {
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openInformation(getShell(), title, message);
- }
- });
- }
-
- public static void informationDialog(final String title,
- final IStatus status) {
- informationDialog(title, status.getMessage());
- }
-
- /**
- * <p>
- * warningDialog
- * </p>
- *
- * @param title
- * The dialogs title
- * @param source
- * The object where the warning was generated (used by log4j)
- * @param message
- * An informative String to be presented to the user
- */
- public static void warningDialog(final String title, final Object source,
- final String message) {
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openWarning(getShell(), title, message);
- Class<? extends Object> clazz = source != null ? source
- .getClass() : AbstractUtility.class;
- warn(clazz, message);
- }
- });
- }
-
- /**
- * @param title
- * @param termBase
- * @param status
- */
- public static void warningDialog(String title, Object source,
- IStatus status) {
- warningDialog(title, source, status.getMessage());
- }
-
- /**
- * <p>
- * errorDialog
- * </p>
- *
- * @param title
- * The dialogs title
- * @param source
- * The object where the warning was generated (used by log4j)
- * @param message
- * An informative String to be presented to the user
- * @param title
- * The dialogs title
- * @param t
- * a Throwable if one exists or null
- */
- public static void errorDialog(final String title, final Object source,
- final String message, final Throwable t) {
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openError(getShell(), title, message + getCauseRecursively(t));
- Class<? extends Object> clazz = source != null ? source
- .getClass() : this.getClass();
- error(clazz, message, t);
- }
-
- private String getCauseRecursively(Throwable t) {
- if(t == null){
- return "";
- }
-
- if(t.getCause() != null){
- return getCauseRecursively(t.getCause());
- }else{
- return String.format("\n\nException: %s\nMessage: %s", t.getClass().getSimpleName(), t.getMessage());
- }
-
- }
- });
- }
-
- public static void errorDialog(final String title, final Object source,
- final String message){
- errorDialog(title, source, message, null);
- }
-
- /**
- * <p>
- * errorDialog
- * </p>
- *
- * @param title
- * a {@link java.lang.String} object.
- * @param source
- * a {@link java.lang.Object} object.
- * @param status
- * a {@link org.eclipse.core.runtime.IStatus} object.
- */
- public static void errorDialog(final String title, final Object source,
- final IStatus status) {
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- ErrorDialog.openError(getShell(), title, null, status);
- Class<? extends Object> clazz = source != null ? source
- .getClass() : this.getClass();
- error(clazz, status);
- }
- });
- }
-
- /**
- * <p>
- * confirmDialog
- * </p>
- *
- * @param title
- * a {@link java.lang.String} object.
- * @param message
- * a {@link java.lang.String} object.
- * @return a boolean.
- */
- public static boolean confirmDialog(String title, String message) {
- return MessageDialog.openQuestion(getShell(), title, message);
- }
-
/**
* <p>
* executeOperation
uiInfoAdapter);
} catch (ExecutionException e) {
- dialogForAbortedOperation(e, this, operationlabel, null);
+ MessagingUtils.operationDialog(this, e, operationlabel, null);
} finally {
monitor.done();
try {
runInUI(runnable, null);
} catch (Exception e) {
- errorDialog("Error executing operation", AbstractUtility.class, "An error occured while executing " + operation.getLabel(), e);
+ MessagingUtils.messageDialog("Error executing operation", AbstractUtility.class, "An error occured while executing " + operation.getLabel(), e);
}
- // // Start the main progress monitor.
- // IProgressMonitor newMonitor =
- // startMainMonitor(getMonitor(),operation.getLabel(), 100);
- //
- // // Check whether operation was canceled and do some steps.
- // workedChecked(newMonitor, 10);
- //
- // try {
- // IStatus status = getOperationHistory().execute(operation, newMonitor,
- // WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
- //
- // // Check whether operation was canceled and do some steps.
- // workedChecked(newMonitor, 30);
- //
- // String statusString = status.equals(Status.OK_STATUS) ? "completed" :
- // "cancelled";
- // setStatusLine(operation.getLabel() + " " + statusString + ".");
- //
- // return status;
- // } catch (ExecutionException e) {
- // logger.error("Error executing operation: " + operation.getLabel(),
- // e);
- // errorDialog("Error executing operation: " + operation.getLabel(),
- // "Please refer to the error log.");
- // }
- // finally {
- //
- // // Stop the progress monitor.
- // newMonitor.done();
- // }
-
IPostOperationEnabled postOperationEnabled = operation
.getPostOperationEnabled();
if (postOperationEnabled != null) {
return (IWorkbenchSiteProgressService) getService(IWorkbenchSiteProgressService.class);
}
- /**
- * <p>
- * info
- * </p>
- *
- * @param message
- * a {@link java.lang.String} object.
- */
- public static void info(String message) {
- IStatus status = new Status(IStatus.INFO, getPluginId(), message);
- info(status);
- }
-
- /**
- * <p>
- * info
- * </p>
- *
- * @param status
- * a {@link org.eclipse.core.runtime.IStatus} object.
- */
- public static void info(IStatus status) {
- log(status);
- }
-
- /**
- * <p>
- * warn
- * </p>
- *
- * @param source
- * a {@link java.lang.Class} object.
- * @param message
- * a {@link java.lang.String} object.
- */
- public static void warn(Class source, String message) {
- IStatus status = new Status(IStatus.WARNING, getPluginId(), message);
- getLog4JLogger(source).warn(message);
- log(status);
- }
-
- public static void warn(Class source, IStatus status) {
- getLog4JLogger(source).warn(status.getMessage(), status.getException());
- log(status);
- }
-
- public static void warn(Class source, Throwable t) {
- IStatus status = new Status(IStatus.WARNING, getPluginId(), t.getMessage(), t);
- getLog4JLogger(source).warn(t);
- log(status);
- }
-
- /**
- * <p>
- * error
- * </p>
- *
- * @param source
- * a {@link java.lang.Class} object.
- * @param t
- * a {@link java.lang.Throwable} object.
- */
- public static void error(Class source, Throwable t) {
- error(source.getClass(), t.getMessage(), t);
- }
-
- /**
- * <p>
- * error
- * </p>
- *
- * @param source
- * a {@link java.lang.Class} object.
- * @param message
- * a {@link java.lang.String} object.
- * @param t
- * a {@link java.lang.Throwable} object.
- */
- public static void error(Class source, String message, Throwable t) {
- IStatus status = new Status(IStatus.ERROR, getPluginId(), message, t);
- error(source, status);
- }
-
- /**
- * <p>
- * error
- * </p>
- *
- * @param source
- * a {@link java.lang.Class} object.
- * @param status
- * a {@link org.eclipse.core.runtime.IStatus} object.
- */
- public static void error(Class source, IStatus status) {
- getLog4JLogger(source)
- .error(status.getMessage(), status.getException());
- log(status);
- }
-
- /**
- * <p>
- * getLog4JLogger
- * </p>
- *
- * @param clazz
- * a {@link java.lang.Class} object.
- * @return a {@link org.apache.log4j.Logger} object.
- */
- public static Logger getLog4JLogger(Class clazz) {
- return Logger.getLogger(clazz);
- }
-
- /**
- * @see {@link ILog#log(IStatus)}
- *
- * @param status
- */
- private static void log(IStatus status) {
- TaxeditorStorePlugin.getDefault().getLog().log(status);
- }
-
/**
* <p>
* getPluginId
}
}
- public static void dialogForAbortedOperation(Exception e, final Object source, String operationlabel, String hint) {
- MultiStatus info = null;
- String title = null;
-
- // FIXME cannot access TaxonomicEditorPlugin.PLUGIN_ID from here
- // String PID = TaxonomicEditorPlugin.PLUGIN_ID;
- String PID = "eu.etaxonomy.taxeditor.application";
-
- RuntimeException securityRuntimeException = SecurityExceptionUtils.findSecurityRuntimeException(e);
-
- if(securityRuntimeException != null){
- title = "Your changes could not be saved!";
- info = new MultiStatus(PID, 1, String.format("You are missing sufficient permissions for the operation \"%s\". %s", operationlabel, hint), null);
- info.add(new Status(IStatus.WARNING, PID, 1, securityRuntimeException.getMessage(), null));
-
- } else {
- title = "Error executing operation";
- info = new MultiStatus(PID, 1, String.format("An error occured while executing %s. %s", operationlabel, hint), null);
- Writer writer = new StringWriter();
- PrintWriter printWriter = new PrintWriter(writer);
- e.printStackTrace(printWriter);
- info.add(new Status(IStatus.ERROR, PID, 1, writer.toString(), null));
- }
-
- errorDialog(title, source, info);
- }
-
private static class TermNode<T extends IEnumTerm<T>> implements Comparable<TermNode<T>>{
private final T term;
private final TreeSet<TermNode<T>> children;
}
}
+
}
--- /dev/null
+package eu.etaxonomy.taxeditor.model;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * Error dialog class specifically implemented for the editor.
+ * The main difference with {@link org.eclipse.jface.dialogs.ErrorDialog} is that
+ * this dialog has a fixed max height.
+ *
+ * @author cmathew
+ *
+ */
+public class CdmErrorDialog extends ErrorDialog {
+
+ private static final int DIALOG_MAX_HEIGHT = 500;
+
+ public CdmErrorDialog(Shell parentShell, String dialogTitle,
+ String message, IStatus status) {
+ super(parentShell,
+ dialogTitle,
+ message, status,
+ IStatus.OK| IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
+ }
+
+ @Override
+ protected void buttonPressed(int id) {
+ super.buttonPressed(id);
+ if (id == IDialogConstants.DETAILS_ID) {
+ Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ // set height to max allowed
+ if(getShell().getSize().y > DIALOG_MAX_HEIGHT) {
+ getShell().setSize(getShell().getSize().x, 500);
+ } else {
+ getShell().setSize(getShell().getSize().x, oldSize.y);
+ }
+ }
+
+ }
+}
/** {@inheritDoc} */
@Override
public void warning(String message) {
- StoreUtil.warn(this.getClass(), message);
+ MessagingUtils.warn(this.getClass(), message);
}
/** {@inheritDoc} */
@Override
public void warning(String message, Throwable throwable) {
- StoreUtil.error(this.getClass(), message, throwable);
+ MessagingUtils.error(this.getClass(), message, throwable);
}
@Override
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>DescriptionHelper class.</p>
}
if(element instanceof Distribution){
- StoreUtil.warn(DescriptionHelper.class, "trying to set cache on distribution, don't know what to do at the moment.");
+ MessagingUtils.warn(DescriptionHelper.class, "trying to set cache on distribution, don't know what to do at the moment.");
return;
}
- StoreUtil.warn(DescriptionHelper.class, "No matching subclass found for DescriptionElementBase object, 'cache' not set.");
+ MessagingUtils.warn(DescriptionHelper.class, "No matching subclass found for DescriptionElementBase object, 'cache' not set.");
}
/**
return ((IdentifiableEntity) element).getTitleCache();
}catch(LazyInitializationException e){
String result = "No Session to initialize title cache for IdentifiableEntity";
- StoreUtil.error(DescriptionHelper.class, result, e);
+ MessagingUtils.error(DescriptionHelper.class, result, e);
return "TODO: " + result;
}
}
return CdmUtils.concat("; ", new String[]{originalSource.getIdNamespace(), originalSource.getIdInSource(), sourceObjectTitle});
}catch(LazyInitializationException e){
String result = "Error initializing title cache for ISourceable of an OriginalSourceBase";
- StoreUtil.error(DescriptionHelper.class, result, e);
+ MessagingUtils.error(DescriptionHelper.class, result, e);
return "TODO: " + result;
}
}
} catch (MalformedURLException e) {
// should never happen
} catch (Exception e) {
- AbstractUtility.error(ImageResources.class, e);
+ MessagingUtils.error(ImageResources.class, e);
}
// logger.warn(ImageDescriptor.getMissingImageDescriptor().getClass());
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.XMLMemento;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>MementoHelper class.</p>
new InputStreamReader(input, "utf-8")); //$NON-NLS-1$
return XMLMemento.createReadRoot(reader);
} catch (WorkbenchException e) {
- StoreUtil.error(MementoHelper.class, "Exception while reading the memento", e);
+ MessagingUtils.error(MementoHelper.class, "Exception while reading the memento", e);
} catch (UnsupportedEncodingException e) {
- StoreUtil.error(MementoHelper.class, "Exception while reading the memento", e);
+ MessagingUtils.error(MementoHelper.class, "Exception while reading the memento", e);
}
return null;
writer.close();
} catch (IOException e) {
stateFile.delete();
- StoreUtil.error(MementoHelper.class, "Could not save datasource state", e);
+ MessagingUtils.error(MementoHelper.class, "Could not save datasource state", e);
return null;
}
--- /dev/null
+package eu.etaxonomy.taxeditor.model;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+
+import eu.etaxonomy.cdm.persistence.hibernate.permission.SecurityExceptionUtils;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
+
+/**
+ * Utility class which handles all the messaging information generated by the
+ * Editor.
+ *
+ * This includes logging as well as dialogs.
+ *
+ * @author cmathew
+ *
+ */
+public class MessagingUtils {
+ public final static String UNEXPECTED_ERROR_MESSAGE = "This is an unexpected error.";
+ public final static String CONTACT_MESSAGE = System.getProperty("line.separator") + "Please contact EDIT Support (EditSupport@bgbm.org) with the error trace below (click on the 'Details' button).";
+
+ /**
+ * Gets the Log4J logger for a given class
+ *
+ * @param clazz
+ * a {@link java.lang.Class} object.
+ * @return a {@link org.apache.log4j.Logger} object.
+ */
+ public static Logger getLog4JLogger(Class clazz) {
+ return Logger.getLogger(clazz);
+ }
+
+ /**
+ * Logs details from a given Status object
+ *
+ * @param status
+ * a {@link org.eclipse.core.runtime.IStatus} object.
+ */
+ private static void log(IStatus status) {
+ TaxeditorStorePlugin.getDefault().getLog().log(status);
+ }
+
+ /**
+ * Logs a status object as information.
+ *
+ * @param status
+ * a {@link org.eclipse.core.runtime.IStatus} object.
+ */
+ public static void info(IStatus status) {
+ log(status);
+ }
+
+ /**
+ * Logs a string as information.
+ *
+ * @param message
+ * a {@link java.lang.String} object.
+ */
+ public static void info(String message) {
+ IStatus status = new Status(IStatus.INFO, AbstractUtility.getPluginId(), message);
+ info(status);
+ }
+
+ /**
+ * Logs an exception from a given source as a warning.
+ *
+ * @param source
+ * @param t
+ */
+ public static void warn(Class source, Throwable t) {
+ IStatus status = new Status(IStatus.WARNING, AbstractUtility.getPluginId(), t.getMessage(), t);
+ MessagingUtils.getLog4JLogger(source).warn(t);
+ log(status);
+ }
+
+ /**
+ * Logs a status object from a given source as a warning.
+ *
+ * @param source
+ * @param status
+ */
+ public static void warn(Class source, IStatus status) {
+ MessagingUtils.getLog4JLogger(source).warn(status.getMessage(), status.getException());
+ log(status);
+ }
+
+ /**
+ * Logs a string from a given source as a warning.
+ *
+ *
+ * @param source
+ * a {@link java.lang.Class} object.
+ * @param message
+ * a {@link java.lang.String} object.
+ */
+ public static void warn(Class source, String message) {
+ IStatus status = new Status(IStatus.WARNING, AbstractUtility.getPluginId(), message);
+ MessagingUtils.getLog4JLogger(source).warn(message);
+ log(status);
+ }
+
+ /**
+ * Logs a status object from a given source as an error.
+ *
+ *
+ * @param source
+ * a {@link java.lang.Class} object.
+ * @param status
+ * a {@link org.eclipse.core.runtime.IStatus} object.
+ */
+ public static void error(Class source, IStatus status) {
+ getLog4JLogger(source)
+ .error(status.getMessage(), status.getException());
+ log(status);
+ }
+
+ /**
+ * Logs a string and exception from a given source as an error.
+ *
+ *
+ * @param source
+ * a {@link java.lang.Class} object.
+ * @param message
+ * a {@link java.lang.String} object.
+ * @param t
+ * a {@link java.lang.Throwable} object.
+ */
+ public static void error(Class source, String message, Throwable t) {
+ IStatus status = new Status(IStatus.ERROR, AbstractUtility.getPluginId(), message, t);
+ error(source, status);
+ }
+
+
+
+ /**
+ * Logs an exception from a given source as an error.
+ *
+ *
+ * @param source
+ * a {@link java.lang.Class} object.
+ * @param t
+ * a {@link java.lang.Throwable} object.
+ */
+ public static void error(Class source, Throwable t) {
+ error(source.getClass(), t.getMessage(), t);
+ }
+
+ /**
+ * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+ *
+ * @param title
+ * a {@link java.lang.String} object.
+ * @param source
+ * a {@link java.lang.Object} object.
+ * @param status
+ * a {@link org.eclipse.core.runtime.IStatus} object.
+ */
+ public static void errorDialog(final String title,
+ final Object source,
+ final String message,
+ final IStatus status) {
+
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status);
+ ced.open();
+ Class<? extends Object> clazz = source != null ? source
+ .getClass() : this.getClass();
+ error(clazz, status);
+ }
+ });
+ }
+
+ /**
+ * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+ *
+ * @param title
+ * @param source
+ * @param message
+ * @param pluginId
+ * @param t
+ */
+ public static void errorDialog(final String title,
+ final Object source,
+ final String message,
+ final String pluginId,
+ final Throwable t,
+ boolean addContactMesg) {
+ // Usually the status contains only the first line of the stack trace.
+ // For the unexpected messages we need the entire stack trace so we
+ // create a new status with the entire stacktrace
+ StringWriter sw = new StringWriter();
+ t.printStackTrace(new PrintWriter(sw));
+ String finalMessage = t.getMessage();
+ if(addContactMesg) {
+ finalMessage += MessagingUtils.CONTACT_MESSAGE;
+ }
+ IStatus status = new Status(IStatus.ERROR,
+ pluginId,
+ finalMessage,
+ new Exception(sw.toString()));
+ errorDialog(title, source, message, status);
+ }
+
+
+
+ /**
+ * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+ *
+ * @param title
+ * a {@link java.lang.String} object.
+ * @param source
+ * a {@link java.lang.Object} object.
+ * @param status
+ * a {@link org.eclipse.core.runtime.IStatus} object.
+ */
+ public static void errorDialog(final String title,
+ final Object source,
+ final String message,
+ final IStatus status,
+ final boolean showStackTrace) {
+ if(showStackTrace && status.getException() != null) {
+ errorDialog(title, source, status.getPlugin(), message, status.getException(),true);
+ } else {
+ errorDialog(title, source, message, status);
+ }
+ }
+
+
+ /**
+ * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+ *
+ * @param title
+ * a {@link java.lang.String} object.
+ * @param source
+ * a {@link java.lang.Object} object.
+ * @param status
+ * a {@link org.eclipse.core.runtime.IStatus} object.
+ */
+ public static void errorDialog(final String title, final Object source,
+ final IStatus status) {
+ errorDialog(title, source, null, status);
+ }
+
+ /**
+ * Displays a dialog for an exception occurring in an operation.
+ *
+ * This will be either a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog} in case of a
+ * security runtime exception or a warning {@link org.eclipse.jface.dialogs.MessageDialog} in
+ * case of any other exception.
+ *
+ * @param title
+ * a {@link java.lang.String} object.
+ * @param source
+ * a {@link java.lang.Object} object.
+ * @param status
+ * a {@link org.eclipse.core.runtime.IStatus} object.
+ */
+ public static void operationDialog(final Object source,
+ final Exception ex,
+ final String operationlabel,
+ final String hint) {
+
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MultiStatus info = null;
+ String title = null;
+
+ // FIXME cannot access TaxonomicEditorPlugin.PLUGIN_ID from here
+ // String PID = TaxonomicEditorPlugin.PLUGIN_ID;
+ String PID = "eu.etaxonomy.taxeditor.application";
+
+ // checking security exceptions for every operation
+ RuntimeException securityRuntimeException = SecurityExceptionUtils.findSecurityRuntimeException(ex);
+
+ // in case of a security exception it is a warning, else it is an error
+ if(securityRuntimeException != null){
+ title = "Your changes could not be saved!";
+ warningDialog(title, source, String.format("You are missing sufficient permissions for the operation \"%s\". %s", operationlabel, hint));
+ } else {
+ title = "Error executing operation";
+ errorDialog(title, source, String.format("An error occured while executing %s. %s", operationlabel, hint), PID, ex, true);
+
+ }
+
+
+ }
+ });
+ }
+
+
+
+
+ /**
+ * Displays a question {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * a {@link java.lang.String} object.
+ * @param message
+ * a {@link java.lang.String} object.
+ * @return a boolean.
+ */
+ public static boolean confirmDialog(String title, String message) {
+ return MessageDialog.openQuestion(AbstractUtility.getShell(), title, message);
+ }
+
+ /**
+ * Displays a message {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * @param source
+ * @param message
+ */
+ public static void messageDialog(final String title, final Object source, final String message) {
+ MessagingUtils.messageDialog(title, source, message, null);
+ }
+
+ /**
+ * Displays an error {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * The dialogs title
+ * @param source
+ * The object where the warning was generated (used by log4j)
+ * @param message
+ * An informative String to be presented to the user
+ * @param title
+ * The dialogs title
+ * @param t
+ * a Throwable if one exists or null
+ */
+ public static void messageDialog(final String title, final Object source,
+ final String message, final Throwable t) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openError(AbstractUtility.getShell(), title, message + getCauseRecursively(t));
+ Class<? extends Object> clazz = source != null ? source
+ .getClass() : this.getClass();
+ error(clazz, message, t);
+ }
+
+ private String getCauseRecursively(Throwable t) {
+ if(t == null){
+ return "";
+ }
+
+ if(t.getCause() != null){
+ return getCauseRecursively(t.getCause());
+ }else{
+ return String.format("\n\nException: %s\nMessage: %s", t.getClass().getSimpleName(), t.getMessage());
+ }
+
+ }
+ });
+ }
+
+ /**
+ * Displays a warning {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * @param termBase
+ * @param status
+ */
+ public static void warningDialog(String title, Object source,
+ IStatus status) {
+ MessagingUtils.warningDialog(title, source, status.getMessage());
+ }
+
+ /**
+ * Displays a warning {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * The dialogs title
+ * @param source
+ * The object where the warning was generated (used by log4j)
+ * @param message
+ * An informative String to be presented to the user
+ */
+ public static void warningDialog(final String title, final Object source, final String message) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openWarning(AbstractUtility.getShell(), title, message);
+ Class<? extends Object> clazz = source != null ? source
+ .getClass() : AbstractUtility.class;
+ warn(clazz, message);
+ }
+ });
+ }
+
+ /**
+ * Displays an information {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * @param status
+ */
+ public static void informationDialog(final String title, final IStatus status) {
+ MessagingUtils.informationDialog(title, status.getMessage());
+ }
+
+ /**
+ * Displays an information {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * a {@link java.lang.String} object.
+ * @param message
+ * a {@link java.lang.String} object.
+ */
+ public static void informationDialog(final String title,
+ final String message) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openInformation(AbstractUtility.getShell(), title, message);
+ }
+ });
+ }
+
+ /**
+ * Open a message box that informs the user about unimplemented
+ * functionality. This method is for developer convenience.
+ *
+ * @param source
+ * a {@link java.lang.Object} object.
+ */
+ public static void notImplementedMessage(Object source) {
+ warningDialog("Not yet implemented", source,
+ "This functionality is not yet implemented.");
+ }
+
+}
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.section.classification.TaxonNodeWizardPage;
/**
TaxonNode taxonNode = parent.addChildTaxon(taxon, parent.getReference(), parent.getMicroReference());
generatedTaxonNodeUuid = CdmStore.getService(ITaxonNodeService.class).saveOrUpdate(taxonNode);
}catch(IllegalArgumentException e){
- StoreUtil.warningDialog("Taxon already exists in classfication", getClass(), e.getMessage());
+ MessagingUtils.warningDialog("Taxon already exists in classfication", getClass(), e.getMessage());
}
}
}
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.strategy.match.MatchException;
import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>ParseHandler class.</p>
if(matchMatrix.duplicateInReferences.size() > 0){
Reference inReference = (Reference) matchMatrix.duplicateInReferences.iterator().next();
reference.setInReference(inReference);
- StoreUtil.warn(this.getClass(), reference.generateTitle());
+ MessagingUtils.warn(this.getClass(), reference.generateTitle());
// FIXME TODO resolve multiple duplications. We use first match for a start
- StoreUtil.warn(this.getClass(), reference.getTitleCache());
+ MessagingUtils.warn(this.getClass(), reference.getTitleCache());
}
}
try{
return CdmStore.getService(ICommonService.class).findMatching(nomenclaturalReference, MatchStrategyConfigurator.ReferenceMatchStrategy());
}catch (MatchException e) {
- StoreUtil.error(this.getClass(), "Error finding matching references", e);
+ MessagingUtils.error(this.getClass(), "Error finding matching references", e);
}
return null;
}
try{
return CdmStore.getService(ICommonService.class).findMatching(authorTeam, MatchStrategyConfigurator.TeamOrPersonMatchStrategy());
}catch (MatchException e) {
- StoreUtil.error(this.getClass(), "Error finding matching authors", e);
+ MessagingUtils.error(this.getClass(), "Error finding matching authors", e);
}
return null;
}
return CdmStore.getService(ICommonService.class).findMatching(taxonNameBase, MatchStrategyConfigurator.NonViralNameMatchStrategy());
} catch (MatchException e) {
- StoreUtil.error(this.getClass(), "Error finding matching names", e);
+ MessagingUtils.error(this.getClass(), "Error finding matching names", e);
}
return null;
}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.preference;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+import eu.etaxonomy.taxeditor.ui.element.CommandHandlerButton;
+
+/**
+ * @author a.oppermann
+ * @date 21.07.2014
+ *
+ */
+public class ChecklistEditorGeneralPreference extends PreferencePage implements IWorkbenchPreferencePage {
+
+ boolean isEditorActivated;
+ Composite child ;
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors
+ * ()
+ */
+ @Override
+ protected Control createContents(Composite parent) {
+
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite.setLayout(new GridLayout());
+ isEditorActivated = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE);
+ final Button activateCheckButton = new Button(composite, SWT.CHECK);
+ activateCheckButton.setText("Enable Checklist Editor");
+ activateCheckButton.setSelection(isEditorActivated);
+ activateCheckButton.addSelectionListener(new SelectionAdapter(){
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ isEditorActivated = activateCheckButton.getSelection();
+ PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE, isEditorActivated);
+ if(isEditorActivated){
+ child.setVisible(true);
+ child.setEnabled(true);
+ }else{
+ child.setVisible(false);
+ child.setEnabled(false);
+ }
+
+ }
+ });
+
+ child = new Composite(composite, SWT.NULL);
+ child.setLayout(new GridLayout());
+ child.setVisible(isEditorActivated);
+ final CLabel label = new CLabel(child, SWT.NULL);
+ label.setText("Please open the wizard below, in order to \n" + "choose the areas for the Checklist Editor");
+ final CommandHandlerButton button_openFeatureTree = new CommandHandlerButton(child, SWT.PUSH,
+ "eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardHandler");
+
+ button_openFeatureTree.setText("Open Distribution Selection Wizard");
+ if(isEditorActivated){
+ child.setEnabled(true);
+ }else{
+ child.setEnabled(false);
+ }
+
+ return composite;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ @Override
+ public void init(IWorkbench workbench) {
+ }
+
+}
public static final String ADD_TYPES_TO_ALL_NAMES = "eu.etaxonomy.taxeditor.store.addTypeToAllNames";
public static final String DETERMINATION_ONLY_FOR_FIELD_UNITS = "eu.etaxonomy.taxeditor.specimen.determinationOnlyOnFieldUnitLevel";
+
+
+ public static final String DISTRIBUTION_AREA_PREFRENCES_ACTIVE = "eu.etaxonomy.taxeditor.checklist.distributionAreaPreferencesActive";
+
+ public static final String DISTRIBUTION_AREA_OCCURENCE_STATUS = "eu.etaxonomy.taxeditor.checklist.distributionAreaStatus";
+
+ public static final String DISTRIBUTION_AREA_OCCURENCE_STATUS_GRAYED = "eu.etaxonomy.taxeditor.checklist.distributionAreaStatusGrayed";
+
+ // TODO RL
+ public static final String IS_RL = "eu.etaxonomy.taxeditor.isRL";
+
}
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
private static final String SHOW_EXPERIMENTAL_FEATURES = "isShowExperimentalFeatures";
-
+
+ private static final String SHOW_CHECKLIST_EDITOR = "isChecklistEditorEnabled";
+
/* (non-Javadoc)
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
@Override
public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {
-
+
if(SHOW_EXPERIMENTAL_FEATURES.equals(property)){
return isShowExperimentalFeatures();
}
-
+ if(SHOW_CHECKLIST_EDITOR.equals(property)){
+ return isChecklistEditorEnabled();
+ }
+
return false;
}
private boolean isShowExperimentalFeatures() {
return PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_EXPERIMENTAL_FEATURES);
}
-
+
+ private boolean isChecklistEditorEnabled() {
+ return PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE);
+ }
}
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
import eu.etaxonomy.cdm.strategy.match.MatchException;
import eu.etaxonomy.cdm.strategy.match.MatchMode;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.model.NomenclaturalCodeHelper;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
/**
try {
matchStrategy.setMatchMode(fieldName, matchMode);
} catch (MatchException e) {
- StoreUtil.error(PreferencesUtil.class, e);
+ MessagingUtils.error(PreferencesUtil.class, e);
throw new RuntimeException(e);
}
}
String key = cdmBase.getClass().getName().concat(".")
.concat(cdmBase.getUuid().toString());
if (key.contains("javassist")) {
- StoreUtil.info("proxy");
+ MessagingUtils.info("proxy");
}
return key;
}
String key = simpleTerm.getClass().getName().concat(".")
.concat(simpleTerm.getUuid().toString());
if (key.contains("javassist")) {
- StoreUtil.warn(PreferencesUtil.class,
+ MessagingUtils.warn(PreferencesUtil.class,
"Trying to persist a preference based on a proxy class.");
}
return key;
String key = definedTerm.getClass().getName().concat(".")
.concat(definedTerm.getUuid().toString());
if (key.contains("javassist")) {
- StoreUtil.warn(PreferencesUtil.class,
+ MessagingUtils.warn(PreferencesUtil.class,
"Trying to persist a preference based on a proxy class.");
}
return key;
*/
@Override
protected void createFieldEditors() {
-
addField(new BooleanFieldEditor(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS,
"Taxon determination only on FieldUnit level",
getFieldEditorParent()));
addField(new BooleanFieldEditor(IPreferenceKeys.SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS,
"Open search results in separate windows",
getFieldEditorParent()));
+
}
/*
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.preference;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * @author a.oppermann
+ * @date 13.08.2014
+ *
+ */
+public class TemplatePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ @Override
+ public void init(IWorkbench workbench) {
+ setPreferenceStore(PreferencesUtil.getPreferenceStore());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+ */
+ @Override
+ protected void createFieldEditors() {
+ addField(new BooleanFieldEditor(IPreferenceKeys.IS_RL, "Rote Liste 2020", getFieldEditorParent()));
+ }
+
+}
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
import eu.etaxonomy.cdm.strategy.match.MatchException;
import eu.etaxonomy.cdm.strategy.match.MatchMode;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>Abstract AbstractMatchingPreferences class.</p>
try {
matchStrategy.setMatchMode(fieldName, matchMode);
} catch (MatchException e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
throw new RuntimeException(e);
}
}
}
} catch (MatchException e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
throw new RuntimeException(e);
}
super.performDefaults();
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>NonViralNameMatchingPreference class.</p>
try {
matchStrategy = MatchStrategyConfigurator.NonViralNameMatchStrategy();
} catch (MatchException e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
throw new RuntimeException(e);
}
}
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>ReferenceMatchingPreference class.</p>
try {
matchStrategy = MatchStrategyConfigurator.ReferenceMatchStrategy();
} catch (MatchException e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
throw new RuntimeException(e);
}
}
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>TeamOrPersonMatchingPreference class.</p>
try {
matchStrategy = MatchStrategyConfigurator.TeamOrPersonMatchStrategy();
} catch (MatchException e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
throw new RuntimeException(e);
}
}
import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.preference.wizard.VocabularyTermWizard;
import eu.etaxonomy.taxeditor.store.CdmStore;
throw new RuntimeException("Could not find open command: "
+ DefinedTermEditor.OPEN_COMMAND_ID);
} catch (Exception e) {
- StoreUtil
+ MessagingUtils
.error(getClass(),
"An exception occured while trying to open a selection",
e);
}
}
} catch (NotDefinedException e) {
- StoreUtil
+ MessagingUtils
.error(getClass(),
"An exception occured while trying to open the Term Editor",
e);
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.preference.wizard;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.StyledString.Styler;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.TextStyle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+
+import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.taxeditor.editor.definedterm.TermContentProvider;
+import eu.etaxonomy.taxeditor.editor.definedterm.TermLabelProvider;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author a.oppermann
+ * @date 21.07.2014
+ *
+ */
+public class AvailableDistributionPage extends WizardPage {
+
+ private CheckboxTreeViewer viewer;
+
+ private Set<TermVocabulary<DefinedTermBase>> vocabularies;
+
+ /**
+ * @param pageName
+ */
+ protected AvailableDistributionPage(String pageName) {
+ super(pageName);
+ // TODO check if configuration exists
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
+ * .Composite)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void createControl(Composite parent) {
+ IPreferenceStore preferenceStore = PreferencesUtil.getPreferenceStore();
+ String checkedValues = preferenceStore.getString(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS);
+ String grayedValues = preferenceStore.getString(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS_GRAYED);
+ setTitle("Select areas for ChecklistEditor");
+ setDescription("In order to be able to modify and see the distribution status of taxa,\n"
+ + "you have to select the areas which you like to see.");
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite.setLayout(new GridLayout());
+ viewer = new CheckboxTreeViewer(composite, SWT.NULL);
+ viewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ viewer.setContentProvider(new TermContentProvider());
+ Styler styler = new Styler() {
+ @Override
+ public void applyStyles(TextStyle textStyle) {
+ textStyle.foreground = Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);
+ }
+ };
+ viewer.setLabelProvider(new TermLabelProvider(styler));
+ viewer.addCheckStateListener(new ICheckStateListener() {
+
+ private boolean ignoreCheckEvent = false;
+
+ @Override
+ public void checkStateChanged(CheckStateChangedEvent event) {
+
+
+ if (ignoreCheckEvent ) {
+ return;
+ }
+
+ ignoreCheckEvent = true;
+
+ try {
+ TreePath path = ((ITreeSelection) viewer.getSelection()).getPaths()[0];
+ checkChildren(path, event.getChecked());
+ checkParents(path.getParentPath());
+ }
+ finally {
+ ignoreCheckEvent = false;
+ }
+ checkNoneChecked();
+ }
+ });
+ // TODO: write listener or toggle button to select all named areas
+
+ rememberCheckedValues(checkedValues, grayedValues);
+ setControl(composite);
+ }
+
+
+ protected List<TermVocabulary<DefinedTermBase>> initialiseVocabularies() {
+ if (vocabularies != null) {
+ vocabularies.clear();
+ }
+ List<TermVocabulary<DefinedTermBase>> vocs = CdmStore.getService(IVocabularyService.class).findByTermType(
+ TermType.NamedArea);
+ return vocs;
+ }
+
+ private void rememberCheckedValues(String checkedValues, String grayedValues) {
+ viewer.setInput(initialiseVocabularies());
+
+ if (grayedValues != null && grayedValues != "") {
+ String[] listGrayed = grayedValues.split(",");
+ ArrayList listGrayedTerms = new ArrayList();
+ getTermsFromStringValues(listGrayed, listGrayedTerms);
+ for(Object element : listGrayedTerms){
+ if(element != null){
+ viewer.setGrayChecked(element, true);
+ }
+ }
+ }
+ if (checkedValues != null && checkedValues != "") {
+ String[] listChecked = checkedValues.split(",");
+ ArrayList<DefinedTermBase<?>> listCheckedTerms = new ArrayList<DefinedTermBase<?>>();
+ getTermsFromStringValues(listChecked, listCheckedTerms);
+ for(Object element : listCheckedTerms){
+ if(element != null){
+ viewer.setChecked(element, true);
+ }
+ }
+ }
+ }
+
+ /**
+ * @param split
+ * @param termlist
+ */
+ private void getTermsFromStringValues(String[] split, ArrayList termlist) {
+ List<String> listValue = Arrays.asList(split);
+ for (String s : listValue) {
+ UUID uuid = UUID.fromString(s);
+ ITermService termService = CdmStore.getService(ITermService.class);
+ DefinedTermBase definedTermBase = termService.load(uuid);
+ if(definedTermBase != null){
+ termlist.add(definedTermBase);
+ }else{
+ IVocabularyService vocabularyService = CdmStore.getService(IVocabularyService.class);
+ TermVocabulary termVocabulary = vocabularyService.load(uuid);
+ termlist.add(termVocabulary);
+ }
+ }
+ }
+
+ private boolean checkNoneChecked() {
+
+ if (viewer.getCheckedElements().length == 0) {
+ setMessage("Please check at least one item", WARNING);
+ return true;
+ } else {
+ setMessage(null);
+ return false;
+ }
+ }
+
+ /**
+ * @return the viewer
+ */
+ public CheckboxTreeViewer getViewer() {
+ return viewer;
+ }
+
+ /**
+ *
+ * @param path
+ */
+ private void checkParents(final TreePath path) {
+ if (path == null) {
+ return;
+ }
+ TermContentProvider tcp = new TermContentProvider();
+ Object treeElement = path.getLastSegment();
+
+ if (treeElement != null) {
+ boolean allChecked = true;
+ boolean allUnchecked = true;
+ for (final Object fieldElement : tcp.getChildren(treeElement)) {
+ allChecked = allChecked && this.viewer.getChecked(fieldElement);
+ allUnchecked = allUnchecked && !this.viewer.getChecked(fieldElement);
+ }
+ if (allUnchecked) {
+ this.viewer.setChecked(treeElement, false);
+ this.viewer.setGrayed(treeElement, false);
+ } else if (allChecked) {
+ this.viewer.setChecked(treeElement, true);
+ this.viewer.setGrayed(treeElement, false);
+ } else if (!allUnchecked && !allChecked) {
+ this.viewer.setChecked(treeElement, true);
+ this.viewer.setGrayed(treeElement, true);
+ }
+ }
+ checkParents(path.getParentPath());
+ }
+
+ /**
+ *
+ * @param path
+ * @param checked
+ */
+ private void checkChildren(final TreePath path, final boolean checked) {
+ TermContentProvider tcp = new TermContentProvider();
+
+ if (path == null) {
+ return;
+ }
+ final Object element = path.getLastSegment();
+ if (element != null) {
+ this.viewer.setChecked(element, checked);
+ this.viewer.setGrayed(element, false);
+ int length = tcp.getChildren(element).length;
+ if(length>1){
+ this.viewer.setSubtreeChecked(element, checked);
+ }
+ }
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.preference.wizard;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.UUID;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.wizard.Wizard;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;
+import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author alex
+ * @date 21.07.2014
+ *
+ */
+public class AvailableDistributionWizard extends Wizard implements IConversationEnabled {
+
+ private ConversationHolder conversation;
+ private final AvailableDistributionPage aPage;
+
+ public AvailableDistributionWizard() {
+ setWindowTitle("Distribution Selection Wizard");
+ // TODO if preferenceStore has elements checked load elements in wizard
+ aPage = new AvailableDistributionPage("AvailableDistributionPage");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ @Override
+ public boolean performFinish() {
+ // TODO: get Selection and save in EditorPreferences
+ if (!checkNoneChecked()) {
+ Object[] checkedElements = aPage.getViewer().getCheckedElements();
+ Object[] grayedElements = aPage.getViewer().getGrayedElements();
+ ArrayList checkedList = new ArrayList(Arrays.asList(checkedElements));
+ ArrayList grayedList = new ArrayList(Arrays.asList(grayedElements));
+ checkedList = (ArrayList) CollectionUtils.subtract(checkedList, grayedList);
+ ArrayList<UUID> listUIIDChecked = new ArrayList<UUID>();
+ ArrayList<UUID> listUIIDGrayed = new ArrayList<UUID>();
+ for (Object o : checkedList) {
+ if (o instanceof NamedArea) {
+ NamedArea na = (NamedArea) o;
+ listUIIDChecked.add(na.getUuid());
+
+ }else if(o instanceof OrderedTermVocabulary){
+ OrderedTermVocabulary otb = (OrderedTermVocabulary) o;
+ listUIIDGrayed.add(otb.getUuid());
+ }
+ }
+ for (Object o : grayedList) {
+ if(o instanceof DefinedTermBase){
+ DefinedTermBase dt = (DefinedTermBase) o;
+ listUIIDGrayed.add(dt.getUuid());
+ }else if(o instanceof OrderedTermVocabulary){
+ OrderedTermVocabulary otb = (OrderedTermVocabulary) o;
+ listUIIDGrayed.add(otb.getUuid());
+ }
+
+ }
+
+ String saveCheckedElements = StringUtils.join(listUIIDChecked, ",");
+ String saveGrayedElements = StringUtils.join(listUIIDGrayed, ",");
+ IPreferenceStore preferenceStore = PreferencesUtil.getPreferenceStore();
+ preferenceStore.setValue(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS, saveCheckedElements);
+ preferenceStore.setValue(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS_GRAYED, saveGrayedElements);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public void addPages() {
+ addPage(aPage);
+ }
+
+ private boolean checkNoneChecked() {
+
+ if (aPage.getViewer().getCheckedElements().length == 0) {
+ aPage.setMessage("Please check at least one item", aPage.WARNING);
+ return true;
+ } else {
+ aPage.setMessage(null);
+ return false;
+ }
+ }
+
+ @Override
+ public ConversationHolder getConversationHolder() {
+ if (conversation == null) {
+ conversation = CdmStore.createConversation();
+ }
+ return conversation;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update
+ * (eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
+ */
+ @Override
+ public void update(CdmDataChangeMap changeEvents) {
+ // TODO Auto-generated method stub
+
+ }
+}
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
import eu.etaxonomy.cdm.model.common.Representation;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.store.TermStore;
/**
term.addRepresentation(Representation.NewInstance("", "", "", CdmStore.getDefaultLanguage()));
} catch (InstantiationException e) {
- StoreUtil.error(this.getClass(), "InstantiationException when setting term", e);
+ MessagingUtils.error(this.getClass(), "InstantiationException when setting term", e);
} catch (IllegalAccessException e) {
- StoreUtil.error(this.getClass(), "IllegalAccessException when setting term", e);
+ MessagingUtils.error(this.getClass(), "IllegalAccessException when setting term", e);
}
}
return term;
import eu.etaxonomy.taxeditor.io.ExportManager;
import eu.etaxonomy.taxeditor.io.ImportManager;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
return instance;
} else if (instance == null || !instance.isConnected) {
- AbstractUtility
+ MessagingUtils
.warningDialog(
"Application is not connected to a datastore",
instance,
cdmSource = CdmDataSourceRepository.getCurrentCdmSource();
connect(cdmSource);
} catch (CdmRemoteSourceException e) {
- StoreUtil.errorDialog("Connection to CDM Source Failed", CdmStore.class, "Could not connect to target CDM Source", e);
+ MessagingUtils.messageDialog("Connection to CDM Source Failed", CdmStore.class, "Could not connect to target CDM Source", e);
}
private static void connect(final ICdmSource cdmSource,
final DbSchemaValidation dbSchemaValidation,
final Resource applicationContextBean) {
- StoreUtil.info("Connecting to datasource: " + cdmSource);
+ MessagingUtils.info("Connecting to datasource: " + cdmSource);
job = new CdmStoreConnector(Display.getDefault(), cdmSource,
dbSchemaValidation, applicationContextBean);
try {
return applicationConfiguration;
} catch (Exception e) {
- StoreUtil.error(CdmStore.class, e);
+ MessagingUtils.error(CdmStore.class, e);
}
return null;
}
try{
conversation.startTransaction();
}catch(Exception e){
- StoreUtil.errorDialog("No database connection", CdmStore.class, "No database connection available", e);
+ MessagingUtils.messageDialog("No database connection", CdmStore.class, "No database connection available", e);
}
return conversation;
}
service = (T) method.invoke(configuration, null);
break;
} catch (IllegalArgumentException e) {
- StoreUtil.error(CdmStore.class, e);
+ MessagingUtils.error(CdmStore.class, e);
} catch (IllegalAccessException e) {
- StoreUtil.error(CdmStore.class, e);
+ MessagingUtils.error(CdmStore.class, e);
} catch (InvocationTargetException e) {
- StoreUtil.error(CdmStore.class, e);
+ MessagingUtils.error(CdmStore.class, e);
}
}
}
import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
import eu.etaxonomy.cdm.model.metadata.CdmMetaData.MetaDataPropertyName;
import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.dialog.LoginDialog;
import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
}
});
- StoreUtil.info("Application context initialized.");
+ MessagingUtils.info("Application context initialized.");
return Status.OK_STATUS;
} else {
// Show datasource view if not shown yet
if (!result) {
// Show an error message
- StoreUtil
- .errorDialog(
+ MessagingUtils
+ .messageDialog(
"DatabaseCompatibilityCheck failed",
this,
"The database schema for the chosen "
cdmSource.checkConnection();
monitor.worked(1);
} catch (CdmSourceException e) {
- StoreUtil.errorDialog("Could not connect to chosen datasource",
+ MessagingUtils.messageDialog("Could not connect to chosen datasource",
this, "Reason: " + e.getMessage(), e);
monitor.setCanceled(true);
}
import eu.etaxonomy.taxeditor.model.IContextListener;
import eu.etaxonomy.taxeditor.model.MementoHelper;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
/**
* <p>notifyContextStart</p>
*/
public void notifyContextStart() {
- StoreUtil.info("Notifying context listeners, that the context has started.");
+ MessagingUtils.info("Notifying context listeners, that the context has started.");
ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
try {
}
});
} catch (InvocationTargetException e) {
- StoreUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
} catch (InterruptedException e) {
- StoreUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
*
*/
public void notifyContextRefresh() {
- StoreUtil.info("Notifying context listeners, that the context needs to be refreshed.");
+ MessagingUtils.info("Notifying context listeners, that the context needs to be refreshed.");
ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
try {
}
});
} catch (InvocationTargetException e) {
- StoreUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
} catch (InterruptedException e) {
- StoreUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
IProgressMonitor subMonitor = StoreUtil.getSubProgressMonitor(monitor, 1);
subMonitor.beginTask("Stoping context", contextListeners.size());
- StoreUtil.info("Notifying context listeners, that the context has stopped.");
+ MessagingUtils.info("Notifying context listeners, that the context has stopped.");
for(Object listener : contextListeners.getListeners()){
((IContextListener) listener).contextStop(memento, subMonitor);
memento = MementoHelper.readMementoFromFile(getStateFileForCurrentDatabase());
} catch (FileNotFoundException e) {
// no memento -> no previous state
- StoreUtil.info("No state file for datasource");
+ MessagingUtils.info("No state file for datasource");
}
}
name = name.replace(" ", "_");
memento = XMLMemento.createWriteRoot(name);
- StoreUtil.info("DataSource found. Memento created.");
+ MessagingUtils.info("DataSource found. Memento created.");
} catch (Exception e) {
// The memento could not be created, but a not closable editor is avoided for this case.
- StoreUtil.error(this.getClass(), "The memento could not be created", e);
+ MessagingUtils.error(this.getClass(), "The memento could not be created", e);
}
} else {
- StoreUtil.info("Not storing state data, because no DataSource present.");
+ MessagingUtils.info("Not storing state data, because no DataSource present.");
}
}
import org.eclipse.ui.IEditorInput;
import eu.etaxonomy.taxeditor.model.ICdmEditorHandle;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
*
ICdmEditorHandle editor = editors.get(inputType);
if(editor == null){
- StoreUtil.warningDialog("No editor", getClass(), "No editor was registered for the given type.");
+ MessagingUtils.warningDialog("No editor", getClass(), "No editor was registered for the given type.");
}else{
editor.open(uuid);
}
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.IContextListener;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* <p>LoginManager class.</p>
return true;
}
catch(BadCredentialsException e){
- AbstractUtility.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Bad Credentials.");
+ MessagingUtils.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Bad Credentials.");
}
catch(LockedException e){
- AbstractUtility.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Account is locked.");
+ MessagingUtils.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Account is locked.");
}
catch(IllegalArgumentException e){
- AbstractUtility.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Username and/or Password empty.");
+ MessagingUtils.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Username and/or Password empty.");
}
return false;
}
AbstractCdmFormElement implements SelectionListener,
IEnableableFormElement, ISelectable {
+ //TODO RL
+ public void setVisible(boolean b){
+ combo.setVisible(b);
+ }
+
+
private static CdmEnumDataHolder[] cdmEnumDataHolders = {
new CdmEnumDataHolder<NomenclaturalCode>(){
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.store.CdmStore;
if (label == null) {
if (term.getTitleCache() != null) {
label = term.getTitleCache();
- StoreUtil.warn(getClass(),
+ MessagingUtils.warn(getClass(),
"Term does not have a default language representation: " + label
+ ", " + term.getUuid());
} else {
label = "Unknown";
- StoreUtil.warn(getClass(),
+ MessagingUtils.warn(getClass(),
"Representation Label and TitleCache empty for term: "
+ term + ", " + term.getUuid());
}
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Shell;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* <p>UriDialog class.</p>
try {
uri = new URI(getValue());
} catch (URISyntaxException e) {
- StoreUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
return uri;
}
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.model.common.IEnumTerm;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
/**
lastCompletedFilter.setAccessible(true);
lastCompletedFilter.set(this, null);
} catch (SecurityException e) {
- StoreUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
} catch (NoSuchFieldException e) {
- StoreUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
} catch (IllegalArgumentException e) {
- StoreUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
} catch (IllegalAccessException e) {
- StoreUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
// this also is not the nicest way to do it.
progressMonitor.worked(1);
}
}else{
- StoreUtil.warn(getClass(), "Model for Filtered Selection is null:" + this.getClass().getSimpleName());
+ MessagingUtils.warn(getClass(), "Model for Filtered Selection is null:" + this.getClass().getSimpleName());
}
}
finally {
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
lastCompletedFilter.setAccessible(true);
lastCompletedFilter.set(this, null);
} catch (SecurityException e) {
- AbstractUtility.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
} catch (NoSuchFieldException e) {
- AbstractUtility.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
} catch (IllegalArgumentException e) {
- AbstractUtility.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
} catch (IllegalAccessException e) {
- AbstractUtility.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
// this also is not the nicest way to do it.
progressMonitor.worked(1);
}
}else{
- AbstractUtility.warn(getClass(), "Model for Filtered Selection is null:" + this.getClass().getSimpleName());
+ MessagingUtils.warn(getClass(), "Model for Filtered Selection is null:" + this.getClass().getSimpleName());
}
}
finally {
import eu.etaxonomy.cdm.api.service.molecular.IAmplificationService;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.molecular.Amplification;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
import eu.etaxonomy.taxeditor.newWizard.NewAmplificationWizard;
import eu.etaxonomy.taxeditor.store.CdmStore;
if(amplification != null){
return amplification;
}
- AbstractUtility.error(this.getClass(), "Selected unit is not an amplification", null);
+ MessagingUtils.error(this.getClass(), "Selected unit is not an amplification", null);
return null;
}
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
import eu.etaxonomy.taxeditor.newWizard.NewDerivedUnitBaseWizard;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>FilteredDerivedUnitSelectionDialog class.</p>
if(specimenObservationBase instanceof DerivedUnit){
return (DerivedUnit) specimenObservationBase;
}
- StoreUtil.error(this.getClass(), "Selected unit is not a derived unit", null);
+ MessagingUtils.error(this.getClass(), "Selected unit is not a derived unit", null);
return null;
}
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
import eu.etaxonomy.taxeditor.newWizard.NewFieldUnitWizard;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>FilteredFieldUnitSelectionDialog class.</p>
if(specimenObservationBase instanceof FieldUnit){
return (FieldUnit) specimenObservationBase;
}
- StoreUtil.error(this.getClass(), "Selected object is not a field unit", null);
+ MessagingUtils.error(this.getClass(), "Selected object is not a field unit", null);
return null;
}
import eu.etaxonomy.cdm.api.service.molecular.IPrimerService;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.molecular.Primer;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
import eu.etaxonomy.taxeditor.newWizard.NewPrimerWizard;
import eu.etaxonomy.taxeditor.store.CdmStore;
if(primer != null){
return primer;
}
- AbstractUtility.error(this.getClass(), "Selected unit is not a primer", null);
+ MessagingUtils.error(this.getClass(), "Selected unit is not a primer", null);
return null;
}
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* @author n.hoffmann
return (T) PolytomousKeySelectionDialog.select(shell, conversation, (PolytomousKey) curentSelection);
}
if(clazz.equals(PolytomousKeyNode.class)){
- StoreUtil.warningDialog("Not implemented yet", SelectionDialogFactory.class,
+ MessagingUtils.warningDialog("Not implemented yet", SelectionDialogFactory.class,
"This functionality is not implemented yet.");
return null;
}
import org.eclipse.ui.forms.widgets.Section;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* <p>Abstract AbstractCdmFormElement class.</p>
// Described here: http://dev.e-taxonomy.eu/trac/ticket/2363#comment:2
// and here: http://dev.e-taxonomy.eu/trac/ticket/2438
// Ignoring the CME because nothing bad is happening
- AbstractUtility.warn(getClass(), "ConcurrentModificationException. Can be ignored.");
+ MessagingUtils.warn(getClass(), "ConcurrentModificationException. Can be ignored.");
}
}
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* <p>
((IPropertyChangeListener) listener).propertyChange(event);
}
} catch (ConcurrentModificationException e) {
- AbstractUtility.warn(getClass(), "ConcurrentModificationException while handling PropertyChangeEvents."
+ MessagingUtils.warn(getClass(), "ConcurrentModificationException while handling PropertyChangeEvents."
+ " It seems like this is not critical");
}
}
}else if(getParentElement() instanceof IConversationEnabled){
return ((IConversationEnabled) getParentElement()).getConversationHolder();
}
- AbstractUtility.errorDialog("Could not get conversation for AbstractFormSection",
+ MessagingUtils.messageDialog("Could not get conversation for AbstractFormSection",
getClass(), "There is an error in the implementation. There should have been an active editor but it wasn't",
new IllegalArgumentException());
return null;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection.UnitType;
if (selectionProvider != null) {
selectionProvider.removeSelectionChangedListener(selectionArbitrator);
} else {
- AbstractUtility.error(this.getClass(),
+ MessagingUtils.error(this.getClass(),
"Tried to destroy a selection listener from this factories listeners but was null", null);
}
}
*/
public void removeSelectionListener(SelectionListener listener) {
if (listener == null) {
- AbstractUtility.error(this.getClass(),
+ MessagingUtils.error(this.getClass(),
"Tried to remove a selection listener from this factories listeners but was null", null);
} else {
selectionListenerList.remove(listener);
}
if (element == null) {
- AbstractUtility.errorDialog("No element for entity", this,
+ MessagingUtils.messageDialog("No element for entity", this,
"Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
+ entity, null);
}
- else if (backgroundColor != null && !backgroundColor.isDisposed()) {
- element.setPersistentBackground(backgroundColor);
+ else{
+ if (backgroundColor != null && !backgroundColor.isDisposed()) {
+ element.setPersistentBackground(backgroundColor);
+ }
adapt(element);
parentElement.addElement(element);
}
import org.eclipse.ui.forms.widgets.TableWrapData;
import eu.etaxonomy.cdm.common.UriUtils;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* <p>ImageElement class.</p>
try {
runnable.run(monitor);
} catch (Exception e) {
- StoreUtil.errorDialog("Could not load image", getClass(), e.getMessage() + ": " + getImageUri(), e);
+ MessagingUtils.messageDialog("Could not load image", getClass(), e.getMessage() + ": " + getImageUri(), e);
}
return Status.OK_STATUS;
try {
runnable.run(monitor);
} catch (Exception e) {
- StoreUtil.errorDialog("Could not unload image", getClass(), e.getMessage() + ": " + getImageUri(), e);
+ MessagingUtils.messageDialog("Could not unload image", getClass(), e.getMessage() + ": " + getImageUri(), e);
}
return Status.OK_STATUS;
import eu.etaxonomy.cdm.model.common.MultilanguageTextHelper;
import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.taxeditor.model.DefaultTermComparator;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.translation.TranslationWizard;
Map<Language, LanguageString> multilanguageText = getMultilanguageText();
if (multilanguageText == null){
- StoreUtil.warningDialog("No text to transalte", getClass(), "The text is empty and therefore can not be translated");
+ MessagingUtils.warningDialog("No text to transalte", getClass(), "The text is empty and therefore can not be translated");
}
TranslationWizard wizard = new TranslationWizard(multilanguageText);
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Widget;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
try{
entityElement.setSelected(false);
}catch(SWTException e){
- StoreUtil.error(getClass(), "Widgets of element are disposed", e);
+ MessagingUtils.error(getClass(), "Widgets of element are disposed", e);
}
ISelection selection = event.getSelection();
if(selection != null && selection instanceof StructuredSelection){
private final Text text_cache;
private final Button button_toggle;
-
private boolean state;
private final Set<SelectionListener> selectionListener = new HashSet<SelectionListener>();
private final Label label;
private final Composite container;
+ //TODO for RL
+ public void setVisible(boolean b) {
+ text_cache.setVisible(b);
+ button_toggle.setVisible(b);
+ label.setVisible(b);
+ container.setVisible(b);
+ }
+
+
/**
* <p>Constructor for ToggleableTextElement.</p>
*
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
// create a granted authrity from a cdm authority
gai = cdma.asNewGrantedAuthority();
} catch (Exception e) {
- StoreUtil.warningDialog("Parsing Error", this, "Could not parse authority string");
+ MessagingUtils.warningDialog("Parsing Error", this, "Could not parse authority string");
return;
}
//FIXME : this contains call will allow users to add authorities which differ only in CRUD operation choice.
// need to have a comparator which only checks permission class and uuid
if(cdmAuthorities.contains(gai) || newCdmAuthorities.contains(gai)) {
- StoreUtil.warningDialog("Duplicate CDM Authority", this, "Chosen CDM Authority is already attached to current group");
+ MessagingUtils.warningDialog("Duplicate CDM Authority", this, "Chosen CDM Authority is already attached to current group");
} else {
group.addGrantedAuthority(gai);
newCdmAuthorities.add(gai);
import org.eclipse.ui.forms.widgets.ScrolledForm;
import eu.etaxonomy.cdm.ext.openurl.OpenUrlReference;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.element.ImageElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.element.RootElement;
getWizard().getContainer().run(true, false, runnable);
} catch (Exception e) {
- StoreUtil.errorDialog("Could not load image", getClass(), e.getMessage() + ": " + imageUri , e);
+ MessagingUtils.messageDialog("Could not load image", getClass(), e.getMessage() + ": " + imageUri , e);
}
}
} catch (IllegalArgumentException e) {
setErrorMessage(String.format("Could not page: %s", e.getLocalizedMessage()));
} catch (Exception e) {
- StoreUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
import org.eclipse.swt.widgets.Label;
import eu.etaxonomy.cdm.model.reference.Reference;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@Override
public void widgetSelected(SelectionEvent e) {
if(openUrlEnabled.getReference() == null){
- StoreUtil.warningDialog("No reference", getClass(), "The given reference is empty");
+ MessagingUtils.warningDialog("No reference", getClass(), "The given reference is empty");
return;
}
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.api.service.IUserService;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
*/
@Override
public void widgetSelected(SelectionEvent e) {
- PasswordWizard wizard = new PasswordWizard(user, conversation);
- WizardDialog dialog = new WizardDialog(getLayoutComposite().getShell(), wizard);
-
- dialog.open();
+ if(!CdmStore.getService(IUserService.class).userExists(user.getUsername())) {
+ MessagingUtils.warningDialog("Username does not exist", this, "Please create or save user '" + user.getUsername() + "' before changing password");
+ } else {
+ PasswordWizard wizard = new PasswordWizard(user, conversation);
+ WizardDialog dialog = new WizardDialog(getLayoutComposite().getShell(), wizard);
+ dialog.open();
+ }
}
/* (non-Javadoc)
import eu.etaxonomy.cdm.api.service.IUserService;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
/**
internalConversation.close();
return true;
}catch(Exception e){
- StoreUtil.errorDialog("Error while changing password", getClass(), "There was a problem changing the password.", e);
+ MessagingUtils.messageDialog("Error while changing password", getClass(), "There was a problem changing the password.", e);
return false;
}finally{
if(conversation != null){
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.LoginManager;
import eu.etaxonomy.taxeditor.store.StoreUtil;
*/
public void handleException(CdmPropertyChangeEvent event) {
// override this in subclasses if you want to deal with the error
- AbstractUtility.error(event.getSource().getClass(), event.getException());
+ MessagingUtils.error(event.getSource().getClass(), event.getException());
}
/**
import eu.etaxonomy.cdm.model.agent.Person;
import eu.etaxonomy.cdm.model.agent.Team;
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
*/
@Override
protected AbstractCdmDetailElement<TeamOrPersonBase> createCdmDetailElement(AbstractCdmDetailSection<TeamOrPersonBase> parentElement, int style) {
- AbstractUtility.error(this.getClass(), "Detail element was not created. Seems like the case was not implemented for TeamOrPersonBaseDetailSection", null);
+ MessagingUtils.error(this.getClass(), "Detail element was not created. Seems like the case was not implemented for TeamOrPersonBaseDetailSection", null);
//TODO DetailElement missing??
return null;
}
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.cdm.model.description.TextData;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
*/
@Override
public void run() {
- boolean confirmed = StoreUtil.confirmDialog("Confirmation", "Do you really want to change to "
+ boolean confirmed = MessagingUtils.confirmDialog("Confirmation", "Do you really want to change to "
+ destinationString + "? Current data will be lost.");
if (confirmed) {
// FIXME
package eu.etaxonomy.taxeditor.ui.section.description;
import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
if(element_media != null){
this.removeElements();
}
- element_media = (MediaElement) formFactory.createEntityCollectionElement(this, entity, null, null, Section.EXPANDED);
- formFactory.addPropertyChangeListener(element_media);
+ element_media = (MediaElement) formFactory.createEntityCollectionElement(this, entity, null, null, ExpandableComposite.EXPANDED);
super.setEntity(entity);
setSectionTitle();
layout();
*/
package eu.etaxonomy.taxeditor.ui.section.media;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Set;
+
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.cdm.model.media.MediaRepresentation;
+import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
+import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.element.UriWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
*/
public class MediaElement extends AbstractEntityCollectionElement<Media> {
- private MediaRepresentationSection section_mediaRepresentation;
- private EntitySelectionElement<AgentBase> selection_artist;
- private LanguageStringWithLabelElement text_description;
- private LanguageStringWithLabelElement text_title;
+// private MediaRepresentationSection section_mediaRepresentation;
+ private EntitySelectionElement<AgentBase> selection_artist;
+ private LanguageStringWithLabelElement text_description;
+ private LanguageStringWithLabelElement text_title;
+ private UriWithLabelElement textUri;
- /**
- * <p>
- * Constructor for MediaElement.
- * </p>
- *
- * @param formElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
- * object.
- * @param element
- * a {@link eu.etaxonomy.cdm.model.media.Media} object.
- * @param removeListener
- * a {@link org.eclipse.swt.events.SelectionListener} object.
- * @param style
- * a int.
- * @param cdmFormFactory
- * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
- * object.
- */
- public MediaElement(CdmFormFactory cdmFormFactory,
- AbstractFormSection formElement, Media element,
- SelectionListener removeListener, int style) {
- super(cdmFormFactory, formElement, element, removeListener, null, style);
- }
+ /**
+ * <p>
+ * Constructor for MediaElement.
+ * </p>
+ *
+ * @param formElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
+ * object.
+ * @param element
+ * a {@link eu.etaxonomy.cdm.model.media.Media} object.
+ * @param removeListener
+ * a {@link org.eclipse.swt.events.SelectionListener} object.
+ * @param style
+ * a int.
+ * @param cdmFormFactory
+ * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
+ * object.
+ */
+ public MediaElement(CdmFormFactory cdmFormFactory,
+ AbstractFormSection formElement, Media element,
+ SelectionListener removeListener, int style) {
+ super(cdmFormFactory, formElement, element, removeListener, null, style);
+ }
- /*
- * (non-Javadoc)
- *
- * @see
- * eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite
- * #createControls(org.eclipse.swt.widgets.Composite, int)
- */
- /** {@inheritDoc} */
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite
+ * #createControls(org.eclipse.swt.widgets.Composite, int)
+ */
+ /** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement element, int style) {
text_title = formFactory.createLanguageStringWithLabelElement(element, "Title", null, style);
selection_artist = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), element, "Artist", null, EntitySelectionElement.ALL, style);
text_description = formFactory.createLanguageStringWithLabelElement(element, "Description", null, 100, style);
- section_mediaRepresentation = formFactory.createMediaRepresentationSection(getConversationHolder(), element, style);
- section_mediaRepresentation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- }
+ textUri = formFactory.createUriWithLabelElement(element, "Media URI", null, style);
+ // section_mediaRepresentation = formFactory.createMediaRepresentationSection(getConversationHolder(), element, style);
+ // section_mediaRepresentation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ }
+
+ private MediaRepresentationPart getFirstMediaRepresentationPart() {
+ Set<MediaRepresentation> representations = entity.getRepresentations();
+ if(representations.size()==1){
+ List<MediaRepresentationPart> parts = representations.iterator().next().getParts();
+ if(parts.size()==1){
+ return parts.iterator().next();
+ }
+ }
+ return null;
+ }
- /** {@inheritDoc} */
- @Override
- public void setEntity(Media element) {
- this.entity = element;
- section_mediaRepresentation.setEntity(element);
- selection_artist.setEntity((TeamOrPersonBase) HibernateProxyHelper
- .deproxy(element.getArtist()));
+ /** {@inheritDoc} */
+ @Override
+ public void setEntity(Media element) {
+ this.entity = element;
+// section_mediaRepresentation.setEntity(element);
+ selection_artist.setEntity((TeamOrPersonBase) HibernateProxyHelper
+ .deproxy(element.getArtist()));
- text_description.setLanguageString(element.getDescription(CdmStore
- .getDefaultLanguage()));
+ text_description.setLanguageString(element.getDescription(CdmStore
+ .getDefaultLanguage()));
- LanguageString title = element.getTitle(CdmStore.getDefaultLanguage());
+ LanguageString title = element.getTitle(CdmStore.getDefaultLanguage());
- if (title == null) {
- title = LanguageString.NewInstance("",
- CdmStore.getDefaultLanguage());
- }
+ if (title == null) {
+ title = LanguageString.NewInstance("",
+ CdmStore.getDefaultLanguage());
+ }
- text_title.setLanguageString(title);
- }
+ text_title.setLanguageString(title);
- /*
- * (non-Javadoc)
- *
- * @see
- * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent
- * (java.lang.Object)
- */
- /** {@inheritDoc} */
- @Override
- public void handleEvent(Object eventSource) {
- if (eventSource == selection_artist) {
- getEntity().setArtist(selection_artist.getSelection());
- } else if (eventSource == text_description) {
- getEntity().addDescription(text_description.getLanguageString());
- } else if (eventSource == text_title) {
- getEntity().putTitle(text_title.getLanguageString());
- if (getParentElement() instanceof AbstractCdmDetailSection) {
- ((AbstractCdmDetailSection) getParentElement()).updateTitle();
- }
- }
- firePropertyChangeEvent(this);
- }
+ MediaRepresentationPart firstMediaRepresentationPart = getFirstMediaRepresentationPart();
+ if(firstMediaRepresentationPart!=null){
+ textUri.setUri(firstMediaRepresentationPart.getUri());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent
+ * (java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void handleEvent(Object eventSource) {
+ if (eventSource == selection_artist) {
+ getEntity().setArtist(selection_artist.getSelection());
+ } else if (eventSource == text_description) {
+ getEntity().addDescription(text_description.getLanguageString());
+ } else if (eventSource == text_title) {
+ getEntity().putTitle(text_title.getLanguageString());
+ if (getParentElement() instanceof AbstractCdmDetailSection) {
+ ((AbstractCdmDetailSection) getParentElement()).updateTitle();
+ }
+ }
+ else if (eventSource == textUri){
+ textUri.setBackground(getPersistentBackground());
+ MediaRepresentationPart firstMediaRepresentationPart = getFirstMediaRepresentationPart();
+ URI uri;
+ try {
+ uri = textUri.getUri();
+ if(firstMediaRepresentationPart!=null){
+ firstMediaRepresentationPart.setUri(uri);
+ }
+ else{
+ Set<MediaRepresentation> representations = getEntity().getRepresentations();
+ if(representations.size()>=1){
+ representations.iterator().next().addRepresentationPart(MediaRepresentationPart.NewInstance(uri, null));
+ }
+ else{
+ MediaRepresentation mediaRepresentation = MediaRepresentation.NewInstance();
+ mediaRepresentation.addRepresentationPart(MediaRepresentationPart.NewInstance(uri, null));
+ getEntity().addRepresentation(mediaRepresentation);
+ }
+ }
+ } catch (URISyntaxException e) {
+ textUri.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
+ }
+ }
+ }
}
import eu.etaxonomy.cdm.model.media.ImageFile;
import eu.etaxonomy.cdm.model.media.MediaRepresentation;
import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
text_suffix.setText(imageInfo.getSuffix());
getEntity().setSuffix(imageInfo.getSuffix());
} catch (IOException e) {
- StoreUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
} catch (HttpException e) {
- StoreUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
}
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
import eu.etaxonomy.taxeditor.ui.selection.NomenclaturalAuthorTeamSelectionElement;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
/**
* <p>
toggleable_cache = formFactory.createToggleableTextField(this,
"Authorship Cache", entity.getAuthorshipCache(),
entity.isProtectedAuthorshipCache(), style);
+
+ //TODO RL
+ if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+ toggleable_cache.setVisible(false);
+ }
selection_combinationAuthorTeam = formFactory.createNomenclaturalAuthorTeamSelectionElement(
getConversationHolder(),
formElement, "Author",
import eu.etaxonomy.cdm.model.name.Rank;
import eu.etaxonomy.cdm.model.name.ZoologicalName;
import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
if (code != null){
switch(nonViralName.getNomenclaturalCode()){
case ICNAFP :
- createBotanicalNameParts(formElement, nonViralName, style);
+ // TODO RL
+ if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL))
+ {
+ createBotanicalNameParts(formElement, nonViralName, style);
+ }
break;
case ICZN:
createZoologicalNameParts(formElement, nonViralName, style);
import eu.etaxonomy.cdm.model.name.NameRelationship;
import eu.etaxonomy.cdm.model.name.NameRelationshipType;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
getEntity().setType(combo_relationshipType.getSelection());
}
else if(eventSource == selection_toName){
- StoreUtil.error(getClass(), "No API call available.", null);
+ MessagingUtils.error(getClass(), "No API call available.", null);
}
else if(eventSource == text_ruleConsidered){
getEntity().setRuleConsidered(text_ruleConsidered.getText());
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
- combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
- combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
-
+ combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
+ combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
+
+ //TODO RL
+ if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+ toggleable_cache.setVisible(false);
+ combo_nomenclaturalCode.setVisible(false);
+ }
+
section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
addControl(section_name);
addControl(section_author);
addElement(section_author);
- section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
- section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- addControl(section_hybrid);
- addElement(section_hybrid);
+ //TODO RL
+ if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+ section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
+ section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ addControl(section_hybrid);
+ addElement(section_hybrid);
+ }
}
/** {@inheritDoc} */
@Override
public void setEntity(NonViralName entity) {
super.setEntity(entity);
- section_name.setEntity(entity);
- section_author.setEntity(entity);
- section_hybrid.setEntity(entity);
+ if (section_name!=null) section_name.setEntity(entity);
+ if (section_author!=null) section_author.setEntity(entity);
+ if (section_hybrid!=null) section_hybrid.setEntity(entity);
}
/** {@inheritDoc} */
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
Action cloneAction = new Action("Clone", IAction.AS_PUSH_BUTTON){
@Override
public void run() {
- boolean confirm = AbstractUtility.confirmDialog("Confirm cloning", "Do you really want to clone the name?");
+ boolean confirm = MessagingUtils.confirmDialog("Confirm cloning", "Do you really want to clone the name?");
if(confirm){
NonViralName clonedName;
import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.reference.Reference;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
try {
mediaRepresentationPart.setUri(new URI(protologueUriText.getText()));
} catch (URISyntaxException e) {
- StoreUtil.warningDialog("Could not parse URI", getClass(), e.getMessage());
+ MessagingUtils.warningDialog("Could not parse URI", getClass(), e.getMessage());
}
}
}
import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
getEntity().setType(combo_relationshipType.getSelection());
}
else if(eventSource == selection_toName){
- AbstractUtility.error(getClass(), "No API call available.", null);
+ MessagingUtils.error(getClass(), "No API call available.", null);
}
else if(eventSource == checkPartial){
getEntity().setPartial(checkPartial.getSelection());
import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
combo_preservationMethod = formFactory.createDefinedTermComboElement(TermType.MaterialOrMethod, formElement, "Preservation Method", preservationMethod==null?null:preservationMethod.getDefinedMaterialOrMethod(), style);
} catch (MethodNotSupportedByDerivedUnitTypeException e) {
// we ignore this
- AbstractUtility.info(e.getMessage());
+ MessagingUtils.info(e.getMessage());
}
selection_storedUnder = formFactory.createSelectionElement(TaxonNameBase.class, getConversationHolder(), formElement, "Stored Under", entity.getStoredUnder(), EntitySelectionElement.ALL, style);
text_exsicatum = formFactory.createTextWithLabelElement(formElement, "Exsiccatum", entity.getExsiccatum(), style);
} catch (MethodNotSupportedByDerivedUnitTypeException e) {
// we ignore this
- AbstractUtility.info(e.getMessage());
+ MessagingUtils.info(e.getMessage());
}
// section_duplicates = (SpecimenCollectionDetailSection) formFactory
preservationMethod.setDefinedMaterialOrMethod(combo_preservationMethod.getSelection());
}
} catch (MethodNotSupportedByDerivedUnitTypeException e) {
- AbstractUtility
- .errorDialog(
+ MessagingUtils
+ .messageDialog(
"MethodNotSupportedByDerivedUnitTypeException",
this,
"MethodNotSupportedByDerivedUnitTypeException when trying to set preservation method for derive unit",
try {
getEntity().setExsiccatum(text_exsicatum.getText());
} catch (Exception e) {
- AbstractUtility.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
}
}
}
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeConfigurator;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
section_fieldUnit.setEntity(facade);
} catch (DerivedUnitFacadeNotSupportedException e) {
- AbstractUtility.errorDialog("Error", this, "SpecimenFacadeNotSupportedException while inititating SpecimenFacade", e);
+ MessagingUtils.messageDialog("Error", this, "SpecimenFacadeNotSupportedException while inititating SpecimenFacade", e);
}
}
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
try {
getEntity().setExsiccatum(text_exsicatum.getText());
} catch (Exception e) {
- AbstractUtility.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
}
}
}
import eu.etaxonomy.cdm.model.common.TimePeriod;
import eu.etaxonomy.cdm.model.occurrence.Collection;
import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
}
} catch (MethodNotSupportedByDerivedUnitTypeException e) {
// we ignore this
- AbstractUtility.info(e.getMessage());
+ MessagingUtils.info(e.getMessage());
}
comboPreservationMedium = formFactory.createDefinedTermComboElement(TermType.MaterialOrMethod, formElement, "Preservation medium", preservationMedium, style);
datePreservation = formFactory.createTimePeriodElement(formElement, "Preservation date", preservationDate, style);
*/
package eu.etaxonomy.taxeditor.ui.section.occurrence.media;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Set;
+
import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.joda.time.DateTime;
import eu.etaxonomy.cdm.api.service.IVocabularyService;
import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.common.VocabularyEnum;
import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.cdm.model.media.MediaRepresentation;
+import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
import eu.etaxonomy.cdm.model.occurrence.Collection;
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.UriWithLabelElement;
import eu.etaxonomy.taxeditor.ui.mvc.element.DateElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
-import eu.etaxonomy.taxeditor.ui.section.media.MediaRepresentationSection;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
private EntitySelectionElement<Collection> selection_collection;
private TextWithLabelElement text_accessionNumber;
private EntitySelectionElement<Reference> selection_publishedIn;
+ private UriWithLabelElement textMediaUri;
+ private MediaRepresentationPart mediaRepresentationPart;
- private MediaRepresentationSection mediaRepresentationSection;
+// private MediaRepresentationSection mediaRepresentationSection;
/**
* @param formFactory
* @param formElement
}
}
selection_publishedIn = formFactory.createSelectionElement(Reference.class, getConversationHolder(), formElement, "Published in", publishedIn, EntitySelectionElement.ALL, style);
+ mediaRepresentationPart = getMediaRepresentationPart(media);
+ textMediaUri = formFactory.createUriWithLabelElement(formElement, "Media URI", mediaRepresentationPart.getUri(), style);
- mediaRepresentationSection = formFactory.createMediaRepresentationSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
- mediaRepresentationSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- mediaRepresentationSection.setEntity(media);
+// mediaRepresentationSection = formFactory.createMediaRepresentationSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+// mediaRepresentationSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+// mediaRepresentationSection.setEntity(media);
}
}
primaryMediaSource.setCitation(selection_publishedIn.getSelection());
}
}
+ else if(eventSource==textMediaUri){
+ textMediaUri.setBackground(getPersistentBackground());
+ try {
+ mediaRepresentationPart.setUri(textMediaUri.getUri());
+ } catch (URISyntaxException e) {
+ textMediaUri.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
+ }
+ }
}
+
+ private MediaRepresentationPart getMediaRepresentationPart(Media media) {
+ if(mediaRepresentationPart==null){
+ Set<MediaRepresentation> representations = media.getRepresentations();
+ if(representations!=null && representations.size()>0){
+ MediaRepresentation mediaRepresentation = representations.iterator().next();
+ List<MediaRepresentationPart> parts = mediaRepresentation.getParts();
+ if(parts!=null && parts.size()>0){
+ mediaRepresentationPart = parts.iterator().next();
+ }
+ else{
+ mediaRepresentationPart = MediaRepresentationPart.NewInstance(null, null);
+ mediaRepresentation.addRepresentationPart(mediaRepresentationPart);
+ }
+ }
+ else{
+ mediaRepresentationPart = MediaRepresentationPart.NewInstance(null, null);
+
+ MediaRepresentation mediaRepresentation = MediaRepresentation.NewInstance();
+ mediaRepresentation.addRepresentationPart(mediaRepresentationPart);
+ media.addRepresentation(mediaRepresentation);
+ }
+ }
+ return mediaRepresentationPart;
+ }
+
}
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
import eu.etaxonomy.cdm.model.reference.ReferenceType;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.AuthorHelper;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
// series
text_series = formFactory.createTextWithLabelElement(element, "Series",
- reference.getSeries(), style);
+ reference.getSeriesPart(), style);
// volume
text_volume = formFactory.createTextWithLabelElement(element, "Volume",
reference.getVolume(), style);
text_series = formFactory.createTextWithLabelElement(element, "Series",
- reference.getSeries(), style);
+ reference.getSeriesPart(), style);
}
/**
// series part
text_seriesPart = formFactory.createTextWithLabelElement(element,
- "Series Part", reference.getSeriesPart(), style);
+ "Series", reference.getSeriesPart(), style);
if (referenceType.equals(ReferenceType.Book)) {
// edition
getEntity().setPublisher(text_publisher.getText());
} else if (eventSource == text_referenceAbstract) {
getEntity().setReferenceAbstract(text_referenceAbstract.getText());
- } else if (eventSource == text_series) {
- getEntity().setSeries(text_series.getText());
} else if (eventSource == text_seriesPart) {
getEntity().setSeriesPart(text_seriesPart.getText());
} else if (eventSource == text_title) {
try {
getEntity().setUri(text_uri.getUri());
} catch (URISyntaxException e) {
- AbstractUtility.warningDialog("Invalid URI", getClass(),
+ MessagingUtils.warningDialog("Invalid URI", getClass(),
e.getLocalizedMessage());
}
} else if (eventSource == text_volume) {
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.persistence.hibernate.permission.Role;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
/** {@inheritDoc} */
@Override
- protected void createControls(ICdmFormElement formElement,
- TaxonBase entity, int style) {
- toggleable_cache = formFactory.createToggleableTextField(formElement,
- "Title Cache", entity.getTitleCache(),
- entity.isProtectedTitleCache(), style);
-
- selection_secundum = formFactory
- .createSelectionElement(Reference.class,
+ protected void createControls(ICdmFormElement formElement, TaxonBase entity, int style) {
+ toggleable_cache = formFactory.createToggleableTextField(formElement,
+ "Title Cache", entity.getTitleCache(),
+ entity.isProtectedTitleCache(), style);
+
+ //TODO RL
+ boolean rl=true;
+ if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+ toggleable_cache.setVisible(false);
+ }
+ if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+ text_appendedPhrase = formFactory.createTextWithLabelElement(
+ formElement, "Appended Phrase", entity.getAppendedPhrase(),
+ SWT.NULL);
+ }
+
+ selection_secundum = formFactory.createSelectionElement(Reference.class,
getConversationHolder(), formElement, "Secundum",
entity.getSec(), EntitySelectionElement.ALL,
style);
-
- text_appendedPhrase = formFactory.createTextWithLabelElement(
- formElement, "Appended Phrase", entity.getAppendedPhrase(),
- SWT.NULL);
- checkbox_useNameCache = formFactory.createCheckbox(formElement,
- "Exclude Authorship", entity.isUseNameCache(), style);
-
- if (entity instanceof Taxon) {
- checkbox_excluded = formFactory.createCheckbox(formElement,
- "Taxon is excluded", ((Taxon) entity).isExcluded(), style);
- checkbox_unplaced = formFactory.createCheckbox(formElement,
- "Taxon is unplaced", ((Taxon) entity).isUnplaced(), style);
+
+ // TODO RL
+ if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)) {
+ checkbox_useNameCache = formFactory.createCheckbox(formElement,
+ "Exclude Authorship", entity.isUseNameCache(), style);
+
+ if (entity instanceof Taxon) {
+ checkbox_excluded = formFactory.createCheckbox(formElement,
+ "Taxon is excluded", ((Taxon) entity).isExcluded(), style);
+ checkbox_unplaced = formFactory.createCheckbox(formElement,
+ "Taxon is unplaced", ((Taxon) entity).isUnplaced(), style);
+ }
+
+ checkbox_doubtful = formFactory.createCheckbox(formElement,
+ entity.getClass().getSimpleName() + " is doubtful", entity.isDoubtful(), style);
}
-
- checkbox_doubtful = formFactory.createCheckbox(formElement,
- entity.getClass().getSimpleName() + " is doubtful", entity.isDoubtful(), style);
-
+
if (entity instanceof Taxon) {
checkbox_published = formFactory.createCheckbox(formElement,
"Taxon is published", ((Taxon) entity).isPublish(), style);
}
+
if(entity instanceof Synonym){
sectionSynonymRelationship = formFactory.createSynonymRelationshipDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
sectionSynonymRelationship.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
int style) {
text_username = formFactory.createTextWithLabelElement(formElement,
"Username", entity.getUsername(), style);
+ // Disabling the text field since the user entity is immutable
+ text_username.setEnabled(false);
if (userIsAuthenticated() || CdmStore.getLoginManager().isAdmin()) {
formFactory.createEditPasswordElement(
import java.net.URISyntaxException;\r
\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
import eu.etaxonomy.taxeditor.store.StoreUtil;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
try {\r
getEntity().setUri(uri_uri.getUri());\r
} catch (URISyntaxException e) {\r
- StoreUtil.errorDialog("Not a URI", getClass(), "You have to provide a valid URI");\r
+ MessagingUtils.messageDialog("Not a URI", getClass(), "You have to provide a valid URI");\r
}\r
} else if (eventSource == uri_uriTermSource) {\r
try {\r
getEntity().setTermSourceUri(uri_uriTermSource.getUri());\r
} catch (URISyntaxException e) {\r
- StoreUtil.errorDialog("Not a URI", getClass(), "You have to provide a valid URI");\r
+ MessagingUtils.messageDialog("Not a URI", getClass(), "You have to provide a valid URI");\r
}\r
}\r
}\r
import eu.etaxonomy.cdm.model.occurrence.Collection;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.reference.Reference;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.model.TextHelper;
import eu.etaxonomy.taxeditor.newWizard.AmplificationCloningWizardPage;
import eu.etaxonomy.taxeditor.newWizard.AmplificationGelPhotoWizardPage;
selectionElement.getConversationHolder(),
(Amplification) entity));
} else {
- AbstractUtility.warningDialog("Missing interface", this,
+ MessagingUtils.warningDialog("Missing interface", this,
"No detail element for current selection");
}
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.common.MultilanguageTextHelper;
import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
if (language != null){
languageList.add(language);
}else{
- StoreUtil.warningDialog("Empty languages", getClass(), "The multilanguage string contains invalid data. Please contact the administrator of you datasource.");
+ MessagingUtils.warningDialog("Empty languages", getClass(), "The multilanguage string contains invalid data. Please contact the administrator of you datasource.");
}
}
*/
package eu.etaxonomy.taxeditor.view;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
import eu.etaxonomy.taxeditor.editor.ISecuredEditor;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
*/
public abstract class AbstractCdmEditorViewPart extends AbstractCdmViewPart {
- /*
- * (non-Javadoc)
- *
- * @see
- * eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createPartControl(org
- * .eclipse.swt.widgets.Composite)
- */
- /** {@inheritDoc} */
- @Override
- public void createPartControl(Composite parent) {
- super.createPartControl(parent);
- }
-
- /**
- * <p>
- * getEditor
- * </p>
- *
- * @return the currently active editor
- */
- public IEditorPart getEditor() {
- return AbstractUtility.getActiveEditor();
- }
-
- /** {@inheritDoc} */
- @Override
- public void setFocus() {
- super.setFocus();
-
- if(getEditor() != null && ISecuredEditor.class.isAssignableFrom(getEditor().getClass())){
- boolean doEnable = ((ISecuredEditor)getEditor()).permissionsSatisfied();
- setEnabled(doEnable);
- }
+ private DelaySelection delaySelection = null;
+ /**
+ * This is the monitor for the DelaySelection runnable.
+ * If it is <code>true</code> then it is currently delaying a selection.
+ */
+ private boolean isInDelay = false;
+
+
+ /**
+ * This class invokes internal_selectionChanged() in a separate thread.
+ * This allows an asynchronous and/or delayed handling of selection changes
+ */
+ private class DelaySelection implements Runnable{
+ private IWorkbenchPart part;
+ private ISelection selection;
+
+ public DelaySelection(IWorkbenchPart part, ISelection selection) {
+ super();
+ this.part = part;
+ this.selection = selection;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ internal_selectionChanged(part, selection);
+ isInDelay = false;
+ }
+
+ public synchronized void setSelection(ISelection selection) {
+ this.selection = selection;
+ }
+
+ public synchronized void setPart(IWorkbenchPart part) {
+ this.part = part;
+ }
+
+ }
+
+ /**
+ * Handle selection change events here and <b>not</b> in
+ * {@link AbstractCdmEditorViewPart#selectionChanged(IWorkbenchPart, ISelection)}
+ * if you want asynchronous selection handling.
+ * @param part The workbench part that has issued the selection change
+ * @param selection the new selection
+ */
+ protected abstract void internal_selectionChanged(IWorkbenchPart part, ISelection selection);
+
+ /** {@inheritDoc} */
+ @Override
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ if(delaySelection==null){
+ delaySelection = new DelaySelection(part, selection);
+ }
+ delaySelection.setPart(part);
+ delaySelection.setSelection(selection);
+ if(!isInDelay){
+ isInDelay = true;
+ Display.getCurrent().asyncExec(delaySelection);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createPartControl(org
+ * .eclipse.swt.widgets.Composite)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void createPartControl(Composite parent) {
+ super.createPartControl(parent);
+ }
+
+ /**
+ * <p>
+ * getEditor
+ * </p>
+ *
+ * @return the currently active editor
+ */
+ public IEditorPart getEditor() {
+ return AbstractUtility.getActiveEditor();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setFocus() {
+ super.setFocus();
+
+ if(getEditor() != null && ISecuredEditor.class.isAssignableFrom(getEditor().getClass())){
+ boolean doEnable = ((ISecuredEditor)getEditor()).permissionsSatisfied();
+ setEnabled(doEnable);
+ }
}
/** {@inheritDoc} */
import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
import eu.etaxonomy.taxeditor.model.IContextListener;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.StoreUtil;
*/
@Override
public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
- monitor.subTask("Refreshing Datasource View");
+ monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
viewer.refresh();
}
*/
@Override
public void contextStop(IMemento memento, IProgressMonitor monitor) {
- monitor.subTask("Refreshing Datasource View");
+ monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
viewer.refresh();
}
*/
@Override
public void contextStart(IMemento memento, IProgressMonitor monitor) {
- monitor.subTask("Refreshing Datasource View");
+ monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
viewer.refresh();
}
}
@Override
public IStatus run(final IProgressMonitor monitor) {
try{
- logger.debug("Begin of eclipse core runtime Job to Retrieve datasources");
- monitor.beginTask("Retrieving datasources", cdmSources.size() + 1);
+ logger.debug("Begin of eclipse core runtime Job to Retrieve datasources"); //$NON-NLS-1$
+ monitor.beginTask("Retrieving datasources", cdmSources.size() + 1); //$NON-NLS-1$
final List<CdmMetaDataAwareDataSourceContainer> containers = new ArrayList<CdmMetaDataAwareDataSourceContainer>();
for(final CdmMetaDataAwareDataSourceContainer container : containers){
- if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " : next DataSourceContainer");
+ if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " : next DataSourceContainer"); //$NON-NLS-1$ //$NON-NLS-2$
container.getMetaDataFromDataSource();
- if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " : metadata retrieved, creating new runnable ...");
+ if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " : metadata retrieved, creating new runnable ..."); //$NON-NLS-1$ //$NON-NLS-2$
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
- if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " starting sub thread to update ...");
+ if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " starting sub thread to update ..."); //$NON-NLS-1$ //$NON-NLS-2$
viewer.update(container, null);
- if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " end of sub thread to update ...");
+ if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " end of sub thread to update ..."); //$NON-NLS-1$ //$NON-NLS-2$
}
});
- if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " done");
+ if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " done"); //$NON-NLS-1$ //$NON-NLS-2$
monitor.worked(1);
}
}
/** Constant <code>ID="eu.etaxonomy.taxeditor.store.datasource"{trunked}</code> */
- public static String ID = "eu.etaxonomy.taxeditor.view.datasource";
+ public static String ID = "eu.etaxonomy.taxeditor.view.datasource"; //$NON-NLS-1$
private TableViewer viewer;
Object element = ((StructuredSelection) event
.getSelection()).getFirstElement();
if (element instanceof CdmMetaDataAwareDataSourceContainer) {
- String commandId = "eu.etaxonomy.taxeditor.store.datasource.change";
+ String commandId = "eu.etaxonomy.taxeditor.store.datasource.change"; //$NON-NLS-1$
ICommandService commandService = (ICommandService)getSite().getService(ICommandService.class);
try {
handlerService.executeCommand(commandId, null);
} catch (ExecutionException e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
} catch (NotDefinedException e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
} catch (NotEnabledException e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
} catch (NotHandledException e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
}
}
}
// This will create the columns for the table
private void createColumns(TableViewer viewer) {
Table table = viewer.getTable();
- String[] titles = {"Connected", "Name", "Server", "Up", "Type", "Database", "Nomenclatural Code", "Created", "CDM Version", "Compatible", "Notes"};
+ String[] titles = {Messages.CdmDataSourceViewPart_12, Messages.CdmDataSourceViewPart_11, Messages.CdmDataSourceViewPart_10, Messages.CdmDataSourceViewPart_9, Messages.CdmDataSourceViewPart_8, Messages.CdmDataSourceViewPart_7, Messages.CdmDataSourceViewPart_6, Messages.CdmDataSourceViewPart_5, Messages.CdmDataSourceViewPart_4, Messages.CdmDataSourceViewPart_3, Messages.CdmDataSourceViewPart_2};
int[] bounds = { 24, 200, 100, 50 , 80, 120, 50, 100, 100, 50, 300};
for (int i = 0; i < titles.length; i++) {
* <p>refresh</p>
*/
public void refresh(){
- getService().schedule(new DataSourceJob("Loading datasources", CdmDataSourceRepository.getAll()), Job.LONG);
+ getService().schedule(new DataSourceJob(Messages.CdmDataSourceViewPart_1, CdmDataSourceRepository.getAll()), Job.LONG);
}
/** {@inheritDoc} */
// viewer.getTable().setEnabled(!busy);
if(busy){
partNameCache = getPartName();
- setPartName("Loading datasources");
+ setPartName(Messages.CdmDataSourceViewPart_1);
}else{
if(partNameCache != null){
setPartName(partNameCache);
import eu.etaxonomy.cdm.database.ICdmDataSource;
import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
import eu.etaxonomy.cdm.model.metadata.CdmMetaData.MetaDataPropertyName;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* <p>CdmMetaDataAwareDataSourceContainer class.</p>
// }
}
} catch (Exception e) {
- StoreUtil.error(this.getClass(), e);
+ MessagingUtils.error(this.getClass(), e);
}
}
--- /dev/null
+// $Id$\r
+/**\r
+ * Copyright (C) 2014 EDIT\r
+ * European Distributed Institute of Taxonomy\r
+ * http://www.e-taxonomy.eu\r
+ *\r
+ * The contents of this file are subject to the Mozilla Public License Version 1.1\r
+ * See LICENSE.TXT at the top of this package for the full license terms.\r
+ */\r
+package eu.etaxonomy.taxeditor.view.datasource;\r
+\r
+import org.eclipse.osgi.util.NLS;\r
+\r
+/**\r
+ * @author d.schild\r
+ * @date 18.06.2014\r
+ *\r
+ */\r
+public class Messages extends NLS {\r
+ private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$\r
+ public static String CdmDataSourceViewPart_1;\r
+ public static String CdmDataSourceViewPart_10;\r
+ public static String CdmDataSourceViewPart_11;\r
+ public static String CdmDataSourceViewPart_12;\r
+ public static String CdmDataSourceViewPart_2;\r
+ public static String CdmDataSourceViewPart_3;\r
+ public static String CdmDataSourceViewPart_4;\r
+ public static String CdmDataSourceViewPart_5;\r
+ public static String CdmDataSourceViewPart_6;\r
+ public static String CdmDataSourceViewPart_7;\r
+ public static String CdmDataSourceViewPart_8;\r
+ public static String CdmDataSourceViewPart_9;\r
+ static {\r
+ // initialize resource bundle\r
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);\r
+ }\r
+\r
+ private Messages() {\r
+ }\r
+}\r
import org.eclipse.ui.handlers.HandlerUtil;
import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.view.datasource.CdmMetaDataAwareDataSourceContainer;
/**
CdmMetaDataAwareDataSourceContainer container = (CdmMetaDataAwareDataSourceContainer) ((IStructuredSelection) selection).getFirstElement();
if(CdmStore.isConnecting()){
- StoreUtil.warningDialog("Already connecting", this, "You are currently connecting to a different datasource already.");
+ MessagingUtils.warningDialog("Already connecting", this, "You are currently connecting to a different datasource already.");
return null;
}
try {
container.getCdmSource().checkConnection();
- boolean confirmed = StoreUtil.confirmDialog("Confirm Datasource Connection", "Do you really want to connect to this datasource?\n\n"
+ boolean confirmed = MessagingUtils.confirmDialog("Confirm Datasource Connection", "Do you really want to connect to this datasource?\n\n"
+ container.getCdmSource().getName());
if(confirmed){
CdmDataSourceRepository.changeDataSource(container.getCdmSource());
}
} catch (Exception e) {
- StoreUtil.warningDialog("Chosen datasource is not available", this, "This could mean that either the database server is " +
+ MessagingUtils.warningDialog("Chosen datasource is not available", this, "This could mean that either the database server is " +
"not running or the machine is not reachable.\n\n" +
"Please also make sure that you are connected to the network when trying to connect to a remote datasource.");
- StoreUtil.warn(getClass(), e);
+ MessagingUtils.warn(getClass(), e);
return null;
}
}
import eu.etaxonomy.cdm.database.ICdmDataSource;
import eu.etaxonomy.cdm.database.update.CdmUpdater;
import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
}
}catch(Exception e){
status = new Status(IStatus.ERROR, TaxeditorStorePlugin.PLUGIN_ID, e.getMessage(), e);
- StoreUtil.errorDialog("Could not run updater", getClass(), status.getMessage());
+ MessagingUtils.messageDialog("Could not run updater", getClass(), status.getMessage());
}
}
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.mvc.combo.EnumTermComboController;
try {
handlerService.executeCommand(commandId, null);
} catch (ExecutionException e) {
- AbstractUtility.error(DerivateSearchCompositeController.class, e);
+ MessagingUtils.error(DerivateSearchCompositeController.class, e);
} catch (NotDefinedException e) {
- AbstractUtility.error(DerivateSearchCompositeController.class, e);
+ MessagingUtils.error(DerivateSearchCompositeController.class, e);
} catch (NotEnabledException e) {
- AbstractUtility.error(DerivateSearchCompositeController.class, e);
+ MessagingUtils.error(DerivateSearchCompositeController.class, e);
} catch (NotHandledException e) {
- AbstractUtility.error(DerivateSearchCompositeController.class, e);
+ MessagingUtils.error(DerivateSearchCompositeController.class, e);
}
}
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.taxeditor.model.IElementHasDetails;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
input = DerivedUnitFacade.NewInstance((DerivedUnit) input,
PreferencesUtil.getDerivedUnitConfigurator());
} catch (DerivedUnitFacadeNotSupportedException e) {
- StoreUtil.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
else if (input instanceof PolytomousKeyRelationship) {
getSite().setSelectionProvider(viewer);
}
- /** {@inheritDoc} */
@Override
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if(AbstractUtility.getActiveEditor() == null){
- showEmptyPage();
- return;
- }
-
- if(part == this){
- return;
- }
-
- if(!(selection instanceof IStructuredSelection)){
- return;
- }
-
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-
- if((part instanceof IEditorPart) || (part instanceof IPartContentHasDetails)) {
- if(structuredSelection.size() != 1){
- showEmptyPage();
- return;
- }
-
- // do not show details for feature nodes TODO really?
- if(structuredSelection.getFirstElement() instanceof FeatureNodeContainer){
- // do show the map for distributions
- Feature feature = ((FeatureNodeContainer) ((IStructuredSelection) selection).getFirstElement()).getFeature();
- if(!feature.equals(Feature.DISTRIBUTION())){
- showEmptyPage();
- return;
- }
- }
-
- showViewer(part, structuredSelection);
- }else{
- showEmptyPage();
- }
+ protected void internal_selectionChanged(IWorkbenchPart part, ISelection selection){
+ if(AbstractUtility.getActiveEditor() == null){
+ showEmptyPage();
+ return;
+ }
+
+ if(part == this){
+ return;
+ }
+
+ if(!(selection instanceof IStructuredSelection)){
+ return;
+ }
+
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+
+ if((part instanceof IEditorPart) || (part instanceof IPartContentHasDetails)) {
+ if(structuredSelection.size() != 1){
+ showEmptyPage();
+ return;
+ }
+
+ // do not show details for feature nodes TODO really?
+ if(structuredSelection.getFirstElement() instanceof FeatureNodeContainer){
+ // do show the map for distributions
+ Feature feature = ((FeatureNodeContainer) ((IStructuredSelection) selection).getFirstElement()).getFeature();
+ if(!feature.equals(Feature.DISTRIBUTION())){
+ showEmptyPage();
+ return;
+ }
+ }
+
+ showViewer(part, structuredSelection);
+ }else{
+ showEmptyPage();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.view.AbstractCdmViewPart#showEmptyPage()
+ */
+ @Override
+ public void showEmptyPage() {
+ viewer.setSelection(null);
+ super.showEmptyPage();
}
/** {@inheritDoc} */
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
input = DerivedUnitFacade.NewInstance(derivedUnit,
PreferencesUtil.getDerivedUnitConfigurator());
} catch (DerivedUnitFacadeNotSupportedException e) {
- AbstractUtility.error(getClass(), e);
+ MessagingUtils.error(getClass(), e);
}
}
else if(input instanceof FieldUnit){
@Override
public void setSelection(ISelection selection, boolean reveal) {
this.selection = selection;
- SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
- fireSelectionChanged(selectionChangedEvent);
+ if(this.selection!=null){
+ SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
+ fireSelectionChanged(selectionChangedEvent);
+ }
}
/**
private void createTaxonSections(RootElement parent) {
destroySections();
- TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
-
+ TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
- | ExpandableComposite.EXPANDED);
-
+ NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
-
+ NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE);
-
+ NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+ //TODO RL
+ if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+ ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+ NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ addPart(protologSection);
+ addPart(typeDesignationSection);
+ addPart(nameRelationshipSection);
+ }
- ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this, ExpandableComposite.EXPANDED);
+ ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
+ ExpandableComposite.EXPANDED | ExpandableComposite.EXPANDED);
addPart(taxonBaseDetailSection);
addPart(nonViralNameSection);
addPart(nomenclaturalStatusSection);
- addPart(protologSection);
- addPart(referenceDetailSection);
- addPart(typeDesignationSection);
- addPart(nameRelationshipSection);
addPart(parsingMessagesSection);
+ addPart(referenceDetailSection);
}
/**
*/
private void createNameSections(RootElement parent) {
destroySections();
- NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
-
+ NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
-
+ NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
+ NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
addPart(nonViralNameSection);
addPart(nomenclaturalStatusSection);
- addPart(protologSection);
addPart(referenceDetailSection);
- addPart(typeDesignationSection);
- addPart(nameRelationshipSection);
+//TODO RL
+ if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+ ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ addPart(protologSection);
+ addPart(typeDesignationSection);
+ addPart(nameRelationshipSection);
+ }
}
/**
private void createReferenceSections(RootElement parent) {
destroySections();
- ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
addPart(referenceDetailSection);
}
/** {@inheritDoc} */
@Override
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ protected void internal_selectionChanged(IWorkbenchPart part, ISelection selection) {
if(AbstractUtility.getActiveEditor() == null){
showEmptyPage();
return;