Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-06-13 04:53:22 -0400
committercletavernie2012-06-13 04:53:22 -0400
commit81d6244e1c86ef5a6e8d93d6e63c6091599a7254 (patch)
treeaa4d2462012c02a689f6e64e076ebb0bb42761c3 /plugins/team/org.eclipse.papyrus.team.svn/src/org
parentbc047e0402c07e33702afb0e379664d5fa069cc0 (diff)
downloadorg.eclipse.papyrus-81d6244e1c86ef5a6e8d93d6e63c6091599a7254.tar.gz
org.eclipse.papyrus-81d6244e1c86ef5a6e8d93d6e63c6091599a7254.tar.xz
org.eclipse.papyrus-81d6244e1c86ef5a6e8d93d6e63c6091599a7254.zip
382467: [Team] The dependency from Papyrus to SVN should be optional
https://bugs.eclipse.org/bugs/show_bug.cgi?id=382467
Diffstat (limited to 'plugins/team/org.eclipse.papyrus.team.svn/src/org')
-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