cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Tue, 5 Jul 2022 20:55:17 +0000 (22:55 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Tue, 5 Jul 2022 20:55:17 +0000 (22:55 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/e4/PolytomousKeyListEditorE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/e4/handler/InsertNewNodeHandlerE4.java
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/InsertPolytomousKeyNodeOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/CdmDefaultOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/CdmOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/CdmUpdateOperation.java

index fd191a7cf96799a298dc9300515549f74f5df4a8..0c61d7c58e1493b9eb5c0d79aef2ab2878975f95 100644 (file)
@@ -6,7 +6,6 @@
  * 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.e4;
 
 import java.util.List;
@@ -60,10 +59,8 @@ import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
 import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
 
 /**
- *
  * @author pplitzner
  * @since Sep 28, 2017
- *
  */
 public class PolytomousKeyListEditorE4 implements
                IConversationEnabled, IDirtyMarkable, IPartContentHasDetails, IPartContentHasSupplementalData,
@@ -81,7 +78,7 @@ public class PolytomousKeyListEditorE4 implements
 
                        int selectedColumn = getSelectedColumn(table, point);
 
-                       if (table == null || point == null ){
+                       if (table == null){
                            return;
                        }
 
@@ -200,8 +197,8 @@ public class PolytomousKeyListEditorE4 implements
                this.input = input;
 
         PolytomousKey key = input.getKey();
-        key = HibernateProxyHelper.deproxy(key, PolytomousKey.class);
-        key.setRoot(HibernateProxyHelper.deproxy(key.getRoot(), PolytomousKeyNode.class));
+        key = HibernateProxyHelper.deproxy(key);
+        key.setRoot(HibernateProxyHelper.deproxy(key.getRoot()));
         thisPart.setLabel(key.getTitleCache());
 
         viewer.setInput(input);
@@ -307,7 +304,6 @@ public class PolytomousKeyListEditorE4 implements
         }
         dirty.setDirty(true);
         viewer.refresh();
-
        }
 
     @Override
index 836ccdbc588da4383606690d615a5530d1c881d9..cb45601092f59e7cf9a74cae0435a373a3a21466 100644 (file)
@@ -30,13 +30,11 @@ import eu.etaxonomy.taxeditor.operation.e4.CdmHandlerE4;
 /**
  * @author k.luther
  * @date 17.11.2016
- *
  */
 public class InsertNewNodeHandlerE4 extends CdmHandlerE4{
 
     private PolytomousKeyNode parentNode ;
 
-
     public InsertNewNodeHandlerE4() {
         super(PolytomousKeyEditorLabels.INSERT_NODE_POLYTOMOUS_KEY_NODE_LABEL);
     }
@@ -76,8 +74,7 @@ public class InsertNewNodeHandlerE4 extends CdmHandlerE4{
     }
 
     @Override
-    public void onComplete() {
-    }
+    public void onComplete() {}
 
     @CanExecute
     public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
@@ -85,12 +82,8 @@ public class InsertNewNodeHandlerE4 extends CdmHandlerE4{
         return true;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     protected Object getTrigger() {
         return this;
     }
-
-}
+}
\ No newline at end of file
index aa1a363f964e4966947112a26db956c8903fbe07..d6bf059898469c81c77cff28d232347f133f8c74 100644 (file)
@@ -1,6 +1,11 @@
 /**
- *
- */
+* Copyright (C) 2015 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;
@@ -15,7 +20,6 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
 /**
  * @author n.hoffmann
- *
  */
 public class CreateNodeOperation extends AbstractPostTaxonOperation {
 
@@ -28,9 +32,6 @@ public class CreateNodeOperation extends AbstractPostTaxonOperation {
                this.parentNode = parentNode;
        }
 
-       /* (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 {
@@ -42,24 +43,15 @@ public class CreateNodeOperation extends AbstractPostTaxonOperation {
                return postExecute(childNode);
        }
 
-       /* (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 a865e77e7eb6deb7cbdf116fca5d2ba75e2f2674..1957642a9004a60d793ea93d8c769ceca8ec9d60 100644 (file)
@@ -18,31 +18,21 @@ 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 k.luther
  * @date 17.11.2016
- *
  */
 public class InsertPolytomousKeyNodeOperation extends CdmDefaultOperation  {
 
-    private final PolytomousKeyNode parentNode;
-
     private final static String LABEL = Messages.InsertPolytomousKeyNodeOperation_INSERT_KEY;
 
-    /**
-    *
-    */
-   protected IPostOperationEnabled postOperationEnabled;
+    private final PolytomousKeyNode parentNode;
+
+    protected IPostOperationEnabled postOperationEnabled;
 
-    /**
-     * @param label
-     * @param action
-     * @param source
-     * @param async
-     */
     public InsertPolytomousKeyNodeOperation(Object source,
             boolean async,
             PolytomousKeyNode parentNode, IPostOperationEnabled postOperationEnabled) {
@@ -51,14 +41,11 @@ public class InsertPolytomousKeyNodeOperation extends CdmDefaultOperation  {
         this.postOperationEnabled = postOperationEnabled;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     protected CdmBase doSimpleExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
         PolytomousKeyNode childNode = PolytomousKeyNode.NewInstance();
         List<PolytomousKeyNode> newChildren = parentNode.getChildren();
-        List<PolytomousKeyNode> copy = new ArrayList<PolytomousKeyNode>();
+        List<PolytomousKeyNode> copy = new ArrayList<>();
         for (PolytomousKeyNode node: newChildren) {
             copy.add(node);
         }
@@ -69,5 +56,4 @@ public class InsertPolytomousKeyNodeOperation extends CdmDefaultOperation  {
         this.postOperationEnabled.postOperation(childNode);
         return childNode;
     }
-
-}
+}
\ No newline at end of file
index 1d084ef1fecab70b70ba5b46cdfcea652a0bf4ae..b857b2f79853dc94436b4d0ec080e39fe554d9bd 100644 (file)
@@ -19,7 +19,6 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 /**
  * @author cmathew
  * @date 21 Jul 2015
- *
  */
 public abstract class CdmDefaultOperation extends CdmOperation {
 
@@ -28,9 +27,7 @@ public abstract class CdmDefaultOperation extends CdmOperation {
     public CdmDefaultOperation(String label, Action action, Object source, boolean async) {
         super(label, action, source, async);
     }
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#doExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-     */
+
     @Override
     protected boolean doExecute(IProgressMonitor monitor, IAdaptable info) {
         try {
@@ -48,14 +45,10 @@ public abstract class CdmDefaultOperation extends CdmOperation {
         if(success && cdmEntity != null) {
             fireDataChangeEvent(cdmEntity);
         }
-
     }
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#onComplete(boolean)
-     */
+
     @Override
     protected IStatus onComplete(boolean success) {
         return Status.OK_STATUS;
     }
-
-}
+}
\ No newline at end of file
index ed7263fae8b6b6f8b7b3320200efcc1f521feadc..7ae5efccfa87be64738eb7d1f38f11bf01e308b5 100644 (file)
@@ -25,14 +25,13 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 /**
  * @author cmathew
  * @date 16 Jun 2015
- *
  */
 public abstract class CdmOperation extends AbstractOperation {
 
     private final Object source;
     private final Action action;
     private final boolean async;
-    protected Class entityType;
+    protected Class<?> entityType;
 
     public CdmOperation(String label, Action action, Object source, boolean async) {
         super(label);
@@ -41,9 +40,6 @@ public abstract class CdmOperation extends AbstractOperation {
         this.async = async;
     }
 
-    /* (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 {
 
@@ -76,22 +72,13 @@ public abstract class CdmOperation extends AbstractOperation {
         }
     }
 
-    /* (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 7bfb77da243c50f090eb84a9064ad2eaa51535c0..ca015334f7776b466082d42fafd9eabbccd4a2b7 100644 (file)
@@ -104,7 +104,7 @@ public abstract class CdmUpdateOperation extends CdmOperation {
 
             Status[] childStatus = new Status[exceptions.size()];
             int count = 0;
-            Set<String> messages = new HashSet<String>();
+            Set<String> messages = new HashSet<>();
             for(Exception ex : exceptions) {
                 Status status = new Status(statusFlag,
                         "unknown",