public interface IResourceRuleFactory
Note that simple use of the workspace APIs does not require use of scheduling
rules. All workspace API methods that modify the workspace will automatically
obtain any scheduling rules needed to perform the modification. However, if you
are aggregating a set of changes to the workspace using WorkspaceJob
or IWorkspaceRunnable
you can use scheduling rules to lock a
portion of the workspace for the duration of the job or runnable. If you
provide a non-null scheduling rule, a runtime exception will occur if you try to
modify a portion of the workspace that is not covered by the rule for the runnable or job.
If more than one rule is needed, they can be aggregated using the
MultiRule.combine
method. Simplifying a group of rules does not change
the set of resources that are covered, but can improve job scheduling performance.
Note that null
is a valid scheduling rule (indicating that no
resources need to be locked), and thus all methods in this class may
return null
.
WorkspaceJob
,
IWorkspace.run(IWorkspaceRunnable, ISchedulingRule, int, org.eclipse.core.runtime.IProgressMonitor)
,
MultiRule.combine(ISchedulingRule, ISchedulingRule)
Modifier and Type | Method and Description |
---|---|
ISchedulingRule |
buildRule()
Returns the scheduling rule that is required for building a project or the
entire workspace.
|
ISchedulingRule |
charsetRule(IResource resource)
Returns the scheduling rule that is required for changing the charset
setting for a file or the default charset setting for a container.
|
ISchedulingRule |
copyRule(IResource source,
IResource destination)
Returns the scheduling rule that is required for copying a resource.
|
ISchedulingRule |
createRule(IResource resource)
Returns the scheduling rule that is required for creating a project, folder,
or file.
|
ISchedulingRule |
deleteRule(IResource resource)
Returns the scheduling rule that is required for deleting a resource.
|
ISchedulingRule |
derivedRule(IResource resource)
Returns the scheduling rule that is required for changing the derived flag
on a resource.
|
ISchedulingRule |
markerRule(IResource resource)
Returns the scheduling rule that is required for creating, modifying, or
deleting markers on a resource.
|
ISchedulingRule |
modifyRule(IResource resource)
Returns the scheduling rule that is required for modifying a resource.
|
ISchedulingRule |
moveRule(IResource source,
IResource destination)
Returns the scheduling rule that is required for moving a resource.
|
ISchedulingRule |
refreshRule(IResource resource)
Returns the scheduling rule that is required for performing
refreshLocal on a resource. |
ISchedulingRule |
validateEditRule(IResource[] resources)
Returns the scheduling rule that is required for a
validateEdit |
ISchedulingRule createRule(IResource resource)
resource
- the resource being creatednull
ISchedulingRule buildRule()
null
ISchedulingRule charsetRule(IResource resource)
resource
- the resource for which the charset will be changednull
ISchedulingRule derivedRule(IResource resource)
resource
- the resource for which the derived flag will be changednull
ISchedulingRule copyRule(IResource source, IResource destination)
source
- the source of the copydestination
- the destination of the copynull
ISchedulingRule deleteRule(IResource resource)
resource
- the resource to be deletednull
ISchedulingRule markerRule(IResource resource)
resource
- the resource owning the marker to be modifiednull
ISchedulingRule modifyRule(IResource resource)
IResource.AVOID_NATURE_CONFIG
flag. For all resources
touch
is considered to be a modification.resource
- the resource being modifiednull
ISchedulingRule moveRule(IResource source, IResource destination)
source
- the source of the movedestination
- the destination of the movenull
ISchedulingRule refreshRule(IResource resource)
refreshLocal
on a resource.resource
- the resource to refreshnull
ISchedulingRule validateEditRule(IResource[] resources)
validateEdit
resources
- the resources to be validatednull
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.