From 763c382d6e4d4b8327da17d100afac96a5e9846c Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Thu, 26 Jul 2018 03:18:41 -0400 Subject: [PATCH] Removal of rename and move refactorings (#10323) Signed-off-by: jpinkney --- .../CheRefactoringContributions.java | 56 ++-- .../participants/MoveArguments.java | 71 ---- .../participants/MoveParticipant.java | 40 --- .../participants/MoveProcessor.java | 24 -- .../participants/MoveRefactoring.java | 51 --- .../participants/ParticipantManager.java | 124 ------- .../participants/RenameArguments.java | 71 ---- .../participants/RenameParticipant.java | 40 --- .../participants/RenameProcessor.java | 24 -- .../participants/RenameRefactoring.java | 42 --- .../resource/MoveResourceChange.java | 190 ----------- .../resource/MoveResourcesDescriptor.java | 233 ------------- .../resource/RenameResourceChange.java | 139 -------- .../resource/RenameResourceDescriptor.java | 184 ----------- .../resource/MoveResourcesProcessor.java | 311 ------------------ .../MoveResourcesRefactoringContribution.java | 125 ------- .../resource/RenameResourceProcessor.java | 258 --------------- ...RenameResourceRefactoringContribution.java | 89 ----- .../resource/ResourceModifications.java | 79 ----- .../RefactoringCoreMessages.properties | 33 -- 20 files changed, 32 insertions(+), 2152 deletions(-) delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/MoveArguments.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/MoveParticipant.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/MoveProcessor.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/MoveRefactoring.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameArguments.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameParticipant.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameProcessor.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameRefactoring.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/MoveResourceChange.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/MoveResourcesDescriptor.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/RenameResourceChange.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/RenameResourceDescriptor.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/MoveResourcesProcessor.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/MoveResourcesRefactoringContribution.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/RenameResourceProcessor.java delete mode 100644 plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/RenameResourceRefactoringContribution.java diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/che/ltk/core/refactoring/CheRefactoringContributions.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/che/ltk/core/refactoring/CheRefactoringContributions.java index 62e49dc35549..d9d1b786c5df 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/che/ltk/core/refactoring/CheRefactoringContributions.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/che/ltk/core/refactoring/CheRefactoringContributions.java @@ -25,30 +25,38 @@ public class CheRefactoringContributions { private static final Map refactoringContributions = new HashMap<>(); static { - refactoringContributions.put( - "org.eclipse.jdt.ui.rename.compilationunit", - "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameCompilationUnitRefactoringContribution"); - refactoringContributions.put( - "org.eclipse.jdt.ui.rename.enum.constant", - "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameEnumConstRefactoringContribution"); - refactoringContributions.put( - "org.eclipse.jdt.ui.rename.field", - "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameFieldRefactoringContribution"); - refactoringContributions.put( - "org.eclipse.jdt.ui.rename.local.variable", - "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameLocalVariableRefactoringContribution"); - refactoringContributions.put( - "org.eclipse.jdt.ui.rename.method", - "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameMethodRefactoringContribution"); - refactoringContributions.put( - "org.eclipse.jdt.ui.rename.package", - "org.eclipse.jdt.internal.corext.refactoring.scripting.RenamePackageRefactoringContribution"); - refactoringContributions.put( - "org.eclipse.jdt.ui.rename.type.parameter", - "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameTypeParameterRefactoringContribution"); - refactoringContributions.put( - "org.eclipse.jdt.ui.rename.type", - "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameTypeRefactoringContribution"); + // refactoringContributions.put( + // "org.eclipse.jdt.ui.rename.compilationunit", + // + // "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameCompilationUnitRefactoringContribution"); + // refactoringContributions.put( + // "org.eclipse.jdt.ui.rename.enum.constant", + // + // "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameEnumConstRefactoringContribution"); + // refactoringContributions.put( + // "org.eclipse.jdt.ui.rename.field", + // + // "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameFieldRefactoringContribution"); + // refactoringContributions.put( + // "org.eclipse.jdt.ui.rename.local.variable", + // + // "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameLocalVariableRefactoringContribution"); + // refactoringContributions.put( + // "org.eclipse.jdt.ui.rename.method", + // + // "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameMethodRefactoringContribution"); + // refactoringContributions.put( + // "org.eclipse.jdt.ui.rename.package", + // + // "org.eclipse.jdt.internal.corext.refactoring.scripting.RenamePackageRefactoringContribution"); + // refactoringContributions.put( + // "org.eclipse.jdt.ui.rename.type.parameter", + // + // "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameTypeParameterRefactoringContribution"); + // refactoringContributions.put( + // "org.eclipse.jdt.ui.rename.type", + // + // "org.eclipse.jdt.internal.corext.refactoring.scripting.RenameTypeRefactoringContribution"); // TODO : /* Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.core.refactoring.participants; - -import org.eclipse.core.runtime.Assert; - -/** - * Move arguments describe the data that a processor provides to its move participants. - * - *

This class is not intended to be subclassed by clients. - * - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class MoveArguments extends RefactoringArguments { - - private Object fDestination; - private boolean fUpdateReferences; - - /** - * Creates new move arguments. - * - * @param destination the destination of the move - * @param updateReferences true if reference updating is requested; false - * otherwise - */ - public MoveArguments(Object destination, boolean updateReferences) { - Assert.isNotNull(destination); - fDestination = destination; - fUpdateReferences = updateReferences; - } - - /** - * Returns the destination of the move - * - * @return the move's destination - */ - public Object getDestination() { - return fDestination; - } - - /** - * Returns whether reference updating is requested or not. - * - * @return returns true if reference updating is requested; false - * otherwise - */ - public boolean getUpdateReferences() { - return fUpdateReferences; - } - - /** - * {@inheritDoc} - * - * @since 3.2 - */ - public String toString() { - return "move to " // $NON-NLS-1$ - + (fUpdateReferences - ? "(update references) " - : "(don't update references) ") // $NON-NLS-1$//$NON-NLS-2$ - + fDestination.toString(); - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/MoveParticipant.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/MoveParticipant.java deleted file mode 100644 index 0dd3bb91e3b8..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/MoveParticipant.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2000, - * 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.core.refactoring.participants; - -/** - * A participant to participate in refactorings that move elements. A move participant can't assume - * that its associated refactoring processor is a move processor. A move operation might be a side - * effect of another refactoring operation. - * - *

Move participants are registered via the extension point - * org.eclipse.ltk.core.refactoring.moveParticipants. Extensions to this extension point must - * therefore extend this abstract class. - * - * @since 3.0 - */ -public abstract class MoveParticipant extends RefactoringParticipant { - - private MoveArguments fArguments; - - /** {@inheritDoc} */ - protected final void initialize(RefactoringArguments arguments) { - fArguments = (MoveArguments) arguments; - } - - /** - * Returns the move arguments. - * - * @return the move arguments - */ - public MoveArguments getArguments() { - return fArguments; - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/MoveProcessor.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/MoveProcessor.java deleted file mode 100644 index bbebc160eff4..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/MoveProcessor.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2000, - * 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.core.refactoring.participants; - -/** - * A special processor that performs move operations. A move processor is responsible for actually - * moving the elements. Additionally it may update other resources of the same domain which are - * affected by the move operation. For example, a Java type move processor also updates all - * references in Java code to the type to be moved. - * - *

This class should be subclassed by clients wishing to provide a special move processor. - * - *

The main purpose of this class is type safety for the generic move refactoring - * - * @since 3.0 - */ -public abstract class MoveProcessor extends RefactoringProcessor {} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/MoveRefactoring.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/MoveRefactoring.java deleted file mode 100644 index 2bb0184c1dd9..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/MoveRefactoring.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2000, - * 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.core.refactoring.participants; - -import org.eclipse.core.runtime.Assert; - -/** - * A generic move refactoring. The actual refactoring is done by the move processor passed to the - * constructor. - * - *

This class is not intended to be subclassed by clients. - * - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class MoveRefactoring extends ProcessorBasedRefactoring { - - private MoveProcessor fProcessor; - - /** - * Creates a new move refactoring with the given move processor. - * - * @param processor the move processor - */ - public MoveRefactoring(MoveProcessor processor) { - super(processor); - Assert.isNotNull(processor); - fProcessor = processor; - } - - /** - * Returns the move processor associated with this move refactoring. - * - * @return returns the move processor associated with this move refactoring - */ - public MoveProcessor getMoveProcessor() { - return fProcessor; - } - - /** {@inheritDoc} */ - public RefactoringProcessor getProcessor() { - return fProcessor; - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/ParticipantManager.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/ParticipantManager.java index 558e358075ab..b43bbdbe4d54 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/ParticipantManager.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/ParticipantManager.java @@ -27,130 +27,6 @@ private ParticipantManager() { // no instance } - // ---- Rename participants ---------------------------------------------------------------- - - private static final String RENAME_PARTICIPANT_EXT_POINT = "renameParticipants"; // $NON-NLS-1$ - private static ParticipantExtensionPoint fgRenameInstance = - new ParticipantExtensionPoint( - RefactoringCorePlugin.getPluginId(), - RENAME_PARTICIPANT_EXT_POINT, - RenameParticipant.class); - - /** - * Loads the rename participants for the given element. - * - * @param status a refactoring status to report status if problems occurred while loading the - * participants - * @param processor the processor that will own the participants - * @param element the element to be renamed - * @param arguments the rename arguments describing the rename - * @param affectedNatures an array of project natures affected by the refactoring - * @param shared a list of shared participants - * @return an array of rename participants - */ - public static RenameParticipant[] loadRenameParticipants( - RefactoringStatus status, - RefactoringProcessor processor, - Object element, - RenameArguments arguments, - String[] affectedNatures, - SharableParticipants shared) { - return loadRenameParticipants( - status, processor, element, arguments, null, affectedNatures, shared); - } - - /** - * Loads the rename participants for the given element. - * - * @param status a refactoring status to report status if problems occurred while loading the - * participants - * @param processor the processor that will own the participants - * @param element the element to be renamed - * @param arguments the rename arguments describing the rename - * @param filter a participant filter to exclude certain participants, or null if no - * filtering is desired - * @param affectedNatures an array of project natures affected by the refactoring - * @param shared a list of shared participants - * @return an array of rename participants - * @since 3.2 - */ - public static RenameParticipant[] loadRenameParticipants( - RefactoringStatus status, - RefactoringProcessor processor, - Object element, - RenameArguments arguments, - IParticipantDescriptorFilter filter, - String[] affectedNatures, - SharableParticipants shared) { - RefactoringParticipant[] participants = - fgRenameInstance.getParticipants( - status, processor, element, arguments, filter, affectedNatures, shared); - RenameParticipant[] result = new RenameParticipant[participants.length]; - System.arraycopy(participants, 0, result, 0, participants.length); - return result; - } - - // ---- Move participants ---------------------------------------------------------------- - - private static final String MOVE_PARTICIPANT_EXT_POINT = "moveParticipants"; // $NON-NLS-1$ - private static ParticipantExtensionPoint fgMoveExtensions = - new ParticipantExtensionPoint( - RefactoringCorePlugin.getPluginId(), MOVE_PARTICIPANT_EXT_POINT, MoveParticipant.class); - - /** - * Loads the move participants for the given element. - * - * @param status a refactoring status to report status if problems occurred while loading the - * participants - * @param processor the processor that will own the participants - * @param element the element to be moved - * @param arguments the move arguments describing the move - * @param affectedNatures an array of project natures affected by the refactoring - * @param shared a list of shared participants - * @return an array of move participants - */ - public static MoveParticipant[] loadMoveParticipants( - RefactoringStatus status, - RefactoringProcessor processor, - Object element, - MoveArguments arguments, - String[] affectedNatures, - SharableParticipants shared) { - return loadMoveParticipants( - status, processor, element, arguments, null, affectedNatures, shared); - } - - /** - * Loads the move participants for the given element. - * - * @param status a refactoring status to report status if problems occurred while loading the - * participants - * @param processor the processor that will own the participants - * @param element the element to be moved - * @param arguments the move arguments describing the move - * @param filter a participant filter to exclude certain participants, or null if no - * filtering is desired - * @param affectedNatures an array of project natures affected by the refactoring - * @param shared a list of shared participants - * @return an array of move participants - * @since 3.2 - */ - public static MoveParticipant[] loadMoveParticipants( - RefactoringStatus status, - RefactoringProcessor processor, - Object element, - MoveArguments arguments, - IParticipantDescriptorFilter filter, - String[] affectedNatures, - SharableParticipants shared) { - RefactoringParticipant[] participants = - fgMoveExtensions.getParticipants( - status, processor, element, arguments, filter, affectedNatures, shared); - MoveParticipant[] result = new MoveParticipant[participants.length]; - System.arraycopy(participants, 0, result, 0, participants.length); - return result; - } - // ---- Delete participants ---------------------------------------------------------------- private static final String DELETE_PARTICIPANT_EXT_POINT = "deleteParticipants"; // $NON-NLS-1$ diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameArguments.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameArguments.java deleted file mode 100644 index f0bb97007ef6..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameArguments.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2000, - * 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.core.refactoring.participants; - -import org.eclipse.core.runtime.Assert; - -/** - * Rename arguments describe the data that a processor provides to its rename participants. - * - *

This class may be subclassed by refactoring processors wishing to provide special rename - * arguments for special participants. - * - * @since 3.0 - */ -public class RenameArguments extends RefactoringArguments { - - private String fNewName; - private boolean fUpdateReferences; - - /** - * Creates new rename arguments. - * - * @param newName the new name of the element to be renamed - * @param updateReferences true if reference updating is requested; false - * otherwise - */ - public RenameArguments(String newName, boolean updateReferences) { - Assert.isNotNull(newName); - fNewName = newName; - fUpdateReferences = updateReferences; - } - - /** - * Returns the new element name. - * - * @return the new element name - */ - public String getNewName() { - return fNewName; - } - - /** - * Returns whether reference updating is requested or not. - * - * @return returns true if reference updating is requested; false - * otherwise - */ - public boolean getUpdateReferences() { - return fUpdateReferences; - } - - /** - * {@inheritDoc} - * - * @since 3.2 - */ - public String toString() { - return "rename to " - + fNewName // $NON-NLS-1$ - + (fUpdateReferences - ? " (update references)" - : " (don't update references)"); // $NON-NLS-1$//$NON-NLS-2$ - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameParticipant.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameParticipant.java deleted file mode 100644 index e9d69c0ddfbf..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameParticipant.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2000, - * 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.core.refactoring.participants; - -/** - * A participant to participate in refactorings that rename elements. A rename participant can't - * assume that its associated refactoring processor is a rename processor. A rename operation might - * be a side effect of another refactoring operation. - * - *

Rename participants are registered via the extension point - * org.eclipse.ltk.core.refactoring.renameParticipants. Extensions to this extension point - * must therefore extend this abstract class. - * - * @since 3.0 - */ -public abstract class RenameParticipant extends RefactoringParticipant { - - private RenameArguments fArguments; - - /** {@inheritDoc} */ - protected final void initialize(RefactoringArguments arguments) { - fArguments = (RenameArguments) arguments; - } - - /** - * Returns the rename arguments. - * - * @return the rename arguments - */ - public RenameArguments getArguments() { - return fArguments; - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameProcessor.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameProcessor.java deleted file mode 100644 index 271ef2160cba..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameProcessor.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2000, - * 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.core.refactoring.participants; - -/** - * A special processor that performs rename operations. A rename processor is responsible for - * actually renaming the element. Additionally it may update other resources of the same domain - * which are affected by the rename operation. For example, a Java method rename processor also - * updates all references in Java code to the method to be renamed. - * - *

This class should be subclassed by clients wishing to provide a special rename processor. - * - *

The main purpose of this class is type safety for the generic rename refactoring - * - * @since 3.0 - */ -public abstract class RenameProcessor extends RefactoringProcessor {} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameRefactoring.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameRefactoring.java deleted file mode 100644 index 49d295819368..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/participants/RenameRefactoring.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2000, - * 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.core.refactoring.participants; - -import org.eclipse.core.runtime.Assert; - -/** - * A generic rename refactoring. The actual refactoring is done by the rename processor passed to - * the constructor. - * - *

This class is not intended to be subclassed by clients. - * - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class RenameRefactoring extends ProcessorBasedRefactoring { - - private RenameProcessor fProcessor; - - /** - * Creates a new rename refactoring with the given rename processor. - * - * @param processor the rename processor - */ - public RenameRefactoring(RenameProcessor processor) { - super(processor); - Assert.isNotNull(processor); - fProcessor = processor; - } - - /** {@inheritDoc} */ - public RefactoringProcessor getProcessor() { - return fProcessor; - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/MoveResourceChange.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/MoveResourceChange.java deleted file mode 100644 index 2759ba45770a..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/MoveResourceChange.java +++ /dev/null @@ -1,190 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2007, - * 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.core.refactoring.resource; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.ltk.core.refactoring.Change; -import org.eclipse.ltk.core.refactoring.ChangeDescriptor; -import org.eclipse.ltk.core.refactoring.RefactoringStatus; -import org.eclipse.ltk.internal.core.refactoring.BasicElementLabels; -import org.eclipse.ltk.internal.core.refactoring.Messages; -import org.eclipse.ltk.internal.core.refactoring.RefactoringCoreMessages; - -/** - * {@link Change} that moves a resource. - * - * @since 3.4 - */ -public class MoveResourceChange extends ResourceChange { - - private final IResource fSource; - private final IContainer fTarget; - private final long fStampToRestore; - private final Change fRestoreSourceChange; - - private ChangeDescriptor fDescriptor; - - /** - * Creates the change. - * - * @param source the resource to move - * @param target the container the resource is moved to. An existing resource at the destination - * will be replaced. - */ - public MoveResourceChange(IResource source, IContainer target) { - this(source, target, IResource.NULL_STAMP, null); - } - - /** - * Creates the change. - * - * @param source the resource to move - * @param target the container the resource is moved to. An existing resource at the destination - * will be replaced. - * @param stampToRestore the stamp to restore on the moved resource - * @param restoreSourceChange the change to restore a resource at the source or null - * if no resource needs to be resourced. - */ - protected MoveResourceChange( - IResource source, IContainer target, long stampToRestore, Change restoreSourceChange) { - fSource = source; - fTarget = target; - fStampToRestore = stampToRestore; - fRestoreSourceChange = restoreSourceChange; - - // We already present a dialog to the user if he - // moves read-only resources. Since moving a resource - // doesn't do a validate edit (it actually doesn't - // change the content we can't check for READ only - // here. - setValidationMethod(VALIDATE_NOT_DIRTY); - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.Change#getDescriptor() - */ - public ChangeDescriptor getDescriptor() { - return fDescriptor; - } - - /** - * Sets the change descriptor to be returned by {@link Change#getDescriptor()}. - * - * @param descriptor the change descriptor - */ - public void setDescriptor(ChangeDescriptor descriptor) { - fDescriptor = descriptor; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor) - */ - public final Change perform(IProgressMonitor monitor) - throws CoreException, OperationCanceledException { - try { - if (monitor == null) monitor = new NullProgressMonitor(); - - monitor.beginTask(getName(), 4); - - Change deleteUndo = null; - - // delete destination if required - IResource resourceAtDestination = fTarget.findMember(fSource.getName()); - if (resourceAtDestination != null && resourceAtDestination.exists()) { - deleteUndo = - performDestinationDelete(resourceAtDestination, new SubProgressMonitor(monitor, 1)); - } else { - monitor.worked(1); - } - - // move resource - long currentStamp = fSource.getModificationStamp(); - IPath destinationPath = fTarget.getFullPath().append(fSource.getName()); - fSource.move( - destinationPath, - IResource.KEEP_HISTORY | IResource.SHALLOW, - new SubProgressMonitor(monitor, 2)); - resourceAtDestination = ResourcesPlugin.getWorkspace().getRoot().findMember(destinationPath); - - // restore timestamp at destination - if (fStampToRestore != IResource.NULL_STAMP) { - resourceAtDestination.revertModificationStamp(fStampToRestore); - } - - // restore file at source - if (fRestoreSourceChange != null) { - performSourceRestore(new SubProgressMonitor(monitor, 1)); - } else { - monitor.worked(1); - } - return new MoveResourceChange( - resourceAtDestination, fSource.getParent(), currentStamp, deleteUndo); - } finally { - monitor.done(); - } - } - - private Change performDestinationDelete(IResource newResource, IProgressMonitor monitor) - throws CoreException { - monitor.beginTask(RefactoringCoreMessages.MoveResourceChange_progress_delete_destination, 3); - try { - DeleteResourceChange deleteChange = new DeleteResourceChange(newResource.getFullPath(), true); - deleteChange.initializeValidationData(new SubProgressMonitor(monitor, 1)); - RefactoringStatus deleteStatus = deleteChange.isValid(new SubProgressMonitor(monitor, 1)); - if (!deleteStatus.hasFatalError()) { - return deleteChange.perform(new SubProgressMonitor(monitor, 1)); - } - return null; - } finally { - monitor.done(); - } - } - - private void performSourceRestore(IProgressMonitor monitor) throws CoreException { - monitor.beginTask(RefactoringCoreMessages.MoveResourceChange_progress_restore_source, 3); - try { - fRestoreSourceChange.initializeValidationData(new SubProgressMonitor(monitor, 1)); - RefactoringStatus restoreStatus = - fRestoreSourceChange.isValid(new SubProgressMonitor(monitor, 1)); - if (!restoreStatus.hasFatalError()) { - fRestoreSourceChange.perform(new SubProgressMonitor(monitor, 1)); - } - } finally { - monitor.done(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.resource.ResourceChange#getModifiedResource() - */ - protected IResource getModifiedResource() { - return fSource; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.Change#getName() - */ - public String getName() { - return Messages.format( - RefactoringCoreMessages.MoveResourceChange_name, - new String[] { - BasicElementLabels.getPathLabel(fSource.getFullPath(), false), - BasicElementLabels.getResourceName(fTarget) - }); - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/MoveResourcesDescriptor.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/MoveResourcesDescriptor.java deleted file mode 100644 index 801e1d4ce336..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/MoveResourcesDescriptor.java +++ /dev/null @@ -1,233 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2007, - * 2010 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.core.refactoring.resource; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.ltk.core.refactoring.Refactoring; -import org.eclipse.ltk.core.refactoring.RefactoringContribution; -import org.eclipse.ltk.core.refactoring.RefactoringCore; -import org.eclipse.ltk.core.refactoring.RefactoringDescriptor; -import org.eclipse.ltk.core.refactoring.RefactoringStatus; -import org.eclipse.ltk.core.refactoring.participants.MoveRefactoring; -import org.eclipse.ltk.internal.core.refactoring.BasicElementLabels; -import org.eclipse.ltk.internal.core.refactoring.Messages; -import org.eclipse.ltk.internal.core.refactoring.RefactoringCoreMessages; -import org.eclipse.ltk.internal.core.refactoring.resource.MoveResourcesProcessor; - -/** - * Refactoring descriptor for the move resource refactoring. - * - *

An instance of this refactoring descriptor may be obtained by calling {@link - * RefactoringContribution#createDescriptor()} on a refactoring contribution requested by invoking - * {@link RefactoringCore#getRefactoringContribution(String)} with the refactoring id ({@link #ID}). - * - *

Note: this class is not intended to be subclassed or instantiated by clients. - * - * @since 3.4 - * @noinstantiate This class is not intended to be instantiated by clients. - */ -public final class MoveResourcesDescriptor extends RefactoringDescriptor { - - /** - * Refactoring id of the 'Move Resources Resource' refactoring (value: - * org.eclipse.ltk.core.refactoring.move.resources). - * - *

Clients may safely cast the obtained refactoring descriptor to {@link - * MoveResourcesDescriptor}. - */ - public static final String ID = "org.eclipse.ltk.core.refactoring.move.resources"; // $NON-NLS-1$ - - /** The destination */ - private IPath fDestinationPath; - - /** The resources to move */ - private IPath[] fResourcePathsToMove; - - /** Configures if references will be updated */ - private boolean fUpdateReferences; - - /** - * Creates a new refactoring descriptor. - * - *

Clients should not instantiated this class but use {@link - * RefactoringCore#getRefactoringContribution(String)} with {@link #ID} to get the contribution - * that can create the descriptor. - */ - public MoveResourcesDescriptor() { - super( - ID, - null, - RefactoringCoreMessages.MoveResourcesDescriptor_unnamed_descriptor, - null, - RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE); - fResourcePathsToMove = null; - fDestinationPath = null; - fUpdateReferences = true; - } - - /** - * Sets the destination container to move the resources in. - * - * @param container the destination - */ - public void setDestination(IContainer container) { - Assert.isNotNull(container); - fDestinationPath = container.getFullPath(); - } - - /** - * Sets the path of the destination container to move the resources in. - * - * @param path the destination path - */ - public void setDestinationPath(IPath path) { - Assert.isNotNull(path); - fDestinationPath = path; - } - - /** - * Returns the destination container to move the resources in. - * - * @return the destination container to move the resource in - */ - public IPath getDestinationPath() { - return fDestinationPath; - } - - /** - * Sets the paths of the resources to move. The resources must be of type {@link IFile} or {@link - * IFolder}. - * - * @param resourcePaths the paths of the resource to move - */ - public void setResourcePathsToMove(IPath[] resourcePaths) { - if (resourcePaths == null) { - throw new IllegalArgumentException( - RefactoringCoreMessages.MoveResourcesDescriptor_error_empty_array); - } - fResourcePathsToMove = resourcePaths; - } - - /** - * Sets the resources to move. The resources must be of type {@link IFile} or {@link IFolder}. - * - * @param resources the resource to move - */ - public void setResourcesToMove(IResource[] resources) { - if (resources == null) { - throw new IllegalArgumentException( - RefactoringCoreMessages.MoveResourcesDescriptor_error_empty_array); - } - IPath[] paths = new IPath[resources.length]; - for (int i = 0; i < paths.length; i++) { - paths[i] = resources[i].getFullPath(); - } - setResourcePathsToMove(paths); - } - - /** - * Returns the resource to move. - * - * @return the resource to move - */ - public IPath[] getResourcePathsToMove() { - return fResourcePathsToMove; - } - - /** - * If set to true, move will also update references. The default is to update - * references. - * - * @param updateReferences true if this move will update references - */ - public void setUpdateReferences(boolean updateReferences) { - fUpdateReferences = updateReferences; - } - - /** - * Returns if move will also update references - * - * @return returns true if this move will update references - */ - public boolean isUpdateReferences() { - return fUpdateReferences; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.RefactoringDescriptor#createRefactoring(org.eclipse.ltk.core.refactoring.RefactoringStatus) - */ - public Refactoring createRefactoring(RefactoringStatus status) throws CoreException { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - - IPath destinationPath = getDestinationPath(); - if (destinationPath == null) { - status.addFatalError( - RefactoringCoreMessages.MoveResourcesDescriptor_error_destination_not_set); - return null; - } - - IResource destination = root.findMember(destinationPath); - if (!(destination instanceof IFolder || destination instanceof IProject) - || !destination.exists()) { - status.addFatalError( - Messages.format( - RefactoringCoreMessages.MoveResourcesDescriptor_error_destination_not_exists, - BasicElementLabels.getPathLabel(destinationPath, false))); - return null; - } - - IPath[] paths = getResourcePathsToMove(); - if (paths == null) { - status.addFatalError(RefactoringCoreMessages.MoveResourcesDescriptor_error_moved_not_set); - return null; - } - - IResource[] resources = new IResource[paths.length]; - for (int i = 0; i < paths.length; i++) { - IPath path = paths[i]; - if (path == null) { - status.addFatalError( - RefactoringCoreMessages.MoveResourcesDescriptor_error_moved_contains_null); - return null; - } - IResource resource = root.findMember(path); - if (resource == null || !resource.exists()) { - status.addFatalError( - Messages.format( - RefactoringCoreMessages.MoveResourcesDescriptor_error_moved_not_exists, - BasicElementLabels.getPathLabel(path, false))); - return null; - } - if (!(resource instanceof IFile || resource instanceof IFolder)) { - status.addFatalError( - Messages.format( - RefactoringCoreMessages.MoveResourcesDescriptor_error_moved_not_file_or_folder, - BasicElementLabels.getPathLabel(path, false))); - return null; - } - resources[i] = resource; - } - - MoveResourcesProcessor processor = new MoveResourcesProcessor(resources); - processor.setDestination((IContainer) destination); - processor.setUpdateReferences(isUpdateReferences()); - - return new MoveRefactoring(processor); - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/RenameResourceChange.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/RenameResourceChange.java deleted file mode 100644 index 7e7ec2ac9a9b..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/RenameResourceChange.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2007, - * 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.core.refactoring.resource; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.ltk.core.refactoring.Change; -import org.eclipse.ltk.core.refactoring.ChangeDescriptor; -import org.eclipse.ltk.internal.core.refactoring.BasicElementLabels; -import org.eclipse.ltk.internal.core.refactoring.Messages; -import org.eclipse.ltk.internal.core.refactoring.RefactoringCoreMessages; - -/** - * {@link Change} that renames a resource. - * - * @since 3.4 - */ -public class RenameResourceChange extends ResourceChange { - - private final String fNewName; - private final IPath fResourcePath; - private final long fStampToRestore; - - private ChangeDescriptor fDescriptor; - - /** - * Creates the change. - * - * @param resourcePath the path of the resource to rename - * @param newName the new name. Must not be empty. - */ - public RenameResourceChange(IPath resourcePath, String newName) { - this(resourcePath, newName, IResource.NULL_STAMP); - } - - /** - * Creates the change with a time stamp to restore. - * - * @param resourcePath the path of the resource to rename - * @param newName the new name. Must not be empty. - * @param stampToRestore the time stamp to restore or {@link IResource#NULL_STAMP} to not restore - * the time stamp. - */ - protected RenameResourceChange(IPath resourcePath, String newName, long stampToRestore) { - if (resourcePath == null || newName == null || newName.length() == 0) { - throw new IllegalArgumentException(); - } - - fResourcePath = resourcePath; - fNewName = newName; - fStampToRestore = stampToRestore; - fDescriptor = null; - setValidationMethod(VALIDATE_NOT_DIRTY); - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.Change#getDescriptor() - */ - public ChangeDescriptor getDescriptor() { - return fDescriptor; - } - - /** - * Sets the change descriptor to be returned by {@link Change#getDescriptor()}. - * - * @param descriptor the change descriptor - */ - public void setDescriptor(ChangeDescriptor descriptor) { - fDescriptor = descriptor; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.resource.ResourceChange#getModifiedResource() - */ - protected IResource getModifiedResource() { - return getResource(); - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.Change#getName() - */ - public String getName() { - return Messages.format( - RefactoringCoreMessages.RenameResourceChange_name, - new String[] { - BasicElementLabels.getPathLabel(fResourcePath, false), - BasicElementLabels.getResourceName(fNewName) - }); - } - - /** - * Returns the new name. - * - * @return return the new name - */ - public String getNewName() { - return fNewName; - } - - private IResource getResource() { - return ResourcesPlugin.getWorkspace().getRoot().findMember(fResourcePath); - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor) - */ - public Change perform(IProgressMonitor pm) throws CoreException { - try { - pm.beginTask(RefactoringCoreMessages.RenameResourceChange_progress_description, 1); - - IResource resource = getResource(); - long currentStamp = resource.getModificationStamp(); - IPath newPath = renamedResourcePath(fResourcePath, fNewName); - resource.move(newPath, IResource.SHALLOW, pm); - if (fStampToRestore != IResource.NULL_STAMP) { - IResource newResource = ResourcesPlugin.getWorkspace().getRoot().findMember(newPath); - newResource.revertModificationStamp(fStampToRestore); - } - String oldName = fResourcePath.lastSegment(); - return new RenameResourceChange(newPath, oldName, currentStamp); - } finally { - pm.done(); - } - } - - private static IPath renamedResourcePath(IPath path, String newName) { - return path.removeLastSegments(1).append(newName); - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/RenameResourceDescriptor.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/RenameResourceDescriptor.java deleted file mode 100644 index 8bf8e5b43e8a..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/core/refactoring/resource/RenameResourceDescriptor.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2006, - * 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.core.refactoring.resource; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.ltk.core.refactoring.Refactoring; -import org.eclipse.ltk.core.refactoring.RefactoringContribution; -import org.eclipse.ltk.core.refactoring.RefactoringCore; -import org.eclipse.ltk.core.refactoring.RefactoringDescriptor; -import org.eclipse.ltk.core.refactoring.RefactoringStatus; -import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring; -import org.eclipse.ltk.internal.core.refactoring.BasicElementLabels; -import org.eclipse.ltk.internal.core.refactoring.Messages; -import org.eclipse.ltk.internal.core.refactoring.RefactoringCoreMessages; -import org.eclipse.ltk.internal.core.refactoring.resource.RenameResourceProcessor; - -/** - * Refactoring descriptor for the rename resource refactoring. - * - *

An instance of this refactoring descriptor may be obtained by calling {@link - * RefactoringContribution#createDescriptor()} on a refactoring contribution requested by invoking - * {@link RefactoringCore#getRefactoringContribution(String)} with the refactoring id ({@link #ID}). - * - *

Note: this class is not intended to be subclassed or instantiated by clients. - * - * @since 3.4 - * @noinstantiate This class is not intended to be instantiated by clients. - */ -public final class RenameResourceDescriptor extends RefactoringDescriptor { - - /** - * Refactoring id of the 'Rename Resource' refactoring (value: - * org.eclipse.ltk.core.refactoring.rename.resource). - * - *

Clients may safely cast the obtained refactoring descriptor to {@link - * RenameResourceDescriptor}. - */ - public static final String ID = "org.eclipse.ltk.core.refactoring.rename.resource"; // $NON-NLS-1$ - - /** The name attribute */ - private String fNewName; - - /** The resource path attribute (full path) */ - private IPath fResourcePath; - - /** Configures if references will be updated */ - private boolean fUpdateReferences; - - /** - * Creates a new refactoring descriptor. - * - *

Clients should not instantiated this class but use {@link - * RefactoringCore#getRefactoringContribution(String)} with {@link #ID} to get the contribution - * that can create the descriptor. - */ - public RenameResourceDescriptor() { - super( - ID, - null, - RefactoringCoreMessages.RenameResourceDescriptor_unnamed_descriptor, - null, - RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE); - fResourcePath = null; - fNewName = null; - } - - /** - * Sets the new name to rename the resource to. - * - * @param name the non-empty new name to set - */ - public void setNewName(final String name) { - Assert.isNotNull(name); - Assert.isLegal(!"".equals(name), "Name must not be empty"); // $NON-NLS-1$//$NON-NLS-2$ - fNewName = name; - } - - /** - * Returns the new name to rename the resource to. - * - * @return the new name to rename the resource to - */ - public String getNewName() { - return fNewName; - } - - /** - * Sets the project name of this refactoring. - * - *

Note: If the resource to be renamed is of type {@link IResource#PROJECT}, clients are - * required to to set the project name to null. - * - *

The default is to associate the refactoring with the workspace. - * - * @param project the non-empty project name to set, or null for the workspace - * @see #getProject() - */ - public void setProject(final String project) { - super.setProject(project); - } - - /** - * Sets the resource to be renamed. - * - *

Note: If the resource to be renamed is of type {@link IResource#PROJECT}, clients are - * required to to set the project name to null. - * - * @param resourcePath the resource to be renamed - */ - public void setResourcePath(IPath resourcePath) { - Assert.isNotNull(resourcePath); - fResourcePath = resourcePath; - } - - /** - * Returns the path of the resource to rename. - * - * @return the path of the resource to rename - */ - public IPath getResourcePath() { - return fResourcePath; - } - - /** - * If set to true, this rename will also update references. The default is to update - * references. - * - * @param updateReferences true if this rename will update references - */ - public void setUpdateReferences(boolean updateReferences) { - fUpdateReferences = updateReferences; - } - - /** - * Returns if this rename will also update references - * - * @return returns true if this rename will update references - */ - public boolean isUpdateReferences() { - return fUpdateReferences; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.RefactoringDescriptor#createRefactoring(org.eclipse.ltk.core.refactoring.RefactoringStatus) - */ - public Refactoring createRefactoring(RefactoringStatus status) throws CoreException { - IPath resourcePath = getResourcePath(); - if (resourcePath == null) { - status.addFatalError(RefactoringCoreMessages.RenameResourceDescriptor_error_path_not_set); - return null; - } - - IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(resourcePath); - if (resource == null || !resource.exists()) { - status.addFatalError( - Messages.format( - RefactoringCoreMessages.RenameResourceDescriptor_error_resource_not_existing, - BasicElementLabels.getPathLabel(resourcePath, false))); - return null; - } - - String newName = getNewName(); - if (newName == null || newName.length() == 0) { - status.addFatalError(RefactoringCoreMessages.RenameResourceDescriptor_error_name_not_defined); - return null; - } - RenameResourceProcessor processor = new RenameResourceProcessor(resource); - processor.setNewResourceName(newName); - processor.setUpdateReferences(isUpdateReferences()); - - return new RenameRefactoring(processor); - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/MoveResourcesProcessor.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/MoveResourcesProcessor.java deleted file mode 100644 index 3b8585205f6e..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/MoveResourcesProcessor.java +++ /dev/null @@ -1,311 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2007, - * 2014 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.internal.core.refactoring.resource; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.mapping.IResourceChangeDescriptionFactory; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.ltk.core.refactoring.Change; -import org.eclipse.ltk.core.refactoring.CompositeChange; -import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; -import org.eclipse.ltk.core.refactoring.RefactoringDescriptor; -import org.eclipse.ltk.core.refactoring.RefactoringStatus; -import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext; -import org.eclipse.ltk.core.refactoring.participants.MoveArguments; -import org.eclipse.ltk.core.refactoring.participants.MoveParticipant; -import org.eclipse.ltk.core.refactoring.participants.MoveProcessor; -import org.eclipse.ltk.core.refactoring.participants.ParticipantManager; -import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; -import org.eclipse.ltk.core.refactoring.participants.ResourceChangeChecker; -import org.eclipse.ltk.core.refactoring.participants.SharableParticipants; -import org.eclipse.ltk.core.refactoring.resource.MoveResourceChange; -import org.eclipse.ltk.core.refactoring.resource.MoveResourcesDescriptor; -import org.eclipse.ltk.internal.core.refactoring.BasicElementLabels; -import org.eclipse.ltk.internal.core.refactoring.Messages; -import org.eclipse.ltk.internal.core.refactoring.RefactoringCoreMessages; -import org.eclipse.ltk.internal.core.refactoring.Resources; - -/** - * A move processor for {@link IResource resources}. The processor will move the resources and load - * move participants if references should be move as well. - * - * @since 3.4 - */ -public class MoveResourcesProcessor extends MoveProcessor { - - private final IResource[] fResourcesToMove; - private IContainer fDestination; - private boolean fUpdateReferences; - private MoveArguments fMoveArguments; // set after checkFinalConditions - - /** - * Creates a new move resource processor. - * - * @param resourcesToMove the resources to move - */ - public MoveResourcesProcessor(IResource[] resourcesToMove) { - if (resourcesToMove == null) { - throw new IllegalArgumentException("resources must not be null"); // $NON-NLS-1$ - } - - fResourcesToMove = resourcesToMove; - fDestination = null; - fUpdateReferences = true; - } - - /** - * Returns the resources to move. - * - * @return the resources to move. - */ - public IResource[] getResourcesToMove() { - return fResourcesToMove; - } - - /** - * Sets the move destination - * - * @param destination the move destination - */ - public void setDestination(IContainer destination) { - Assert.isNotNull(destination); - fDestination = destination; - } - - /** - * Returns true if the refactoring processor also updates references - * - * @return true if the refactoring processor also updates references - */ - public boolean isUpdateReferences() { - return fUpdateReferences; - } - - /** - * Specifies if the refactoring processor also updates references. The default behavior is to - * update references. - * - * @param updateReferences true if the refactoring processor should also updates - * references - */ - public void setUpdateReferences(boolean updateReferences) { - fUpdateReferences = updateReferences; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor) - */ - public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException { - RefactoringStatus result = new RefactoringStatus(); - result.merge(RefactoringStatus.create(Resources.checkInSync(fResourcesToMove))); - return result; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext) - */ - public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) - throws CoreException { - pm.beginTask("", 1); // $NON-NLS-1$ - try { - RefactoringStatus status = validateDestination(fDestination); - if (status.hasFatalError()) { - return status; - } - fMoveArguments = new MoveArguments(fDestination, isUpdateReferences()); - - ResourceChangeChecker checker = - (ResourceChangeChecker) context.getChecker(ResourceChangeChecker.class); - IResourceChangeDescriptionFactory deltaFactory = checker.getDeltaFactory(); - - for (int i = 0; i < fResourcesToMove.length; i++) { - IResource resource = fResourcesToMove[i]; - IResource newResource = fDestination.findMember(resource.getName()); - if (newResource != null) { - status.addWarning( - Messages.format( - RefactoringCoreMessages.MoveResourcesProcessor_warning_destination_already_exists, - BasicElementLabels.getPathLabel(newResource.getFullPath(), false))); - deltaFactory.delete(newResource); - } - ResourceModifications.buildMoveDelta(deltaFactory, fResourcesToMove[i], fMoveArguments); - } - return status; - } finally { - pm.done(); - } - } - - /** - * Validates if the a destination is valid. This method does not change the destination settings - * on the refactoring. It is intended to be used in a wizard to validate user input. - * - * @param destination the destination to validate - * @return returns the resulting status of the validation - */ - public RefactoringStatus validateDestination(IContainer destination) { - Assert.isNotNull(destination, "container is null"); // $NON-NLS-1$ - if (destination instanceof IWorkspaceRoot) - return RefactoringStatus.createFatalErrorStatus( - RefactoringCoreMessages.MoveResourceProcessor_error_invalid_destination); - - if (!destination.exists()) { - return RefactoringStatus.createFatalErrorStatus( - RefactoringCoreMessages.MoveResourceProcessor_error_destination_not_exists); - } - - IPath destinationPath = destination.getFullPath(); - for (int i = 0; i < fResourcesToMove.length; i++) { - IPath path = fResourcesToMove[i].getFullPath(); - if (path.isPrefixOf(destinationPath) || path.equals(destinationPath)) { - return RefactoringStatus.createFatalErrorStatus( - Messages.format( - RefactoringCoreMessages.MoveResourceProcessor_destination_inside_moved, - BasicElementLabels.getPathLabel(path, false))); - } - if (path.removeLastSegments(1).equals(destinationPath)) { - return RefactoringStatus.createFatalErrorStatus( - Messages.format( - RefactoringCoreMessages.MoveResourceProcessor_destination_same_as_moved, - BasicElementLabels.getPathLabel(path, false))); - } - } - return new RefactoringStatus(); - } - - private String getMoveDescription() { - if (fResourcesToMove.length == 1) { - return Messages.format( - RefactoringCoreMessages.MoveResourceProcessor_description_single, - new String[] { - BasicElementLabels.getResourceName(fResourcesToMove[0]), - BasicElementLabels.getResourceName(fDestination) - }); - } else { - return Messages.format( - RefactoringCoreMessages.MoveResourceProcessor_description_multiple, - new Object[] { - new Integer(fResourcesToMove.length), BasicElementLabels.getResourceName(fDestination) - }); - } - } - - protected MoveResourcesDescriptor createDescriptor() { - MoveResourcesDescriptor descriptor = new MoveResourcesDescriptor(); - descriptor.setProject(fDestination.getProject().getName()); - descriptor.setDescription(getMoveDescription()); - if (fResourcesToMove.length <= 1) { - descriptor.setComment(descriptor.getDescription()); - } else { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < fResourcesToMove.length; i++) { - if (i > 0) buf.append(", "); // $NON-NLS-1$ - buf.append(fResourcesToMove[i].getName()); - } - descriptor.setComment( - Messages.format( - RefactoringCoreMessages.MoveResourceProcessor_comment, - new String[] {buf.toString(), BasicElementLabels.getResourceName(fDestination)})); - } - descriptor.setFlags( - RefactoringDescriptor.STRUCTURAL_CHANGE - | RefactoringDescriptor.MULTI_CHANGE - | RefactoringDescriptor.BREAKING_CHANGE); - descriptor.setDestination(fDestination); - descriptor.setUpdateReferences(isUpdateReferences()); - descriptor.setResourcesToMove(fResourcesToMove); - return descriptor; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor) - */ - public Change createChange(IProgressMonitor pm) throws CoreException { - pm.beginTask("", fResourcesToMove.length); // $NON-NLS-1$ - try { - CompositeChange compositeChange = new CompositeChange(getMoveDescription()); - compositeChange.markAsSynthetic(); - - RefactoringChangeDescriptor descriptor = new RefactoringChangeDescriptor(createDescriptor()); - for (int i = 0; i < fResourcesToMove.length; i++) { - MoveResourceChange moveChange = new MoveResourceChange(fResourcesToMove[i], fDestination); - moveChange.setDescriptor(descriptor); - compositeChange.add(moveChange); - } - return compositeChange; - } finally { - pm.done(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements() - */ - public Object[] getElements() { - return fResourcesToMove; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier() - */ - public String getIdentifier() { - return "org.eclipse.ltk.core.refactoring.moveResourcesProcessor"; // $NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName() - */ - public String getProcessorName() { - return RefactoringCoreMessages.MoveResourceProcessor_processor_name; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable() - */ - public boolean isApplicable() { - for (int i = 0; i < fResourcesToMove.length; i++) { - if (!canMove(fResourcesToMove[i])) { - return false; - } - } - return true; - } - - private static boolean canMove(IResource res) { - return (res instanceof IFile || res instanceof IFolder) && res.exists() && !res.isPhantom(); - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#loadParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus, org.eclipse.ltk.core.refactoring.participants.SharableParticipants) - */ - public RefactoringParticipant[] loadParticipants( - RefactoringStatus status, SharableParticipants shared) throws CoreException { - String[] affectedNatures = ResourceProcessors.computeAffectedNatures(fResourcesToMove); - - List result = new ArrayList(); - for (int i = 0; i < fResourcesToMove.length; i++) { - MoveParticipant[] participants = - ParticipantManager.loadMoveParticipants( - status, this, fResourcesToMove[i], fMoveArguments, null, affectedNatures, shared); - result.addAll(Arrays.asList(participants)); - } - return (RefactoringParticipant[]) result.toArray(new RefactoringParticipant[result.size()]); - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/MoveResourcesRefactoringContribution.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/MoveResourcesRefactoringContribution.java deleted file mode 100644 index b1326c2626ee..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/MoveResourcesRefactoringContribution.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2007, - * 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.internal.core.refactoring.resource; - -import java.util.HashMap; -import java.util.Map; -import org.eclipse.core.runtime.IPath; -import org.eclipse.ltk.core.refactoring.RefactoringContribution; -import org.eclipse.ltk.core.refactoring.RefactoringDescriptor; -import org.eclipse.ltk.core.refactoring.resource.MoveResourcesDescriptor; - -/** - * Refactoring contribution for the move resources refactoring. - * - * @since 3.4 - */ -public final class MoveResourcesRefactoringContribution extends RefactoringContribution { - - /** Key used for the number of resource to be moved */ - private static final String ATTRIBUTE_NUMBER_OF_RESOURCES = "resources"; // $NON-NLS-1$ - - /** - * Key prefix used for the path of the resources to be moved. - * - *

The element arguments are simply distinguished by appending a number to the argument name, - * e.g. element1. The indices of this argument are one-based. - */ - private static final String ATTRIBUTE_ELEMENT = "element"; // $NON-NLS-1$ - - /** Key used for the new resource name */ - private static final String ATTRIBUTE_DESTINATION = "destination"; // $NON-NLS-1$ - - /** Key used for the 'update references' property */ - private static final String ATTRIBUTE_UPDATE_REFERENCES = "updateReferences"; // $NON-NLS-1$ - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.RefactoringContribution#retrieveArgumentMap(org.eclipse.ltk.core.refactoring.RefactoringDescriptor) - */ - public Map retrieveArgumentMap(final RefactoringDescriptor descriptor) { - HashMap map = new HashMap(); - - if (descriptor instanceof MoveResourcesDescriptor) { - MoveResourcesDescriptor moveDescriptor = (MoveResourcesDescriptor) descriptor; - IPath[] paths = moveDescriptor.getResourcePathsToMove(); - String project = moveDescriptor.getProject(); - IPath destinationPath = moveDescriptor.getDestinationPath(); - - map.put(ATTRIBUTE_NUMBER_OF_RESOURCES, String.valueOf(paths.length)); - for (int i = 0; i < paths.length; i++) { - map.put( - ATTRIBUTE_ELEMENT + (i + 1), - ResourceProcessors.resourcePathToHandle(project, paths[i])); - } - map.put( - ATTRIBUTE_DESTINATION, ResourceProcessors.resourcePathToHandle(project, destinationPath)); - map.put( - ATTRIBUTE_UPDATE_REFERENCES, - moveDescriptor.isUpdateReferences() ? "true" : "false"); // $NON-NLS-1$//$NON-NLS-2$ - return map; - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.RefactoringContribution#createDescriptor() - */ - public RefactoringDescriptor createDescriptor() { - return new MoveResourcesDescriptor(); - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.RefactoringContribution#createDescriptor(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, int) - */ - public RefactoringDescriptor createDescriptor( - String id, String project, String description, String comment, Map arguments, int flags) { - try { - int numResources = Integer.parseInt((String) arguments.get(ATTRIBUTE_NUMBER_OF_RESOURCES)); - if (numResources < 0 || numResources > 100000) { - throw new IllegalArgumentException( - "Can not restore MoveResourceDescriptor from map, number of moved elements invalid"); // $NON-NLS-1$ - } - - IPath[] resourcePaths = new IPath[numResources]; - for (int i = 0; i < numResources; i++) { - String resource = (String) arguments.get(ATTRIBUTE_ELEMENT + String.valueOf(i + 1)); - if (resource == null) { - throw new IllegalArgumentException( - "Can not restore MoveResourceDescriptor from map, resource missing"); // $NON-NLS-1$ - } - resourcePaths[i] = ResourceProcessors.handleToResourcePath(project, resource); - } - - String destination = (String) arguments.get(ATTRIBUTE_DESTINATION); - if (destination == null) { - throw new IllegalArgumentException( - "Can not restore MoveResourceDescriptor from map, destination missing"); // $NON-NLS-1$ - } - IPath destPath = ResourceProcessors.handleToResourcePath(project, destination); - - boolean updateReferences = - "true".equals(arguments.get(ATTRIBUTE_UPDATE_REFERENCES)); // $NON-NLS-1$ - - MoveResourcesDescriptor descriptor = new MoveResourcesDescriptor(); - descriptor.setProject(project); - descriptor.setDescription(description); - descriptor.setComment(comment); - descriptor.setFlags(flags); - descriptor.setResourcePathsToMove(resourcePaths); - descriptor.setDestinationPath(destPath); - descriptor.setUpdateReferences(updateReferences); - return descriptor; - - } catch (NumberFormatException e) { - throw new IllegalArgumentException( - "Can not restore MoveResourceDescriptor from map"); // $NON-NLS-1$ - } - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/RenameResourceProcessor.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/RenameResourceProcessor.java deleted file mode 100644 index 0b441e4b0074..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/RenameResourceProcessor.java +++ /dev/null @@ -1,258 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2007, - * 2010 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.internal.core.refactoring.resource; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.mapping.IResourceChangeDescriptionFactory; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.ltk.core.refactoring.Change; -import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; -import org.eclipse.ltk.core.refactoring.RefactoringDescriptor; -import org.eclipse.ltk.core.refactoring.RefactoringStatus; -import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext; -import org.eclipse.ltk.core.refactoring.participants.ParticipantManager; -import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; -import org.eclipse.ltk.core.refactoring.participants.RenameArguments; -import org.eclipse.ltk.core.refactoring.participants.RenameProcessor; -import org.eclipse.ltk.core.refactoring.participants.ResourceChangeChecker; -import org.eclipse.ltk.core.refactoring.participants.SharableParticipants; -import org.eclipse.ltk.core.refactoring.resource.RenameResourceChange; -import org.eclipse.ltk.core.refactoring.resource.RenameResourceDescriptor; -import org.eclipse.ltk.internal.core.refactoring.BasicElementLabels; -import org.eclipse.ltk.internal.core.refactoring.Messages; -import org.eclipse.ltk.internal.core.refactoring.RefactoringCoreMessages; -import org.eclipse.ltk.internal.core.refactoring.Resources; - -/** - * A rename processor for {@link IResource}. The processor will rename the resource and load rename - * participants if references should be renamed as well. - * - * @since 3.4 - */ -public class RenameResourceProcessor extends RenameProcessor { - - private IResource fResource; - private String fNewResourceName; - private boolean fUpdateReferences; - private RenameArguments fRenameArguments; // set after checkFinalConditions - - /** - * Creates a new rename resource processor. - * - * @param resource the resource to rename. - */ - public RenameResourceProcessor(IResource resource) { - if (resource == null || !resource.exists()) { - throw new IllegalArgumentException("resource must not be null and must exist"); // $NON-NLS-1$ - } - - fResource = resource; - fRenameArguments = null; - fUpdateReferences = true; - setNewResourceName(resource.getName()); // Initialize new name - } - - /** - * Returns the resource this processor was created on - * - * @return the resource to rename - */ - public IResource getResource() { - return fResource; - } - - /** - * Returns the new resource name - * - * @return the new resource name - */ - public String getNewResourceName() { - return fNewResourceName; - } - - /** - * Sets the new resource name - * - * @param newName the new resource name - */ - public void setNewResourceName(String newName) { - Assert.isNotNull(newName); - fNewResourceName = newName; - } - - /** - * Returns true if the refactoring processor also updates references - * - * @return true if the refactoring processor also updates references - */ - public boolean isUpdateReferences() { - return fUpdateReferences; - } - - /** - * Specifies if the refactoring processor also updates references. The default behaviour is to - * update references. - * - * @param updateReferences true if the refactoring processor should also updates - * references - */ - public void setUpdateReferences(boolean updateReferences) { - fUpdateReferences = updateReferences; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor) - */ - public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException { - return RefactoringStatus.create(Resources.checkInSync(fResource)); - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext) - */ - public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) - throws CoreException { - pm.beginTask("", 1); // $NON-NLS-1$ - try { - fRenameArguments = new RenameArguments(getNewResourceName(), isUpdateReferences()); - - ResourceChangeChecker checker = - (ResourceChangeChecker) context.getChecker(ResourceChangeChecker.class); - IResourceChangeDescriptionFactory deltaFactory = checker.getDeltaFactory(); - - ResourceModifications.buildMoveDelta(deltaFactory, fResource, fRenameArguments); - - return new RefactoringStatus(); - } finally { - pm.done(); - } - } - - /** - * Validates if the a name is valid. This method does not change the name settings on the - * refactoring. It is intended to be used in a wizard to validate user input. - * - * @param newName the name to validate - * @return returns the resulting status of the validation - */ - public RefactoringStatus validateNewElementName(String newName) { - Assert.isNotNull(newName, "new name"); // $NON-NLS-1$ - IContainer c = fResource.getParent(); - if (c == null) - return RefactoringStatus.createFatalErrorStatus( - RefactoringCoreMessages.RenameResourceProcessor_error_no_parent); - - if (!c.getFullPath().isValidSegment(newName)) - return RefactoringStatus.createFatalErrorStatus( - RefactoringCoreMessages.RenameResourceProcessor_error_invalid_name); - - if (c.findMember(newName) != null) - return RefactoringStatus.createFatalErrorStatus( - RefactoringCoreMessages.RenameResourceProcessor_error_resource_already_exists); - - RefactoringStatus result = - RefactoringStatus.create(c.getWorkspace().validateName(newName, fResource.getType())); - if (!result.hasFatalError()) - result.merge( - RefactoringStatus.create( - c.getWorkspace().validatePath(createNewPath(newName), fResource.getType()))); - return result; - } - - protected RenameResourceDescriptor createDescriptor() { - IResource resource = getResource(); - - RenameResourceDescriptor descriptor = new RenameResourceDescriptor(); - descriptor.setProject(resource instanceof IProject ? null : resource.getProject().getName()); - descriptor.setDescription( - Messages.format( - RefactoringCoreMessages.RenameResourceProcessor_description, - BasicElementLabels.getResourceName(resource))); - descriptor.setComment( - Messages.format( - RefactoringCoreMessages.RenameResourceProcessor_comment, - new String[] { - BasicElementLabels.getPathLabel(resource.getFullPath(), false), - BasicElementLabels.getResourceName(getNewResourceName()) - })); - descriptor.setFlags( - RefactoringDescriptor.STRUCTURAL_CHANGE - | RefactoringDescriptor.MULTI_CHANGE - | RefactoringDescriptor.BREAKING_CHANGE); - descriptor.setResourcePath(resource.getFullPath()); - descriptor.setNewName(getNewResourceName()); - descriptor.setUpdateReferences(isUpdateReferences()); - return descriptor; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor) - */ - public Change createChange(IProgressMonitor pm) throws CoreException { - pm.beginTask("", 1); // $NON-NLS-1$ - try { - RenameResourceChange change = - new RenameResourceChange(fResource.getFullPath(), getNewResourceName()); - change.setDescriptor(new RefactoringChangeDescriptor(createDescriptor())); - return change; - } finally { - pm.done(); - } - } - - private String createNewPath(String newName) { - return fResource.getFullPath().removeLastSegments(1).append(newName).toString(); - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements() - */ - public Object[] getElements() { - return new Object[] {fResource}; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier() - */ - public String getIdentifier() { - return "org.eclipse.ltk.core.refactoring.renameResourceProcessor"; // $NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName() - */ - public String getProcessorName() { - return RefactoringCoreMessages.RenameResourceProcessor_processor_name; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable() - */ - public boolean isApplicable() { - if (fResource == null) return false; - if (!fResource.exists()) return false; - if (!fResource.isAccessible()) return false; - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#loadParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus, org.eclipse.ltk.core.refactoring.participants.SharableParticipants) - */ - public RefactoringParticipant[] loadParticipants( - RefactoringStatus status, SharableParticipants shared) throws CoreException { - String[] affectedNatures = ResourceProcessors.computeAffectedNatures(fResource); - return ParticipantManager.loadRenameParticipants( - status, this, fResource, fRenameArguments, null, affectedNatures, shared); - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/RenameResourceRefactoringContribution.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/RenameResourceRefactoringContribution.java deleted file mode 100644 index 4353cf523099..000000000000 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/RenameResourceRefactoringContribution.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * ***************************************************************************** Copyright (c) 2007, - * 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 which accompanies this - * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html - * - *

Contributors: IBM Corporation - initial API and implementation - * ***************************************************************************** - */ -package org.eclipse.ltk.internal.core.refactoring.resource; - -import java.util.HashMap; -import java.util.Map; -import org.eclipse.core.runtime.IPath; -import org.eclipse.ltk.core.refactoring.RefactoringContribution; -import org.eclipse.ltk.core.refactoring.RefactoringDescriptor; -import org.eclipse.ltk.core.refactoring.resource.RenameResourceDescriptor; - -/** - * Refactoring contribution for the rename resource refactoring. - * - * @since 3.4 - */ -public final class RenameResourceRefactoringContribution extends RefactoringContribution { - - /** Key used for the path of the resource to be renamed */ - private static final String ATTRIBUTE_INPUT = "input"; // $NON-NLS-1$ - - /** Key used for the new resource name */ - private static final String ATTRIBUTE_NAME = "name"; // $NON-NLS-1$ - - /** Key used for the 'update references' property */ - private static final String ATTRIBUTE_UPDATE_REFERENCES = "updateReferences"; // $NON-NLS-1$ - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.RefactoringContribution#retrieveArgumentMap(org.eclipse.ltk.core.refactoring.RefactoringDescriptor) - */ - public Map retrieveArgumentMap(final RefactoringDescriptor descriptor) { - HashMap map = new HashMap(); - - if (descriptor instanceof RenameResourceDescriptor) { - RenameResourceDescriptor resourceDescriptor = (RenameResourceDescriptor) descriptor; - map.put( - ATTRIBUTE_INPUT, - ResourceProcessors.resourcePathToHandle( - descriptor.getProject(), resourceDescriptor.getResourcePath())); - map.put(ATTRIBUTE_NAME, resourceDescriptor.getNewName()); - map.put( - ATTRIBUTE_UPDATE_REFERENCES, - resourceDescriptor.isUpdateReferences() ? "true" : "false"); // $NON-NLS-1$//$NON-NLS-2$ - return map; - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.RefactoringContribution#createDescriptor() - */ - public RefactoringDescriptor createDescriptor() { - return new RenameResourceDescriptor(); - } - - /* (non-Javadoc) - * @see org.eclipse.ltk.core.refactoring.RefactoringContribution#createDescriptor(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, int) - */ - public RefactoringDescriptor createDescriptor( - String id, String project, String description, String comment, Map arguments, int flags) { - String pathString = (String) arguments.get(ATTRIBUTE_INPUT); - String newName = (String) arguments.get(ATTRIBUTE_NAME); - - boolean updateReferences = - "true".equals(arguments.get(ATTRIBUTE_UPDATE_REFERENCES)); // $NON-NLS-1$ - - if (pathString != null && newName != null) { - IPath path = ResourceProcessors.handleToResourcePath(project, pathString); - RenameResourceDescriptor descriptor = new RenameResourceDescriptor(); - descriptor.setProject(project); - descriptor.setDescription(description); - descriptor.setComment(comment); - descriptor.setFlags(flags); - descriptor.setNewName(newName); - descriptor.setResourcePath(path); - descriptor.setUpdateReferences(updateReferences); - return descriptor; - } - throw new IllegalArgumentException( - "Can not restore RenameResourceDescriptor from map"); // $NON-NLS-1$ - } -} diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/ResourceModifications.java b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/ResourceModifications.java index 1709ad19c73c..4201ae7e0aa3 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/ResourceModifications.java +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/resource/ResourceModifications.java @@ -16,7 +16,6 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.mapping.IResourceChangeDescriptionFactory; -import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.IPath; import org.eclipse.ltk.core.refactoring.RefactoringStatus; import org.eclipse.ltk.core.refactoring.participants.CopyArguments; @@ -25,13 +24,9 @@ import org.eclipse.ltk.core.refactoring.participants.CreateParticipant; import org.eclipse.ltk.core.refactoring.participants.DeleteArguments; import org.eclipse.ltk.core.refactoring.participants.DeleteParticipant; -import org.eclipse.ltk.core.refactoring.participants.MoveArguments; -import org.eclipse.ltk.core.refactoring.participants.MoveParticipant; import org.eclipse.ltk.core.refactoring.participants.ParticipantManager; import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor; -import org.eclipse.ltk.core.refactoring.participants.RenameArguments; -import org.eclipse.ltk.core.refactoring.participants.RenameParticipant; import org.eclipse.ltk.core.refactoring.participants.SharableParticipants; /** @@ -181,26 +176,6 @@ public void addDelete(IResource delete) { } } - /** - * Adds the given resource to the list of resources to be moved. - * - * @param move the resource to be moved - * @param arguments the move arguments - */ - public void addMove(IResource move, MoveArguments arguments) { - if (fMove == null) { - fMove = new ArrayList(2); - fMoveArguments = new ArrayList(2); - } - fMove.add(move); - fMoveArguments.add(arguments); - if (fIgnoreCount == 0) { - IPath destination = - ((IResource) arguments.getDestination()).getFullPath().append(move.getName()); - internalAdd(new MoveDescription(move, destination)); - } - } - /** * Adds the given resource to the list of resources to be copied. * @@ -217,27 +192,6 @@ public void addCopy(IResource copy, CopyArguments arguments) { addCopyDelta(copy, arguments); } - /** - * Adds the given resource to the list of renamed resources. - * - * @param rename the resource to be renamed - * @param arguments the arguments of the rename - */ - public void addRename(IResource rename, RenameArguments arguments) { - Assert.isNotNull(rename); - Assert.isNotNull(arguments); - if (fRename == null) { - fRename = new ArrayList(2); - fRenameArguments = new ArrayList(2); - } - fRename.add(rename); - fRenameArguments.add(arguments); - if (fIgnoreCount == 0) { - IPath newPath = rename.getFullPath().removeLastSegments(1).append(arguments.getNewName()); - internalAdd(new MoveDescription(rename, newPath)); - } - } - public RefactoringParticipant[] getParticipants( RefactoringStatus status, RefactoringProcessor processor, @@ -262,16 +216,6 @@ public RefactoringParticipant[] getParticipants( result.addAll(Arrays.asList(creates)); } } - if (fMove != null) { - for (int i = 0; i < fMove.size(); i++) { - Object element = fMove.get(i); - MoveArguments arguments = (MoveArguments) fMoveArguments.get(i); - MoveParticipant[] moves = - ParticipantManager.loadMoveParticipants( - status, processor, element, arguments, natures, shared); - result.addAll(Arrays.asList(moves)); - } - } if (fCopy != null) { for (int i = 0; i < fCopy.size(); i++) { Object element = fCopy.get(i); @@ -282,16 +226,6 @@ public RefactoringParticipant[] getParticipants( result.addAll(Arrays.asList(copies)); } } - if (fRename != null) { - for (int i = 0; i < fRename.size(); i++) { - Object resource = fRename.get(i); - RenameArguments arguments = (RenameArguments) fRenameArguments.get(i); - RenameParticipant[] renames = - ParticipantManager.loadRenameParticipants( - status, processor, resource, arguments, natures, shared); - result.addAll(Arrays.asList(renames)); - } - } return (RefactoringParticipant[]) result.toArray(new RefactoringParticipant[result.size()]); } @@ -339,19 +273,6 @@ public void buildDelta(IResourceChangeDescriptionFactory builder) { } } - public static void buildMoveDelta( - IResourceChangeDescriptionFactory builder, IResource resource, RenameArguments args) { - IPath newPath = resource.getFullPath().removeLastSegments(1).append(args.getNewName()); - builder.move(resource, newPath); - } - - public static void buildMoveDelta( - IResourceChangeDescriptionFactory builder, IResource resource, MoveArguments args) { - IPath destination = - ((IResource) args.getDestination()).getFullPath().append(resource.getName()); - builder.move(resource, destination); - } - public static void buildCopyDelta( IResourceChangeDescriptionFactory builder, IResource resource, CopyArguments args) { IPath destination = diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/resources/org/eclipse/ltk/internal/core/refactoring/RefactoringCoreMessages.properties b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/resources/org/eclipse/ltk/internal/core/refactoring/RefactoringCoreMessages.properties index 7be94b05d86b..6e28ac277aef 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/resources/org/eclipse/ltk/internal/core/refactoring/RefactoringCoreMessages.properties +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/resources/org/eclipse/ltk/internal/core/refactoring/RefactoringCoreMessages.properties @@ -68,18 +68,6 @@ ParticipantExtensionPoint_wrong_type= The participant ''{0}'' does not extend th RefactoringUndoContext_label=Refactoring Undo Context Refactoring_execute_label=Refactoring - Execute -RenameResourceChange_name=Rename ''{0}'' to ''{1}'' -RenameResourceChange_progress_description=Rename resource -RenameResourceDescriptor_error_name_not_defined=The rename resource refactoring can not be performed as the new name is invalid -RenameResourceDescriptor_error_path_not_set=The rename resource refactoring can not be performed as resource path is not set -RenameResourceDescriptor_error_resource_not_existing=The rename resource refactoring can not be performed as the resource ''{0}'' does not exist -RenameResourceDescriptor_unnamed_descriptor=N/A -RenameResourceProcessor_comment=Rename resource ''{0}'' to ''{1}'' -RenameResourceProcessor_description=Rename resource ''{0}'' -RenameResourceProcessor_error_invalid_name=This is an invalid name for a file or folder -RenameResourceProcessor_error_no_parent=Internal Error -RenameResourceProcessor_error_resource_already_exists=A file or folder with this name already exists -RenameResourceProcessor_processor_name=Rename Resource Refactoring_undo_label=Refactoring - Undo Refactoring_redo_label=Refactoring - Redo @@ -135,24 +123,3 @@ UndoDeleteResourceChange_change_name=Restore ''{0}'' UndoDeleteResourceChange_cannot_restore=There is not enough information to create or restore ''{0}''. UndoDeleteResourceChange_already_exists=Cannot create or restore ''{0}'' because it already exists. UndoDeleteResourceChange_revert_resource=Revert ''{0}'' -MoveResourceChange_name=Move resource ''{0}'' to ''{1}'' -MoveResourceChange_progress_delete_destination=Delete resource at destination -MoveResourceChange_progress_restore_source=Restore resource at source -MoveResourcesDescriptor_error_destination_not_exists=The destination container ''{0}'' does not exist -MoveResourcesDescriptor_error_destination_not_set=The move resource refactoring can not be performed as destination path is not set -MoveResourcesDescriptor_error_empty_array=Only arrays with size > 0 are allowed -MoveResourcesDescriptor_error_moved_contains_null=The move resource refactoring can not be performed as a path to move is null -MoveResourcesDescriptor_error_moved_not_exists=The moved resource ''{0}'' does not exist -MoveResourcesDescriptor_error_moved_not_file_or_folder=The moved resource ''{0}'' is not a file or folder -MoveResourcesDescriptor_error_moved_not_set=The move resource refactoring can not be performed as as the paths to move are not set -MoveResourcesDescriptor_unnamed_descriptor=N/A -MoveResourcesProcessor_warning_destination_already_exists=''{0}'' already exist. It will be replaced. -MoveResourceProcessor_comment=Move ''{0}'' to ''{1}'' -MoveResourceProcessor_description_multiple=Move {0} resources to ''{1}'' -MoveResourceProcessor_description_single=Move ''{0}'' to ''{1}'' -MoveResourceProcessor_destination_inside_moved=Destination is inside moved resource ''{0}'' -MoveResourceProcessor_destination_same_as_moved=The destination contains a resource to be moved - -MoveResourceProcessor_error_destination_not_exists=Destination does not exist -MoveResourceProcessor_error_invalid_destination=Invalid parent -MoveResourceProcessor_processor_name=Move Resources