cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Tue, 5 Jul 2022 21:14:00 +0000 (23:14 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Tue, 5 Jul 2022 21:14:00 +0000 (23:14 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/CreateNodeOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/CreatePolytomousKeyNodeOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/DeleteNodeOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/RefreshNodeNumberingOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/AbstractPostOperation.java

index d6bf059898469c81c77cff28d232347f133f8c74..9bec986402ec592b421668be93f05cf406511e51 100644 (file)
@@ -23,7 +23,7 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
  */
 public class CreateNodeOperation extends AbstractPostTaxonOperation {
 
-       PolytomousKeyNode parentNode;
+       private PolytomousKeyNode parentNode;
        private PolytomousKeyNode childNode;
 
        public CreateNodeOperation(String label,
index 3d34d60cdbe3e2bf04a33080fc6a1e83f5a07838..128a7ab9e8dc7ca1e866fb0993e3b614074e915e 100644 (file)
@@ -15,29 +15,25 @@ import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.operation.CdmDefaultOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
 /**
  * @author cmathew
  * @date 21 Jul 2015
- *
  */
 public class CreatePolytomousKeyNodeOperation extends CdmDefaultOperation {
 
+    private final static String LABEL = Messages.RemotingCreatePolytomousKeyNodeOperation_CREATE_KEY;
+
     private final PolytomousKeyNode parentNode;
     private PolytomousKeyNode childNode;
-    /**
-    *
-    */
-   protected IPostOperationEnabled postOperationEnabled;
+    private IPostOperationEnabled postOperationEnabled;
 
     public PolytomousKeyNode getChildNode() {
         return childNode;
     }
 
-    private final static String LABEL = Messages.RemotingCreatePolytomousKeyNodeOperation_CREATE_KEY;
-
     public CreatePolytomousKeyNodeOperation(Object source,
             boolean async,
             PolytomousKeyNode parentNode, IPostOperationEnabled postOperationEnabled){
@@ -46,23 +42,14 @@ public class CreatePolytomousKeyNodeOperation extends CdmDefaultOperation {
         this.postOperationEnabled = postOperationEnabled;
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmSimpleOperation#doSimpleExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-     */
     @Override
     protected CdmBase doSimpleExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
-      childNode = PolytomousKeyNode.NewInstance();
-      parentNode.addChild(childNode);
-      if (postOperationEnabled.postOperation(childNode)){
-          return childNode;
-      }else {
-          return null;
-      }
+        childNode = PolytomousKeyNode.NewInstance();
+        parentNode.addChild(childNode);
+        if (postOperationEnabled.postOperation(childNode)){
+            return childNode;
+        } else {
+            return null;
+        }
     }
-
-
-
-
-
-
-}
+}
\ No newline at end of file
index 4c2fa5c874d7d8a1c0bcda2c87b73e47f1252ac4..4174c40db8ab050f68275946d1153ae9dff9711f 100644 (file)
@@ -1,6 +1,11 @@
 /**
- *
- */
+* Copyright (C) 2016 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.editor.key.polytomous.operation;
 
 import org.eclipse.core.commands.ExecutionException;
@@ -24,30 +29,20 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * @author n.hoffmann
- *
  */
 public class DeleteNodeOperation extends AbstractPostOperation<PolytomousKeyNode> {
 
-       private final PolytomousKeyNode parent;
        private final PolytomousKeyNode node;
        private final boolean deleteChildren;
 
        public DeleteNodeOperation(String label, IUndoContext undoContext,
                        PolytomousKeyNode node, IPostOperationEnabled postOperationEnabled, boolean deleteChildren) {
            super(label, undoContext, node, postOperationEnabled);
-           HibernateProxyHelper.deproxy(node, PolytomousKeyNode.class);
+           HibernateProxyHelper.deproxy(node);
                this.node = node;
-               this.parent = node.getParent();
                this.deleteChildren = deleteChildren;
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse
-        * .core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
        @Override
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
@@ -77,31 +72,15 @@ public class DeleteNodeOperation extends AbstractPostOperation<PolytomousKeyNode
                return postExecute(null);
        }
 
-    /*
-        * (non-Javadoc)
-        *
-        * @see
-        * org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse
-        * .core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
        @Override
        public IStatus redo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
                return execute(monitor, info);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse
-        * .core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
        @Override
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               // TODO Auto-generated method stub
                return null;
        }
-
-}
+}
\ No newline at end of file
index d3d84db585f6555bb164a613e571dbfa132bb5d0..31058f17fcd6da3571f38a0b35f6579bb012ca8f 100644 (file)
@@ -1,3 +1,11 @@
+/**
+* Copyright (C) 2016 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.editor.key.polytomous.operation;
 
 import org.eclipse.core.commands.ExecutionException;
@@ -13,52 +21,38 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 /**
  * Operation responsible for refreshing node numbers of the Polytomous Key Nodes.
  * The refresh is performed on the entire Key starting from the root.
- * 
- * @author c.mathew
  *
+ * @author c.mathew
  */
 public class RefreshNodeNumberingOperation extends AbstractPostTaxonOperation {
 
-       PolytomousKeyNode node;
-       private PolytomousKeyNode childNode;
-       
+       private PolytomousKeyNode node;
+
        public RefreshNodeNumberingOperation(String label,
-                       IUndoContext undoContext, 
-                       PolytomousKeyNode node, 
+                       IUndoContext undoContext,
+                       PolytomousKeyNode node,
                        IPostOperationEnabled postOperationEnabled) {
                super(label, undoContext, postOperationEnabled);
                this.node = node;
        }
-       
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
+
        @Override
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
 
-               node.refreshNodeNumbering();            
+               node.refreshNodeNumbering();
                return postExecute(node);
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
        @Override
        public IStatus redo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               // TODO Auto-generated method stub
                return null;
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
        @Override
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               // TODO Auto-generated method stub
                return null;
        }
-
-}
+}
\ No newline at end of file
index 894b274ea4bd6022c609ebd8a3e4180feff37770..ccff1862865bd1409550f74b2a0a3acaee4ea570 100644 (file)
@@ -72,7 +72,6 @@ public abstract class AbstractPostOperation<T extends ICdmBase> extends Abstract
         return elementUuid;
     }
 
-
     /**
      * This method will try to call the post operation on a possibly registered
      * IPostOperationEnabled implementor. Objects that were affected by the operation