Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java')
-rw-r--r--plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java b/plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java
index 12e5b9db7e9..50366a8e7ac 100644
--- a/plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java
+++ b/plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java
@@ -9,6 +9,7 @@
*
* Contributors:
* Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Made the dependency to SVN optional
*
*****************************************************************************/
package org.eclipse.papyrus.team.svn;
@@ -25,9 +26,22 @@ import org.eclipse.team.svn.ui.SVNTeamModificationValidator;
public class SVNLockHandler implements IReadOnlyHandler {
- SVNTeamModificationValidator validator = new SVNTeamModificationValidator();
+ SVNTeamModificationValidator validator;
+
+ public SVNLockHandler() {
+ try {
+ validator = new SVNTeamModificationValidator();
+ } catch (NoClassDefFoundError ex) {
+ System.out.println("Ignore SVN");
+ //If SVN is not installed, then the file is not locked, and can be written.
+ }
+
+ }
public boolean isReadOnly(IFile[] files) {
+ if(validator == null) {
+ return false; //SVN is not installed
+ }
IResource[] needsLockResources = FileUtility.filterResources(files, IStateFilter.SF_NEEDS_LOCK, IResource.DEPTH_ZERO);
for(IResource needsLockResource : needsLockResources) {
@@ -40,6 +54,9 @@ public class SVNLockHandler implements IReadOnlyHandler {
}
public boolean enableWrite(IFile[] files) {
+ if(validator == null) {
+ return true; //SVN is not installed
+ }
IStatus result = validator.validateEdit(files, FileModificationValidationContext.VALIDATE_PROMPT);

Back to the top