import org.eclipse.jface.viewers.IStructuredSelection;
import eu.etaxonomy.cdm.model.description.FeatureTree;
-import eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor;
+import eu.etaxonomy.taxeditor.featuretree.e4.IFeatureTreeEditor;
import eu.etaxonomy.taxeditor.featuretree.e4.operation.RemoveFeatureTreeOperation;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.store.StoreUtil;
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart thisPart,
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, UISynchronize sync){
- FeatureTreeEditor editor = (FeatureTreeEditor) thisPart.getObject();
+ IFeatureTreeEditor editor = (IFeatureTreeEditor) thisPart.getObject();
- if (StoreUtil.checkDirty(editor)) {
+ if (StoreUtil.promptCheckIsDirty(editor)) {
return;
}
if(!StoreUtil.confirmDelete()){
FeatureTree featureTree = (FeatureTree) selectedObject;
RemoveFeatureTreeOperation operation = new RemoveFeatureTreeOperation(featureTree, editor, editor);
AbstractUtility.executeOperation(operation, sync);
-// editor.getViewer().remove(featureTree);
-// editor.getRootEntities().remove(featureTree);
}
}
canExecute &= object instanceof FeatureTree;
}
}
- canExecute &= thisPart.getObject() instanceof FeatureTreeEditor;
+ canExecute &= thisPart.getObject() instanceof IFeatureTreeEditor;
menuItem.setVisible(canExecute);
return canExecute;
}