Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-pmc] API Request: Support validateEdit for non-UI clients


API Request

Add the following field to IWorkspace:

public static final Object VALIDATE_PROMPT - An object that can be used by clients calling IWorkspace#validateEdit to indicate that they would like the user to be prompted for validation, but they don't have a UI context (shell) available.  This is to be used by "core" code that doesn't have access to a shell, but needs to perform validateEdit to allow a pessimistic repository to check out files prior to modification

Add the following to the SPI for team providers (org.eclipse.core.resources.team package):

New class: org.eclipse.core.resources.team.FileModificationValidationContext - provides context information for use by the file modification validator.  Previously a Shell was used, but this wasn't rich enough to capture all use cases (client does't want prompt, client wants prompt and has a Shell to use as parent, or client wants a prompt but doesn't have access to a shell).

New class: org.eclipse.core.resources.team.FileModificationValidator - replaces IFileModificationValidator, and deprecates validateEdit(IFile[], Object) in favour of the richer validateEdit(IFile[], FileModificationValidationContext).

RISKS


This introduces a deprecation warning for implementations of IFileModificationValidator.  Only team plugins implement this interface, and Team/CVS has indicated they will move to the new API.  The implementation is fully backwards compatible for old team provider implementations and old callers of validateEdit.


RISKS OF NOT SUPPLYING THIS SUPPORT


Headless plug-ins will fail on validateEdit in the presence of a pessimistic team provider because they are not able to provide a Shell.

Associated bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=160905

Back to the top