implemented user management, fixes #803. Minor refactorings.
[taxeditor.git] / taxeditor-navigation / src / main / java / eu / etaxonomy / taxeditor / navigation / NavigationUtil.java
index bfe4f19586bf0211749cf39a8aecabd4ea44d2fe..6c13ec8ccfa8af979b40a306eebd96e1d48a7ec9 100644 (file)
@@ -15,15 +15,8 @@ import java.util.UUID;
 
 import org.apache.log4j.Logger;
 import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.IOperationHistory;
 import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.core.commands.operations.IUndoableOperation;
 import org.eclipse.core.commands.operations.UndoContext;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.IStatusLineManager;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TreeSelection;
@@ -32,7 +25,6 @@ import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.ide.undo.WorkspaceUndoUtil;
 import org.eclipse.ui.navigator.CommonViewer;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
@@ -53,7 +45,6 @@ import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
  */
 public class NavigationUtil extends AbstractUtility{
        private static final Logger logger = Logger.getLogger(NavigationUtil.class);
-       private static IStatusLineManager statusLineManager;
        private static IUndoContext defaultUndoContext;
        
        /**
@@ -91,40 +82,10 @@ public class NavigationUtil extends AbstractUtility{
                }
        }
        
-       public static IOperationHistory getWorkbenchOperationHistory() {
-               return TaxeditorEditorPlugin.getDefault().getWorkbench().
-                                       getOperationSupport().getOperationHistory();
-       }
-       
        public static IUndoContext getWorkbenchUndoContext() {
                return TaxeditorEditorPlugin.getDefault().getWorkbench().
                                        getOperationSupport().getUndoContext();
        }
-       
-       public static void executeOperation(IUndoableOperation operation){
-               try {
-                       IStatus status = getWorkbenchOperationHistory().execute(operation, getMonitor(),
-                                                               WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
-                       String statusString = status.equals(Status.OK_STATUS) ? "completed" : "cancelled";
-                       setStatusLine(operation.getLabel() + " " + statusString + ".");
-               } catch (ExecutionException e) {
-                       logger.error("Error executing operation: " + operation.getLabel(), e);
-               }
-       }
-       
-       private static IProgressMonitor getMonitor() {
-               statusLineManager.setCancelEnabled(false);
-               return statusLineManager.getProgressMonitor();
-       }
-       
-       public static void setStatusLineManager(IStatusLineManager manager) {
-               statusLineManager = manager;
-       }
-
-       public static void setStatusLine(String message) {
-               statusLineManager.setMessage(message);
-       }
-       
 
        /**
         * Returns the selected taxon for referencing in context menus