cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Mon, 22 Feb 2021 16:29:44 +0000 (17:29 +0100)
committerAndreas Müller <a.mueller@bgbm.org>
Mon, 22 Feb 2021 16:29:44 +0000 (17:29 +0100)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AbstractMoveImageHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddExistingMediaHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddImageGalleryHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/CreateMediaHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/DeleteMediaHandler.java

index bd3b377c556c5595e81c1acc9aaa240b82c79546..f3e2793f8c768fed87cdae969ac24a10df356ecf 100644 (file)
@@ -36,9 +36,9 @@ import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
 /**
  * @author pplitzner
  * @since Jun 6, 2018
- *
  */
 public abstract class AbstractMoveImageHandler {
+
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart,
             MMenuItem menuItem,
@@ -56,14 +56,14 @@ public abstract class AbstractMoveImageHandler {
             TreeSelection selection = (TreeSelection) mediaView.getViewer().getSelection();
             TreePath[] paths = selection.getPaths();
             int count = paths[0].getSegmentCount();
-            DescriptionBase description = null;
+            DescriptionBase<?> description = null;
             for (int i = 0; i < count; i++ ) {
                 if (paths[0].getSegment(i) instanceof DescriptionBase) {
-                    description = (DescriptionBase) paths[0].getSegment(i);
+                    description = (DescriptionBase<?>) paths[0].getSegment(i);
                     break;
                 }
             }
-            AbstractPostOperation operation = null;
+            AbstractPostOperation<?> operation = null;
             // TODO use undo context specific to editor
             operation = new MoveMediaInListOperation(menuItem.getLocalizedLabel(),
                     EditorUtil.getUndoContext(),
index 10c774fb2d0a23e5ac22a86519807d1906609361..1d83d656f080116bbfd6451e2d98f74229976ee9 100644 (file)
@@ -1,3 +1,11 @@
+/**
+* Copyright (C) 2018 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.view.media.handler;
 
 import javax.inject.Named;
@@ -30,7 +38,7 @@ public class AddExistingMediaHandler  {
 
         MediaViewPartE4 mediaView = (MediaViewPartE4) activePart.getObject();
 
-        AbstractPostOperation operation = null;
+        AbstractPostOperation<?> operation = null;
         //select media
         Media media = MediaSelectionDialog.select(AbstractUtility.getShell(),// null,
                 null);
@@ -50,5 +58,4 @@ public class AddExistingMediaHandler  {
         menuItem.setVisible(canExecute);
         return canExecute;
     }
-
-}
+}
\ No newline at end of file
index c7e720062c909bec4de163d6c5c6c9c2c1165c30..8fff252e833a99896a19b075af5b195d7ada8b13 100644 (file)
@@ -1,6 +1,11 @@
 /**
- *
- */
+* Copyright (C) 2018 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.view.media.handler;
 
 import javax.inject.Named;
@@ -24,14 +29,11 @@ import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 
 /**
- *
  * @author pplitzner
  * @since Aug 14, 2017
- *
  */
 public class AddImageGalleryHandler {
 
-    /** {@inheritDoc} */
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, MMenuItem menuItem,
             UISynchronize sync) {
@@ -58,5 +60,4 @@ public class AddImageGalleryHandler {
             }
         }
     }
-
-}
+}
\ No newline at end of file
index 497cb3c6fe7a425681ddb051bb093cf49e9e910d..f48d60a90bdaf5a04f90e206b4c00c2a3f6cb514 100644 (file)
@@ -1,6 +1,11 @@
 /**
- *
- */
+* Copyright (C) 2018 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.view.media.handler;
 
 import javax.inject.Named;
@@ -23,10 +28,8 @@ import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 
 /**
- *
  * @author pplitzner
  * @since Aug 14, 2017
- *
  */
 public class CreateMediaHandler {
 
@@ -37,7 +40,7 @@ public class CreateMediaHandler {
 
         MediaViewPartE4 mediaView = (MediaViewPartE4) activePart.getObject();
 
-        AbstractPostOperation operation = null;
+        AbstractPostOperation<?> operation = null;
         // TODO use undo context specific to editor
         operation = new AddMediaToImageGalleryOperation(menuItem.getLocalizedLabel(),
                 EditorUtil.getUndoContext(), (DescriptionBase<?>) selection.getFirstElement(), mediaView);
@@ -52,5 +55,4 @@ public class CreateMediaHandler {
         menuItem.setVisible(canExecute);
         return canExecute;
     }
-
-}
+}
\ No newline at end of file
index a32a8d76730528fff799994902708d7a456ee98b..1314979b18b1c4e03832ad5501e4401b3e99766d 100644 (file)
@@ -1,6 +1,11 @@
 /**
- *
- */
+* Copyright (C) 2018 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.view.media.handler;
 
 import java.util.ArrayList;
