### Eclipse Workspace Patch 1.0
#P org.eclipse.core.resources
Index: src/org/eclipse/core/internal/resources/Rules.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Rules.java,v
retrieving revision 1.20
diff -u -r1.20 Rules.java
--- src/org/eclipse/core/internal/resources/Rules.java 5 Oct 2009 21:40:29 -0000 1.20
+++ src/org/eclipse/core/internal/resources/Rules.java 6 Oct 2009 12:52:34 -0000
@@ -120,6 +120,15 @@
}
/**
+ * Obtains the scheduling rule from the appropriate factory for marking as derived operation.
+ */
+ public ISchedulingRule derivedRule(IResource resource) {
+ if (resource.getType() == IResource.ROOT || resource.getType() == IResource.PROJECT)
+ return null;
+ return factoryFor(resource).derivedRule(resource);
+ }
+
+ /**
* Obtains the scheduling rule from the appropriate factory for a marker change operation.
*/
public ISchedulingRule markerRule(IResource resource) {
Index: src/org/eclipse/core/resources/IResource.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/resources/IResource.java,v
retrieving revision 1.105
diff -u -r1.105 IResource.java
--- src/org/eclipse/core/resources/IResource.java 5 Oct 2009 21:40:29 -0000 1.105
+++ src/org/eclipse/core/resources/IResource.java 6 Oct 2009 12:52:34 -0000
@@ -2345,6 +2345,7 @@
* event notification. See IResourceChangeEvent
for more details.
*
* @see #isDerived()
+ * @see IResourceRuleFactory#derivedRule(IResource)
* @since 2.0
* @deprecated Replaced by {@link #setDerived(boolean, IProgressMonitor)} which
* is a workspace operation and reports changes in resource deltas.
@@ -2402,6 +2403,7 @@
* event notification. See IResourceChangeEvent
for more details.
*
* @see #isDerived()
+ * @see IResourceRuleFactory#derivedRule(IResource)
* @since 3.6
*/
public void setDerived(boolean isDerived, IProgressMonitor monitor) throws CoreException;
Index: src/org/eclipse/core/resources/IResourceDelta.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/resources/IResourceDelta.java,v
retrieving revision 1.28
diff -u -r1.28 IResourceDelta.java
--- src/org/eclipse/core/resources/IResourceDelta.java 18 Sep 2009 14:47:34 -0000 1.28
+++ src/org/eclipse/core/resources/IResourceDelta.java 6 Oct 2009 12:52:35 -0000
@@ -405,6 +405,12 @@
*
CONTENT
- The bytes contained by the resource have
* been altered, or IResource.touch
has been called on
* the resource.COPIED_FROM
- The resource was copied from another location.
+ * The location in the "before" state can be retrieved using getMovedFromPath()
.
+ * This flag is only used when describing potential changes using an
+ * {@link IResourceChangeDescriptionFactory}.DERIVED_CHANGED
- The derived flag of the resource may have
+ * been altered.ENCODING
- The encoding of the resource may have been altered.
* This flag is not set when the encoding changes due to the file being modified,
* or being moved.null
* @since 3.1
*/
- public ISchedulingRule charsetRule(IResource resource);
+ public ISchedulingRule charsetRule(IResource resource);
+
+ /**
+ * Returns the scheduling rule that is required for marking resources
+ * as derived.
+ *
+ * @param resource the resource to be marked as derived
+ * @return a scheduling rule, or null
+ * @since 3.6
+ */
+ public ISchedulingRule derivedRule(IResource resource);
/**
* Returns the scheduling rule that is required for copying a resource.
Index: src/org/eclipse/core/resources/team/ResourceRuleFactory.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/resources/team/ResourceRuleFactory.java,v
retrieving revision 1.12
diff -u -r1.12 ResourceRuleFactory.java
--- src/org/eclipse/core/resources/team/ResourceRuleFactory.java 25 Jan 2008 23:17:10 -0000 1.12
+++ src/org/eclipse/core/resources/team/ResourceRuleFactory.java 6 Oct 2009 12:52:35 -0000
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 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
@@ -68,6 +68,26 @@
}
/**
+ * Default implementation of IResourceRuleFactory#derivedRule
.
+ * This default implementation always returns the resource that is to be
+ * marked as derived, or null
if the resource is the workspace
+ * root or a project.
+ * + * Subclasses may override this method. The rule provided by an overriding + * method must at least contain the rule from this default implementation. + *
+ * + * @see org.eclipse.core.runtime.jobs.ISchedulingRule#contains(org.eclipse.core.runtime.jobs.ISchedulingRule) + * @see org.eclipse.core.resources.IResourceRuleFactory#derivedRule(IResource) + * @since 3.6 + */ + public ISchedulingRule derivedRule(IResource resource) { + if (resource.getType() == IResource.ROOT || resource.getType() == IResource.PROJECT) + return null; + return resource; + } + + /** * Default implementation ofIResourceRuleFactory#copyRule
.
* This default implementation always returns the parent of the destination
* resource.