X-Git-Url: http://git.phpeclipse.com
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/CopyResourceElementsOperation.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/CopyResourceElementsOperation.java
index e6d149e..ddf268c 100644
--- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/CopyResourceElementsOperation.java
+++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/CopyResourceElementsOperation.java
@@ -35,6 +35,7 @@ import net.sourceforge.phpdt.core.jdom.DOMFactory;
import net.sourceforge.phpdt.core.jdom.IDOMCompilationUnit;
import net.sourceforge.phpdt.core.jdom.IDOMNode;
import net.sourceforge.phpdt.core.jdom.IDOMPackage;
+import net.sourceforge.phpdt.internal.core.util.Util;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
@@ -154,7 +155,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
private void createNeededPackageFragments(IContainer sourceFolder, IPackageFragmentRoot root, String newFragName, boolean moveFolder) throws JavaModelException {
IContainer parentFolder = (IContainer) root.getResource();
JavaElementDelta projectDelta = null;
- String[] names = net.sourceforge.phpdt.internal.core.Util.getTrimmedSimpleNames(newFragName);
+ String[] names = net.sourceforge.phpdt.internal.core.util.Util.getTrimmedSimpleNames(newFragName);
StringBuffer sideEffectPackageName = new StringBuffer();
char[][] exclusionsPatterns = ((PackageFragmentRoot)root).fullExclusionPatternChars();
for (int i = 0; i < names.length; i++) {
@@ -164,7 +165,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
if (subFolder == null) {
// create deepest folder only if not a move (folder will be moved in processPackageFragmentResource)
if (!(moveFolder && i == names.length-1)) {
- createFolder(parentFolder, subFolderName, fForce);
+ createFolder(parentFolder, subFolderName, force);
}
parentFolder = parentFolder.getFolder(new Path(subFolderName));
sourceFolder = sourceFolder.getFolder(new Path(subFolderName));
@@ -173,7 +174,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
}
IPackageFragment sideEffectPackage = root.getPackageFragment(sideEffectPackageName.toString());
if (i < names.length - 1 // all but the last one are side effect packages
- && !net.sourceforge.phpdt.internal.core.Util.isExcluded(parentFolder, exclusionsPatterns)) {
+ && !net.sourceforge.phpdt.internal.core.util.Util.isExcluded(parentFolder, exclusionsPatterns)) {
if (projectDelta == null) {
projectDelta = getDeltaFor(root.getJavaProject());
}
@@ -203,7 +204,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
* @see MultiOperation
*/
protected String getMainTaskName() {
- return net.sourceforge.phpdt.internal.core.Util.bind("operation.copyResourceProgress"); //$NON-NLS-1$
+ return net.sourceforge.phpdt.internal.core.util.Util.bind("operation.copyResourceProgress"); //$NON-NLS-1$
}
/**
* Sets the deltas to register the changes resulting from this operation
@@ -217,7 +218,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
*
*/
protected void prepareDeltas(IJavaElement sourceElement, IJavaElement destinationElement, boolean isMove) {
- if (net.sourceforge.phpdt.internal.core.Util.isExcluded(sourceElement) || net.sourceforge.phpdt.internal.core.Util.isExcluded(destinationElement)) return;
+ if (net.sourceforge.phpdt.internal.core.util.Util.isExcluded(sourceElement) || net.sourceforge.phpdt.internal.core.util.Util.isExcluded(destinationElement)) return;
IJavaProject destProject = destinationElement.getJavaProject();
if (isMove) {
IJavaProject sourceProject = sourceElement.getJavaProject();
@@ -248,7 +249,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
if (!destFile.equals(sourceResource)) {
try {
if (destFile.exists()) {
- if (fForce) {
+ if (force) {
// we can remove it
deleteResource(destFile, IResource.KEEP_HISTORY);
} else {
@@ -258,7 +259,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
Util.bind("status.nameCollision", destFile.getFullPath().toString()))); //$NON-NLS-1$
}
}
- int flags = fForce ? IResource.FORCE : IResource.NONE;
+ int flags = force ? IResource.FORCE : IResource.NONE;
if (this.isMove()) {
flags |= IResource.KEEP_HISTORY;
sourceResource.move(destFile.getFullPath(), flags, getSubProgressMonitor(1));
@@ -279,7 +280,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
String encoding = source.getJavaProject().getOption(JavaCore.CORE_ENCODING, true);
destFile.setContents(
new ByteArrayInputStream(encoding == null ? newContent.getBytes() : newContent.getBytes(encoding)),
- fForce ? IResource.FORCE | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY,
+ force ? IResource.FORCE | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY,
getSubProgressMonitor(1));
}
} catch(IOException e) {
@@ -300,7 +301,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
prepareDeltas(source.getType(oldName), destCU.getType(newName), isMove());
}
} else {
- if (!fForce) {
+ if (!force) {
throw new JavaModelException(new JavaModelStatus(
IJavaModelStatusConstants.NAME_COLLISION,
Util.bind("status.nameCollision", destFile.getFullPath().toString()))); //$NON-NLS-1$
@@ -313,7 +314,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
String encoding = source.getJavaProject().getOption(JavaCore.CORE_ENCODING, true);
destFile.setContents(
new ByteArrayInputStream(encoding == null ? newContent.getBytes() : newContent.getBytes(encoding)),
- fForce ? IResource.FORCE | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY,
+ force ? IResource.FORCE | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY,
getSubProgressMonitor(1));
}
} catch(IOException e) {
@@ -363,11 +364,12 @@ public class CopyResourceElementsOperation extends MultiOperation {
} catch (JavaModelException jme) {
throw jme;
} finally {
- fResultElements = new IJavaElement[fCreatedElements.size()];
- fCreatedElements.toArray(fResultElements);
+ resultElements = new IJavaElement[fCreatedElements.size()];
+ fCreatedElements.toArray(resultElements);
processDeltas();
}
}
+
/**
* Copies/moves a package fragment with the name newName
* to the destination package.
@@ -405,7 +407,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
// Process resources
if (shouldMoveFolder) {
// move underlying resource
- srcFolder.move(destPath, fForce, true /* keep history */, getSubProgressMonitor(1));
+ srcFolder.move(destPath, force, true /* keep history */, getSubProgressMonitor(1));
this.setAttribute(HAS_MODIFIED_RESOURCE_ATTR, TRUE);
} else {
// process the leaf resources
@@ -419,7 +421,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
for (int i = 0, max = resources.length; i < max; i++) {
IResource destinationResource = ResourcesPlugin.getWorkspace().getRoot().findMember(destPath.append(resources[i].getName()));
if (destinationResource != null) {
- if (fForce) {
+ if (force) {
deleteResource(destinationResource, IResource.KEEP_HISTORY);
} else {
throw new JavaModelException(new JavaModelStatus(
@@ -434,7 +436,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
for (int i = 0, max = resources.length; i < max; i++) {
IResource destinationResource = ResourcesPlugin.getWorkspace().getRoot().findMember(destPath.append(resources[i].getName()));
if (destinationResource != null) {
- if (fForce) {
+ if (force) {
// we need to delete this resource if this operation wants to override existing resources
deleteResource(destinationResource, IResource.KEEP_HISTORY);
} else {
@@ -494,7 +496,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
String domCUContents = domCU.getContents();
String cuContents = null;
if (domCUContents != null) {
- cuContents = net.sourceforge.phpdt.internal.core.Util.normalizeCRs(domCU.getContents(), bufferContents);
+ cuContents = net.sourceforge.phpdt.internal.core.util.Util.normalizeCRs(domCU.getContents(), bufferContents);
} else {
// See PR http://dev.eclipse.org/bugs/show_bug.cgi?id=11285
cuContents = bufferContents;//$NON-NLS-1$