|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.resources.team.FileModificationValidator
The file modification validator is a Team-related hook for pre-checking operations that modify the contents of files.
This class is used only in conjunction with the "org.eclipse.core.resources.fileModificationValidator" extension point. It is intended to be implemented only by the Eclipse Platform Team plug-in or by repository providers whose validator get invoked by Team.
Constructor Summary | |
---|---|
FileModificationValidator()
|
Method Summary | |
---|---|
abstract IStatus |
validateEdit(IFile[] files,
FileModificationValidationContext context)
Validates that the given files can be modified. |
IStatus |
validateEdit(IFile[] files,
Object context)
Deprecated. this method is part of the deprecated IFileModificationValidator
interface. Clients should call validateEdit(IFile[], FileModificationValidationContext)
instead. |
IStatus |
validateSave(IFile file)
Validates that the given file can be saved. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileModificationValidator()
Method Detail |
public final IStatus validateEdit(IFile[] files, Object context)
IFileModificationValidator
interface. Clients should call validateEdit(IFile[], FileModificationValidationContext)
instead.
null
, the
validator must attempt to perform the validation in a headless manner.
The returned status is IStatus.OK
if this validator
believes the given file can be modified. Other return statuses indicate
the reason why the individual files cannot be modified.
validateEdit
in interface IFileModificationValidator
files
- the files that are to be modified; these files must all exist in the workspacecontext
- the org.eclipse.swt.widgets.Shell
that is to be used to
parent any dialogs with the user, or null
if there is no UI context (declared
as an Object
to avoid any direct references on the SWT component)
IWorkspace.validateEdit(IFile[], Object)
public IStatus validateSave(IFile file)
IFile#setContents
and IFile#appendContents
before any attempt to write data to disk. The returned status is
IStatus.OK
if this validator believes the given file can be
successfully saved. In all other cases the return value is a non-OK status.
Note that a return value of IStatus.OK
does not guarantee
that the save will succeed.
validateSave
in interface IFileModificationValidator
file
- the file that is to be modified; this file must exist in the workspace
IStatus.OK
indicates a save should be attempted.IFile.setContents(java.io.InputStream, int, org.eclipse.core.runtime.IProgressMonitor)
,
IFile.appendContents(java.io.InputStream, int, org.eclipse.core.runtime.IProgressMonitor)
public abstract IStatus validateEdit(IFile[] files, FileModificationValidationContext context)
null
, the
validator must attempt to perform the validation in a headless manner.
The returned status is IStatus.OK
if this validator
believes the given file can be modified. Other return statuses indicate
the reason why the individual files cannot be modified.
files
- the files that are to be modified; these files must all exist in the workspacecontext
- the context to aid in UI-based validation or null
if the validation
must be headless
IWorkspace.validateEdit(IFile[], Object)
|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.