Runtime

org.eclipse.gmf.runtime.common.core.command
Class FileModificationValidator

java.lang.Object
  extended by org.eclipse.gmf.runtime.common.core.command.FileModificationValidator

public class FileModificationValidator
extends java.lang.Object

Static utility that approves the modification of files using an IModificationValidator.

The modification validator can be set exactly once using setModificationValidator(IModificationValidator) before the first request to validate files.


Nested Class Summary
static interface FileModificationValidator.ISyncExecHelper
          This interface works in conjuction with the FileModificationValidator.ISyncExecHelper to bridge entities knowing of UI and those with knowledge of editing domains.
static class FileModificationValidator.SyncExecHelper
          Utility class that is used to bridge those entities that have knowledge of UI and those that have knowledge of editing domains.
 
Method Summary
static IStatus approveFileModification(IFile[] files)
          Checks that the files may be modified.
static void setModificationValidator(IModificationValidator v)
          Set the modification validator to be used to check that files can be modified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setModificationValidator

public static void setModificationValidator(IModificationValidator v)
Set the modification validator to be used to check that files can be modified.

This method may only be called once, and must be called before any request to validate files. Attempts to set the validator will be ignored after it has been already set, or after a default one has been created.

Parameters:
validator - the modification validator

approveFileModification

public static IStatus approveFileModification(IFile[] files)
Checks that the files may be modified.

Returns:
the approval status

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.