Class ResourceRuleFactory
- All Implemented Interfaces:
IResourceRuleFactory
- Since:
- 3.0
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
Deprecated.protected
ResourceRuleFactory
(IWorkspace workspace) Creates a new resource rule factory for the given workspace. -
Method Summary
Modifier and TypeMethodDescriptionfinal ISchedulingRule
Default implementation ofIResourceRuleFactory#buildRule
.charsetRule
(IResource resource) Default implementation ofIResourceRuleFactory#charsetRule
.Default implementation ofIResourceRuleFactory#copyRule
.createRule
(IResource resource) Default implementation ofIResourceRuleFactory#createRule
.deleteRule
(IResource resource) Default implementation ofIResourceRuleFactory#deleteRule
.final ISchedulingRule
derivedRule
(IResource resource) Default implementation ofIResourceRuleFactory#derivedRule
.final ISchedulingRule
markerRule
(IResource resource) Default implementation ofIResourceRuleFactory#markerRule
.modifyRule
(IResource resource) Default implementation ofIResourceRuleFactory#modifyRule
.Default implementation ofIResourceRuleFactory#moveRule
.protected final ISchedulingRule
Convenience method to return the parent of the given resource, or the resource itself for projects and the workspace root.refreshRule
(IResource resource) Default implementation ofIResourceRuleFactory#refreshRule
.validateEditRule
(IResource[] resources) Default implementation ofIResourceRuleFactory#validateEditRule
.
-
Constructor Details
-
ResourceRuleFactory
Deprecated.this constructor relies on the workspace already initialized and accessible via static access, instead theResourceRuleFactory(IWorkspace)
constructor should be used.Creates a new default resource rule factory. This constructor must only be called by subclasses. -
ResourceRuleFactory
Creates a new resource rule factory for the given workspace. This constructor must only be called by subclasses.- Since:
- 3.17
-
-
Method Details
-
buildRule
Default implementation ofIResourceRuleFactory#buildRule
. This default implementation always returns the workspace root.Subclasses may not currently override this method.
- Specified by:
buildRule
in interfaceIResourceRuleFactory
- Returns:
- a scheduling rule, or
null
- See Also:
-
charsetRule
Default implementation ofIResourceRuleFactory#charsetRule
. This default implementation always returns the project of the resource whose charset setting is being changed, ornull
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.
- Specified by:
charsetRule
in interfaceIResourceRuleFactory
- Parameters:
resource
- the resource for which the charset will be changed- Returns:
- a scheduling rule, or
null
- Since:
- 3.1
- See Also:
-
derivedRule
Default implementation ofIResourceRuleFactory#derivedRule
. This default implementation always returnsnull
.Subclasses may not currently override this method.
- Specified by:
derivedRule
in interfaceIResourceRuleFactory
- Parameters:
resource
- the resource for which the derived flag will be changed- Returns:
- a scheduling rule, or
null
- Since:
- 3.6
- See Also:
-
copyRule
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:
copyRule
in interfaceIResourceRuleFactory
- Parameters:
source
- the source of the copydestination
- the destination of the copy- Returns:
- a scheduling rule, or
null
- See Also:
-
createRule
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:
createRule
in interfaceIResourceRuleFactory
- Parameters:
resource
- the resource being created- Returns:
- a scheduling rule, or
null
- See Also:
-
deleteRule
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:
deleteRule
in interfaceIResourceRuleFactory
- Parameters:
resource
- the resource to be deleted- Returns:
- a scheduling rule, or
null
- See Also:
-
markerRule
Default implementation ofIResourceRuleFactory#markerRule
. This default implementation always returnsnull
.Subclasses may not currently override this method.
- Specified by:
markerRule
in interfaceIResourceRuleFactory
- Parameters:
resource
- the resource owning the marker to be modified- Returns:
- a scheduling rule, or
null
- See Also:
-
modifyRule
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 thevalidateSave
hook.Subclasses may override this method. The rule provided by an overriding method must at least contain the rule from this default implementation.
- Specified by:
modifyRule
in interfaceIResourceRuleFactory
- Parameters:
resource
- the resource being modified- Returns:
- a scheduling rule, or
null
- See Also:
-
moveRule
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:
moveRule
in interfaceIResourceRuleFactory
- Parameters:
source
- the source of the movedestination
- the destination of the move- Returns:
- a scheduling rule, or
null
- See Also:
-
parent
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
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:
refreshRule
in interfaceIResourceRuleFactory
- Parameters:
resource
- the resource to refresh- Returns:
- a scheduling rule, or
null
- See Also:
-
validateEditRule
Default implementation ofIResourceRuleFactory#validateEditRule
. This default implementation returns a rule that combines the parents of all read-only resources, ornull
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.
- Specified by:
validateEditRule
in interfaceIResourceRuleFactory
- Parameters:
resources
- the resources to be validated- Returns:
- a scheduling rule, or
null
- See Also:
-
ResourceRuleFactory(IWorkspace)
constructor should be used.