+++ /dev/null
-package eu.etaxonomy.taxeditor.molecular.handler;
-
-
-import javax.inject.Named;
-
-import org.eclipse.e4.core.di.annotations.CanExecute;
-import org.eclipse.e4.core.di.annotations.Execute;
-import org.eclipse.e4.core.di.annotations.Optional;
-import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
-import org.eclipse.e4.ui.services.IServiceConstants;
-import org.eclipse.jface.viewers.TreeNode;
-
-import eu.etaxonomy.cdm.model.molecular.Sequence;
-
-
-
-/**
- * Opens the alignment editor from the CDM tree.
- *
- * @author Ben Stöver
- * @author pplitzner
- */
-public class EditSequenceHandler {
- private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(EditSequenceHandler.class);
-
-
- @Execute
- public void execute(@Optional@Named(IServiceConstants.ACTIVE_SELECTION)TreeNode treeNodeOfSelection) {
- if(treeNodeOfSelection != null && treeNodeOfSelection.getValue() instanceof Sequence){
-// AlignmentEditorInput input = new AlignmentEditorInput(((Sequence)treeNodeOfSelection.getValue()).getUuid()); //TODO Should there always be a new instance created here? What if the specified CDM node is already opened in an AlignmentEditor? => Possible create Singleton that keeps instances by sequence objects in a map.
-// try {
-// TaxeditorMolecularPlugin.getDefault().getWorkbench()
-// .getActiveWorkbenchWindow().getActivePage().openEditor(input, AlignmentEditor.ID);
-// }
-// catch (PartInitException e) {
-// logger.error(Messages.EditSequenceHandler_COULD_NOT_OPEN, e);
-// }
- }
- }
-
- @CanExecute
- public boolean canExecute(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) TreeNode selectedTreeNode, MHandledMenuItem menuItem) {
- boolean canExecute = false;
- if(selectedTreeNode!=null){
- Object value = selectedTreeNode.getValue();
- canExecute = value instanceof Sequence;
- }
- menuItem.setVisible(canExecute);
- return canExecute;
- }
-}