+++ /dev/null
-/**
-* Copyright (C) 2019 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.navigation.navigator.e4.handler;
-
-import javax.inject.Named;
-
-import org.eclipse.core.commands.operations.AbstractOperation;
-import org.eclipse.e4.core.di.annotations.CanExecute;
-import org.eclipse.e4.ui.model.application.ui.basic.MPart;
-import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
-import org.eclipse.e4.ui.services.IServiceConstants;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.swt.widgets.Shell;
-
-import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
-import eu.etaxonomy.taxeditor.navigation.navigator.operation.SetDoubtfulOperation;
-
-/**
- * @author k.luther
- * @since 23.08.2019
- */
-public class RemoveDoubtfulHandler extends DoubtfulHandler {
-
- @Override
- public AbstractOperation prepareOperation(IStructuredSelection selection,
- Shell shell,
- MPart activePart,
- MHandledMenuItem menuItem) {
- SetDoubtfulOperation operation =
- new SetDoubtfulOperation(getTrigger(),
- true,
- taxonNodes,
- null, null, false);
-
- return operation;
- }
-
- @CanExecute
- private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){
- boolean canExecute = !selection.isEmpty();
- Object[] array = selection.toArray();
- for (Object object : array) {
- canExecute &= (object instanceof TaxonNodeDto) && (((TaxonNodeDto)object).getUuid() != null) && ((TaxonNodeDto)object).isDoubtful() && ((TaxonNodeDto)object).getTaxonUuid() != null;
- }
- menuItem.setVisible(canExecute);
- return canExecute;
- }
-}