Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.core.resources.mapping
Class ResourceChangeValidator


java.lang.Object
  extended by 
org.eclipse.core.resources.mapping.ResourceChangeValidator

public final class ResourceChangeValidator
extends Object

The resource change validator is used to validate that changes made to resources will not adversely affect the models stored in those resources.

The validator is used by first creating a resource delta describing the proposed changes. A delta can be generated using a IResourceChangeDescriptionFactory. The change is then validated by calling the validateChange(IResourceDelta, IProgressMonitor) method. This example validates a change to a single file: IFile file = ..;//some file that is going to be changed ResourceChangeValidator validator = ResourceChangeValidator.getValidator(); IResourceChangeDescriptionFactory factory = validator.createDeltaFactory(); factory.change(file); IResourceDelta delta = factory.getDelta(); IStatus result = validator.validateChange(delta, null); If the result status does not have severity IStatus.OK, then the changes may cause problems for models that are built on those resources. In this case the user should be presented with the status message to determine if they want to proceed with the modification.

Since:
3.2

Method Summary
  IResourceChangeDescriptionFactory createDeltaFactory ()
          Return an empty change description factory that can be used to build a proposed resource delta.
static  ResourceChangeValidator getValidator ()
          Return the singleton change validator.
  IStatus validateChange ( IResourceDelta delta, IProgressMonitor monitor)
          Validate the proposed changes contained in the given delta by consulting all model providers to determine if the changes have any adverse side effects.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getValidator

public static 
ResourceChangeValidator getValidator()
Return the singleton change validator.

Returns:
the singleton change validator

createDeltaFactory

public 
IResourceChangeDescriptionFactory createDeltaFactory()
Return an empty change description factory that can be used to build a proposed resource delta.

Returns:
an empty change description factory that can be used to build a proposed resource delta

validateChange

public 
IStatus validateChange(
IResourceDelta delta,
                              
IProgressMonitor monitor)
Validate the proposed changes contained in the given delta by consulting all model providers to determine if the changes have any adverse side effects.

This method returns either a ModelStatus, or a MultiStatus whose children are ModelStatus. In either case, the severity of the status indicates the severity of the possible side-effects of the operation. Any severity other than OK should be shown to the user. The message should be a human readable message that will allow the user to make a decision on whether to continue with the operation. The model provider id should indicate which model is flagging the the possible side effects.

Parameters:
delta - a delta tree containing the proposed changes
Returns:
a status indicating any potential side effects on models stored in the affected resources.

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire