Class ResourceRuleFactory
- java.lang.Object
-
- org.eclipse.core.resources.team.ResourceRuleFactory
-
- All Implemented Interfaces:
IResourceRuleFactory
public class ResourceRuleFactory extends Object implements IResourceRuleFactory
Default implementation of IResourceRuleFactory. The teamHook extension may subclass to provide more specialized scheduling rules for workspace operations that they participate in.- Since:
- 3.0
- See Also:
IResourceRuleFactory
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedResourceRuleFactory()Creates a new default resource rule factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ISchedulingRulebuildRule()Default implementation ofIResourceRuleFactory#buildRule.ISchedulingRulecharsetRule(IResource resource)Default implementation ofIResourceRuleFactory#charsetRule.ISchedulingRulecopyRule(IResource source, IResource destination)Default implementation ofIResourceRuleFactory#copyRule.ISchedulingRulecreateRule(IResource resource)Default implementation ofIResourceRuleFactory#createRule.ISchedulingRuledeleteRule(IResource resource)Default implementation ofIResourceRuleFactory#deleteRule.ISchedulingRulederivedRule(IResource resource)Default implementation ofIResourceRuleFactory#derivedRule.ISchedulingRulemarkerRule(IResource resource)Default implementation ofIResourceRuleFactory#markerRule.ISchedulingRulemodifyRule(IResource resource)Default implementation ofIResourceRuleFactory#modifyRule.ISchedulingRulemoveRule(IResource source, IResource destination)Default implementation ofIResourceRuleFactory#moveRule.protected ISchedulingRuleparent(IResource resource)Convenience method to return the parent of the given resource, or the resource itself for projects and the workspace root.ISchedulingRulerefreshRule(IResource resource)Default implementation ofIResourceRuleFactory#refreshRule.ISchedulingRulevalidateEditRule(IResource[] resources)Default implementation ofIResourceRuleFactory#validateEditRule.
-
-
-
Method Detail
-
buildRule
public final ISchedulingRule buildRule()
Default implementation ofIResourceRuleFactory#buildRule. This default implementation always returns the workspace root.Subclasses may not currently override this method.
- Specified by:
buildRulein interfaceIResourceRuleFactory- Returns:
- a scheduling rule, or
null - See Also:
IResourceRuleFactory.buildRule()
-
charsetRule
public ISchedulingRule charsetRule(IResource resource)
Default implementation ofIResourceRuleFactory#charsetRule. This default implementation always returns the project of the resource whose charset setting is being changed, ornullif the resource is the workspace root.Subclasses may override this method. The rule provided by an overriding method must at least contain the rule from this default implementation.
- Specified by:
charsetRulein interfaceIResourceRuleFactory- Parameters:
resource- the resource for which the charset will be changed- Returns:
- a scheduling rule, or
null - Since:
- 3.1
- See Also:
ISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),IResourceRuleFactory.charsetRule(IResource)
-
derivedRule
public final ISchedulingRule derivedRule(IResource resource)
Default implementation ofIResourceRuleFactory#derivedRule. This default implementation always returnsnull.Subclasses may not currently override this method.
- Specified by:
derivedRulein interfaceIResourceRuleFactory- Parameters:
resource- the resource for which the derived flag will be changed- Returns:
- a scheduling rule, or
null - Since:
- 3.6
- See Also:
ISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),IResourceRuleFactory.derivedRule(IResource)
-
copyRule
public ISchedulingRule copyRule(IResource source, IResource destination)
Default implementation ofIResourceRuleFactory#copyRule. This default implementation always returns the parent of the destination resource.Subclasses may override this method. The rule provided by an overriding method must at least contain the rule from this default implementation.
- Specified by:
copyRulein interfaceIResourceRuleFactory- Parameters:
source- the source of the copydestination- the destination of the copy- Returns:
- a scheduling rule, or
null - See Also:
ISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),IResourceRuleFactory.copyRule(IResource, IResource)
-
createRule
public ISchedulingRule createRule(IResource resource)
Default implementation ofIResourceRuleFactory#createRule. This default implementation always returns the parent of the resource being created.Subclasses may override this method. The rule provided by an overriding method must at least contain the rule from this default implementation.
- Specified by:
createRulein interfaceIResourceRuleFactory- Parameters:
resource- the resource being created- Returns:
- a scheduling rule, or
null - See Also:
ISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),IResourceRuleFactory.createRule(IResource)
-
deleteRule
public ISchedulingRule deleteRule(IResource resource)
Default implementation ofIResourceRuleFactory#deleteRule. This default implementation always returns the parent of the resource being deleted.Subclasses may override this method. The rule provided by an overriding method must at least contain the rule from this default implementation.
- Specified by:
deleteRulein interfaceIResourceRuleFactory- Parameters:
resource- the resource to be deleted- Returns:
- a scheduling rule, or
null - See Also:
ISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),IResourceRuleFactory.deleteRule(IResource)
-
markerRule
public final ISchedulingRule markerRule(IResource resource)
Default implementation ofIResourceRuleFactory#markerRule. This default implementation always returnsnull.Subclasses may not currently override this method.
- Specified by:
markerRulein interfaceIResourceRuleFactory- Parameters:
resource- the resource owning the marker to be modified- Returns:
- a scheduling rule, or
null - See Also:
IResourceRuleFactory.markerRule(IResource)
-
modifyRule
public ISchedulingRule modifyRule(IResource resource)
Default implementation ofIResourceRuleFactory#modifyRule. This default implementation returns the resource being modified, or the parent resource if modifying a project description file. Note that this must encompass any rule required by thevalidateSavehook.Subclasses may override this method. The rule provided by an overriding method must at least contain the rule from this default implementation.
- Specified by:
modifyRulein interfaceIResourceRuleFactory- Parameters:
resource- the resource being modified- Returns:
- a scheduling rule, or
null - See Also:
ISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),IResourceRuleFactory.modifyRule(IResource),FileModificationValidator.validateSave(IFile),IProjectDescription.DESCRIPTION_FILE_NAME
-
moveRule
public ISchedulingRule moveRule(IResource source, IResource destination)
Default implementation ofIResourceRuleFactory#moveRule. This default implementation returns a rule that combines the parent of the source resource and the parent of the destination resource.Subclasses may override this method. The rule provided by an overriding method must at least contain the rule from this default implementation.
- Specified by:
moveRulein interfaceIResourceRuleFactory- Parameters:
source- the source of the movedestination- the destination of the move- Returns:
- a scheduling rule, or
null - See Also:
ISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),IResourceRuleFactory.moveRule(IResource, IResource)
-
parent
protected final ISchedulingRule parent(IResource resource)
Convenience method to return the parent of the given resource, or the resource itself for projects and the workspace root.- Parameters:
resource- the resource to compute the parent of- Returns:
- the parent resource for folders and files, and the resource itself for projects and the workspace root.
-
refreshRule
public ISchedulingRule refreshRule(IResource resource)
Default implementation ofIResourceRuleFactory#refreshRule. This default implementation always returns the parent of the resource being refreshed.Subclasses may override this method. The rule provided by an overriding method must at least contain the rule from this default implementation.
- Specified by:
refreshRulein interfaceIResourceRuleFactory- Parameters:
resource- the resource to refresh- Returns:
- a scheduling rule, or
null - See Also:
ISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),IResourceRuleFactory.refreshRule(IResource)
-
validateEditRule
public ISchedulingRule validateEditRule(IResource[] resources)
Default implementation ofIResourceRuleFactory#validateEditRule. This default implementation returns a rule that combines the parents of all read-only resources, ornullif there are no read-only resources.Subclasses may override this method. The rule provided by an overriding method must at least contain the rule from this default implementation.
- Specified by:
validateEditRulein interfaceIResourceRuleFactory- Parameters:
resources- the resources to be validated- Returns:
- a scheduling rule, or
null - See Also:
ISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),IResourceRuleFactory.validateEditRule(IResource[])
-
-