Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormvelten2012-07-31 08:02:51 -0400
committermvelten2012-07-31 08:02:51 -0400
commit5f0f6082d59796c628489203b8f4169822b51db1 (patch)
tree0d7e185fbd2d78b10bf531dab66f2fe6e6e6a952 /plugins/team
parentc47a7fcf8270f93d17980b516668bf021ae7208b (diff)
downloadorg.eclipse.papyrus-5f0f6082d59796c628489203b8f4169822b51db1.tar.gz
org.eclipse.papyrus-5f0f6082d59796c628489203b8f4169822b51db1.tar.xz
org.eclipse.papyrus-5f0f6082d59796c628489203b8f4169822b51db1.zip
backport r7420
Diffstat (limited to 'plugins/team')
-rw-r--r--plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF3
-rw-r--r--plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java23
2 files changed, 6 insertions, 20 deletions
diff --git a/plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF b/plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF
index c0267068ea7..42ee7bf54d9 100644
--- a/plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF
+++ b/plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF
@@ -5,7 +5,8 @@ Require-Bundle: org.eclipse.papyrus.infra.onefile;bundle-version="0.9.0",
org.eclipse.emf.ecore,
org.eclipse.team.svn.core;resolution:=optional,
org.eclipse.papyrus.infra.emf.readonly;bundle-version="0.9.0",
- org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.9.0"
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.9.0",
+ org.eclipse.emf.edit
Export-Package: org.eclipse.papyrus.team.svn
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
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 2e3966745e1..ee73a06fedc 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,7 +9,6 @@
*
* 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;
@@ -18,6 +17,7 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.team.FileModificationValidationContext;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.papyrus.infra.emf.readonly.IReadOnlyHandler;
import org.eclipse.team.svn.core.IStateFilter;
import org.eclipse.team.svn.core.svnstorage.SVNRemoteStorage;
@@ -26,21 +26,9 @@ import org.eclipse.team.svn.ui.SVNTeamModificationValidator;
public class SVNLockHandler implements IReadOnlyHandler {
- SVNTeamModificationValidator validator;
+ SVNTeamModificationValidator validator = new SVNTeamModificationValidator();
- public SVNLockHandler() {
- try {
- validator = new SVNTeamModificationValidator();
- } catch (NoClassDefFoundError ex) {
- //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
- }
+ public boolean isReadOnly(IFile[] files, EditingDomain editingDomain) {
IResource[] needsLockResources = FileUtility.filterResources(files, IStateFilter.SF_NEEDS_LOCK, IResource.DEPTH_ZERO);
for(IResource needsLockResource : needsLockResources) {
@@ -52,10 +40,7 @@ public class SVNLockHandler implements IReadOnlyHandler {
return false;
}
- public boolean enableWrite(IFile[] files) {
- if(validator == null) {
- return true; //SVN is not installed
- }
+ public boolean enableWrite(IFile[] files, EditingDomain editingDomain) {
IStatus result = validator.validateEdit(files, FileModificationValidationContext.VALIDATE_PROMPT);

Back to the top