@@ -43,10 +48,8 @@ import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.ui.dialog.configurator.deleteConfigurator.DeleteConfiguratorDialog;
 
 /**
- *
  * @author pplitzner
  * @since Aug 15, 2017
- *
  */
 public class DeleteMediaHandler  {
 
@@ -59,14 +62,14 @@ public class DeleteMediaHandler  {
         MediaViewPartE4 mediaView = (MediaViewPartE4) activePart.getObject();
         TreeSelection selection = (TreeSelection) mediaView.getViewer().getSelection();
 
-        for(Iterator iter = selection.iterator();iter.hasNext();){
+        for(Iterator<?> iter = selection.iterator();iter.hasNext();){
             Object object = iter.next();
             TreePath[] paths = selection.getPaths();
             int count = paths[0].getSegmentCount();
-            DescriptionBase description = null;
+            DescriptionBase<?> description = null;
             for (int i = 0; i < count; i++ ) {
                 if (paths[0].getSegment(i) instanceof DescriptionBase) {
-                    description = (DescriptionBase) paths[0].getSegment(i);
+                    description = (DescriptionBase<?>) paths[0].getSegment(i);
                     break;
                 }
             }
@@ -81,13 +84,13 @@ public class DeleteMediaHandler  {
                 mediaList.add((Media)object);
                 createMediaDeleteOperation(menuItem.getLocalizedLabel(), sync, mediaView, mediaList, description, config);
             }
-            if(object instanceof DescriptionBase && ((DescriptionBase) object).isImageGallery()){
-                if (!((DescriptionBase)object).getElements().isEmpty()){
+            if(object instanceof DescriptionBase && ((DescriptionBase<?>) object).isImageGallery()){
+                if (!((DescriptionBase<?>)object).getElements().isEmpty()){
                     MediaDeletionConfigurator config = fillDeleteConfigurator(shell, description, Messages.DeleteMediaHandler_CONFIRM_MESSAGE_DESCRIPTION);
                     if (config == null){
                         return;
                     }
-                    Iterator<DescriptionElementBase> elements = ((DescriptionBase)object).getElements().iterator();
+                    Iterator<DescriptionElementBase> elements = ((DescriptionBase<?>)object).getElements().iterator();
                     DescriptionElementBase element = elements.next();
                     createMediaDeleteOperation(menuItem.getLocalizedLabel(), sync, mediaView, element.getMedia(), description, config);
                 }
@@ -120,7 +123,7 @@ public class DeleteMediaHandler  {
     }
 
     public void createMediaDeleteOperation(String menuLabel, UISynchronize sync, MediaViewPartE4 mediaView,
-            List<Media> media, DescriptionBase description, MediaDeletionConfigurator config) {
+            List<Media> media, DescriptionBase<?> description, MediaDeletionConfigurator config) {
         AbstractPostOperation<?> operation = new DeleteMediaOperation(menuLabel, EditorUtil.getUndoContext(), description, media, config, mediaView);
         if (mediaView.getSelectionProvidingPart().getObject() instanceof TaxonNameEditorE4){
             if (!config.isOnlyRemoveFromGallery()){
@@ -147,7 +150,7 @@ public class DeleteMediaHandler  {
         }
     }
 
-    public MediaDeletionConfigurator fillDeleteConfigurator(Shell shell, DescriptionBase description, String message) {
+    public MediaDeletionConfigurator fillDeleteConfigurator(Shell shell, DescriptionBase<?> description, String message) {
         MediaDeletionConfigurator config = new MediaDeletionConfigurator();
 
         config.setDeleteFromDescription(true);
@@ -176,10 +179,10 @@ public class DeleteMediaHandler  {
         ISelection selection = mediaView.getViewer().getSelection();
 
         boolean canExecute = selection instanceof TreeSelection && !selection.isEmpty();
-        for(Iterator iter = ((TreeSelection) selection).iterator();iter.hasNext();){
+        for(Iterator<?> iter = ((TreeSelection) selection).iterator();iter.hasNext();){
             Object object = iter.next();
             canExecute &= object instanceof Media
-                    || (object instanceof DescriptionBase && ((DescriptionBase) object).isImageGallery());
+                    || (object instanceof DescriptionBase && ((DescriptionBase<?>) object).isImageGallery());
         }
         menuItem.setVisible(canExecute);
         return canExecute;