public class ResourceRuleFactory extends Object implements IResourceRuleFactory
IResourceRuleFactory| Modifier | Constructor and Description |
|---|---|
protected |
ResourceRuleFactory()
Creates a new default resource rule factory.
|
| Modifier and Type | Method and Description |
|---|---|
ISchedulingRule |
buildRule()
Default implementation of
IResourceRuleFactory#buildRule. |
ISchedulingRule |
charsetRule(IResource resource)
Default implementation of
IResourceRuleFactory#charsetRule. |
ISchedulingRule |
copyRule(IResource source,
IResource destination)
Default implementation of
IResourceRuleFactory#copyRule. |
ISchedulingRule |
createRule(IResource resource)
Default implementation of
IResourceRuleFactory#createRule. |
ISchedulingRule |
deleteRule(IResource resource)
Default implementation of
IResourceRuleFactory#deleteRule. |
ISchedulingRule |
markerRule(IResource resource)
Default implementation of
IResourceRuleFactory#markerRule. |
ISchedulingRule |
modifyRule(IResource resource)
Default implementation of
IResourceRuleFactory#modifyRule. |
ISchedulingRule |
moveRule(IResource source,
IResource destination)
Default implementation of
IResourceRuleFactory#moveRule. |
protected ISchedulingRule |
parent(IResource resource)
Convenience method to return the parent of the given resource,
or the resource itself for projects and the workspace root.
|
ISchedulingRule |
refreshRule(IResource resource)
Default implementation of
IResourceRuleFactory#refreshRule. |
ISchedulingRule |
validateEditRule(IResource[] resources)
Default implementation of
IResourceRuleFactory#validateEditRule. |
protected ResourceRuleFactory()
public final ISchedulingRule buildRule()
IResourceRuleFactory#buildRule.
This default implementation always returns the workspace root.
Subclasses may not currently override this method.
buildRule in interface IResourceRuleFactorynullIResourceRuleFactory.buildRule()public ISchedulingRule charsetRule(IResource resource)
IResourceRuleFactory#charsetRule.
This default implementation always returns the project of the resource
whose charset setting is being changed, or null if 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.
charsetRule in interface IResourceRuleFactoryresource - the resource the charset will be changednullISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),
IResourceRuleFactory.charsetRule(IResource)public ISchedulingRule copyRule(IResource source, IResource destination)
IResourceRuleFactory#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.
copyRule in interface IResourceRuleFactorysource - the source of the copydestination - the destination of the copynullISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),
IResourceRuleFactory.copyRule(IResource, IResource)public ISchedulingRule createRule(IResource resource)
IResourceRuleFactory#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.
createRule in interface IResourceRuleFactoryresource - the resource being creatednullISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),
IResourceRuleFactory.createRule(IResource)public ISchedulingRule deleteRule(IResource resource)
IResourceRuleFactory#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.
deleteRule in interface IResourceRuleFactoryresource - the resource to be deletednullISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),
IResourceRuleFactory.deleteRule(IResource)public final ISchedulingRule markerRule(IResource resource)
IResourceRuleFactory#markerRule.
This default implementation always returns null.
Subclasses may not currently override this method.
markerRule in interface IResourceRuleFactoryresource - the resource owning the marker to be modifiednullIResourceRuleFactory.markerRule(IResource)public ISchedulingRule modifyRule(IResource resource)
IResourceRuleFactory#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 the validateSave hook.
Subclasses may override this method. The rule provided by an overriding method must at least contain the rule from this default implementation.
modifyRule in interface IResourceRuleFactoryresource - the resource being modifiednullISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),
IResourceRuleFactory.modifyRule(IResource),
IFileModificationValidator.validateSave(IFile),
IProjectDescription.DESCRIPTION_FILE_NAMEpublic ISchedulingRule moveRule(IResource source, IResource destination)
IResourceRuleFactory#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.
moveRule in interface IResourceRuleFactorysource - the source of the movedestination - the destination of the movenullISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),
IResourceRuleFactory.moveRule(IResource, IResource)protected final ISchedulingRule parent(IResource resource)
resource - the resource to compute the parent ofpublic ISchedulingRule refreshRule(IResource resource)
IResourceRuleFactory#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.
refreshRule in interface IResourceRuleFactoryresource - the resource to refreshnullISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),
IResourceRuleFactory.refreshRule(IResource)public ISchedulingRule validateEditRule(IResource[] resources)
IResourceRuleFactory#validateEditRule.
This default implementation returns a rule that combines the parents of
all read-only resources, or null if 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.
validateEditRule in interface IResourceRuleFactoryresources - the resources to be validatednullISchedulingRule.contains(org.eclipse.core.runtime.jobs.ISchedulingRule),
IResourceRuleFactory.validateEditRule(IResource[])Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.