From: Andreas Müller Date: Mon, 22 Feb 2021 16:29:44 +0000 (+0100) Subject: cleanup X-Git-Tag: 5.21.0^2~84 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/d847c8749ce7cbeab9ca9006e052dfdf2e518d25 cleanup --- diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AbstractMoveImageHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AbstractMoveImageHandler.java index bd3b377c5..f3e2793f8 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AbstractMoveImageHandler.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AbstractMoveImageHandler.java @@ -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(), diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddExistingMediaHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddExistingMediaHandler.java index 10c774fb2..1d83d656f 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddExistingMediaHandler.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddExistingMediaHandler.java @@ -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 diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddImageGalleryHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddImageGalleryHandler.java index c7e720062..8fff252e8 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddImageGalleryHandler.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddImageGalleryHandler.java @@ -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 diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/CreateMediaHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/CreateMediaHandler.java index 497cb3c6f..f48d60a90 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/CreateMediaHandler.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/CreateMediaHandler.java @@ -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 diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/DeleteMediaHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/DeleteMediaHandler.java index a32a8d767..1314979b1 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/DeleteMediaHandler.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/DeleteMediaHandler.java @@ -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 elements = ((DescriptionBase)object).getElements().iterator(); + Iterator 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, DescriptionBase description, MediaDeletionConfigurator config) { + List 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;