Runtime

org.eclipse.gmf.runtime.common.ui.resources
Class FileModificationValidator

java.lang.Object
  extended byorg.eclipse.gmf.runtime.common.ui.resources.FileModificationValidator

public class FileModificationValidator
extends java.lang.Object

A wrapper around the Eclipse IFileModificationValidator.


Method Summary
static FileModificationValidator getInstance()
          get the singleton instance of this class
 boolean okToEdit(IFile[] files, java.lang.String modificationReason)
          Validates that the given files can be modified using the Team validateEdit support.
 boolean okToEdit(IFile[] files, java.lang.String modificationReason, Shell shell)
          Validates that the given files can be modified using the Team validateEdit support.
 boolean okToSave(IFile file)
          Validates that the given file can be saved using the Team validateSave support.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static FileModificationValidator getInstance()
get the singleton instance of this class

Returns:
singleton instance of the FileModificationValidator class

okToEdit

public boolean okToEdit(IFile[] files,
                        java.lang.String modificationReason)
Validates that the given files can be modified using the Team validateEdit support.

Parameters:
files - files that are to be modified; these files must all exist in the workspace.
modificationReason - a String describing the reason for modifying the file, usually the command text.
Returns:
true if it is OK to edit the files.
See Also:
IFileModificationValidator.validateEdit(org.eclipse.core.resources.IFile[], java.lang.Object)

okToEdit

public boolean okToEdit(IFile[] files,
                        java.lang.String modificationReason,
                        Shell shell)
Validates that the given files can be modified using the Team validateEdit support.

Parameters:
files - files that are to be modified; these files must all exist in the workspace.
modificationReason - a String describing the reason for modifying the file, usually the command text.
shell - UI context for UI that could be presented to the user to determine whether the file may be edited.
Returns:
true if it is OK to edit the files.
See Also:
IFileModificationValidator.validateEdit(org.eclipse.core.resources.IFile[], java.lang.Object)

okToSave

public boolean okToSave(IFile file)
Validates that the given file can be saved using the Team validateSave support.

Parameters:
file - the file that is to be saved; this file must exist in the workspace.
Returns:
true if it is OK to save the file.
See Also:
IFileModificationValidator.validateSave(org.eclipse.core.resources.IFile)

Runtime

Guidelines for using Eclipse APIs.

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