summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilippe ROLAND2014-03-14 11:09:36 (EDT)
committerPhilippe ROLAND2014-03-14 11:13:53 (EDT)
commitc05175d4aee887c85fa8c32daa7b991123f274a9 (patch)
tree5cac9e6b038fe41695a6f2512827fa017b1bdb4a
parent832ceab5e78772d2b483348f620de7b47a4c091f (diff)
downloadorg.eclipse.papyrus-c05175d4aee887c85fa8c32daa7b991123f274a9.zip
org.eclipse.papyrus-c05175d4aee887c85fa8c32daa7b991123f274a9.tar.gz
org.eclipse.papyrus-c05175d4aee887c85fa8c32daa7b991123f274a9.tar.bz2
Bug 425560 - [Collaborative] Migrate collaborative mode from Indigo to Luna : fixed compilation errors
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/security/CollabReadOnlyHandler.java34
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/ui/dialogs/PreviewDialog.java28
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNCommitter.java2
3 files changed, 33 insertions, 31 deletions
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/security/CollabReadOnlyHandler.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/security/CollabReadOnlyHandler.java
index 8af6a52..9c975dc 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/security/CollabReadOnlyHandler.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/security/CollabReadOnlyHandler.java
@@ -13,14 +13,15 @@ package org.eclipse.papyrus.team.collaborative.strategy.security;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
+import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.edit.domain.EditingDomain;
-//import org.eclipse.papyrus.infra.emf.readonly.IReadOnlyHandler;
+import org.eclipse.papyrus.infra.core.resource.AbstractReadOnlyHandler;
import org.eclipse.papyrus.infra.core.resource.IReadOnlyHandler;
-import org.eclipse.papyrus.infra.emf.readonly.AbstractReadOnlyHandler;
+import org.eclipse.papyrus.infra.core.resource.ReadOnlyAxis;
import org.eclipse.papyrus.team.collaborative.core.ICollaborativeManager;
import org.eclipse.papyrus.team.collaborative.core.IExtendedURI;
import org.eclipse.papyrus.team.collaborative.core.participants.locker.ILocker;
@@ -48,8 +49,8 @@ public class CollabReadOnlyHandler extends AbstractReadOnlyHandler {
*
* @see org.eclipse.papyrus.readonly.IReadOnlyHandler#isReadOnly(org.eclipse.emf.common.util.URI[], org.eclipse.emf.edit.domain.EditingDomain)
*/
- public Optional<Boolean> anyReadOnly(URI[] uris) {
- if(uris != null && uris.length > 0 && getEditingDomain() != null) {
+ public Optional<Boolean> anyReadOnly(Set<ReadOnlyAxis> axes, URI[] uris) {
+ if(uris != null && uris.length > 0 && getEditingDomain() != null && axes.contains(ReadOnlyAxis.PERMISSION)) {
ArrayList<URI> urisList = Lists.newArrayList(uris);
Collection<IExtendedURI> extendedURICollection = Collections2.transform(urisList, CollabFunctionsFactory.getURIToExtendedURIWithContainment());
HashSet<IExtendedURI> extendURISet = Sets.newHashSet(extendedURICollection);
@@ -75,19 +76,20 @@ public class CollabReadOnlyHandler extends AbstractReadOnlyHandler {
*
* @see org.eclipse.papyrus.readonly.IReadOnlyHandler#enableWrite(org.eclipse.emf.common.util.URI[], org.eclipse.emf.edit.domain.EditingDomain)
*/
- public Optional<Boolean> makeWritable(URI[] uris) {
- ArrayList<URI> urisList = Lists.newArrayList(uris);
- Collection<IExtendedURI> extendedURICollection = Collections2.transform(urisList, CollabFunctionsFactory.getURIToExtendedURIWithContainment());
- HashSet<IExtendedURI> extendedURISet = Sets.newHashSet(extendedURICollection);
- ResourceSet resourceSet = getEditingDomain().getResourceSet();
- if(ICollaborativeManager.INSTANCE.isCollab(extendedURISet, resourceSet)) {
- IStatus status = LockAction.doSafeLock(resourceSet, extendedURISet, true);
- if(!status.isOK()) {
- return Optional.absent();
+ public Optional<Boolean> makeWritable(Set<ReadOnlyAxis> axes, URI[] uris) {
+ if(axes.contains(ReadOnlyAxis.PERMISSION)) {
+ ArrayList<URI> urisList = Lists.newArrayList(uris);
+ Collection<IExtendedURI> extendedURICollection = Collections2.transform(urisList, CollabFunctionsFactory.getURIToExtendedURIWithContainment());
+ HashSet<IExtendedURI> extendedURISet = Sets.newHashSet(extendedURICollection);
+ ResourceSet resourceSet = getEditingDomain().getResourceSet();
+ if(ICollaborativeManager.INSTANCE.isCollab(extendedURISet, resourceSet)) {
+ IStatus status = LockAction.doSafeLock(resourceSet, extendedURISet, true);
+ if(!status.isOK()) {
+ return Optional.absent();
+ }
+ return Optional.of(true);
}
- return Optional.of(true);
}
return Optional.absent();
}
-
-}
+} \ No newline at end of file
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/ui/dialogs/PreviewDialog.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/ui/dialogs/PreviewDialog.java
index 66c1303..02c49ee 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/ui/dialogs/PreviewDialog.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.strategy/src/org/eclipse/papyrus/team/collaborative/strategy/ui/dialogs/PreviewDialog.java
@@ -117,20 +117,20 @@ public class PreviewDialog extends TitleAreaDialog {
// return result.toArray(new EObject[result.size()]);
// }
- @Override
- public Object[] getChildren(Object parentElement) {
- //Remove duplicate
- Object[] superChildren = super.getChildren(parentElement);
-
- List<Object> result = new ArrayList<Object>();
- for(int i = 0; i < superChildren.length; i++) {
- Object c = superChildren[i];
- if(!result.contains(c)) {
- result.add(c);
- }
- }
- return result.toArray(new Object[result.size()]);
- }
+// @Override
+// public Object[] getChildren(Object parentElement) {
+// //Remove duplicate
+// Object[] superChildren = super.getChildren(parentElement);
+//
+// List<Object> result = new ArrayList<Object>();
+// for(int i = 0; i < superChildren.length; i++) {
+// Object c = superChildren[i];
+// if(!result.contains(c)) {
+// result.add(c);
+// }
+// }
+// return result.toArray(new Object[result.size()]);
+// }
});
treeViewer.setLabelProvider(labelProvider);
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNCommitter.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNCommitter.java
index 6ae4fd0..7288235 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNCommitter.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNCommitter.java
@@ -108,7 +108,7 @@ public class SVNCommitter extends SVNWorkOnModifiedFile implements ICommitter {
}
Tracer.logInfo(stringBuilder.toString());
}
- CompositeOperation mainOp = tt.getCompositeCommitOperation(allResources, new IResource[0], message, keepLock, Display.getDefault().getActiveShell(), PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart(), true);
+ CompositeOperation mainOp = tt.getCompositeCommitOperation(allResources, new IResource[0], message, keepLock, Display.getDefault().getActiveShell(), PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart());
ICancellableOperationWrapper runnable = UIMonitorUtility.doTaskNowDefault(mainOp, false);
IActionOperation resultStatus = runnable.getOperation();
return resultStatus.getStatus();