import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
+import eu.etaxonomy.taxeditor.workbench.part.ISelectionElementEditingPart;
/**
* @author pplitzner
* @since Aug 10, 2017
*
*/
-public abstract class AbstractCdmEditorPartE4 implements IConversationEnabled, IDirtyMarkable{
+public abstract class AbstractCdmEditorPartE4 implements IConversationEnabled, IDirtyMarkable, ISelectionElementEditingPart{
protected AbstractCdmDataViewerE4 viewer;
return null;
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Object getSelectionProvidingPart() {
+ return selectionProvidingPart;
+ }
+
@PreDestroy
public void dispose() {
}
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.model.description.Feature;
showEmptyPage();
return;
}
- if((partObject instanceof IEditorPart) || (partObject instanceof IPartContentHasDetails)
- && partObject instanceof IConversationEnabled) {
+ if(partObject instanceof IPartContentHasDetails){
+ if(partObject instanceof IConversationEnabled && ((IConversationEnabled) partObject).getConversationHolder()==null) {
+ //TODO show specific message (refactor EmptyElement to allow specific messages)
+ showEmptyPage();
+ return;
+ }
// do not show details for feature nodes TODO strange check to avoid having shown the distribution map for every FeatureNodeContainer
if(structuredSelection.getFirstElement() instanceof FeatureNodeContainer){
// do show the map for distributions
else if(savablePart instanceof IE4SavablePart){
((IE4SavablePart) savablePart).save(new NullProgressMonitor());
}
+ else if(savablePart instanceof MPart){
+ savePart(partService, commandService, handlerService, (MPart) savablePart);
+ }
}
}
}
private Object findSavablePart(ISelectionElementEditingPart part){
Object selectionProvidingPart = part.getSelectionProvidingPart();
- if(selectionProvidingPart instanceof ISaveablePart || selectionProvidingPart instanceof IE4SavablePart){
+ if(selectionProvidingPart instanceof ISaveablePart || selectionProvidingPart instanceof IE4SavablePart || selectionProvidingPart instanceof MPart){
return selectionProvidingPart;
}
else if(selectionProvidingPart instanceof ISelectionElementEditingPart){