- unified "New Image Gallery" command and handler for TaxonEditor and BulkEditor
- Removed "Add Derived/Field Unit Media" command
- added interface IPartContentHasMedia to specify that the MediaView should react to selection changes of implementers
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicMarkerTypeEditingMenu.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicNewObjectMenu.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/OpenBulkEditorContributionItem.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AbstractAddDerivedUnitFacadeMediaHandler.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AddDerivedUnitMediaHandler.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AddFieldObjectMediaHandler.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/operation/AddDerivedUnitFacadeMediaOperation.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/MergeGroupHandler.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/OpenBulkEditorHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DynamicFeatureMenu.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionElementsHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionToOtherTaxonHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/AddDerivedUnitFacadeMediaOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/CreateDescriptionElementOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/CreateSpecimenDescriptionOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/CreateTaxonDescriptionOperation.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartChangeListener.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasDetails.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasFactualData.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasMedia.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasSupplementalData.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
style="push">\r
</command>\r
</menuContribution>\r
- <menuContribution\r
- allPopups="false"\r
- locationURI="popup:eu.etaxonomy.taxeditor.editor.view.media">\r
- <command\r
- commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addDerivedUnitMedia"\r
- label="Add Derived Unit Media"\r
- style="push">\r
- <visibleWhen>\r
- <not>\r
- <reference\r
- definitionId="isTaxonEditor">\r
- </reference>\r
- </not>\r
- </visibleWhen>\r
- </command>\r
- <command\r
- commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addFieldObjectMedia"\r
- label="Add Field Object Media"\r
- style="push">\r
- <visibleWhen>\r
- <not>\r
- <reference\r
- definitionId="isTaxonEditor">\r
- </reference>\r
- </not>\r
- </visibleWhen>\r
- </command>\r
- </menuContribution>\r
<menuContribution\r
allPopups="false"\r
locationURI="popup:#DataImportEditorContext">\r
properties="isMergingEnabled"\r
type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
</propertyTester>\r
+ <propertyTester\r
+ class="eu.etaxonomy.taxeditor.bulkeditor.PropertyTester"\r
+ id="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
+ namespace="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
+ properties="isDerivedUnitEditor"\r
+ type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
+ </propertyTester>\r
</extension>\r
<extension\r
point="org.eclipse.ui.handlers">\r
name="%page.name.0">\r
</page>\r
</extension>\r
- <extension\r
- point="org.eclipse.core.expressions.propertyTesters">\r
- <propertyTester\r
- class="eu.etaxonomy.taxeditor.bulkeditor.PropertyTester"\r
- id="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
- namespace="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
- properties="isDerivedUnitEditor"\r
- type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
- </propertyTester>\r
- </extension>\r
<extension\r
point="org.eclipse.ui.perspectiveExtensions">\r
<perspectiveExtension\r
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
- * <p>BulkEditor class.</p>
+ * <p>
+ * BulkEditor class.
+ * </p>
*
* @author p.ciardelli
* @created 07.07.2009
* @version 1.0
*/
-public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDetails, IDirtyMarkableSelectionProvider{
+public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDetails, IPartContentHasMedia,
+ IDirtyMarkableSelectionProvider {
/** Constant <code>ID="bulkeditor.editor"</code> */
public static final String ID = "bulkeditor.editor";
+++ /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.bulkeditor.derivedunit.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.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-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;
-
-/**
- * @author n.hoffmann
- * @created Feb 11, 2011
- * @version 1.0
- */
-public abstract class AbstractAddDerivedUnitFacadeMediaHandler extends AbstractHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @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);
- IEditorInput input = editor.getEditorInput();
-
-
- if(input instanceof OccurrenceEditorInput){
- BulkEditor bulkEditor = (BulkEditor) editor;
- ISelection selection = bulkEditor.getSelectionProvider().getSelection();
-
- if(selection instanceof IStructuredSelection){
- Object element = ((IStructuredSelection) selection).getFirstElement();
- if(element instanceof DerivedUnit){
-
- try{
- AbstractPostOperation operation = new AddDerivedUnitFacadeMediaOperation(event.getCommand().getName(), BulkEditorUtil.getUndoContext(), (DerivedUnit) element, getMode(), postOperationEnabled);
- BulkEditorUtil.executeOperation(operation);
- } catch (NotDefinedException e) {
- MessagingUtils.warn(getClass(), "Command name not set.");
- }
- }
- }
- }
- return null;
- }
-
- /**
- * @return
- */
- protected abstract int getMode();
-
-}
+++ /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.bulkeditor.derivedunit.handler;
-
-import eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation.AddDerivedUnitFacadeMediaOperation;
-
-
-/**
- * @author n.hoffmann
- * @created Feb 7, 2011
- * @version 1.0
- */
-public class AddDerivedUnitMediaHandler extends AbstractAddDerivedUnitFacadeMediaHandler {
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AbstractAddDerivedUnitFacadeMediaHandler#getMode()
- */
- @Override
- protected int getMode() {
- return AddDerivedUnitFacadeMediaOperation.DERIVED_UNIT_MEDIA;
- }
-
-
-}
+++ /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.bulkeditor.derivedunit.handler;
-
-import eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation.AddDerivedUnitFacadeMediaOperation;
-
-/**
- * @author n.hoffmann
- * @created Feb 11, 2011
- * @version 1.0
- */
-public class AddFieldObjectMediaHandler extends
- AbstractAddDerivedUnitFacadeMediaHandler {
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AbstractAddDerivedUnitFacadeMediaHandler#getMode()
- */
- @Override
- protected int getMode() {
- return AddDerivedUnitFacadeMediaOperation.FIELD_OBJECT_MEDIA;
- }
-
-}
commandId="taxeditor-editor.command.newimagegallery"
label="%command.label.37"
style="push">
+ <visibleWhen>
+ <or>
+ <reference
+ definitionId="isBulkEditor">
+ </reference>
+ <reference
+ definitionId="isTaxonEditor">
+ </reference>
+ <reference
+ definitionId="isDerivateEditor">
+ </reference>
+ </or>
+ </visibleWhen>
</command>
<separator
name="taxeditor-editor.separator1"
</test>
</with>
</definition>
+ <definition
+ id="isBulkEditor">
+ <with
+ variable="selection">
+ <test
+ property="eu.etaxonomy.taxeditor.descriptions.propertyTester.isBulkEditor">
+ </test>
+ </with>
+ </definition>
+ <definition
+ id="isDerivateEditor">
+ <with
+ variable="selection">
+ <test
+ property="eu.etaxonomy.taxeditor.descriptions.propertyTester.isDerivateEditor">
+ </test>
+ </with>
+ </definition>
<definition
id="isDescription">
<with
class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DescriptionsMenuPropertyTester"
id="eu.etaxonomy.taxeditor.descriptions.PropertyTester"
namespace="eu.etaxonomy.taxeditor.descriptions.propertyTester"
- properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor"
+ properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor,isBulkEditor,isDerivateEditor"
type="org.eclipse.jface.viewers.TreeSelection">
</propertyTester>
<propertyTester
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
private static final String DELETABLE = "isDeletable";
private static final String IMAGE_GALLERY = "isImageGallery";
private static final String TAXON_EDITOR = "isTaxonEditor";
+ private static final String BULK_EDITOR = "isBulkEditor";
+ private static final String DERIVATE_EDITOR = "isDerivateEditor";
/* (non-Javadoc)
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
if(TAXON_EDITOR.equals(property)){
return isTaxonEditor();
}
+ else if(BULK_EDITOR.equals(property)){
+ return isBulkEditor();
+ }
+ else if(DERIVATE_EDITOR.equals(property)){
+ return isDerivateEditor();
+ }
Object[] selectedElements = ((IStructuredSelection) receiver).toArray();
}
return false;
}
+
+ private boolean isBulkEditor() {
+ if(AbstractUtility.getActiveEditor() instanceof BulkEditor){
+ return true;
+ }
+ return false;
+ }
+
+ private boolean isDerivateEditor() {
+ if(AbstractUtility.getActiveEditor() instanceof DerivateView){
+ return true;
+ }
+ return false;
+ }
}
// $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.
*/
-package eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation;
+package eu.etaxonomy.taxeditor.editor.view.descriptive.operation;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.operations.IUndoContext;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
-import eu.etaxonomy.cdm.model.description.DescriptionBase;
-import eu.etaxonomy.cdm.model.description.SpecimenDescription;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
* @created Feb 11, 2011
* @version 1.0
*/
-public class AddDerivedUnitFacadeMediaOperation extends
- AbstractPostTaxonOperation {
+public class AddDerivedUnitFacadeMediaOperation extends AbstractPostTaxonOperation {
+
+ private final SpecimenOrObservationBase<?> specimen;
- public static final int DERIVED_UNIT_MEDIA = 0;
- public static final int FIELD_OBJECT_MEDIA = 1;
-
- private DerivedUnit derivedUnit;
- private int mode;
-
/**
* @param label
* @param undoContext
* @param postOperationEnabled
*/
- public AddDerivedUnitFacadeMediaOperation(String label, IUndoContext undoContext, DerivedUnit derivedUnit,
- int mode, IPostOperationEnabled postOperationEnabled) {
+ public AddDerivedUnitFacadeMediaOperation(String label, IUndoContext undoContext, SpecimenOrObservationBase<?> specimen,
+ IPostOperationEnabled postOperationEnabled) {
super(label, undoContext, postOperationEnabled);
-
- this.derivedUnit = derivedUnit;
- this.mode = mode;
+
+ this.specimen = specimen;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
*/
@Override
- public IStatus execute(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
DerivedUnitFacade facade;
try {
- facade = DerivedUnitFacade.NewInstance(derivedUnit);
-
- createImageGallery(facade);
+ if(specimen instanceof FieldUnit){
+ facade = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit) specimen);
+ facade.getFieldObjectImageGallery(true);
+ }
+ else if(specimen instanceof DerivedUnit){
+ facade = DerivedUnitFacade.NewInstance((DerivedUnit)specimen);
+ facade.getDerivedUnitImageGallery(true);
+ }
} catch (DerivedUnitFacadeNotSupportedException e) {
MessagingUtils.error(getClass(), e);
}
-
- return postExecute(derivedUnit);
- }
-
-
- /**
- * @param facade
- * @return
- */
- protected void createImageGallery(DerivedUnitFacade facade){
- if(mode == DERIVED_UNIT_MEDIA){
- facade.getDerivedUnitImageGallery(true);
- }
- else if(mode == FIELD_OBJECT_MEDIA){
- facade.getFieldObjectImageGallery(true);
- }
- else{
- throw new IllegalArgumentException("Mode not supported: " + mode);
- }
+ return postExecute(specimen);
}
+
/* (non-Javadoc)
* @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
*/
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
showViewer(part, new StructuredSelection(input));
}
- if(part instanceof BulkEditor && selection instanceof IStructuredSelection){
+ else if(part instanceof IPartContentHasMedia && selection instanceof IStructuredSelection){
showViewer(part, (IStructuredSelection) selection);
}
}
/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.editor.view.media.handler;
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.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.handlers.HandlerUtil;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.AddDerivedUnitFacadeMediaOperation;
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;
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
/** {@inheritDoc} */
- public Object execute(ExecutionEvent event) throws ExecutionException {
+ @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);
IEditorInput input = editor.getEditorInput();
+
if (input instanceof TaxonEditorInput) {
- Taxon taxon = ((TaxonEditorInput) input).getTaxon();
- AbstractPostOperation operation;
+ Taxon taxon = ((TaxonEditorInput) input).getTaxon();
+ AbstractPostOperation<?> operation;
try {
// TODO use undo context specific to editor
- operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(),
+ operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(),
EditorUtil.getUndoContext(), taxon, postOperationEnabled, true);
- EditorUtil.executeOperation(operation);
+ AbstractUtility.executeOperation(operation);
} catch (NotDefinedException e) {
MessagingUtils.warn(getClass(), "Command name not set.");
}
- }
+ }
+ else if(input instanceof OccurrenceEditorInput){
+ BulkEditor bulkEditor = (BulkEditor) editor;
+ ISelection selection = bulkEditor.getSelectionProvider().getSelection();
+
+ if(selection instanceof IStructuredSelection){
+ Object element = ((IStructuredSelection) selection).getFirstElement();
+ if(element instanceof SpecimenOrObservationBase<?>){
+ try {
+ AbstractPostOperation<?> operation = new AddDerivedUnitFacadeMediaOperation(event.getCommand().getName(),
+ BulkEditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>)element, postOperationEnabled);
+ AbstractUtility.executeOperation(operation);
+ } catch (NotDefinedException e) {
+ MessagingUtils.warn(getClass(), "Command name not set.");
+ }
+ }
+ }
+ }
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.model;
+
+
+/**
+ *
+ * Clients implementing this interface indicate, that the data they present is suitable for the media view
+ * and that the media view should handle selection from the implementing part.
+ *
+ * @author pplitzner
+ * @date Sep 16, 2014
+ *
+ */
+public interface IPartContentHasMedia {
+
+}