Skip to content

Commit

Permalink
Fixed bug 433932: Cancel moving a read-only resource error
Browse files Browse the repository at this point in the history
  • Loading branch information
Dani Megert committed May 20, 2014
1 parent 0bdb601 commit 25f839b
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2008 IBM Corporation and others.
* 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
Expand Down Expand Up @@ -181,17 +181,17 @@ public RefactoringStatus validateDestination(IContainer destination) {

private String getMoveDescription() {
if (fResourcesToMove.length == 1) {
return Messages.format(RefactoringCoreMessages.MoveResourceProcessor_description_multiple, new Object[] { new Integer(fResourcesToMove.length), BasicElementLabels.getResourceName(fDestination) });
} else {
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) {
if (fResourcesToMove.length <= 1) {
descriptor.setComment(descriptor.getDescription());
} else {
StringBuffer buf= new StringBuffer();
Expand All @@ -200,8 +200,7 @@ protected MoveResourcesDescriptor createDescriptor() {
buf.append(", "); //$NON-NLS-1$
buf.append(fResourcesToMove[i].getName());
}
descriptor.setComment(Messages.format(RefactoringCoreMessages.MoveResourceProcessor_comment, new String[] { BasicElementLabels.getResourceName(fResourcesToMove[0]), BasicElementLabels.getResourceName(fDestination) }));

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);
Expand Down

0 comments on commit 25f839b

Please sign in to comment.