summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilippe ROLAND2014-03-05 10:54:08 (EST)
committerPhilippe ROLAND2014-03-13 12:28:09 (EDT)
commitebe840eb8d0b25b6db19eec327c1aa9236c86df0 (patch)
tree6200dfd80d7f03168e9a8df1033ece356d9888c2
parent0fb379aa54074b1cf94ce10009cdf8dabf019b5b (diff)
downloadorg.eclipse.papyrus-ebe840eb8d0b25b6db19eec327c1aa9236c86df0.zip
org.eclipse.papyrus-ebe840eb8d0b25b6db19eec327c1aa9236c86df0.tar.gz
org.eclipse.papyrus-ebe840eb8d0b25b6db19eec327c1aa9236c86df0.tar.bz2
425560: [Collaborative] Migrate collaborative mode from Indigo to Luna : Beggining adjustment of this component to make it adhere to 1.0 standards. Added 1.5 compatiblity. Removed reliance on ad-hoc mechanisms for access to ServiceRegistry and semantic element access
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/.settings/org.eclipse.jdt.core.prefs10
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/META-INF/MANIFEST.MF48
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/plugin.xml28
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/pom.xml26
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/AbstractExtendedURIBuilderForFile.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/AbstractExtendedURIBuilderForFile.java)151
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/Activator.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/Activator.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/CollabResourceSelector.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/CollabResourceSelector.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/SVNCollabFactory.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/SVNCollabFactory.java)296
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/locker/AbstractSVNCollab.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/locker/AbstractSVNCollab.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/locker/SVNLocker.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/locker/SVNLocker.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/locker/SVNUnlocker.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/locker/SVNUnlocker.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/tracing/ITracingConstant.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/tracing/ITracingConstant.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/tracing/Tracer.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/tracing/Tracer.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/utils/CommitActionUtilityWithProperties.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/utils/CommitActionUtilityWithProperties.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/utils/SVNUtils.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/utils/SVNUtils.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/utils/SetPropertyActionNow.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/utils/SetPropertyActionNow.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/AbstractSVNVersionController.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/AbstractSVNVersionController.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNCommitter.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/SVNCommitter.java)239
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNReverter.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/SVNReverter.java)151
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNUpdater.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/SVNUpdater.java)371
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNWorkOnModifiedFile.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/SVNWorkOnModifiedFile.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/META-INF/MANIFEST.MF60
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/pom.xml26
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/Activator.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/Activator.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/commands/AddFileToCollabSVN.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/commands/AddFileToCollabSVN.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/commands/SaveCommand.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/commands/SaveCommand.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/control/SVNControlModeParticipant.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/control/SVNControlModeParticipant.java)258
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/handler/SVNCollabControlCommandHandler.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/handler/SVNCollabControlCommandHandler.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/handler/ShowModelPartitionHandler.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/handler/ShowModelPartitionHandler.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/queries/IsCollabQuery.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/queries/IsCollabQuery.java)139
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/queries/IsPartialyLocked.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/queries/IsPartialyLocked.java)139
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/ui/CreateCollabModelFragmentDialog.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/ui/CreateCollabModelFragmentDialog.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/ui/IconsPath.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/ui/IconsPath.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/.settings/org.eclipse.jdt.core.prefs10
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/META-INF/MANIFEST.MF72
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/plugin.xml250
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/pom.xml26
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/IsCollabPropertyTest.java124
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/MatchingURIObject.java157
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/RefreshHelper.java363
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/security/CollabReadOnlyHandler.java188
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/security/PreCommitReadOnlyHandler.java280
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/stategies/PapyrusCurrentResource.java121
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/stategies/PapyrusSelectionAllContent.java164
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/CommitHandler.java307
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/RevertHandler.java279
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/UpdateHandler.java243
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/dialogs/CommitDialog.java269
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/dialogs/PreviewDialog.java556
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/items/LockStrategyItemProvider.java147
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/items/UnlockStrategyItemProvider.java145
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/providers/ExtensivePartitionNameLabelProvider.java443
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/utils/UIUtils.java598
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/META-INF/MANIFEST.MF50
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/plugin.xml12
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/pom.xml26
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/schema/contribution.exsd (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/schema/collaborative.exsd)302
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/Activator.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/Activator.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/ExtendedURI.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/ExtendedURI.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/ICollabFactory.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/ICollabFactory.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/ICollaborativeManager.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/ICollaborativeManager.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/IExtendedURI.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/IExtendedURI.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/impl/CollaborativeManager.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/impl/CollaborativeManager.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/AbstractExtendedURIBuilder.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/AbstractExtendedURIBuilder.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/ICollabParticipant.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/ICollabParticipant.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/IExtendedURISuperSet.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/IExtendedURISuperSet.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/locker/ILocker.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/locker/ILocker.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/locker/IUnlocker.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/locker/IUnlocker.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/version/ICommitter.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/version/ICommitter.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/version/IReverter.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/version/IReverter.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/version/IUpdater.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/version/IUpdater.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/version/IWorkOnModifiedElementParticipant.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/version/IWorkOnModifiedElementParticipant.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/reports/CollabStatus.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/CollabStatus.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/reports/LogHelper.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/LogHelper.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/strategy/AbstractLockingStrategy.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/strategy/AbstractLockingStrategy.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/strategy/ILockingStrategy.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/strategy/ILockingStrategy.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/AbstractRunnableWithProgressWithResult.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/AbstractRunnableWithProgressWithResult.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/CollabFunctionsFactory.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/CollabFunctionsFactory.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/CollabUtils.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/CollabUtils.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/ExtendedURIUtil.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/ExtendedURIUtil.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/IRunnableWithProgressWithResult.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/IRunnableWithProgressWithResult.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/ModelsUtil.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/ModelsUtil.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/ResourceUtils.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/ResourceUtils.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/URIUtils.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/URIUtils.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/EObjectToExtendedURI.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/EObjectToExtendedURI.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ExtendedURIToEObjects.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ExtendedURIToEObjects.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ExtendedURIToIResource.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ExtendedURIToIResource.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ExtendedURIToURI.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ExtendedURIToURI.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/IFileToFile.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/IFileToFile.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/IResourceToExtendedURI.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/IResourceToExtendedURI.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ResourceToIFile.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ResourceToIFile.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ResourceToURI.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ResourceToURI.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/URIToExtendedURI.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/URIToExtendedURI.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/URIToExtendedURIWithContainment.java (renamed from extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/URIToExtendedURIWithContainment.java)0
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/copy/CollabStatus.java94
-rw-r--r--extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/copy/LogHelper.java162
97 files changed, 3455 insertions, 3882 deletions
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/.settings/org.eclipse.jdt.core.prefs b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/.settings/org.eclipse.jdt.core.prefs
index 6bb8136..42337f0 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/.settings/org.eclipse.jdt.core.prefs
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,2 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
-org.eclipse.objectteams.otdt.compiler.option.pure_java=enabled
+eclipse.preferences.version=1
+org.eclipse.objectteams.otdt.compiler.option.pure_java=enabled
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/META-INF/MANIFEST.MF b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/META-INF/MANIFEST.MF
index 255d9a0..46b1d62 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/META-INF/MANIFEST.MF
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/META-INF/MANIFEST.MF
@@ -1,24 +1,24 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Svn Connector
-Bundle-SymbolicName: org.eclipse.papyrus.team.collaborative.connector.svn;singleton:=true
-Bundle-Version: 1.7.0.qualifier
-Bundle-Activator: org.eclipse.papyrus.team.collaborative.connector.svn.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.papyrus.team.collaborative,
- org.eclipse.emf.ecore,
- com.google.guava,
- org.eclipse.core.resources,
- org.eclipse.emf.workspace,
- org.eclipse.team.core,
- org.eclipse.team.ui,
- org.eclipse.team.svn.core,
- org.eclipse.team.svn.ui
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Export-Package: org.eclipse.papyrus.team.collaborative.connector.svn,
- org.eclipse.papyrus.team.collaborative.connector.svn.tracing,
- org.eclipse.papyrus.team.collaborative.connector.svn.utils,
- org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller
-Bundle-Vendor: Atos
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SVN Connector
+Bundle-SymbolicName: org.eclipse.papyrus.team.collaborative.connector.svn;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.team.collaborative.connector.svn.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.team.collaborative,
+ org.eclipse.emf.ecore,
+ com.google.guava,
+ org.eclipse.core.resources,
+ org.eclipse.emf.workspace,
+ org.eclipse.team.core,
+ org.eclipse.team.ui,
+ org.eclipse.team.svn.core,
+ org.eclipse.team.svn.ui
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.eclipse.papyrus.team.collaborative.connector.svn,
+ org.eclipse.papyrus.team.collaborative.connector.svn.tracing,
+ org.eclipse.papyrus.team.collaborative.connector.svn.utils,
+ org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller
+Bundle-Vendor: Atos
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/plugin.xml b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/plugin.xml
index faea148..29d2ca6 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/plugin.xml
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/plugin.xml
@@ -1,14 +1,14 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.papyrus.team.collaborative.collaborative">
- <ParticipantFactory
- id="org.eclipse.papyrus.team.collaborative.connector.svn"
- impl="org.eclipse.papyrus.team.collaborative.connector.svn.SVNCollabFactory"
- priority="10">
- </ParticipantFactory>
- </extension>
-
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.team.collaborative.contribution">
+ <ParticipantFactory
+ id="org.eclipse.papyrus.team.collaborative.connector.svn"
+ impl="org.eclipse.papyrus.team.collaborative.connector.svn.SVNCollabFactory"
+ priority="10">
+ </ParticipantFactory>
+ </extension>
+
+
+</plugin>
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/pom.xml b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/pom.xml
deleted file mode 100644
index 3a58d6b..0000000
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/pom.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2013 Atos.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Arthur Daussy <a href="mailto:arthur.daussy@atos.net"> - initial API and implementation
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <relativePath>../../../Releng/org.topcased.fast.tycho.master/pom.xml</relativePath>
- <groupId>org.topcased.fast</groupId>
- <artifactId>parent</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>org.eclipse.papyrus.team.collaborative.connector.svn</artifactId>
- <packaging>eclipse-plugin</packaging>
-
- <name>Svn Connector</name>
-</project>
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/AbstractExtendedURIBuilderForFile.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/AbstractExtendedURIBuilderForFile.java
index 38aea3c..577905b 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/AbstractExtendedURIBuilderForFile.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/AbstractExtendedURIBuilderForFile.java
@@ -1,76 +1,75 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.connector.svn;
-
-import java.util.Collection;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.participants.AbstractExtendedURIBuilder;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Collections2;
-
-
-/**
- * Extends {@link AbstractExtendedURIBuilder} adding some utilitary method to manipulate files
- *
- * @author adaussy
- *
- */
-public abstract class AbstractExtendedURIBuilderForFile extends AbstractExtendedURIBuilder {
-
- public AbstractExtendedURIBuilderForFile(Set<IExtendedURI> uris, ResourceSet resourceSet) {
- super(uris, resourceSet);
- }
-
- /**
- * Transform resource to {@link IFile}
- *
- * @param r
- * the r
- * @return the i file
- */
- protected IFile toIFile(Resource r) {
- if(r != null) {
- return TO_FILE_FUNCTION.apply(r);
- }
- return null;
- }
-
- /** The Constant TO_FILE_FUNCTION. */
- protected static final Function<Resource, IFile> TO_FILE_FUNCTION = new Function<Resource, IFile>() {
-
- @Override
- public IFile apply(Resource from) {
-
- return WorkspaceSynchronizer.getFile(from);
- }
- };
-
- /**
- * Gets the target files.
- *
- * @param resourcesToLock
- * the resources to lock
- * @return the target files
- */
- protected static IFile[] getTargetFiles(Collection<Resource> resourcesToLock) {
- Collection<IFile> iResourcesToLock = Collections2.transform(resourcesToLock, TO_FILE_FUNCTION);
- return iResourcesToLock.toArray(new IFile[iResourcesToLock.size()]);
- }
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.connector.svn;
+
+import java.util.Collection;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.participants.AbstractExtendedURIBuilder;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
+
+
+/**
+ * Extends {@link AbstractExtendedURIBuilder} adding some utilitary method to manipulate files
+ *
+ * @author adaussy
+ *
+ */
+public abstract class AbstractExtendedURIBuilderForFile extends AbstractExtendedURIBuilder {
+
+ public AbstractExtendedURIBuilderForFile(Set<IExtendedURI> uris, ResourceSet resourceSet) {
+ super(uris, resourceSet);
+ }
+
+ /**
+ * Transform resource to {@link IFile}
+ *
+ * @param r
+ * the r
+ * @return the i file
+ */
+ protected IFile toIFile(Resource r) {
+ if(r != null) {
+ return TO_FILE_FUNCTION.apply(r);
+ }
+ return null;
+ }
+
+ /** The Constant TO_FILE_FUNCTION. */
+ protected static final Function<Resource, IFile> TO_FILE_FUNCTION = new Function<Resource, IFile>() {
+
+ public IFile apply(Resource from) {
+
+ return WorkspaceSynchronizer.getFile(from);
+ }
+ };
+
+ /**
+ * Gets the target files.
+ *
+ * @param resourcesToLock
+ * the resources to lock
+ * @return the target files
+ */
+ protected static IFile[] getTargetFiles(Collection<Resource> resourcesToLock) {
+ Collection<IFile> iResourcesToLock = Collections2.transform(resourcesToLock, TO_FILE_FUNCTION);
+ return iResourcesToLock.toArray(new IFile[iResourcesToLock.size()]);
+ }
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/Activator.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/Activator.java
index a2a850b..a2a850b 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/Activator.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/Activator.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/CollabResourceSelector.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/CollabResourceSelector.java
index 696b11e..696b11e 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/CollabResourceSelector.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/CollabResourceSelector.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/SVNCollabFactory.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/SVNCollabFactory.java
index eb27a15..a306293 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/SVNCollabFactory.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/SVNCollabFactory.java
@@ -1,151 +1,145 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- * Philippe Roland (Atos) philippe.roland@atos.net - added workaround for eclipse bug 385394
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.connector.svn;
-
-import java.util.HashSet;
-import java.util.Set;
-import java.util.WeakHashMap;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.papyrus.team.collaborative.ICollabFactory;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.connector.svn.locker.SVNLocker;
-import org.eclipse.papyrus.team.collaborative.connector.svn.locker.SVNUnlocker;
-import org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller.SVNCommitter;
-import org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller.SVNReverter;
-import org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller.SVNUpdater;
-import org.eclipse.papyrus.team.collaborative.participants.locker.ILocker;
-import org.eclipse.papyrus.team.collaborative.participants.locker.IUnlocker;
-import org.eclipse.papyrus.team.collaborative.participants.version.ICommitter;
-import org.eclipse.papyrus.team.collaborative.participants.version.IReverter;
-import org.eclipse.papyrus.team.collaborative.participants.version.IUpdater;
-import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
-import org.eclipse.team.svn.core.utility.FileUtility;
-
-import com.google.common.collect.Collections2;
-
-
-/**
- * Factory to build element to do collaborative work with SVN.
- *
- * @author adaussy
- */
-public class SVNCollabFactory implements ICollabFactory {
-
- /** The Constant SVN_COLLAB_ID. */
- public static final String SVN_COLLAB_ID = "org.eclipse.papyrus.team.collaborative.connector.svn";
-
- /**
- * Resource set svn status cache
- */
- private WeakHashMap<ResourceSet, Boolean> alreadyOnSvnCache = new WeakHashMap<ResourceSet, Boolean>();
-
- /**
- * Instantiates a new sVN collab factory.
- */
- public SVNCollabFactory() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.team.collaborative.ICollabFactory#provide(java.util.Set, org.eclipse.emf.ecore.resource.ResourceSet)
- */
- @Override
- public boolean provide(Set<IExtendedURI> uris, ResourceSet resourceSet) {
- /**
- * Workaround for eclipse bug 385394. This bug causes property testers to be called very frequently
- * even if no activity is taking place, causing important slowdowns when a right-click on a model explorer element is performed.
- * a cache prevents these calls (and the subsequent calls to FileUtility.alreadyOnSVN) from being too taxing on system resources.
- *
- * This bug was fixed on 16/01/2014 but its fix has not yet been released outside of integration builds. Remove this workaround when it is.
- */
- if(alreadyOnSvnCache.containsKey(resourceSet)) {
- return alreadyOnSvnCache.get(resourceSet);
- }
- boolean result;
- Set<IProject> projects = new HashSet<IProject>();
- for(IResource iResource : Collections2.transform(uris, CollabFunctionsFactory.getExtendedURIToIResource(resourceSet))) {
- if(iResource != null) {
- projects.add(iResource.getProject());
- }
- }
- if(projects.isEmpty()) {
- result = false;
- alreadyOnSvnCache.put(resourceSet, result);
- return result;
- }
- for(IProject iProject : projects) {
- if(!FileUtility.alreadyOnSVN(iProject)) {
- result = false;
- alreadyOnSvnCache.put(resourceSet, result);
- return result;
- }
- }
- result = true;
- alreadyOnSvnCache.put(resourceSet, result);
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.team.collaborative.ICollabFactory#createLocker(java.util.Set, org.eclipse.emf.ecore.resource.ResourceSet)
- */
- @Override
- public ILocker createLocker(Set<IExtendedURI> uris, ResourceSet resourceSet) {
- return new SVNLocker(uris, resourceSet);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.team.collaborative.ICollabFactory#createUnlocker(java.util.Set, org.eclipse.emf.ecore.resource.ResourceSet)
- */
- @Override
- public IUnlocker createUnlocker(Set<IExtendedURI> uris, ResourceSet resourceSet) {
- return new SVNUnlocker(uris, resourceSet);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.team.collaborative.ICollabFactory#createReverter(java.util.Set, org.eclipse.emf.ecore.resource.ResourceSet)
- */
- @Override
- public IReverter createReverter(Set<IExtendedURI> uris, ResourceSet resourceSet) {
- return new SVNReverter(uris, resourceSet);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.team.collaborative.ICollabFactory#createCommitter(java.util.Set, org.eclipse.emf.ecore.resource.ResourceSet)
- */
- @Override
- public ICommitter createCommitter(Set<IExtendedURI> uris, ResourceSet resourceSet) {
- return new SVNCommitter(uris, resourceSet);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.team.collaborative.ICollabFactory#createUpdater(java.util.Set, org.eclipse.emf.ecore.resource.ResourceSet)
- */
- @Override
- public IUpdater createUpdater(Set<IExtendedURI> uris, ResourceSet resourceSet) {
- return new SVNUpdater(uris, resourceSet);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ * Philippe Roland (Atos) philippe.roland@atos.net - added workaround for eclipse bug 385394
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.connector.svn;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.WeakHashMap;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.papyrus.team.collaborative.ICollabFactory;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.connector.svn.locker.SVNLocker;
+import org.eclipse.papyrus.team.collaborative.connector.svn.locker.SVNUnlocker;
+import org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller.SVNCommitter;
+import org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller.SVNReverter;
+import org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller.SVNUpdater;
+import org.eclipse.papyrus.team.collaborative.participants.locker.ILocker;
+import org.eclipse.papyrus.team.collaborative.participants.locker.IUnlocker;
+import org.eclipse.papyrus.team.collaborative.participants.version.ICommitter;
+import org.eclipse.papyrus.team.collaborative.participants.version.IReverter;
+import org.eclipse.papyrus.team.collaborative.participants.version.IUpdater;
+import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
+import org.eclipse.team.svn.core.utility.FileUtility;
+
+import com.google.common.collect.Collections2;
+
+
+/**
+ * Factory to build element to do collaborative work with SVN.
+ *
+ * @author adaussy
+ */
+public class SVNCollabFactory implements ICollabFactory {
+
+ /** The Constant SVN_COLLAB_ID. */
+ public static final String SVN_COLLAB_ID = "org.eclipse.papyrus.team.collaborative.connector.svn";
+
+ /**
+ * Resource set svn status cache
+ */
+ private WeakHashMap<ResourceSet, Boolean> alreadyOnSvnCache = new WeakHashMap<ResourceSet, Boolean>();
+
+ /**
+ * Instantiates a new sVN collab factory.
+ */
+ public SVNCollabFactory() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.team.collaborative.ICollabFactory#provide(java.util.Set, org.eclipse.emf.ecore.resource.ResourceSet)
+ */
+ public boolean provide(Set<IExtendedURI> uris, ResourceSet resourceSet) {
+ /**
+ * Workaround for eclipse bug 385394. This bug causes property testers to be called very frequently
+ * even if no activity is taking place, causing important slowdowns when a right-click on a model explorer element is performed.
+ * a cache prevents these calls (and the subsequent calls to FileUtility.alreadyOnSVN) from being too taxing on system resources.
+ *
+ * This bug was fixed on 16/01/2014 but its fix has not yet been released outside of integration builds. Remove this workaround when it is.
+ */
+ if(alreadyOnSvnCache.containsKey(resourceSet)) {
+ return alreadyOnSvnCache.get(resourceSet);
+ }
+ boolean result;
+ Set<IProject> projects = new HashSet<IProject>();
+ for(IResource iResource : Collections2.transform(uris, CollabFunctionsFactory.getExtendedURIToIResource(resourceSet))) {
+ if(iResource != null) {
+ projects.add(iResource.getProject());
+ }
+ }
+ if(projects.isEmpty()) {
+ result = false;
+ alreadyOnSvnCache.put(resourceSet, result);
+ return result;
+ }
+ for(IProject iProject : projects) {
+ if(!FileUtility.alreadyOnSVN(iProject)) {
+ result = false;
+ alreadyOnSvnCache.put(resourceSet, result);
+ return result;
+ }
+ }
+ result = true;
+ alreadyOnSvnCache.put(resourceSet, result);
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.team.collaborative.ICollabFactory#createLocker(java.util.Set, org.eclipse.emf.ecore.resource.ResourceSet)
+ */
+ public ILocker createLocker(Set<IExtendedURI> uris, ResourceSet resourceSet) {
+ return new SVNLocker(uris, resourceSet);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.team.collaborative.ICollabFactory#createUnlocker(java.util.Set, org.eclipse.emf.ecore.resource.ResourceSet)
+ */
+ public IUnlocker createUnlocker(Set<IExtendedURI> uris, ResourceSet resourceSet) {
+ return new SVNUnlocker(uris, resourceSet);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.team.collaborative.ICollabFactory#createReverter(java.util.Set, org.eclipse.emf.ecore.resource.ResourceSet)
+ */
+ public IReverter createReverter(Set<IExtendedURI> uris, ResourceSet resourceSet) {
+ return new SVNReverter(uris, resourceSet);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.team.collaborative.ICollabFactory#createCommitter(java.util.Set, org.eclipse.emf.ecore.resource.ResourceSet)
+ */
+ public ICommitter createCommitter(Set<IExtendedURI> uris, ResourceSet resourceSet) {
+ return new SVNCommitter(uris, resourceSet);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.team.collaborative.ICollabFactory#createUpdater(java.util.Set, org.eclipse.emf.ecore.resource.ResourceSet)
+ */
+ public IUpdater createUpdater(Set<IExtendedURI> uris, ResourceSet resourceSet) {
+ return new SVNUpdater(uris, resourceSet);
+ }
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/locker/AbstractSVNCollab.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/locker/AbstractSVNCollab.java
index 8144658..8144658 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/locker/AbstractSVNCollab.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/locker/AbstractSVNCollab.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/locker/SVNLocker.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/locker/SVNLocker.java
index e08d1a1..e08d1a1 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/locker/SVNLocker.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/locker/SVNLocker.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/locker/SVNUnlocker.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/locker/SVNUnlocker.java
index 5779b4a..5779b4a 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/locker/SVNUnlocker.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/locker/SVNUnlocker.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/tracing/ITracingConstant.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/tracing/ITracingConstant.java
index 949fdb6..949fdb6 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/tracing/ITracingConstant.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/tracing/ITracingConstant.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/tracing/Tracer.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/tracing/Tracer.java
index 7dcbaf2..7dcbaf2 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/tracing/Tracer.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/tracing/Tracer.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/utils/CommitActionUtilityWithProperties.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/utils/CommitActionUtilityWithProperties.java
index d044eef..d044eef 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/utils/CommitActionUtilityWithProperties.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/utils/CommitActionUtilityWithProperties.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/utils/SVNUtils.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/utils/SVNUtils.java
index 4dff948..4dff948 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/utils/SVNUtils.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/utils/SVNUtils.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/utils/SetPropertyActionNow.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/utils/SetPropertyActionNow.java
index d61e959..d61e959 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/utils/SetPropertyActionNow.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/utils/SetPropertyActionNow.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/AbstractSVNVersionController.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/AbstractSVNVersionController.java
index 6e41a8b..6e41a8b 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/AbstractSVNVersionController.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/AbstractSVNVersionController.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/SVNCommitter.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNCommitter.java
index b8535cc..fb09cae 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/SVNCommitter.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNCommitter.java
@@ -1,120 +1,119 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.connector.svn.CollabResourceSelector;
-import org.eclipse.papyrus.team.collaborative.connector.svn.tracing.ITracingConstant;
-import org.eclipse.papyrus.team.collaborative.connector.svn.tracing.Tracer;
-import org.eclipse.papyrus.team.collaborative.connector.svn.utils.CommitActionUtilityWithProperties;
-import org.eclipse.papyrus.team.collaborative.participants.version.ICommitter;
-import org.eclipse.papyrus.team.collaborative.utils.ResourceUtils;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.team.svn.core.operation.CompositeOperation;
-import org.eclipse.team.svn.core.operation.IActionOperation;
-import org.eclipse.team.svn.ui.utility.ICancellableOperationWrapper;
-import org.eclipse.team.svn.ui.utility.UIMonitorUtility;
-import org.eclipse.ui.PlatformUI;
-
-import com.google.common.collect.Lists;
-
-
-/**
- * SVN implementation for {@link ICommitter}.
- *
- * @author adaussy
- */
-public class SVNCommitter extends SVNWorkOnModifiedFile implements ICommitter {
-
-
- /**
- * Instantiates a new SVN committer.
- *
- * @param uris
- * the uris
- * @param resourceSet
- * the resource set
- */
- public SVNCommitter(Set<IExtendedURI> uris, ResourceSet resourceSet) {
- super(uris, resourceSet);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.team.collaborative.participants.version.ICommitter#commit(java.lang.String, boolean)
- */
- @Override
- public IStatus commit(String message, boolean keepLock) {
- IStatus status = doCommit(message, keepLock, getTargetResources());
- return status;
- }
-
- /**
- * Do commit.
- *
- * @param message
- * the message for the commit action
- * @param keepLock
- * the keep lock set to true if the lock has to be kept
- * @param resourceToCommit
- * the resource to commit
- * @return the i status
- */
- public static IStatus doCommit(String message, boolean keepLock, Set<Resource> resourceToCommit) {
- if(resourceToCommit != null && !resourceToCommit.isEmpty()) {
- List<IFile> targetIFileList = Lists.newArrayList(getTargetFiles(resourceToCommit));
- return doCommit(message, keepLock, ResourceUtils.getListAncestors(targetIFileList));
- }
- return Status.OK_STATUS;
- }
-
- /**
- * Do commit.
- *
- * @param message
- * the message for the commit action
- * @param keepLock
- * the keep lock set to true if the lock has to be kept
- * @param filesToCommit
- * the files to commit
- * @return the i status
- */
- public static IStatus doCommit(String message, boolean keepLock, Collection<? extends IResource> filesToCommit) {
- CommitActionUtilityWithProperties tt = new CommitActionUtilityWithProperties(new CollabResourceSelector(filesToCommit.toArray(new IResource[filesToCommit.size()]), Display.getDefault().getActiveShell()));
- IResource[] allResources = tt.getAllResources();
- if(ITracingConstant.COMMIT_TRACING) {
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append("Committing ").append(message).append("\n");
- for(IResource r : allResources) {
- stringBuilder.append(r).append("\n");
- }
- Tracer.logInfo(stringBuilder.toString());
- }
- CompositeOperation mainOp = tt.getCompositeCommitOperation(allResources, new IResource[0], message, keepLock, Display.getDefault().getActiveShell(), PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart(), true);
- ICancellableOperationWrapper runnable = UIMonitorUtility.doTaskNowDefault(mainOp, false);
- IActionOperation resultStatus = runnable.getOperation();
- return resultStatus.getStatus();
- }
-
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.connector.svn.CollabResourceSelector;
+import org.eclipse.papyrus.team.collaborative.connector.svn.tracing.ITracingConstant;
+import org.eclipse.papyrus.team.collaborative.connector.svn.tracing.Tracer;
+import org.eclipse.papyrus.team.collaborative.connector.svn.utils.CommitActionUtilityWithProperties;
+import org.eclipse.papyrus.team.collaborative.participants.version.ICommitter;
+import org.eclipse.papyrus.team.collaborative.utils.ResourceUtils;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.team.svn.core.operation.CompositeOperation;
+import org.eclipse.team.svn.core.operation.IActionOperation;
+import org.eclipse.team.svn.ui.utility.ICancellableOperationWrapper;
+import org.eclipse.team.svn.ui.utility.UIMonitorUtility;
+import org.eclipse.ui.PlatformUI;
+
+import com.google.common.collect.Lists;
+
+
+/**
+ * SVN implementation for {@link ICommitter}.
+ *
+ * @author adaussy
+ */
+public class SVNCommitter extends SVNWorkOnModifiedFile implements ICommitter {
+
+
+ /**
+ * Instantiates a new SVN committer.
+ *
+ * @param uris
+ * the uris
+ * @param resourceSet
+ * the resource set
+ */
+ public SVNCommitter(Set<IExtendedURI> uris, ResourceSet resourceSet) {
+ super(uris, resourceSet);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.team.collaborative.participants.version.ICommitter#commit(java.lang.String, boolean)
+ */
+ public IStatus commit(String message, boolean keepLock) {
+ IStatus status = doCommit(message, keepLock, getTargetResources());
+ return status;
+ }
+
+ /**
+ * Do commit.
+ *
+ * @param message
+ * the message for the commit action
+ * @param keepLock
+ * the keep lock set to true if the lock has to be kept
+ * @param resourceToCommit
+ * the resource to commit
+ * @return the i status
+ */
+ public static IStatus doCommit(String message, boolean keepLock, Set<Resource> resourceToCommit) {
+ if(resourceToCommit != null && !resourceToCommit.isEmpty()) {
+ List<IFile> targetIFileList = Lists.newArrayList(getTargetFiles(resourceToCommit));
+ return doCommit(message, keepLock, ResourceUtils.getListAncestors(targetIFileList));
+ }
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * Do commit.
+ *
+ * @param message
+ * the message for the commit action
+ * @param keepLock
+ * the keep lock set to true if the lock has to be kept
+ * @param filesToCommit
+ * the files to commit
+ * @return the i status
+ */
+ public static IStatus doCommit(String message, boolean keepLock, Collection<? extends IResource> filesToCommit) {
+ CommitActionUtilityWithProperties tt = new CommitActionUtilityWithProperties(new CollabResourceSelector(filesToCommit.toArray(new IResource[filesToCommit.size()]), Display.getDefault().getActiveShell()));
+ IResource[] allResources = tt.getAllResources();
+ if(ITracingConstant.COMMIT_TRACING) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("Committing ").append(message).append("\n");
+ for(IResource r : allResources) {
+ stringBuilder.append(r).append("\n");
+ }
+ Tracer.logInfo(stringBuilder.toString());
+ }
+ CompositeOperation mainOp = tt.getCompositeCommitOperation(allResources, new IResource[0], message, keepLock, Display.getDefault().getActiveShell(), PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart(), true);
+ ICancellableOperationWrapper runnable = UIMonitorUtility.doTaskNowDefault(mainOp, false);
+ IActionOperation resultStatus = runnable.getOperation();
+ return resultStatus.getStatus();
+ }
+
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/SVNReverter.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNReverter.java
index b42fdee..9f05fa6 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/SVNReverter.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNReverter.java
@@ -1,76 +1,75 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller;
-
-/*******************************************************************************
- * Copyright (c) 2013 Atos.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy <a href="mailto:arthur.daussy@atos.net"> - initial API and implementation
- ******************************************************************************/
-import java.io.File;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.connector.svn.tracing.ITracingConstant;
-import org.eclipse.papyrus.team.collaborative.connector.svn.tracing.Tracer;
-import org.eclipse.papyrus.team.collaborative.participants.version.IReverter;
-import org.eclipse.team.svn.core.operation.CompositeOperation;
-import org.eclipse.team.svn.core.operation.IActionOperation;
-import org.eclipse.team.svn.core.operation.file.RevertOperation;
-import org.eclipse.team.svn.core.operation.local.RefreshResourcesOperation;
-import org.eclipse.team.svn.ui.utility.ICancellableOperationWrapper;
-import org.eclipse.team.svn.ui.utility.UIMonitorUtility;
-
-
-/**
- * SVN Implementation for {@link IReverter}
- *
- * @author adaussy
- *
- */
-public class SVNReverter extends SVNWorkOnModifiedFile implements IReverter {
-
-
- public SVNReverter(Set<IExtendedURI> uris, ResourceSet resourceSet) {
- super(uris, resourceSet);
- }
-
- @Override
- public IStatus revert() {
- File[] modifiedFiles = getModifiedFile(getTargetResources());
- if(ITracingConstant.REVERT_TRACING) {
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append("Reverting: ").append("\n");
- for(File f : modifiedFiles) {
- stringBuilder.append(f).append("\n");
- }
- Tracer.logInfo(stringBuilder.toString());
- }
- //Revert operation
- RevertOperation mainOp = new RevertOperation(modifiedFiles, true);
- CompositeOperation op = new CompositeOperation(mainOp.getId(), mainOp.getMessagesClass());
- op.add(mainOp);
- op.add(new RefreshResourcesOperation(getTargetFiles(getTargetResources())));
- ICancellableOperationWrapper runnable = UIMonitorUtility.doTaskNowDefault(op, false);
- IActionOperation resultStatus = runnable.getOperation();
-
- return resultStatus.getStatus();
- }
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller;
+
+/*******************************************************************************
+ * Copyright (c) 2013 Atos.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy <a href="mailto:arthur.daussy@atos.net"> - initial API and implementation
+ ******************************************************************************/
+import java.io.File;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.connector.svn.tracing.ITracingConstant;
+import org.eclipse.papyrus.team.collaborative.connector.svn.tracing.Tracer;
+import org.eclipse.papyrus.team.collaborative.participants.version.IReverter;
+import org.eclipse.team.svn.core.operation.CompositeOperation;
+import org.eclipse.team.svn.core.operation.IActionOperation;
+import org.eclipse.team.svn.core.operation.file.RevertOperation;
+import org.eclipse.team.svn.core.operation.local.RefreshResourcesOperation;
+import org.eclipse.team.svn.ui.utility.ICancellableOperationWrapper;
+import org.eclipse.team.svn.ui.utility.UIMonitorUtility;
+
+
+/**
+ * SVN Implementation for {@link IReverter}
+ *
+ * @author adaussy
+ *
+ */
+public class SVNReverter extends SVNWorkOnModifiedFile implements IReverter {
+
+
+ public SVNReverter(Set<IExtendedURI> uris, ResourceSet resourceSet) {
+ super(uris, resourceSet);
+ }
+
+ public IStatus revert() {
+ File[] modifiedFiles = getModifiedFile(getTargetResources());
+ if(ITracingConstant.REVERT_TRACING) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("Reverting: ").append("\n");
+ for(File f : modifiedFiles) {
+ stringBuilder.append(f).append("\n");
+ }
+ Tracer.logInfo(stringBuilder.toString());
+ }
+ //Revert operation
+ RevertOperation mainOp = new RevertOperation(modifiedFiles, true);
+ CompositeOperation op = new CompositeOperation(mainOp.getId(), mainOp.getMessagesClass());
+ op.add(mainOp);
+ op.add(new RefreshResourcesOperation(getTargetFiles(getTargetResources())));
+ ICancellableOperationWrapper runnable = UIMonitorUtility.doTaskNowDefault(op, false);
+ IActionOperation resultStatus = runnable.getOperation();
+
+ return resultStatus.getStatus();
+ }
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/SVNUpdater.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNUpdater.java
index 7acf706..27d6201 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/SVNUpdater.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNUpdater.java
@@ -1,186 +1,185 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.connector.svn.tracing.ITracingConstant;
-import org.eclipse.papyrus.team.collaborative.connector.svn.tracing.Tracer;
-import org.eclipse.papyrus.team.collaborative.participants.version.IUpdater;
-import org.eclipse.team.svn.core.connector.SVNEntryInfo;
-import org.eclipse.team.svn.core.connector.SVNLogEntry;
-import org.eclipse.team.svn.core.connector.SVNRevision;
-import org.eclipse.team.svn.core.operation.CompositeOperation;
-import org.eclipse.team.svn.core.operation.IActionOperation;
-import org.eclipse.team.svn.core.operation.local.InfoOperation;
-import org.eclipse.team.svn.core.operation.remote.GetLogMessagesOperation;
-import org.eclipse.team.svn.core.resource.IRepositoryResource;
-import org.eclipse.team.svn.core.svnstorage.SVNRemoteStorage;
-import org.eclipse.team.svn.ui.action.local.UpdateAction;
-import org.eclipse.team.svn.ui.utility.ICancellableOperationWrapper;
-import org.eclipse.team.svn.ui.utility.UIMonitorUtility;
-
-
-/**
- * SVN implementation of {@link IUpdater}
- *
- * @author adaussy
- *
- */
-public class SVNUpdater extends AbstractSVNVersionController implements IUpdater {
-
- /**
- * Instantiates a new sVN updater.
- *
- * @param uris
- * the uris
- * @param resourceSet
- * the resource set
- */
- public SVNUpdater(Set<IExtendedURI> uris, ResourceSet resourceSet) {
- super(uris, resourceSet);
- }
-
- @Override
- public IStatus update() {
- IFile[] resourcesToProcess = getTargetFiles(getTargetResources());
- //The all project of each file shall be updated (In order to see if new files appeared (New control))
- Set<IProject> projects = new HashSet<IProject>();
- for(IFile f : resourcesToProcess) {
- projects.add(f.getProject());
- }
-
- IProject[] projectsToUpdate = new IProject[projects.size()];
- projects.toArray(projectsToUpdate);
- if(ITracingConstant.UPDATE_TRACING) {
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append("Updating projects: ").append("\n");
- for(IProject p : projectsToUpdate) {
- stringBuilder.append(p.getFullPath()).append("\n");
- }
- Tracer.logInfo(stringBuilder.toString());
- }
- CompositeOperation op = UpdateAction.getUpdateOperation(projectsToUpdate, SVNRevision.HEAD);
- ICancellableOperationWrapper runnable = UIMonitorUtility.doTaskNowDefault(op, false);
- IActionOperation resultStatus = runnable.getOperation();
-
- return resultStatus.getStatus();
- }
-
- @Override
- protected Set<IExtendedURI> doBuild() {
- for(IExtendedURI extendedURI : getUris()) {
- IExtendedURI resourceURI = getResourceURI(extendedURI);
- if(resourceURI != null) {
- IFile file = toIFile(toResource(resourceURI.getUri()));
- if(file != null && file.exists()) {
- if(!isUpToDate(resourceURI).isUpToDate()) {
- getExtendedSet().add(resourceURI);
- }
- }
- }
- }
- return getExtendedSet();
- }
-
-
- /**
- * Checks if is up to date.
- *
- * @param uri
- * the uri
- * @return the i status
- */
- public UpToDateStatus isUpToDate(IExtendedURI uri) {
- IExtendedURI resourceEURI = getResourceURI(uri);
- if(resourceEURI == null) {
- return UpToDateStatus.createErrorDuringUpToDataStatus("The URI is null");
- }
- UpToDateStatus status = getCache().get(resourceEURI);
- if(status == null) {
- URI resourceURI = resourceEURI.getUri();
- Resource resource = toResource(resourceURI);
- if(resource == null) {
- return UpToDateStatus.createErrorDuringUpToDataStatus(resourceURI + " is not a URI pointing to a resource");
- }
- IFile file = toIFile(resource);
- if(file == null || !file.exists()) {
- return UpToDateStatus.createErrorDuringUpToDataStatus(resourceURI + " is not a URI pointing to a existing file");
- }
-
- SVNLogEntry log = getRemoteHEADRevision(file);
- if(log == null) {
- return UpToDateStatus.createErrorDuringUpToDataStatus("Unable to get remote HEAD revision for file " + file.getFullPath());
- }
- InfoOperation refreshOperation = new InfoOperation(file);
- refreshOperation.run(new NullProgressMonitor());
- SVNEntryInfo info = refreshOperation.getInfo();
- long localRevision = info.revision;
- if(log.revision > localRevision) {
- status = UpToDateStatus.createNotUpToDataStatus(log.author, log.date, log.revision);
- getCache().put(resourceEURI, status);
- return status;
- } else {
- status = UpToDateStatus.createUpToDataStatus(log.author, log.date, log.revision);
- getCache().put(resourceEURI, status);
- }
- }
- return status;
- }
-
-
-
-
- protected Map<IExtendedURI, UpToDateStatus> getCache() {
- if(cache == null) {
- cache = new HashMap<IExtendedURI, IUpdater.UpToDateStatus>();
- }
- return cache;
- }
-
-
-
- private Map<IExtendedURI, UpToDateStatus> cache = null;
-
- public static final long INVALID_REVISION = -1;
-
-
- public SVNLogEntry getRemoteHEADRevision(IResource resource) {
- IRepositoryResource remote = SVNRemoteStorage.instance().asRepositoryResource(resource);
- GetLogMessagesOperation logOp = new GetLogMessagesOperation(remote);
- logOp.setLimit(1);
- logOp.run(new NullProgressMonitor());
- if(logOp.getExecutionState() == IActionOperation.OK && logOp.getMessages() != null) {
- SVNLogEntry[] messages = logOp.getMessages();
- if(messages.length > 0) {
- return messages[0];
- }
- }
- return null;
- }
-
-
-
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.connector.svn.versioncontroller;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.connector.svn.tracing.ITracingConstant;
+import org.eclipse.papyrus.team.collaborative.connector.svn.tracing.Tracer;
+import org.eclipse.papyrus.team.collaborative.participants.version.IUpdater;
+import org.eclipse.team.svn.core.connector.SVNEntryInfo;
+import org.eclipse.team.svn.core.connector.SVNLogEntry;
+import org.eclipse.team.svn.core.connector.SVNRevision;
+import org.eclipse.team.svn.core.operation.CompositeOperation;
+import org.eclipse.team.svn.core.operation.IActionOperation;
+import org.eclipse.team.svn.core.operation.local.InfoOperation;
+import org.eclipse.team.svn.core.operation.remote.GetLogMessagesOperation;
+import org.eclipse.team.svn.core.resource.IRepositoryResource;
+import org.eclipse.team.svn.core.svnstorage.SVNRemoteStorage;
+import org.eclipse.team.svn.ui.action.local.UpdateAction;
+import org.eclipse.team.svn.ui.utility.ICancellableOperationWrapper;
+import org.eclipse.team.svn.ui.utility.UIMonitorUtility;
+
+
+/**
+ * SVN implementation of {@link IUpdater}
+ *
+ * @author adaussy
+ *
+ */
+public class SVNUpdater extends AbstractSVNVersionController implements IUpdater {
+
+ /**
+ * Instantiates a new sVN updater.
+ *
+ * @param uris
+ * the uris
+ * @param resourceSet
+ * the resource set
+ */
+ public SVNUpdater(Set<IExtendedURI> uris, ResourceSet resourceSet) {
+ super(uris, resourceSet);
+ }
+
+ public IStatus update() {
+ IFile[] resourcesToProcess = getTargetFiles(getTargetResources());
+ //The all project of each file shall be updated (In order to see if new files appeared (New control))
+ Set<IProject> projects = new HashSet<IProject>();
+ for(IFile f : resourcesToProcess) {
+ projects.add(f.getProject());
+ }
+
+ IProject[] projectsToUpdate = new IProject[projects.size()];
+ projects.toArray(projectsToUpdate);
+ if(ITracingConstant.UPDATE_TRACING) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("Updating projects: ").append("\n");
+ for(IProject p : projectsToUpdate) {
+ stringBuilder.append(p.getFullPath()).append("\n");
+ }
+ Tracer.logInfo(stringBuilder.toString());
+ }
+ CompositeOperation op = UpdateAction.getUpdateOperation(projectsToUpdate, SVNRevision.HEAD);
+ ICancellableOperationWrapper runnable = UIMonitorUtility.doTaskNowDefault(op, false);
+ IActionOperation resultStatus = runnable.getOperation();
+
+ return resultStatus.getStatus();
+ }
+
+ @Override
+ protected Set<IExtendedURI> doBuild() {
+ for(IExtendedURI extendedURI : getUris()) {
+ IExtendedURI resourceURI = getResourceURI(extendedURI);
+ if(resourceURI != null) {
+ IFile file = toIFile(toResource(resourceURI.getUri()));
+ if(file != null && file.exists()) {
+ if(!isUpToDate(resourceURI).isUpToDate()) {
+ getExtendedSet().add(resourceURI);
+ }
+ }
+ }
+ }
+ return getExtendedSet();
+ }
+
+
+ /**
+ * Checks if is up to date.
+ *
+ * @param uri
+ * the uri
+ * @return the i status
+ */
+ public UpToDateStatus isUpToDate(IExtendedURI uri) {
+ IExtendedURI resourceEURI = getResourceURI(uri);
+ if(resourceEURI == null) {
+ return UpToDateStatus.createErrorDuringUpToDataStatus("The URI is null");
+ }
+ UpToDateStatus status = getCache().get(resourceEURI);
+ if(status == null) {
+ URI resourceURI = resourceEURI.getUri();
+ Resource resource = toResource(resourceURI);
+ if(resource == null) {
+ return UpToDateStatus.createErrorDuringUpToDataStatus(resourceURI + " is not a URI pointing to a resource");
+ }
+ IFile file = toIFile(resource);
+ if(file == null || !file.exists()) {
+ return UpToDateStatus.createErrorDuringUpToDataStatus(resourceURI + " is not a URI pointing to a existing file");
+ }
+
+ SVNLogEntry log = getRemoteHEADRevision(file);
+ if(log == null) {
+ return UpToDateStatus.createErrorDuringUpToDataStatus("Unable to get remote HEAD revision for file " + file.getFullPath());
+ }
+ InfoOperation refreshOperation = new InfoOperation(file);
+ refreshOperation.run(new NullProgressMonitor());
+ SVNEntryInfo info = refreshOperation.getInfo();
+ long localRevision = info.revision;
+ if(log.revision > localRevision) {
+ status = UpToDateStatus.createNotUpToDataStatus(log.author, log.date, log.revision);
+ getCache().put(resourceEURI, status);
+ return status;
+ } else {
+ status = UpToDateStatus.createUpToDataStatus(log.author, log.date, log.revision);
+ getCache().put(resourceEURI, status);
+ }
+ }
+ return status;
+ }
+
+
+
+
+ protected Map<IExtendedURI, UpToDateStatus> getCache() {
+ if(cache == null) {
+ cache = new HashMap<IExtendedURI, IUpdater.UpToDateStatus>();
+ }
+ return cache;
+ }
+
+
+
+ private Map<IExtendedURI, UpToDateStatus> cache = null;
+
+ public static final long INVALID_REVISION = -1;
+
+
+ public SVNLogEntry getRemoteHEADRevision(IResource resource) {
+ IRepositoryResource remote = SVNRemoteStorage.instance().asRepositoryResource(resource);
+ GetLogMessagesOperation logOp = new GetLogMessagesOperation(remote);
+ logOp.setLimit(1);
+ logOp.run(new NullProgressMonitor());
+ if(logOp.getExecutionState() == IActionOperation.OK && logOp.getMessages() != null) {
+ SVNLogEntry[] messages = logOp.getMessages();
+ if(messages.length > 0) {
+ return messages[0];
+ }
+ }
+ return null;
+ }
+
+
+
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/SVNWorkOnModifiedFile.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNWorkOnModifiedFile.java
index 70aded9..70aded9 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/connector/svn/versioncontroller/SVNWorkOnModifiedFile.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.connector.svn/src/org/eclipse/papyrus/team/collaborative/svn/versioncontroller/SVNWorkOnModifiedFile.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/.settings/org.eclipse.jdt.core.prefs b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index c537b63..0000000
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/META-INF/MANIFEST.MF b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/META-INF/MANIFEST.MF
index 869d49e..cf3cac8 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/META-INF/MANIFEST.MF
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/META-INF/MANIFEST.MF
@@ -1,30 +1,30 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: SVN Control
-Bundle-SymbolicName: org.eclipse.papyrus.team.collaborative.integration.papyrus.svn;singleton:=true
-Bundle-Version: 1.7.0.qualifier
-Bundle-Activator: org.eclipse.papyrus.team.collaborative.integration.papyrus.svn.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.papyrus.infra.services.controlmode,
- org.eclipse.gmf.runtime.common.core,
- org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0",
- org.eclipse.papyrus.editor,
- org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
- org.eclipse.papyrus.team.collaborative;bundle-version="1.7.0",
- com.google.guava,
- org.eclipse.papyrus.infra.gmfdiag.modelexplorer,
- org.eclipse.ui.navigator;bundle-version="3.5.101",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.1.2",
- org.eclipse.papyrus.team.collaborative.integration.papyrus,
- org.eclipse.papyrus.team.collaborative.connector.svn,
- org.eclipse.papyrus.infra.gmfdiag.modelexplorer,
- org.eclipse.papyrus.infra.widgets.toolbox,
- org.eclipse.papyrus.infra.gmfdiag.commands,
- org.eclipse.team.svn.core;bundle-version="1.1.0",
- org.eclipse.emf.facet.infra.query.core,
- org.eclipse.emf.facet.infra.browser.custom,
- org.eclipse.emf.common.ui,
- org.eclipse.papyrus.views.modelexplorer
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ActivationPolicy: lazy
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SVN Control
+Bundle-SymbolicName: org.eclipse.papyrus.team.collaborative.integration.papyrus.svn;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.team.collaborative.integration.papyrus.svn.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.infra.services.controlmode,
+ org.eclipse.gmf.runtime.common.core,
+ org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0",
+ org.eclipse.papyrus.editor,
+ org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
+ org.eclipse.papyrus.team.collaborative;bundle-version="1.0.0",
+ com.google.guava,
+ org.eclipse.papyrus.infra.gmfdiag.modelexplorer,
+ org.eclipse.ui.navigator;bundle-version="3.5.101",
+ org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.1.2",
+ org.eclipse.papyrus.team.collaborative.integration.papyrus,
+ org.eclipse.papyrus.team.collaborative.connector.svn,
+ org.eclipse.papyrus.infra.gmfdiag.modelexplorer,
+ org.eclipse.papyrus.infra.widgets.toolbox,
+ org.eclipse.papyrus.infra.gmfdiag.commands,
+ org.eclipse.team.svn.core;bundle-version="1.1.0",
+ org.eclipse.emf.facet.infra.query.core,
+ org.eclipse.emf.facet.infra.browser.custom,
+ org.eclipse.emf.common.ui,
+ org.eclipse.papyrus.views.modelexplorer
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/pom.xml b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/pom.xml
deleted file mode 100644
index 24fd918..0000000
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/pom.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2013 Atos.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Arthur Daussy <a href="mailto:arthur.daussy@atos.net"> - initial API and implementation
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <relativePath>../../../Releng/org.topcased.fast.tycho.master/pom.xml</relativePath>
- <groupId>org.topcased.fast</groupId>
- <artifactId>parent</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>org.eclipse.papyrus.team.collaborative.integration.papyrus.svn</artifactId>
- <packaging>eclipse-plugin</packaging>
-
- <name>SVN Control</name>
-</project>
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/Activator.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/Activator.java
index 13fec00..13fec00 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/Activator.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/Activator.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/commands/AddFileToCollabSVN.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/commands/AddFileToCollabSVN.java
index b0fd1ee..b0fd1ee 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/commands/AddFileToCollabSVN.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/commands/AddFileToCollabSVN.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/commands/SaveCommand.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/commands/SaveCommand.java
index 9af1e6b..9af1e6b 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/commands/SaveCommand.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/commands/SaveCommand.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/control/SVNControlModeParticipant.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/control/SVNControlModeParticipant.java
index db7733e..1d6317c 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/control/SVNControlModeParticipant.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/control/SVNControlModeParticipant.java
@@ -1,133 +1,125 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.svn.control;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.papyrus.infra.services.controlmode.ControlModeRequest;
-import org.eclipse.papyrus.infra.services.controlmode.participants.IControlCommandParticipant;
-import org.eclipse.papyrus.infra.services.controlmode.participants.IUncontrolCommandParticipant;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.svn.commands.AddFileToCollabSVN;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.svn.commands.SaveCommand;
-import org.eclipse.papyrus.team.collaborative.utils.CollabUtils;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.ISaveablePart;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * The Class SVNControlModeParticipant.
- * This {@link IControlCommandParticipant} provide mean to automatically integrate file generated after a control into a SVN repository
- * WARNING: The {@link IUncontrolCommandParticipant} is not implemented yet
- */
-public class SVNControlModeParticipant implements IControlCommandParticipant, IUncontrolCommandParticipant {
-
- /**
- * Instantiates a new sVN control mode participant.
- */
- public SVNControlModeParticipant() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.controlmode.interfaces.IControlModeParticipant#getID()
- */
- @Override
- public String getID() {
- return "org.eclipse.papyrus.team.collaborative.integration.papyrus.control.SVNControlModeParticipant";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.controlmode.interfaces.IControlModeParticipant#getPriority()
- */
- @Override
- public int getPriority() {
- return 10000;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.controlmode.interfaces.IUncontrolCommandParticipant#provideUnControlCommand(org.eclipse.papyrus.controlmode.request.
- * ControlModeRequest)
- */
- @Override
- public boolean provideUnControlCommand(ControlModeRequest request) {
- return CollabUtils.isCollab(request.getTargetObject());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.controlmode.interfaces.IUncontrolCommandParticipant#getPreUncontrolCommand(org.eclipse.papyrus.controlmode.request.
- * ControlModeRequest)
- */
- @Override
- public ICommand getPreUncontrolCommand(ControlModeRequest request) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.controlmode.interfaces.IUncontrolCommandParticipant#getPostUncontrolCommand(org.eclipse.papyrus.controlmode.request.
- * ControlModeRequest)
- */
- @Override
- public ICommand getPostUncontrolCommand(ControlModeRequest request) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.controlmode.interfaces.IControlCommandParticipant#provideControlCommand(org.eclipse.papyrus.controlmode.request.
- * ControlModeRequest)
- */
- @Override
- public boolean provideControlCommand(ControlModeRequest request) {
- return CollabUtils.isCollab(request.getTargetObject());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.controlmode.interfaces.IControlCommandParticipant#getPreControlCommand(org.eclipse.papyrus.controlmode.request.
- * ControlModeRequest)
- */
- @Override
- public ICommand getPreControlCommand(ControlModeRequest request) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.controlmode.interfaces.IControlCommandParticipant#getPostControlCommand(org.eclipse.papyrus.controlmode.request.
- * ControlModeRequest)
- */
- @Override
- public ICommand getPostControlCommand(ControlModeRequest request) {
- CompositeTransactionalCommand cc = new CompositeTransactionalCommand(request.getEditingDomain(), "Share file to SVN with need lock");
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if(editor instanceof ISaveablePart) {
- cc.compose(new SaveCommand(request.getEditingDomain(), editor));
- cc.compose(new AddFileToCollabSVN(request.getEditingDomain(), request));
- }
- return cc;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.svn.control;
+
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.papyrus.infra.services.controlmode.ControlModeRequest;
+import org.eclipse.papyrus.infra.services.controlmode.participants.IControlCommandParticipant;
+import org.eclipse.papyrus.infra.services.controlmode.participants.IUncontrolCommandParticipant;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.svn.commands.AddFileToCollabSVN;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.svn.commands.SaveCommand;
+import org.eclipse.papyrus.team.collaborative.utils.CollabUtils;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.ISaveablePart;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * The Class SVNControlModeParticipant.
+ * This {@link IControlCommandParticipant} provide mean to automatically integrate file generated after a control into a SVN repository
+ * WARNING: The {@link IUncontrolCommandParticipant} is not implemented yet
+ */
+public class SVNControlModeParticipant implements IControlCommandParticipant, IUncontrolCommandParticipant {
+
+ /**
+ * Instantiates a new sVN control mode participant.
+ */
+ public SVNControlModeParticipant() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.controlmode.interfaces.IControlModeParticipant#getID()
+ */
+ public String getID() {
+ return "org.eclipse.papyrus.team.collaborative.integration.papyrus.control.SVNControlModeParticipant";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.controlmode.interfaces.IControlModeParticipant#getPriority()
+ */
+ public int getPriority() {
+ return 10000;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.controlmode.interfaces.IUncontrolCommandParticipant#provideUnControlCommand(org.eclipse.papyrus.controlmode.request.
+ * ControlModeRequest)
+ */
+ public boolean provideUnControlCommand(ControlModeRequest request) {
+ return CollabUtils.isCollab(request.getTargetObject());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.controlmode.interfaces.IUncontrolCommandParticipant#getPreUncontrolCommand(org.eclipse.papyrus.controlmode.request.
+ * ControlModeRequest)
+ */
+ public ICommand getPreUncontrolCommand(ControlModeRequest request) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.controlmode.interfaces.IUncontrolCommandParticipant#getPostUncontrolCommand(org.eclipse.papyrus.controlmode.request.
+ * ControlModeRequest)
+ */
+ public ICommand getPostUncontrolCommand(ControlModeRequest request) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.controlmode.interfaces.IControlCommandParticipant#provideControlCommand(org.eclipse.papyrus.controlmode.request.
+ * ControlModeRequest)
+ */
+ public boolean provideControlCommand(ControlModeRequest request) {
+ return CollabUtils.isCollab(request.getTargetObject());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.controlmode.interfaces.IControlCommandParticipant#getPreControlCommand(org.eclipse.papyrus.controlmode.request.
+ * ControlModeRequest)
+ */
+ public ICommand getPreControlCommand(ControlModeRequest request) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.controlmode.interfaces.IControlCommandParticipant#getPostControlCommand(org.eclipse.papyrus.controlmode.request.
+ * ControlModeRequest)
+ */
+ public ICommand getPostControlCommand(ControlModeRequest request) {
+ CompositeTransactionalCommand cc = new CompositeTransactionalCommand(request.getEditingDomain(), "Share file to SVN with need lock");
+ IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if(editor instanceof ISaveablePart) {
+ cc.compose(new SaveCommand(request.getEditingDomain(), editor));
+ cc.compose(new AddFileToCollabSVN(request.getEditingDomain(), request));
+ }
+ return cc;
+ }
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/handler/SVNCollabControlCommandHandler.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/handler/SVNCollabControlCommandHandler.java
index a40d03a..a40d03a 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/handler/SVNCollabControlCommandHandler.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/handler/SVNCollabControlCommandHandler.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/handler/ShowModelPartitionHandler.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/handler/ShowModelPartitionHandler.java
index 83f44d3..83f44d3 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/handler/ShowModelPartitionHandler.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/handler/ShowModelPartitionHandler.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/queries/IsCollabQuery.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/queries/IsCollabQuery.java
index 376d86c..eba91ba 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/queries/IsCollabQuery.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/queries/IsCollabQuery.java
@@ -1,70 +1,69 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.svn.queries;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
-import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
-import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
-import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.PapyrusResourceUtils;
-import org.eclipse.papyrus.team.collaborative.participants.locker.ILocker;
-import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
-
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Sets;
-
-
-/**
- * Return true if the element is a collab element
- *
- * @author adaussy
- *
- */
-public class IsCollabQuery implements IJavaModelQuery<EObject, Boolean> {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery#evaluate(org.eclipse.emf.ecore.EObject,
- * org.eclipse.emf.facet.infra.query.core.java.ParameterValueList)
- */
- @Override
- public Boolean evaluate(EObject arg0, ParameterValueList arg1) throws ModelQueryExecutionException {
- List<URI> uris = new ArrayList<URI>();
- URI uri = arg0.eResource().getURI();
- ResourceSet resourceSet = arg0.eResource().getResourceSet();
- uris.add(uri);
- PapyrusResourceUtils.addExtraResources(resourceSet, uris, uri);
- Set<IExtendedURI> extendedURIS = Sets.newHashSet(Collections2.transform(uris, CollabFunctionsFactory.getURIToExtendedURIWithContainment()));
- ILocker locker = ICollaborativeManager.INSTANCE.getLocker(extendedURIS, resourceSet);
- if(locker == null) {
- return false;
- }
- boolean result = false;
- for(IExtendedURI extURI : extendedURIS) {
- if(locker.isLocked(extURI).isOK()) {
- result = true;
- }
- }
- return result;
-
-
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.svn.queries;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
+import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
+import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
+import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.PapyrusResourceUtils;
+import org.eclipse.papyrus.team.collaborative.participants.locker.ILocker;
+import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
+
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Sets;
+
+
+/**
+ * Return true if the element is a collab element
+ *
+ * @author adaussy
+ *
+ */
+public class IsCollabQuery implements IJavaModelQuery<EObject, Boolean> {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery#evaluate(org.eclipse.emf.ecore.EObject,
+ * org.eclipse.emf.facet.infra.query.core.java.ParameterValueList)
+ */
+ public Boolean evaluate(EObject arg0, ParameterValueList arg1) throws ModelQueryExecutionException {
+ List<URI> uris = new ArrayList<URI>();
+ URI uri = arg0.eResource().getURI();
+ ResourceSet resourceSet = arg0.eResource().getResourceSet();
+ uris.add(uri);
+ PapyrusResourceUtils.addExtraResources(resourceSet, uris, uri);
+ Set<IExtendedURI> extendedURIS = Sets.newHashSet(Collections2.transform(uris, CollabFunctionsFactory.getURIToExtendedURIWithContainment()));
+ ILocker locker = ICollaborativeManager.INSTANCE.getLocker(extendedURIS, resourceSet);
+ if(locker == null) {
+ return false;
+ }
+ boolean result = false;
+ for(IExtendedURI extURI : extendedURIS) {
+ if(locker.isLocked(extURI).isOK()) {
+ result = true;
+ }
+ }
+ return result;
+
+
+ }
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/queries/IsPartialyLocked.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/queries/IsPartialyLocked.java
index 246ffab..532d782 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/queries/IsPartialyLocked.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/queries/IsPartialyLocked.java
@@ -1,70 +1,69 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.svn.queries;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
-import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
-import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
-import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.PapyrusResourceUtils;
-import org.eclipse.papyrus.team.collaborative.participants.locker.ILocker;
-import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
-
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Sets;
-
-
-/**
- * The Class IsPartialyLocked.
- * Return true if the element is partialy locked. Partialy locked mean that there is one of the di or uml or notation model that has not been locked
- */
-public class IsPartialyLocked implements IJavaModelQuery<EObject, Boolean> {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery#evaluate(org.eclipse.emf.ecore.EObject,
- * org.eclipse.emf.facet.infra.query.core.java.ParameterValueList)
- */
- @Override
- public Boolean evaluate(EObject arg0, ParameterValueList arg1) throws ModelQueryExecutionException {
- List<URI> uris = new ArrayList<URI>();
- URI uri = arg0.eResource().getURI();
- ResourceSet resourceSet = arg0.eResource().getResourceSet();
- uris.add(uri);
- PapyrusResourceUtils.addExtraResources(resourceSet, uris, uri);
- Set<IExtendedURI> extendedURIS = Sets.newHashSet(Collections2.transform(uris, CollabFunctionsFactory.getURIToExtendedURIWithContainment()));
- ILocker locker = ICollaborativeManager.INSTANCE.getLocker(extendedURIS, resourceSet);
- if(locker == null) {
- return false;
- }
- boolean oneLocked = false;
- boolean oneUnlocked = false;
- for(IExtendedURI extURI : extendedURIS) {
- if(locker.isLocked(extURI).isOK()) {
- oneLocked = true;
- } else {
- oneUnlocked = true;
- }
- }
- return oneUnlocked && oneLocked;
-
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.svn.queries;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
+import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
+import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
+import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.PapyrusResourceUtils;
+import org.eclipse.papyrus.team.collaborative.participants.locker.ILocker;
+import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
+
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Sets;
+
+
+/**
+ * The Class IsPartialyLocked.
+ * Return true if the element is partialy locked. Partialy locked mean that there is one of the di or uml or notation model that has not been locked
+ */
+public class IsPartialyLocked implements IJavaModelQuery<EObject, Boolean> {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery#evaluate(org.eclipse.emf.ecore.EObject,
+ * org.eclipse.emf.facet.infra.query.core.java.ParameterValueList)
+ */
+ public Boolean evaluate(EObject arg0, ParameterValueList arg1) throws ModelQueryExecutionException {
+ List<URI> uris = new ArrayList<URI>();
+ URI uri = arg0.eResource().getURI();
+ ResourceSet resourceSet = arg0.eResource().getResourceSet();
+ uris.add(uri);
+ PapyrusResourceUtils.addExtraResources(resourceSet, uris, uri);
+ Set<IExtendedURI> extendedURIS = Sets.newHashSet(Collections2.transform(uris, CollabFunctionsFactory.getURIToExtendedURIWithContainment()));
+ ILocker locker = ICollaborativeManager.INSTANCE.getLocker(extendedURIS, resourceSet);
+ if(locker == null) {
+ return false;
+ }
+ boolean oneLocked = false;
+ boolean oneUnlocked = false;
+ for(IExtendedURI extURI : extendedURIS) {
+ if(locker.isLocked(extURI).isOK()) {
+ oneLocked = true;
+ } else {
+ oneUnlocked = true;
+ }
+ }
+ return oneUnlocked && oneLocked;
+
+ }
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/ui/CreateCollabModelFragmentDialog.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/ui/CreateCollabModelFragmentDialog.java
index 4a2d329..4a2d329 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/ui/CreateCollabModelFragmentDialog.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/ui/CreateCollabModelFragmentDialog.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/ui/IconsPath.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/ui/IconsPath.java
index 8067086..8067086 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/svn/ui/IconsPath.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus.svn/src/org/eclipse/papyrus/team/collaborative/controlmode/ui/IconsPath.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/.settings/org.eclipse.jdt.core.prefs b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/.settings/org.eclipse.jdt.core.prefs
index 6bb8136..42337f0 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/.settings/org.eclipse.jdt.core.prefs
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,2 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
-org.eclipse.objectteams.otdt.compiler.option.pure_java=enabled
+eclipse.preferences.version=1
+org.eclipse.objectteams.otdt.compiler.option.pure_java=enabled
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/META-INF/MANIFEST.MF b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/META-INF/MANIFEST.MF
index 98c700e..1789e51 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/META-INF/MANIFEST.MF
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/META-INF/MANIFEST.MF
@@ -1,36 +1,36 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Team Ui
-Bundle-SymbolicName: org.eclipse.papyrus.team.collaborative.integration.papyrus;singleton:=true
-Bundle-Version: 1.7.0.qualifier
-Bundle-Activator: org.eclipse.papyrus.team.collaborative.integration.papyrus.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.papyrus.team.collaborative;bundle-version="1.0.0",
- com.google.guava,
- org.eclipse.emf.ecore;bundle-version="2.7.0",
- org.eclipse.papyrus.infra.core,
- org.eclipse.papyrus.infra.gmfdiag.modelexplorer,
- org.eclipse.ui.navigator;bundle-version="3.5.101",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.1.2",
- org.eclipse.papyrus.infra.emf.readonly,
- org.eclipse.core.expressions,
- org.eclipse.uml2.uml;bundle-version="3.2.100",
- org.eclipse.emf.edit,
- org.eclipse.gmf.runtime.common.ui,
- org.eclipse.papyrus.uml.tools,
- org.eclipse.ui.ide,
- org.eclipse.ui.views.properties.tabbed,
- org.eclipse.emf.transaction,
- org.eclipse.papyrus.infra.gmfdiag.common,
- org.eclipse.papyrus.views.modelexplorer,
- org.eclipse.papyrus.infra.emf,
- org.eclipse.papyrus.infra.widgets,
- org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Export-Package: org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions,
- org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs,
- org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.providers,
- org.eclipse.papyrus.team.collaborative.integration.papyrus.utils
-Bundle-Vendor: Atos
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Team Ui
+Bundle-SymbolicName: org.eclipse.papyrus.team.collaborative.integration.papyrus;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.team.collaborative.integration.papyrus.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.team.collaborative;bundle-version="1.0.0",
+ com.google.guava,
+ org.eclipse.emf.ecore;bundle-version="2.7.0",
+ org.eclipse.papyrus.infra.core,
+ org.eclipse.papyrus.infra.gmfdiag.modelexplorer,
+ org.eclipse.ui.navigator;bundle-version="3.5.101",
+ org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.1.2",
+ org.eclipse.papyrus.infra.emf.readonly,
+ org.eclipse.core.expressions,
+ org.eclipse.uml2.uml;bundle-version="3.2.100",
+ org.eclipse.emf.edit,
+ org.eclipse.gmf.runtime.common.ui,
+ org.eclipse.papyrus.uml.tools,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.views.properties.tabbed,
+ org.eclipse.emf.transaction,
+ org.eclipse.papyrus.infra.gmfdiag.common,
+ org.eclipse.papyrus.views.modelexplorer,
+ org.eclipse.papyrus.infra.emf,
+ org.eclipse.papyrus.infra.widgets,
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions,
+ org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs,
+ org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.providers,
+ org.eclipse.papyrus.team.collaborative.integration.papyrus.utils
+Bundle-Vendor: Atos
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/plugin.xml b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/plugin.xml
index 6b66d5f..364eeb6 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/plugin.xml
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/plugin.xml
@@ -1,125 +1,125 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- allPopups="false"
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
- <menu
- icon="icons/TeamIcon.png"
- id="org.eclipse.papyrus.team.collaborative.ui.collab.menu"
- label="Collaborative">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="selection">
- <test
- property="org.eclipse.papyrus.team.collaborative.integration.papyrus.isCollab"
- value="true">
- </test>
- </with>
- </visibleWhen>
- </menu>
- </menuContribution>
- <menuContribution
- allPopups="false"
- locationURI="popup:org.eclipse.papyrus.team.collaborative.ui.collab.menu">
- <menu
- icon="icons/lock.gif"
- id="org.eclipse.papyrus.team.collaborative.integration.papyrus.menu"
- label="Lock">
- <dynamic
- class="org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.items.LockStrategyItemProvider"
- id="org.eclipse.papyrus.team.collaborative.integration.papyrus.lockItems">
- </dynamic>
- </menu>
- <menu
- icon="icons/unlock.gif"
- id="org.eclipse.papyrus.team.collaborative.integration.papyrus.unlock"
- label="Unlock">
- <dynamic
- class="org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.items.UnlockStrategyItemProvider"
- id="org.eclipse.papyrus.team.collaborative.integration.papyrus.UnlockItem">
- </dynamic>
- </menu>
- <command
- commandId="org.eclipse.papyrus.team.collaborative.integration.papyrus.update"
- icon="icons/update.gif"
- label="Update"
- style="push"
- tooltip="Update the all model from the repository">
- </command>
- <command
- commandId="org.eclipse.papyrus.team.collaborative.integration.papyrus.commit"
- icon="icons/commit.gif"
- label="Commit"
- style="push"
- tooltip="Commit all modification to the repository">
- </command>
- <command
- commandId="org.eclipse.papyrus.team.collaborative.integration.papyrus.revert"
- icon="icons/revert.gif"
- label="Revert"
- style="push"
- tooltip="Revert all changes">
- </command>
- </menuContribution>
- </extension>
- <extension
- point="org.eclipse.papyrus.team.collaborative.collaborative">
- <LockingStrategy
- id="org.eclipse.papyrus.team.collaborative.integration.papyrus.elementsandcontents"
- impl="org.eclipse.papyrus.team.collaborative.integration.papyrus.stategies.PapyrusSelectionAllContent"
- name="Selected element and content">
- </LockingStrategy>
- <LockingStrategy
- id="org.eclipse.papyrus.team.collaborative.integration.papyrus.papyrusResourceContent"
- impl="org.eclipse.papyrus.team.collaborative.integration.papyrus.stategies.PapyrusCurrentResource"
- name="Selected element">
- </LockingStrategy>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <command
- defaultHandler="org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.UpdateHandler"
- id="org.eclipse.papyrus.team.collaborative.integration.papyrus.update"
- name="Update">
- </command>
- <command
- defaultHandler="org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.CommitHandler"
- id="org.eclipse.papyrus.team.collaborative.integration.papyrus.commit"
- name="Commit">
- </command>
- <command
- defaultHandler="org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.RevertHandler"
- id="org.eclipse.papyrus.team.collaborative.integration.papyrus.revert"
- name="Revert">
- </command>
- </extension>
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.papyrus.team.collaborative.integration.papyrus.IsCollabPropertyTest"
- id="org.eclipse.papyrus.team.collaborative.integration.papyrus.iCollabID"
- namespace="org.eclipse.papyrus.team.collaborative.integration.papyrus"
- properties="isCollab"
- type="org.eclipse.jface.viewers.ISelection">
- </propertyTester>
- </extension>
- <extension
- point="org.eclipse.papyrus.infra.emf.readonly.readOnlyHandler">
- <readOnlyHandler
- class="org.eclipse.papyrus.team.collaborative.integration.papyrus.security.CollabReadOnlyHandler"
- id="org.eclipse.papyrus.team.collaborative.integration.papyrus.CollabReadOnlyHandler"
- priority="700">
- </readOnlyHandler>
- </extension>
- <extension
- point="org.eclipse.papyrus.infra.core.model">
- <modelSetSnippet
- classname="org.eclipse.papyrus.team.collaborative.integration.papyrus.security.PreCommitReadOnlyHandler">
- </modelSetSnippet>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
+ <menu
+ icon="icons/TeamIcon.png"
+ id="org.eclipse.papyrus.team.collaborative.ui.collab.menu"
+ label="Collaborative">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <test
+ property="org.eclipse.papyrus.team.collaborative.integration.papyrus.isCollab"
+ value="true">
+ </test>
+ </with>
+ </visibleWhen>
+ </menu>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.papyrus.team.collaborative.ui.collab.menu">
+ <menu
+ icon="icons/lock.gif"
+ id="org.eclipse.papyrus.team.collaborative.integration.papyrus.menu"
+ label="Lock">
+ <dynamic
+ class="org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.items.LockStrategyItemProvider"
+ id="org.eclipse.papyrus.team.collaborative.integration.papyrus.lockItems">
+ </dynamic>
+ </menu>
+ <menu
+ icon="icons/unlock.gif"
+ id="org.eclipse.papyrus.team.collaborative.integration.papyrus.unlock"
+ label="Unlock">
+ <dynamic
+ class="org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.items.UnlockStrategyItemProvider"
+ id="org.eclipse.papyrus.team.collaborative.integration.papyrus.UnlockItem">
+ </dynamic>
+ </menu>
+ <command
+ commandId="org.eclipse.papyrus.team.collaborative.integration.papyrus.update"
+ icon="icons/update.gif"
+ label="Update"
+ style="push"
+ tooltip="Update the all model from the repository">
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.team.collaborative.integration.papyrus.commit"
+ icon="icons/commit.gif"
+ label="Commit"
+ style="push"
+ tooltip="Commit all modification to the repository">
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.team.collaborative.integration.papyrus.revert"
+ icon="icons/revert.gif"
+ label="Revert"
+ style="push"
+ tooltip="Revert all changes">
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.team.collaborative.contribution">
+ <LockingStrategy
+ id="org.eclipse.papyrus.team.collaborative.integration.papyrus.elementsandcontents"
+ impl="org.eclipse.papyrus.team.collaborative.integration.papyrus.stategies.PapyrusSelectionAllContent"
+ name="Selected element and content">
+ </LockingStrategy>
+ <LockingStrategy
+ id="org.eclipse.papyrus.team.collaborative.integration.papyrus.papyrusResourceContent"
+ impl="org.eclipse.papyrus.team.collaborative.integration.papyrus.stategies.PapyrusCurrentResource"
+ name="Selected element">
+ </LockingStrategy>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ defaultHandler="org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.UpdateHandler"
+ id="org.eclipse.papyrus.team.collaborative.integration.papyrus.update"
+ name="Update">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.CommitHandler"
+ id="org.eclipse.papyrus.team.collaborative.integration.papyrus.commit"
+ name="Commit">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.RevertHandler"
+ id="org.eclipse.papyrus.team.collaborative.integration.papyrus.revert"
+ name="Revert">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.papyrus.team.collaborative.integration.papyrus.IsCollabPropertyTest"
+ id="org.eclipse.papyrus.team.collaborative.integration.papyrus.iCollabID"
+ namespace="org.eclipse.papyrus.team.collaborative.integration.papyrus"
+ properties="isCollab"
+ type="org.eclipse.jface.viewers.ISelection">
+ </propertyTester>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.emf.readonly.readOnlyHandler">
+ <readOnlyHandler
+ class="org.eclipse.papyrus.team.collaborative.integration.papyrus.security.CollabReadOnlyHandler"
+ id="org.eclipse.papyrus.team.collaborative.integration.papyrus.CollabReadOnlyHandler"
+ priority="700">
+ </readOnlyHandler>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.core.model">
+ <modelSetSnippet
+ classname="org.eclipse.papyrus.team.collaborative.integration.papyrus.security.PreCommitReadOnlyHandler">
+ </modelSetSnippet>
+ </extension>
+
+</plugin>
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/pom.xml b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/pom.xml
deleted file mode 100644
index d070516..0000000
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/pom.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2013 Atos.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Arthur Daussy <a href="mailto:arthur.daussy@atos.net"> - initial API and implementation
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <relativePath>../../../Releng/org.topcased.fast.tycho.master/pom.xml</relativePath>
- <groupId>org.topcased.fast</groupId>
- <artifactId>parent</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>org.eclipse.papyrus.team.collaborative.integration.papyrus</artifactId>
- <packaging>eclipse-plugin</packaging>
-
- <name>Team Ui</name>
-</project>
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/IsCollabPropertyTest.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/IsCollabPropertyTest.java
index 0459c54..5f917da 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/IsCollabPropertyTest.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/IsCollabPropertyTest.java
@@ -1,64 +1,60 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.team.collaborative.utils.CollabUtils;
-
-
-/**
- * Tester to check if the selection belong to a collaborative model.
- *
- * @author adaussy
- */
-public class IsCollabPropertyTest extends PropertyTester {
-
- /** The Constant IS_COLLAB_PROPERTY. */
- private static final String IS_COLLAB_PROPERTY = "isCollab";
-
- /**
- * Instantiates a new checks if is collab property test.
- */
- public IsCollabPropertyTest() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- @Override
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if(IS_COLLAB_PROPERTY.equals(property)) {
- if(receiver instanceof ISelection) {
- ISelection selection = (ISelection)receiver;
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection structurSelection = (IStructuredSelection)selection;
- Object first = structurSelection.getFirstElement();
- if(first instanceof IAdaptable) {
- Object eObject = ((IAdaptable)first).getAdapter(EObject.class);
- if(eObject != null) {
- EObject eObject2 = (EObject)eObject;
- return CollabUtils.isCollab(eObject2);
- }
- }
- }
- }
- }
- return false;
- }
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.team.collaborative.utils.CollabUtils;
+
+
+/**
+ * Tester to check if the selection belong to a collaborative model.
+ *
+ * @author adaussy
+ */
+public class IsCollabPropertyTest extends PropertyTester {
+
+ /** The Constant IS_COLLAB_PROPERTY. */
+ private static final String IS_COLLAB_PROPERTY = "isCollab";
+
+ /**
+ * Instantiates a new checks if is collab property test.
+ */
+ public IsCollabPropertyTest() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+ */
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ if(IS_COLLAB_PROPERTY.equals(property)) {
+ if(receiver instanceof ISelection) {
+ ISelection selection = (ISelection)receiver;
+ if(selection instanceof IStructuredSelection) {
+ IStructuredSelection structurSelection = (IStructuredSelection)selection;
+ Object first = structurSelection.getFirstElement();
+ EObject eObject = EMFHelper.getEObject(first);
+ if(eObject != null) {
+ return CollabUtils.isCollab(eObject);
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/MatchingURIObject.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/MatchingURIObject.java
index 858b540..bd680ce 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/MatchingURIObject.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/MatchingURIObject.java
@@ -1,79 +1,78 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.utils.ExtendedURIUtil;
-import org.eclipse.uml2.uml.Element;
-
-import com.google.common.base.Predicate;
-
-
-/**
- * The Class MatchingURIObject.
- * Predicate that will return true if the EObject belong to the set of {@link IExtendedURI}
- */
-public class MatchingURIObject implements Predicate<EObject> {
-
- private Set<IExtendedURI> uris;
-
- public MatchingURIObject(Set<IExtendedURI> uris) {
- super();
- this.uris = uris;
- }
-
- @Override
- public boolean apply(EObject input) {
- List<EObject> objectToTEObjects = new ArrayList<EObject>();
- objectToTEObjects.add(input);
- objectToTEObjects.addAll(NotationUtils.getLoadedAssociatedDiagrams(input));
- for(IExtendedURI extendedURI : uris) {
- for(EObject o : objectToTEObjects) {
- boolean contained = ExtendedURIUtil.isIncluded(o, extendedURI);
-
- if(contained) {
- return contained;
- }
- }
- }
- return false;
- }
-
-
- protected EObject getSemanticObject(EObject eObject) {
- EObject result = null;
- if(eObject instanceof Element) {
- result = eObject;
- } else if(eObject instanceof View) {
- //Handle view
- result = ((View)eObject).getElement();
- } else {
- //Handle setereotype
- Element baseElement = org.eclipse.uml2.uml.util.UMLUtil.getBaseElement(eObject);
- if(baseElement != null) {
- result = baseElement;
- }
- //TODO handle tab
- }
- return result;
- }
-
-
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.utils.ExtendedURIUtil;
+import org.eclipse.uml2.uml.Element;
+
+import com.google.common.base.Predicate;
+
+
+/**
+ * The Class MatchingURIObject.
+ * Predicate that will return true if the EObject belong to the set of {@link IExtendedURI}
+ */
+public class MatchingURIObject implements Predicate<EObject> {
+
+ private Set<IExtendedURI> uris;
+
+ public MatchingURIObject(Set<IExtendedURI> uris) {
+ super();
+ this.uris = uris;
+ }
+
+ public boolean apply(EObject input) {
+ List<EObject> objectToTEObjects = new ArrayList<EObject>();
+ objectToTEObjects.add(input);
+ objectToTEObjects.addAll(NotationUtils.getLoadedAssociatedDiagrams(input));
+ for(IExtendedURI extendedURI : uris) {
+ for(EObject o : objectToTEObjects) {
+ boolean contained = ExtendedURIUtil.isIncluded(o, extendedURI);
+
+ if(contained) {
+ return contained;
+ }
+ }
+ }
+ return false;
+ }
+
+
+ protected EObject getSemanticObject(EObject eObject) {
+ EObject result = null;
+ if(eObject instanceof Element) {
+ result = eObject;
+ } else if(eObject instanceof View) {
+ //Handle view
+ result = ((View)eObject).getElement();
+ } else {
+ //Handle setereotype
+ Element baseElement = org.eclipse.uml2.uml.util.UMLUtil.getBaseElement(eObject);
+ if(baseElement != null) {
+ result = baseElement;
+ }
+ //TODO handle tab
+ }
+ return result;
+ }
+
+
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/RefreshHelper.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/RefreshHelper.java
index f9a73a7..c7fac09 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/RefreshHelper.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/RefreshHelper.java
@@ -1,182 +1,181 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Olivier Melois <a href="mailto:olivier.melois@atos.net"> - initial API and implementation
- ******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.AbstractCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView;
-import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IViewReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Helper used to store method for refreshin model explorer view
- *
- * @author omelois
- *
- */
-public final class RefreshHelper {
-
-
- private RefreshHelper() {
- }
-
-
- /**
- * Runnable that will be used to refresh the model explorer view
- *
- * @author adaussy
- *
- */
- public static final class RefreshModelExplorerRunnable implements Runnable {
-
- private final Collection<EObject> elementsToRefresh;
-
- private static final int TIME_TO_REFRESH_MODEL_EXPLORER = 100;
-
- /**
- * @param elementsToRefresh
- * Element to Refresh
- */
- public RefreshModelExplorerRunnable(Collection<EObject> elementsToRefresh) {
- this.elementsToRefresh = elementsToRefresh;
- }
-
- @Override
- public void run() {
-
- try {
- Thread.sleep(TIME_TO_REFRESH_MODEL_EXPLORER);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-
- if(elementsToRefresh != null) {
- IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- if(activePage != null) {
- IViewReference viewRef = activePage.findViewReference(ModelExplorerPageBookView.VIEW_ID);
- if(viewRef != null && viewRef.getView(false) instanceof ModelExplorerView) {
- ModelExplorerView modelExplorerView = (ModelExplorerView)viewRef.getView(false);
- modelExplorerView.refresh();
-// Set<Object> alreadyRefreshed = new HashSet<Object>();
-// if(view != null) {
-// for(EObject elementToRefresh : elementsToRefresh) {
-//
-// view.refreshObject(elementToRefresh, alreadyRefreshed);
-// alreadyRefreshed.add(elementToRefresh);
-// }
-// }
- }
- }
-// IViewReference[] viewReferences = activePage.getViewReferences();
-// for(IViewReference viewRef : viewReferences) {
-// if(viewRef.getId().equals(ModelExplorerPageBookView.VIEW_ID));
-// }
-
- }
- }
- }
-
- protected static final String ELEMENTS_TO_REFRESH_KEY = "elementsToRefresh"; //$NON-NLS-1$
-
- /**
- * Get the model explorer refresh command
- *
- * @param request
- * IEditCommandRequest which implies refresh
- * @return
- */
- public static ICommand getRefreshCommand(final IEditCommandRequest request) {
- return new AbstractCommand("Refresh") //$NON-NLS-1$
- {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- refreshPostMove(request);
- return CommandResult.newOKCommandResult();
- }
-
- @Override
- protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- refreshPostMove(request);
- return CommandResult.newOKCommandResult();
- }
-
- @Override
- protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- refreshPostMove(request);
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- /**
- * Function to asynchronously refresh the model explorer after moving a breakdown element.
- *
- * @param request
- */
- private static void refreshPostMove(final IEditCommandRequest request) {
- @SuppressWarnings("unchecked")
- final Set<EObject> elementsToRefresh = (Set<EObject>)request.getParameter(ELEMENTS_TO_REFRESH_KEY);
-
- refreshModelExplorer(elementsToRefresh);
- }
-
- public static void refreshModelExplorer(Collection<EObject> elementsToRefresh) {
- if(elementsToRefresh != null && !(elementsToRefresh.isEmpty())) {
- Display.getDefault().asyncExec(new RefreshModelExplorerRunnable(elementsToRefresh));
- }
- }
-
- /**
- * Adds an element to the list of elements that should be refreshed, in the request.
- *
- * @param element
- * Element you want to refresh
- * @param request
- * Request in which the information about a refresh will be added
- */
- @SuppressWarnings({ "unchecked", "rawtypes" })
- public static void addElementToRefresh(EObject element, IEditCommandRequest request) {
- Object elementsToRefresh = request.getParameter(ELEMENTS_TO_REFRESH_KEY);
- if(elementsToRefresh == null) {
- elementsToRefresh = new HashSet<EObject>();
- request.getParameters().put(ELEMENTS_TO_REFRESH_KEY, elementsToRefresh);
- }
- if(elementsToRefresh instanceof Set<?>) {
- ((Set)elementsToRefresh).add(element);
- }
- }
-
- /**
- * Checks whether a request has elements to refresh;
- *
- * @param request
- * Request in which the information about a refresh will be added
- * @return
- */
- public static boolean hasElementsToRefresh(IEditCommandRequest request) {
- Object elementsToRefresh = request.getParameter(ELEMENTS_TO_REFRESH_KEY);
- return elementsToRefresh instanceof Set<?> && (!((Set<?>)elementsToRefresh).isEmpty());
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Olivier Melois <a href="mailto:olivier.melois@atos.net"> - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.AbstractCommand;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Helper used to store method for refreshin model explorer view
+ *
+ * @author omelois
+ *
+ */
+public final class RefreshHelper {
+
+
+ private RefreshHelper() {
+ }
+
+
+ /**
+ * Runnable that will be used to refresh the model explorer view
+ *
+ * @author adaussy
+ *
+ */
+ public static final class RefreshModelExplorerRunnable implements Runnable {
+
+ private final Collection<EObject> elementsToRefresh;
+
+ private static final int TIME_TO_REFRESH_MODEL_EXPLORER = 100;
+
+ /**
+ * @param elementsToRefresh
+ * Element to Refresh
+ */
+ public RefreshModelExplorerRunnable(Collection<EObject> elementsToRefresh) {
+ this.elementsToRefresh = elementsToRefresh;
+ }
+
+ public void run() {
+
+ try {
+ Thread.sleep(TIME_TO_REFRESH_MODEL_EXPLORER);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ if(elementsToRefresh != null) {
+ IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ if(activePage != null) {
+ IViewReference viewRef = activePage.findViewReference(ModelExplorerPageBookView.VIEW_ID);
+ if(viewRef != null && viewRef.getView(false) instanceof ModelExplorerView) {
+ ModelExplorerView modelExplorerView = (ModelExplorerView)viewRef.getView(false);
+ modelExplorerView.refresh();
+// Set<Object> alreadyRefreshed = new HashSet<Object>();
+// if(view != null) {
+// for(EObject elementToRefresh : elementsToRefresh) {
+//
+// view.refreshObject(elementToRefresh, alreadyRefreshed);
+// alreadyRefreshed.add(elementToRefresh);
+// }
+// }
+ }
+ }
+// IViewReference[] viewReferences = activePage.getViewReferences();
+// for(IViewReference viewRef : viewReferences) {
+// if(viewRef.getId().equals(ModelExplorerPageBookView.VIEW_ID));
+// }
+
+ }
+ }
+ }
+
+ protected static final String ELEMENTS_TO_REFRESH_KEY = "elementsToRefresh"; //$NON-NLS-1$
+
+ /**
+ * Get the model explorer refresh command
+ *
+ * @param request
+ * IEditCommandRequest which implies refresh
+ * @return
+ */
+ public static ICommand getRefreshCommand(final IEditCommandRequest request) {
+ return new AbstractCommand("Refresh") //$NON-NLS-1$
+ {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ refreshPostMove(request);
+ return CommandResult.newOKCommandResult();
+ }
+
+ @Override
+ protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ refreshPostMove(request);
+ return CommandResult.newOKCommandResult();
+ }
+
+ @Override
+ protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ refreshPostMove(request);
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ }
+
+ /**
+ * Function to asynchronously refresh the model explorer after moving a breakdown element.
+ *
+ * @param request
+ */
+ private static void refreshPostMove(final IEditCommandRequest request) {
+ @SuppressWarnings("unchecked")
+ final Set<EObject> elementsToRefresh = (Set<EObject>)request.getParameter(ELEMENTS_TO_REFRESH_KEY);
+
+ refreshModelExplorer(elementsToRefresh);
+ }
+
+ public static void refreshModelExplorer(Collection<EObject> elementsToRefresh) {
+ if(elementsToRefresh != null && !(elementsToRefresh.isEmpty())) {
+ Display.getDefault().asyncExec(new RefreshModelExplorerRunnable(elementsToRefresh));
+ }
+ }
+
+ /**
+ * Adds an element to the list of elements that should be refreshed, in the request.
+ *
+ * @param element
+ * Element you want to refresh
+ * @param request
+ * Request in which the information about a refresh will be added
+ */
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public static void addElementToRefresh(EObject element, IEditCommandRequest request) {
+ Object elementsToRefresh = request.getParameter(ELEMENTS_TO_REFRESH_KEY);
+ if(elementsToRefresh == null) {
+ elementsToRefresh = new HashSet<EObject>();
+ request.getParameters().put(ELEMENTS_TO_REFRESH_KEY, elementsToRefresh);
+ }
+ if(elementsToRefresh instanceof Set<?>) {
+ ((Set)elementsToRefresh).add(element);
+ }
+ }
+
+ /**
+ * Checks whether a request has elements to refresh;
+ *
+ * @param request
+ * Request in which the information about a refresh will be added
+ * @return
+ */
+ public static boolean hasElementsToRefresh(IEditCommandRequest request) {
+ Object elementsToRefresh = request.getParameter(ELEMENTS_TO_REFRESH_KEY);
+ return elementsToRefresh instanceof Set<?> && (!((Set<?>)elementsToRefresh).isEmpty());
+ }
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/security/CollabReadOnlyHandler.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/security/CollabReadOnlyHandler.java
index 66f5887..779eb449 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/security/CollabReadOnlyHandler.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/security/CollabReadOnlyHandler.java
@@ -1,95 +1,93 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.security;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-
-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.IReadOnlyHandler;
-import org.eclipse.papyrus.infra.emf.readonly.AbstractReadOnlyHandler;
-import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.LockAction;
-import org.eclipse.papyrus.team.collaborative.participants.locker.ILocker;
-import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
-
-import com.google.common.base.Optional;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-
-
-/**
- * The Class CollabReadOnlyHandler.
- * This read only handler implement {@link IReadOnlyHandler} using the collaborative framework
- */
-public class CollabReadOnlyHandler extends AbstractReadOnlyHandler {
-
- public CollabReadOnlyHandler(EditingDomain editingDomain) {
- super(editingDomain);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.readonly.IReadOnlyHandler#isReadOnly(org.eclipse.emf.common.util.URI[], org.eclipse.emf.edit.domain.EditingDomain)
- */
- @Override
- public Optional<Boolean> anyReadOnly(URI[] uris) {
- if(uris != null && uris.length > 0 && getEditingDomain() != null) {
- ArrayList<URI> urisList = Lists.newArrayList(uris);
- Collection<IExtendedURI> extendedURICollection = Collections2.transform(urisList, CollabFunctionsFactory.getURIToExtendedURIWithContainment());
- HashSet<IExtendedURI> extendURISet = Sets.newHashSet(extendedURICollection);
- ResourceSet resourceSet = getEditingDomain().getResourceSet();
- if(ICollaborativeManager.INSTANCE.isCollab(extendURISet, resourceSet)) {
- ILocker locker;
- locker = ICollaborativeManager.INSTANCE.getLocker(extendURISet, resourceSet);
- if(locker == null) {
- return Optional.absent();
- }
- for(IExtendedURI extendURI : locker.getExtendedSet()) {
- if(!locker.isLocked(extendURI).isOK()) {
- return Optional.of(true);
- }
- }
- }
- }
- return Optional.absent();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.readonly.IReadOnlyHandler#enableWrite(org.eclipse.emf.common.util.URI[], org.eclipse.emf.edit.domain.EditingDomain)
- */
- @Override
- 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();
- }
- return Optional.of(true);
- }
- return Optional.absent();
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.security;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+
+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.IReadOnlyHandler;
+import org.eclipse.papyrus.infra.emf.readonly.AbstractReadOnlyHandler;
+import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.LockAction;
+import org.eclipse.papyrus.team.collaborative.participants.locker.ILocker;
+import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
+
+import com.google.common.base.Optional;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+
+
+/**
+ * The Class CollabReadOnlyHandler.
+ * This read only handler implement {@link IReadOnlyHandler} using the collaborative framework
+ */
+public class CollabReadOnlyHandler extends AbstractReadOnlyHandler {
+
+ public CollabReadOnlyHandler(EditingDomain editingDomain) {
+ super(editingDomain);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @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) {
+ ArrayList<URI> urisList = Lists.newArrayList(uris);
+ Collection<IExtendedURI> extendedURICollection = Collections2.transform(urisList, CollabFunctionsFactory.getURIToExtendedURIWithContainment());
+ HashSet<IExtendedURI> extendURISet = Sets.newHashSet(extendedURICollection);
+ ResourceSet resourceSet = getEditingDomain().getResourceSet();
+ if(ICollaborativeManager.INSTANCE.isCollab(extendURISet, resourceSet)) {
+ ILocker locker;
+ locker = ICollaborativeManager.INSTANCE.getLocker(extendURISet, resourceSet);
+ if(locker == null) {
+ return Optional.absent();
+ }
+ for(IExtendedURI extendURI : locker.getExtendedSet()) {
+ if(!locker.isLocked(extendURI).isOK()) {
+ return Optional.of(true);
+ }
+ }
+ }
+ }
+ return Optional.absent();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @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();
+ }
+ return Optional.of(true);
+ }
+ return Optional.absent();
+ }
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/security/PreCommitReadOnlyHandler.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/security/PreCommitReadOnlyHandler.java
index 3593730..06402e1 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/security/PreCommitReadOnlyHandler.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/security/PreCommitReadOnlyHandler.java
@@ -1,141 +1,139 @@
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.security;
-
-import java.util.HashSet;
-import java.util.Set;
-import java.util.WeakHashMap;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.transaction.NotificationFilter;
-import org.eclipse.emf.transaction.ResourceSetChangeEvent;
-import org.eclipse.emf.transaction.ResourceSetListenerImpl;
-import org.eclipse.emf.transaction.RollbackException;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.infra.core.resource.IModelSetSnippet;
-import org.eclipse.papyrus.infra.core.resource.ModelSet;
-import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel;
-import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.LockAction;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.UIUtils;
-import org.eclipse.papyrus.team.collaborative.participants.locker.ILocker;
-import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
-
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Sets;
-
-
-/**
- * This model snippet will register a new {@link ResourceSetListener} that will provide a new security on modifed resources.
- * Each time a resource will be set to modified this listener will check that the resources has been locked. If the resources is not lock then it will
- * try to rollback the current transaction
- *
- * @author adaussy
- *
- */
-public class PreCommitReadOnlyHandler implements IModelSetSnippet {
-
- /**
- * This {@link ResourceSetListener} will listen each time a resource is modified to check that it has been locked or will ask for lock
- *
- * @author adaussy
- *
- */
- private static class ResourceSetListener extends ResourceSetListenerImpl {
-
- @Override
- public boolean isPostcommitOnly() {
- return false;
- }
-
- @Override
- public boolean isPrecommitOnly() {
- return true;
- }
-
- @Override
- public boolean isAggregatePrecommitListener() {
- return false;
- }
-
- /**
- * Filter only IS_MODIFIED notification
- */
- private static NotificationFilter filter = NotificationFilter.createFeatureFilter(Resource.class, Resource.RESOURCE__IS_MODIFIED);
-
- @Override
- public NotificationFilter getFilter() {
- return filter;
- }
-
-
- @Override
- public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException {
- final Set<Resource> resourceToTest = new HashSet<Resource>();
- for(Notification n : event.getNotifications()) {
- if(n.getNewBooleanValue()) {
- Resource resource = (Resource)n.getNotifier();
- //Filtered out any DI resource. Those resource are not collaborative resources
- if(!DiModel.MODEL_FILE_EXTENSION.equals(resource.getURI().fileExtension())) {
- resourceToTest.add(resource);
- }
- }
- }
- if(!resourceToTest.isEmpty()) {
- TransactionalEditingDomain editingDomain = event.getEditingDomain();
- ResourceSet resourceSet = editingDomain.getResourceSet();
- HashSet<IExtendedURI> uriToTest = Sets.newHashSet(Collections2.transform(resourceToTest, CollabFunctionsFactory.getResourceToExtendedURIWithContainment()));
- if(ICollaborativeManager.INSTANCE.isCollab(uriToTest, resourceSet)) {
- Set<IExtendedURI> uriToLock = new HashSet<IExtendedURI>();
- ILocker locker = ICollaborativeManager.INSTANCE.getLocker(uriToTest, resourceSet);
- if(locker == null) {
- return null;
- }
- for(IExtendedURI extendURI : locker.getExtendedSet()) {
- if(!locker.isLocked(extendURI).isOK()) {
- uriToLock.add(extendURI);
- }
- }
- if(!uriToLock.isEmpty()) {
- final IStatus status = LockAction.doSafeLock(resourceSet, uriToLock, true);
- if(!status.isOK()) {
- UIUtils.errorDialog(status, "Unable to lock");
- throw new RollbackException(status);
-
- }
- }
- }
- }
- return null;
- }
- }
-
- public PreCommitReadOnlyHandler() {
- }
-
-
- private WeakHashMap<EditingDomain, ResourceSetListener> link = new WeakHashMap<EditingDomain, PreCommitReadOnlyHandler.ResourceSetListener>();
-
- @Override
- public void start(ModelSet modelsManager) {
- TransactionalEditingDomain transactionalEditingDomain = modelsManager.getTransactionalEditingDomain();
- ResourceSetListener listener = new ResourceSetListener();
- link.put(transactionalEditingDomain, listener);
- transactionalEditingDomain.addResourceSetListener(listener);
-
- }
-
- @Override
- public void dispose(ModelSet modelsManager) {
- TransactionalEditingDomain transactionalEditingDomain = modelsManager.getTransactionalEditingDomain();
- transactionalEditingDomain.removeResourceSetListener(link.get(transactionalEditingDomain));
-
- }
-
-
-
-}
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.security;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.WeakHashMap;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.NotificationFilter;
+import org.eclipse.emf.transaction.ResourceSetChangeEvent;
+import org.eclipse.emf.transaction.ResourceSetListenerImpl;
+import org.eclipse.emf.transaction.RollbackException;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.core.resource.IModelSetSnippet;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel;
+import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.LockAction;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.UIUtils;
+import org.eclipse.papyrus.team.collaborative.participants.locker.ILocker;
+import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
+
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Sets;
+
+
+/**
+ * This model snippet will register a new {@link ResourceSetListener} that will provide a new security on modifed resources.
+ * Each time a resource will be set to modified this listener will check that the resources has been locked. If the resources is not lock then it will
+ * try to rollback the current transaction
+ *
+ * @author adaussy
+ *
+ */
+public class PreCommitReadOnlyHandler implements IModelSetSnippet {
+
+ /**
+ * This {@link ResourceSetListener} will listen each time a resource is modified to check that it has been locked or will ask for lock
+ *
+ * @author adaussy
+ *
+ */
+ private static class ResourceSetListener extends ResourceSetListenerImpl {
+
+ @Override
+ public boolean isPostcommitOnly() {
+ return false;
+ }
+
+ @Override
+ public boolean isPrecommitOnly() {
+ return true;
+ }
+
+ @Override
+ public boolean isAggregatePrecommitListener() {
+ return false;
+ }
+
+ /**
+ * Filter only IS_MODIFIED notification
+ */
+ private static NotificationFilter filter = NotificationFilter.createFeatureFilter(Resource.class, Resource.RESOURCE__IS_MODIFIED);
+
+ @Override
+ public NotificationFilter getFilter() {
+ return filter;
+ }
+
+
+ @Override
+ public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException {
+ final Set<Resource> resourceToTest = new HashSet<Resource>();
+ for(Notification n : event.getNotifications()) {
+ if(n.getNewBooleanValue()) {
+ Resource resource = (Resource)n.getNotifier();
+ //Filtered out any DI resource. Those resource are not collaborative resources
+ if(!DiModel.MODEL_FILE_EXTENSION.equals(resource.getURI().fileExtension())) {
+ resourceToTest.add(resource);
+ }
+ }
+ }
+ if(!resourceToTest.isEmpty()) {
+ TransactionalEditingDomain editingDomain = event.getEditingDomain();
+ ResourceSet resourceSet = editingDomain.getResourceSet();
+ HashSet<IExtendedURI> uriToTest = Sets.newHashSet(Collections2.transform(resourceToTest, CollabFunctionsFactory.getResourceToExtendedURIWithContainment()));
+ if(ICollaborativeManager.INSTANCE.isCollab(uriToTest, resourceSet)) {
+ Set<IExtendedURI> uriToLock = new HashSet<IExtendedURI>();
+ ILocker locker = ICollaborativeManager.INSTANCE.getLocker(uriToTest, resourceSet);
+ if(locker == null) {
+ return null;
+ }
+ for(IExtendedURI extendURI : locker.getExtendedSet()) {
+ if(!locker.isLocked(extendURI).isOK()) {
+ uriToLock.add(extendURI);
+ }
+ }
+ if(!uriToLock.isEmpty()) {
+ final IStatus status = LockAction.doSafeLock(resourceSet, uriToLock, true);
+ if(!status.isOK()) {
+ UIUtils.errorDialog(status, "Unable to lock");
+ throw new RollbackException(status);
+
+ }
+ }
+ }
+ }
+ return null;
+ }
+ }
+
+ public PreCommitReadOnlyHandler() {
+ }
+
+
+ private WeakHashMap<EditingDomain, ResourceSetListener> link = new WeakHashMap<EditingDomain, PreCommitReadOnlyHandler.ResourceSetListener>();
+
+ public void start(ModelSet modelsManager) {
+ TransactionalEditingDomain transactionalEditingDomain = modelsManager.getTransactionalEditingDomain();
+ ResourceSetListener listener = new ResourceSetListener();
+ link.put(transactionalEditingDomain, listener);
+ transactionalEditingDomain.addResourceSetListener(listener);
+
+ }
+
+ public void dispose(ModelSet modelsManager) {
+ TransactionalEditingDomain transactionalEditingDomain = modelsManager.getTransactionalEditingDomain();
+ transactionalEditingDomain.removeResourceSetListener(link.get(transactionalEditingDomain));
+
+ }
+
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/stategies/PapyrusCurrentResource.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/stategies/PapyrusCurrentResource.java
index b59c189..50035ce 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/stategies/PapyrusCurrentResource.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/stategies/PapyrusCurrentResource.java
@@ -1,61 +1,60 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.stategies;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
-import org.eclipse.papyrus.team.collaborative.utils.ModelsUtil;
-
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Sets;
-
-
-/**
- * Strategy that will lock the current triplet resource of the selection (uml,di,notation).
- *
- * @author adaussy
- */
-public class PapyrusCurrentResource extends AbstractResourceBaseStrategy {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.team.collaborative.strategy.ILockingStrategy#getBusinessObject(java.util.Collection)
- */
- @Override
- public Set<IExtendedURI> getBusinessObject(Collection<EObject> eOjbects) {
- if(!eOjbects.isEmpty()) {
- ResourceSet ressourceSet = eOjbects.iterator().next().eResource().getResourceSet();
- Collection<URI> uris = new HashSet<URI>();
- for(EObject o : ModelsUtil.getRoots(eOjbects)) {
- URI uri = o.eResource().getURI();
- if(!uris.contains(uri)) {
- uris.add(uri);
- addExtraResources(ressourceSet, uris, uri);
- }
- }
- return Sets.newHashSet(Collections2.transform(uris, CollabFunctionsFactory.getURIToExtendedURI()));
- }
- return Collections.emptySet();
- }
-
-
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.stategies;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
+import org.eclipse.papyrus.team.collaborative.utils.ModelsUtil;
+
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Sets;
+
+
+/**
+ * Strategy that will lock the current triplet resource of the selection (uml,di,notation).
+ *
+ * @author adaussy
+ */
+public class PapyrusCurrentResource extends AbstractResourceBaseStrategy {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.team.collaborative.strategy.ILockingStrategy#getBusinessObject(java.util.Collection)
+ */
+ public Set<IExtendedURI> getBusinessObject(Collection<EObject> eOjbects) {
+ if(!eOjbects.isEmpty()) {
+ ResourceSet ressourceSet = eOjbects.iterator().next().eResource().getResourceSet();
+ Collection<URI> uris = new HashSet<URI>();
+ for(EObject o : ModelsUtil.getRoots(eOjbects)) {
+ URI uri = o.eResource().getURI();
+ if(!uris.contains(uri)) {
+ uris.add(uri);
+ addExtraResources(ressourceSet, uris, uri);
+ }
+ }
+ return Sets.newHashSet(Collections2.transform(uris, CollabFunctionsFactory.getURIToExtendedURI()));
+ }
+ return Collections.emptySet();
+ }
+
+
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/stategies/PapyrusSelectionAllContent.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/stategies/PapyrusSelectionAllContent.java
index 2fee22d..8047be7 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/stategies/PapyrusSelectionAllContent.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/stategies/PapyrusSelectionAllContent.java
@@ -1,83 +1,81 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.stategies;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
-import org.eclipse.papyrus.team.collaborative.utils.ModelsUtil;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Sets;
-
-
-/**
- * Locking strategy that will lock all resources which contains element contained by the selection.
- *
- * @author adaussy
- */
-public class PapyrusSelectionAllContent extends AbstractResourceBaseStrategy {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.team.collaborative.strategy.ILockingStrategy#getBusinessObject(java.util.Collection)
- */
- @Override
- public Set<IExtendedURI> getBusinessObject(Collection<EObject> eOjbects) {
- if(!eOjbects.isEmpty()) {
- ResourceSet ressourceSet = eOjbects.iterator().next().eResource().getResourceSet();
- Collection<URI> uris = new HashSet<URI>();
- for(EObject o : ModelsUtil.getRoots(eOjbects)) {
- URI uri = o.eResource().getURI();
- if(!uris.contains(uri)) {
- uris.add(uri);
- addExtraResources(ressourceSet, uris, uri);
- }
- Predicate<Resource> semanticResourcePredicate = new Predicate<Resource>() {
-
- @Override
- public boolean apply(Resource input) {
- return "uml".equals(input.getURI().fileExtension());
- }
- };
- //Add all resource that contains at least one descendant of a selected resource
- for(Resource r : Collections2.filter(ressourceSet.getResources(), semanticResourcePredicate)) {
- for(EObject potentialDescedant : r.getContents()) {
- if(EcoreUtil.isAncestor(o, potentialDescedant)) {
- URI childResourceURI = r.getURI();
- if(!uris.contains(childResourceURI)) {
- uris.add(childResourceURI);
- addExtraResources(ressourceSet, uris, childResourceURI);
- continue;
- }
- }
- }
- }
- }
- return Sets.newHashSet(Collections2.transform(uris, CollabFunctionsFactory.getURIToExtendedURIWithContainment()));
- }
- return Collections.emptySet();
- }
-
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.stategies;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
+import org.eclipse.papyrus.team.collaborative.utils.ModelsUtil;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Sets;
+
+
+/**
+ * Locking strategy that will lock all resources which contains element contained by the selection.
+ *
+ * @author adaussy
+ */
+public class PapyrusSelectionAllContent extends AbstractResourceBaseStrategy {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.team.collaborative.strategy.ILockingStrategy#getBusinessObject(java.util.Collection)
+ */
+ public Set<IExtendedURI> getBusinessObject(Collection<EObject> eOjbects) {
+ if(!eOjbects.isEmpty()) {
+ ResourceSet ressourceSet = eOjbects.iterator().next().eResource().getResourceSet();
+ Collection<URI> uris = new HashSet<URI>();
+ for(EObject o : ModelsUtil.getRoots(eOjbects)) {
+ URI uri = o.eResource().getURI();
+ if(!uris.contains(uri)) {
+ uris.add(uri);
+ addExtraResources(ressourceSet, uris, uri);
+ }
+ Predicate<Resource> semanticResourcePredicate = new Predicate<Resource>() {
+
+ public boolean apply(Resource input) {
+ return "uml".equals(input.getURI().fileExtension());
+ }
+ };
+ //Add all resource that contains at least one descendant of a selected resource
+ for(Resource r : Collections2.filter(ressourceSet.getResources(), semanticResourcePredicate)) {
+ for(EObject potentialDescedant : r.getContents()) {
+ if(EcoreUtil.isAncestor(o, potentialDescedant)) {
+ URI childResourceURI = r.getURI();
+ if(!uris.contains(childResourceURI)) {
+ uris.add(childResourceURI);
+ addExtraResources(ressourceSet, uris, childResourceURI);
+ continue;
+ }
+ }
+ }
+ }
+ }
+ return Sets.newHashSet(Collections2.transform(uris, CollabFunctionsFactory.getURIToExtendedURIWithContainment()));
+ }
+ return Collections.emptySet();
+ }
+
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/CommitHandler.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/CommitHandler.java
index 16beed3..fb76a3b 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/CommitHandler.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/CommitHandler.java
@@ -1,154 +1,153 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.papyrus.team.collaborative.ExtendedURI;
-import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.MatchingURIObject;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.ICollabColors;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs.CommitDialog;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs.PreviewDialog;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.providers.ExtensivePartitionNameLabelProvider;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.UIUtils;
-import org.eclipse.papyrus.team.collaborative.participants.version.ICommitter;
-import org.eclipse.papyrus.team.collaborative.reports.CollabStatus;
-import org.eclipse.swt.widgets.Display;
-
-
-/**
- * Handler use to deal with Commit action
- * The commit action will be performed on all the current model
- *
- * @author adaussy
- */
-public class CommitHandler extends AbstractCollabHandler {
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- //Check that everything is commit
- if(!UIUtils.saveAllDirtyEditor().isOK()) {
- return null;
- }
- ResourceSet resourceSet = getResourceSet();
- if(resourceSet == null) {
- UIUtils.errorDialog(CollabStatus.createErrorStatus("unable to retreive the resource set"), "Collaboratibe error");
- return null;
- }
- Set<IExtendedURI> uris = new HashSet<IExtendedURI>();
- for(Resource r : resourceSet.getResources()) {
- IFile file = WorkspaceSynchronizer.getFile(r);
- if(file != null && file.exists()) {
- uris.add(new ExtendedURI(r.getURI()));
- }
- }
- IStatus status = doCommit(uris, resourceSet, true, null);
- if(!status.isOK() && status.getCode() == Status.ERROR) {
- UIUtils.errorDialog(status, "Error");
- }
- return null;
-
-
- }
-
- /**
- * Do commit action
- *
- * @param uris
- * the uris to commit
- * @param resourceSet
- * the resource set
- * @param isPreview
- * Set to true if the used to be given preview
- * @param message
- * the message used for the commit operation
- * @return the {@link IStatus} of the operation
- */
- public static IStatus doCommit(Set<IExtendedURI> uris, ResourceSet resourceSet, boolean isPreview, String message) {
- ICommitter committer = ICollaborativeManager.INSTANCE.getCommitter(uris, resourceSet);
- if(committer == null) {
- return CollabStatus.createErrorStatus("Unable to get a ICommitter for uris\n" + uris);
- }
- Set<IExtendedURI> toBeCommitted = committer.getExtendedSet();
- IStatus status = doCommitFromBuilder(resourceSet, committer, toBeCommitted, isPreview, message);
- if(!status.isOK()) {
- return status;
- }
- return Status.OK_STATUS;
-
- }
-
- /**
- * Do commit from builder using a already created {@link ICommitter}
- *
- * @param resourceSet
- * the resource set
- * @param committer
- * the {@link ICommitter} to use
- * @param toBeCommitted
- * {@link IExtendedURI} of what is about to be committed
- * @param isPreview
- * Set to true if the user has to be given preview
- * @param message
- * the message
- * @return the i status
- * @throws CollabException
- * the collab exception
- */
- public static IStatus doCommitFromBuilder(ResourceSet resourceSet, ICommitter committer, Set<IExtendedURI> toBeCommitted, boolean isPreview, String message) {
- if(isPreview || message == null) {
- ExtensivePartitionNameLabelProvider labelProvider = new ExtensivePartitionNameLabelProvider(new MatchingURIObject(toBeCommitted),UIUtils.getModelExplorerLavelProvider());
- labelProvider.setColor(ICollabColors.COMMIT_COLLOR);
- CommitDialog commitDialog = new CommitDialog(Display.getDefault().getActiveShell(), labelProvider, "Commit Dialog", "Element in red will be committed");
- Collection<EObject> objectsToReveal = UIUtils.getLeafSemanticElement(toBeCommitted, resourceSet);
- if(objectsToReveal != null && !objectsToReveal.isEmpty()) {
- commitDialog.setObjectsToReveal(objectsToReveal);
- }
- if(commitDialog.open() == PreviewDialog.OK) {
- message = commitDialog.getCommitMessage();
- } else {
- return Status.CANCEL_STATUS;
- }
- }
-
- //Keep lock force to true. This shall be improve later
- IStatus commitStatus = committer.commit(message, true);
- UIUtils.refreshModelExplorer(toBeCommitted, resourceSet);
- if(!commitStatus.isOK()) {
- return commitStatus;
- }
- return Status.OK_STATUS;
- }
-
-
-
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.papyrus.team.collaborative.ExtendedURI;
+import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.MatchingURIObject;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.ICollabColors;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs.CommitDialog;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs.PreviewDialog;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.providers.ExtensivePartitionNameLabelProvider;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.UIUtils;
+import org.eclipse.papyrus.team.collaborative.participants.version.ICommitter;
+import org.eclipse.papyrus.team.collaborative.reports.CollabStatus;
+import org.eclipse.swt.widgets.Display;
+
+
+/**
+ * Handler use to deal with Commit action
+ * The commit action will be performed on all the current model
+ *
+ * @author adaussy
+ */
+public class CommitHandler extends AbstractCollabHandler {
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ //Check that everything is commit
+ if(!UIUtils.saveAllDirtyEditor().isOK()) {
+ return null;
+ }
+ ResourceSet resourceSet = getResourceSet();
+ if(resourceSet == null) {
+ UIUtils.errorDialog(CollabStatus.createErrorStatus("unable to retreive the resource set"), "Collaboratibe error");
+ return null;
+ }
+ Set<IExtendedURI> uris = new HashSet<IExtendedURI>();
+ for(Resource r : resourceSet.getResources()) {
+ IFile file = WorkspaceSynchronizer.getFile(r);
+ if(file != null && file.exists()) {
+ uris.add(new ExtendedURI(r.getURI()));
+ }
+ }
+ IStatus status = doCommit(uris, resourceSet, true, null);
+ if(!status.isOK() && status.getCode() == Status.ERROR) {
+ UIUtils.errorDialog(status, "Error");
+ }
+ return null;
+
+
+ }
+
+ /**
+ * Do commit action
+ *
+ * @param uris
+ * the uris to commit
+ * @param resourceSet
+ * the resource set
+ * @param isPreview
+ * Set to true if the used to be given preview
+ * @param message
+ * the message used for the commit operation
+ * @return the {@link IStatus} of the operation
+ */
+ public static IStatus doCommit(Set<IExtendedURI> uris, ResourceSet resourceSet, boolean isPreview, String message) {
+ ICommitter committer = ICollaborativeManager.INSTANCE.getCommitter(uris, resourceSet);
+ if(committer == null) {
+ return CollabStatus.createErrorStatus("Unable to get a ICommitter for uris\n" + uris);
+ }
+ Set<IExtendedURI> toBeCommitted = committer.getExtendedSet();
+ IStatus status = doCommitFromBuilder(resourceSet, committer, toBeCommitted, isPreview, message);
+ if(!status.isOK()) {
+ return status;
+ }
+ return Status.OK_STATUS;
+
+ }
+
+ /**
+ * Do commit from builder using a already created {@link ICommitter}
+ *
+ * @param resourceSet
+ * the resource set
+ * @param committer
+ * the {@link ICommitter} to use
+ * @param toBeCommitted
+ * {@link IExtendedURI} of what is about to be committed
+ * @param isPreview
+ * Set to true if the user has to be given preview
+ * @param message
+ * the message
+ * @return the i status
+ * @throws CollabException
+ * the collab exception
+ */
+ public static IStatus doCommitFromBuilder(ResourceSet resourceSet, ICommitter committer, Set<IExtendedURI> toBeCommitted, boolean isPreview, String message) {
+ if(isPreview || message == null) {
+ ExtensivePartitionNameLabelProvider labelProvider = new ExtensivePartitionNameLabelProvider(new MatchingURIObject(toBeCommitted),UIUtils.getModelExplorerLavelProvider());
+ labelProvider.setColor(ICollabColors.COMMIT_COLLOR);
+ CommitDialog commitDialog = new CommitDialog(Display.getDefault().getActiveShell(), labelProvider, "Commit Dialog", "Element in red will be committed");
+ Collection<EObject> objectsToReveal = UIUtils.getLeafSemanticElement(toBeCommitted, resourceSet);
+ if(objectsToReveal != null && !objectsToReveal.isEmpty()) {
+ commitDialog.setObjectsToReveal(objectsToReveal);
+ }
+ if(commitDialog.open() == PreviewDialog.OK) {
+ message = commitDialog.getCommitMessage();
+ } else {
+ return Status.CANCEL_STATUS;
+ }
+ }
+
+ //Keep lock force to true. This shall be improve later
+ IStatus commitStatus = committer.commit(message, true);
+ UIUtils.refreshModelExplorer(toBeCommitted, resourceSet);
+ if(!commitStatus.isOK()) {
+ return commitStatus;
+ }
+ return Status.OK_STATUS;
+ }
+
+
+
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/RevertHandler.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/RevertHandler.java
index 483aeb4..eafbde2 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/RevertHandler.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/RevertHandler.java
@@ -1,140 +1,139 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.papyrus.team.collaborative.ExtendedURI;
-import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.MatchingURIObject;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.ICollabColors;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs.PreviewDialog;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.providers.ExtensivePartitionNameLabelProvider;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.UIUtils;
-import org.eclipse.papyrus.team.collaborative.participants.version.IReverter;
-import org.eclipse.papyrus.team.collaborative.reports.CollabStatus;
-import org.eclipse.swt.widgets.Display;
-
-
-// TODO: Auto-generated Javadoc
-/**
- * Handler use for Revert action
- * The revert action will be performe on all the current model.
- *
- * @author adaussy
- */
-public class RevertHandler extends AbstractCollabHandler {
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- //Check that everything is commit
- if(!UIUtils.saveAllDirtyEditor().isOK()) {
- return null;
- }
- ResourceSet resourceSet = getResourceSet();
- if(resourceSet == null) {
- UIUtils.errorDialog(CollabStatus.createErrorStatus("unable to retreive the resource set"), "Collaboratibe error");
- return null;
- }
- Set<IExtendedURI> uris = new HashSet<IExtendedURI>();
- for(Resource r : resourceSet.getResources()) {
- IFile file = WorkspaceSynchronizer.getFile(r);
- if(file != null && file.exists()) {
- uris.add(new ExtendedURI(r.getURI()));
- }
- }
- IStatus status = doRevert(uris, resourceSet);
- if(!status.isOK() && status.getCode() == Status.ERROR) {
- UIUtils.errorDialog(status, "Error");
- }
-
- return null;
-
- }
-
- /**
- * Do revert action
- *
- * @param uris
- * the uris about to be reverted
- * @param resourceSet
- * the resource set
- * @return the {@link IStatus} of the operation
- * @throws CollabException
- * the collab exception
- */
- public static IStatus doRevert(Set<IExtendedURI> uris, ResourceSet resourceSet) {
-
- IReverter reverter = ICollaborativeManager.INSTANCE.getReverter(uris, resourceSet);
- if(reverter == null) {
- CollabStatus errorStatus = CollabStatus.createErrorStatus("Unable to find a reverter");
- return errorStatus;
- }
-
- Set<IExtendedURI> toBeCommitted = reverter.getExtendedSet();
- IStatus status = doRevertFromBuilder(resourceSet, reverter, toBeCommitted);
- return status;
-
- }
-
- /**
- * Do revert using an existing {@link IReverter}s
- *
- * @param resourceSet
- * the resource set
- * @param reverter
- * the reverter
- * @param toBeReverted
- * the {@link IExtendedURI} about to be reverted
- * @return the {@link IStatus} of the operation
- * @throws CollabException
- * the collab exception
- */
- public static IStatus doRevertFromBuilder(ResourceSet resourceSet, IReverter reverter, Set<IExtendedURI> toBeReverted) {
- ExtensivePartitionNameLabelProvider labelProvider = new ExtensivePartitionNameLabelProvider(new MatchingURIObject(toBeReverted),UIUtils.getModelExplorerLavelProvider());
- labelProvider.setColor(ICollabColors.REVERT_COLLOR);
- PreviewDialog revertDialog = new PreviewDialog(Display.getDefault().getActiveShell(), labelProvider, "Revert Dialog", "Element in yellow will be reverted");
- Collection<EObject> objectsToReveal = UIUtils.getLeafSemanticElement(toBeReverted, resourceSet);
- if(objectsToReveal != null && !objectsToReveal.isEmpty()) {
- revertDialog.setObjectsToReveal(objectsToReveal);
- }
- if(revertDialog.open() == PreviewDialog.OK) {
-
- //Keep lock force to true. This shall be improve later
- IStatus commitStatus = reverter.revert();
- UIUtils.refreshModelExplorer(toBeReverted, resourceSet);
- UIUtils.reloadEditor();
- return commitStatus;
- } else {
- return Status.CANCEL_STATUS;
- }
- }
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.papyrus.team.collaborative.ExtendedURI;
+import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.MatchingURIObject;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.ICollabColors;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs.PreviewDialog;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.providers.ExtensivePartitionNameLabelProvider;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.UIUtils;
+import org.eclipse.papyrus.team.collaborative.participants.version.IReverter;
+import org.eclipse.papyrus.team.collaborative.reports.CollabStatus;
+import org.eclipse.swt.widgets.Display;
+
+
+// TODO: Auto-generated Javadoc
+/**
+ * Handler use for Revert action
+ * The revert action will be performe on all the current model.
+ *
+ * @author adaussy
+ */
+public class RevertHandler extends AbstractCollabHandler {
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ //Check that everything is commit
+ if(!UIUtils.saveAllDirtyEditor().isOK()) {
+ return null;
+ }
+ ResourceSet resourceSet = getResourceSet();
+ if(resourceSet == null) {
+ UIUtils.errorDialog(CollabStatus.createErrorStatus("unable to retreive the resource set"), "Collaboratibe error");
+ return null;
+ }
+ Set<IExtendedURI> uris = new HashSet<IExtendedURI>();
+ for(Resource r : resourceSet.getResources()) {
+ IFile file = WorkspaceSynchronizer.getFile(r);
+ if(file != null && file.exists()) {
+ uris.add(new ExtendedURI(r.getURI()));
+ }
+ }
+ IStatus status = doRevert(uris, resourceSet);
+ if(!status.isOK() && status.getCode() == Status.ERROR) {
+ UIUtils.errorDialog(status, "Error");
+ }
+
+ return null;
+
+ }
+
+ /**
+ * Do revert action
+ *
+ * @param uris
+ * the uris about to be reverted
+ * @param resourceSet
+ * the resource set
+ * @return the {@link IStatus} of the operation
+ * @throws CollabException
+ * the collab exception
+ */
+ public static IStatus doRevert(Set<IExtendedURI> uris, ResourceSet resourceSet) {
+
+ IReverter reverter = ICollaborativeManager.INSTANCE.getReverter(uris, resourceSet);
+ if(reverter == null) {
+ CollabStatus errorStatus = CollabStatus.createErrorStatus("Unable to find a reverter");
+ return errorStatus;
+ }
+
+ Set<IExtendedURI> toBeCommitted = reverter.getExtendedSet();
+ IStatus status = doRevertFromBuilder(resourceSet, reverter, toBeCommitted);
+ return status;
+
+ }
+
+ /**
+ * Do revert using an existing {@link IReverter}s
+ *
+ * @param resourceSet
+ * the resource set
+ * @param reverter
+ * the reverter
+ * @param toBeReverted
+ * the {@link IExtendedURI} about to be reverted
+ * @return the {@link IStatus} of the operation
+ * @throws CollabException
+ * the collab exception
+ */
+ public static IStatus doRevertFromBuilder(ResourceSet resourceSet, IReverter reverter, Set<IExtendedURI> toBeReverted) {
+ ExtensivePartitionNameLabelProvider labelProvider = new ExtensivePartitionNameLabelProvider(new MatchingURIObject(toBeReverted),UIUtils.getModelExplorerLavelProvider());
+ labelProvider.setColor(ICollabColors.REVERT_COLLOR);
+ PreviewDialog revertDialog = new PreviewDialog(Display.getDefault().getActiveShell(), labelProvider, "Revert Dialog", "Element in yellow will be reverted");
+ Collection<EObject> objectsToReveal = UIUtils.getLeafSemanticElement(toBeReverted, resourceSet);
+ if(objectsToReveal != null && !objectsToReveal.isEmpty()) {
+ revertDialog.setObjectsToReveal(objectsToReveal);
+ }
+ if(revertDialog.open() == PreviewDialog.OK) {
+
+ //Keep lock force to true. This shall be improve later
+ IStatus commitStatus = reverter.revert();
+ UIUtils.refreshModelExplorer(toBeReverted, resourceSet);
+ UIUtils.reloadEditor();
+ return commitStatus;
+ } else {
+ return Status.CANCEL_STATUS;
+ }
+ }
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/UpdateHandler.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/UpdateHandler.java
index 71639d3..c658e0c 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/UpdateHandler.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/actions/UpdateHandler.java
@@ -1,122 +1,121 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.papyrus.team.collaborative.ExtendedURI;
-import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.MatchingURIObject;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.ICollabColors;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs.PreviewDialog;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.providers.ExtensivePartitionNameLabelProvider;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.UIUtils;
-import org.eclipse.papyrus.team.collaborative.participants.version.IUpdater;
-import org.eclipse.papyrus.team.collaborative.reports.CollabStatus;
-import org.eclipse.swt.widgets.Display;
-
-
-/**
- * Handler for Update action in Papyrus
- * The update will be performed in all the current model
- */
-public class UpdateHandler extends AbstractCollabHandler {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- if(!UIUtils.saveAllDirtyEditor().isOK()) {
- return null;
- }
- ResourceSet resourceSet = getResourceSet();
- if(resourceSet == null) {
- UIUtils.errorDialog(CollabStatus.createErrorStatus("unable to retreive the resource set"), "Collaboratibe error");
- return null;
- }
- Set<IExtendedURI> uris = new HashSet<IExtendedURI>();
- for(Resource r : resourceSet.getResources()) {
- IFile file = WorkspaceSynchronizer.getFile(r);
- if(file != null && file.exists()) {
- uris.add(new ExtendedURI(r.getURI()));
- }
- }
- IStatus status = doUpdate(uris, resourceSet, true);
- if(!status.isOK()) {
- UIUtils.errorDialog(status, "Error");
- }
- return null;
-
- }
-
- /**
- * Do update action
- *
- * @param uris
- * the {@link IExtendedURI} to update
- * @param resourceSet
- * the resource set
- * @throws CollabException
- * the collab exception
- */
- public static IStatus doUpdate(Set<IExtendedURI> uris, ResourceSet resourceSet, boolean preview) {
- IUpdater updater = ICollaborativeManager.INSTANCE.getUpdater(uris, resourceSet);
- if(updater == null) {
- return CollabStatus.createErrorStatus("Unable to find an Updater for: \n" + uris);
- }
- return doUpdateFromUpdater(resourceSet, updater, preview);
-
- }
-
- public static IStatus doUpdateFromUpdater(ResourceSet resourceSet, IUpdater updater, boolean preview) {
- Set<IExtendedURI> toUpdate = updater.getExtendedSet();
- if(!toUpdate.isEmpty()) {
- if(preview) {
- ExtensivePartitionNameLabelProvider labelProvider = new ExtensivePartitionNameLabelProvider(new MatchingURIObject(toUpdate),UIUtils.getModelExplorerLavelProvider());
- labelProvider.setColor(ICollabColors.UPDATE_COLLOR);
- PreviewDialog previewDialog = new PreviewDialog(Display.getDefault().getActiveShell(), labelProvider, "Update Preview", "Element in light green will be updated");
- Collection<EObject> objectsToReveal = UIUtils.getLeafSemanticElement(toUpdate, resourceSet);
- if(objectsToReveal != null && !objectsToReveal.isEmpty()) {
- previewDialog.setObjectsToReveal(objectsToReveal);
- }
- if(previewDialog.open() != PreviewDialog.OK) {
- return CollabStatus.createErrorStatus("Canceled by user");
- }
- }
- IStatus updateStatus = updater.update();
- UIUtils.reloadEditor();
- return updateStatus;
- } else {
- MessageDialog.openInformation(Display.getDefault().getActiveShell(), "Nothing to do", "Nothing to update");
- return Status.OK_STATUS;
- }
- }
-
-
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.papyrus.team.collaborative.ExtendedURI;
+import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.MatchingURIObject;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.ICollabColors;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs.PreviewDialog;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.providers.ExtensivePartitionNameLabelProvider;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.UIUtils;
+import org.eclipse.papyrus.team.collaborative.participants.version.IUpdater;
+import org.eclipse.papyrus.team.collaborative.reports.CollabStatus;
+import org.eclipse.swt.widgets.Display;
+
+
+/**
+ * Handler for Update action in Papyrus
+ * The update will be performed in all the current model
+ */
+public class UpdateHandler extends AbstractCollabHandler {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ if(!UIUtils.saveAllDirtyEditor().isOK()) {
+ return null;
+ }
+ ResourceSet resourceSet = getResourceSet();
+ if(resourceSet == null) {
+ UIUtils.errorDialog(CollabStatus.createErrorStatus("unable to retreive the resource set"), "Collaboratibe error");
+ return null;
+ }
+ Set<IExtendedURI> uris = new HashSet<IExtendedURI>();
+ for(Resource r : resourceSet.getResources()) {
+ IFile file = WorkspaceSynchronizer.getFile(r);
+ if(file != null && file.exists()) {
+ uris.add(new ExtendedURI(r.getURI()));
+ }
+ }
+ IStatus status = doUpdate(uris, resourceSet, true);
+ if(!status.isOK()) {
+ UIUtils.errorDialog(status, "Error");
+ }
+ return null;
+
+ }
+
+ /**
+ * Do update action
+ *
+ * @param uris
+ * the {@link IExtendedURI} to update
+ * @param resourceSet
+ * the resource set
+ * @throws CollabException
+ * the collab exception
+ */
+ public static IStatus doUpdate(Set<IExtendedURI> uris, ResourceSet resourceSet, boolean preview) {
+ IUpdater updater = ICollaborativeManager.INSTANCE.getUpdater(uris, resourceSet);
+ if(updater == null) {
+ return CollabStatus.createErrorStatus("Unable to find an Updater for: \n" + uris);
+ }
+ return doUpdateFromUpdater(resourceSet, updater, preview);
+
+ }
+
+ public static IStatus doUpdateFromUpdater(ResourceSet resourceSet, IUpdater updater, boolean preview) {
+ Set<IExtendedURI> toUpdate = updater.getExtendedSet();
+ if(!toUpdate.isEmpty()) {
+ if(preview) {
+ ExtensivePartitionNameLabelProvider labelProvider = new ExtensivePartitionNameLabelProvider(new MatchingURIObject(toUpdate),UIUtils.getModelExplorerLavelProvider());
+ labelProvider.setColor(ICollabColors.UPDATE_COLLOR);
+ PreviewDialog previewDialog = new PreviewDialog(Display.getDefault().getActiveShell(), labelProvider, "Update Preview", "Element in light green will be updated");
+ Collection<EObject> objectsToReveal = UIUtils.getLeafSemanticElement(toUpdate, resourceSet);
+ if(objectsToReveal != null && !objectsToReveal.isEmpty()) {
+ previewDialog.setObjectsToReveal(objectsToReveal);
+ }
+ if(previewDialog.open() != PreviewDialog.OK) {
+ return CollabStatus.createErrorStatus("Canceled by user");
+ }
+ }
+ IStatus updateStatus = updater.update();
+ UIUtils.reloadEditor();
+ return updateStatus;
+ } else {
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(), "Nothing to do", "Nothing to update");
+ return Status.OK_STATUS;
+ }
+ }
+
+
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/dialogs/CommitDialog.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/dialogs/CommitDialog.java
index 3f9a5d0..18d5bdf 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/dialogs/CommitDialog.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/dialogs/CommitDialog.java
@@ -1,135 +1,134 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-
-/**
- * Dialog used to gather inforamtion before commit
- */
-public class CommitDialog extends PreviewDialog {
-
- /** The toolkit. */
- private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
-
- /** The message value text. */
- private Text messageValueText;
-
- /**
- * Instantiates a new commit dialog.
- *
- * @param parentShell
- * the parent shell
- * @param labelProvider
- * the label provider
- * @param title
- * the title
- * @param message
- * the message
- */
- public CommitDialog(Shell parentShell, ILabelProvider labelProvider, String title, String message) {
- super(parentShell, labelProvider, title, message);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs.PreviewDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- Control result = super.createDialogArea(parent);
- commitComposite((Composite)result, SWT.BORDER);
- return result;
-
- }
-
- /** The message. */
- protected String message = "";
-
- /** The keep lock. */
- protected boolean keepLock = false;
-
- /**
- * Commit composite.
- *
- * @param parent
- * the parent
- * @param style
- * the style
- * @return the composite
- */
- public Composite commitComposite(Composite parent, int style) {
- Composite commitComposite = new Composite(parent, style);
- commitComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- toolkit.adapt(commitComposite);
- toolkit.paintBordersFor(commitComposite);
- commitComposite.setLayout(new GridLayout(1, false));
-
- Label lblMessage = new Label(commitComposite, SWT.NONE);
- toolkit.adapt(lblMessage, true, true);
- lblMessage.setText("Message:");
-
- messageValueText = new Text(commitComposite, SWT.BORDER);
- messageValueText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- messageValueText.addModifyListener(new ModifyListener() {
-
- @Override
- public void modifyText(ModifyEvent e) {
- message = messageValueText.getMessage();
-
- }
- });
- toolkit.adapt(messageValueText, true, true);
-
- Composite composite = new Composite(commitComposite, SWT.NONE);
- toolkit.adapt(composite);
- toolkit.paintBordersFor(composite);
- composite.setLayout(new GridLayout(1, false));
- return commitComposite;
- }
-
-
- /**
- * Gets the commit message.
- *
- * @return the commit message
- */
- public String getCommitMessage() {
- return message;
- }
-
-
- /**
- * Checks if is keep lock.
- *
- * @return true, if is keep lock
- */
- public boolean isKeepLock() {
- return keepLock;
- }
-
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+
+/**
+ * Dialog used to gather inforamtion before commit
+ */
+public class CommitDialog extends PreviewDialog {
+
+ /** The toolkit. */
+ private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+
+ /** The message value text. */
+ private Text messageValueText;
+
+ /**
+ * Instantiates a new commit dialog.
+ *
+ * @param parentShell
+ * the parent shell
+ * @param labelProvider
+ * the label provider
+ * @param title
+ * the title
+ * @param message
+ * the message
+ */
+ public CommitDialog(Shell parentShell, ILabelProvider labelProvider, String title, String message) {
+ super(parentShell, labelProvider, title, message);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs.PreviewDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Control result = super.createDialogArea(parent);
+ commitComposite((Composite)result, SWT.BORDER);
+ return result;
+
+ }
+
+ /** The message. */
+ protected String message = "";
+
+ /** The keep lock. */
+ protected boolean keepLock = false;
+
+ /**
+ * Commit composite.
+ *
+ * @param parent
+ * the parent
+ * @param style
+ * the style
+ * @return the composite
+ */
+ public Composite commitComposite(Composite parent, int style) {
+ Composite commitComposite = new Composite(parent, style);
+ commitComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ toolkit.adapt(commitComposite);
+ toolkit.paintBordersFor(commitComposite);
+ commitComposite.setLayout(new GridLayout(1, false));
+
+ Label lblMessage = new Label(commitComposite, SWT.NONE);
+ toolkit.adapt(lblMessage, true, true);
+ lblMessage.setText("Message:");
+
+ messageValueText = new Text(commitComposite, SWT.BORDER);
+ messageValueText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ messageValueText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ message = messageValueText.getMessage();
+
+ }
+ });
+ toolkit.adapt(messageValueText, true, true);
+
+ Composite composite = new Composite(commitComposite, SWT.NONE);
+ toolkit.adapt(composite);
+ toolkit.paintBordersFor(composite);
+ composite.setLayout(new GridLayout(1, false));
+ return commitComposite;
+ }
+
+
+ /**
+ * Gets the commit message.
+ *
+ * @return the commit message
+ */
+ public String getCommitMessage() {
+ return message;
+ }
+
+
+ /**
+ * Checks if is keep lock.
+ *
+ * @return true, if is keep lock
+ */
+ public boolean isKeepLock() {
+ return keepLock;
+ }
+
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/dialogs/PreviewDialog.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/dialogs/PreviewDialog.java
index 2e1b3f8..c376dc1 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/dialogs/PreviewDialog.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/dialogs/PreviewDialog.java
@@ -1,270 +1,286 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.papyrus.infra.core.editor.CoreMultiDiagramEditor;
-import org.eclipse.papyrus.infra.core.resource.ModelSet;
-import org.eclipse.papyrus.infra.emf.providers.MoDiscoContentProvider;
-import org.eclipse.papyrus.uml.tools.model.UmlModel;
-import org.eclipse.papyrus.uml.tools.model.UmlUtils;
-import org.eclipse.papyrus.views.modelexplorer.CustomCommonViewer;
-import org.eclipse.papyrus.views.modelexplorer.matching.IMatchingItem;
-import org.eclipse.papyrus.views.modelexplorer.matching.ModelElementItemMatchingItem;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-
-
-/**
- * The Class PreviewDialog.
- * The preview dialog is a generic dialog use to display feedback to the user using specific {@link ILabelProvider}
- */
-public class PreviewDialog extends TitleAreaDialog {
-
-
- /** The title. */
- private String title;
-
- /** The message. */
- private String message;
-
- /** The label provider. */
- private ILabelProvider labelProvider;
-
- /** The tree viewer. */
- private TreeViewer treeViewer;
-
- /** The objects to reveal. */
- private Collection<EObject> objectsToReveal;
-
-
-
- /**
- * Sets the objects to reveal.
- *
- * @param objectToReveal
- * the new objects to reveal
- */
- public void setObjectsToReveal(Collection<EObject> objectToReveal) {
- this.objectsToReveal = objectToReveal;
- }
-
- /**
- * Create contents of the dialog.
- *
- * @param parent
- * the parent
- * @return the control
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- setMessage(message);
- setTitle(title);
- Composite area = (Composite)super.createDialogArea(parent);
- Composite container = new Composite(area, SWT.NONE);
- container.setLayout(new FillLayout(SWT.HORIZONTAL));
- container.setLayoutData(new GridData(GridData.FILL_BOTH));
- treeViewer = new CustomCommonViewer("org.eclipse.papyrus.modelexplorer.modelexplorer", container, SWT.BORDER);
- treeViewer.setContentProvider(new MoDiscoContentProvider() {
-
- @Override
- protected EObject[] getRootElements(ModelSet modelSet) {
- UmlModel umlModel = (UmlUtils.getUmlModel(modelSet));
-
- if(umlModel == null)
- return null;
-
- EList<EObject> contents = umlModel.getResource().getContents();
- ArrayList<EObject> result = new ArrayList<EObject>();
- Iterator<EObject> iterator = contents.iterator();
- while(iterator.hasNext()) {
- EObject eObject = (EObject)iterator.next();
- //Shall be improved
- if(eObject.eClass().getEPackage().getNsURI().contains("uml")) {
- result.add(eObject);
- }
- }
- 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()]);
- }
- });
- treeViewer.setLabelProvider(labelProvider);
- treeViewer.setInput(((CoreMultiDiagramEditor)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getServicesRegistry());
- if(objectsToReveal != null) {
- reveal(objectsToReveal);
- }
- return area;
- }
-
- /**
- * Create contents of the button bar.
- *
- * @param parent
- * the parent
- */
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- /**
- * Return the initial size of the dialog.
- *
- * @return the initial size
- */
- @Override
- protected Point getInitialSize() {
- return new Point(600, 600);
- }
-
- /**
- * Create the dialog.
- *
- * @param parentShell
- * the parent shell
- * @param labelProvider
- * the label provider
- * @param title
- * the title
- * @param message
- * the message
- */
- public PreviewDialog(Shell parentShell, ILabelProvider labelProvider, String title, String message) {
- super(parentShell);
- setShellStyle(SWT.SHELL_TRIM);
- setHelpAvailable(false);
- this.title = title;
- this.message = message;
- this.labelProvider = labelProvider;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.window.Window#open()
- */
- @Override
- public int open() {
- int result = super.open();
- return result;
- }
-
-
-
- /**
- * Reveal.
- *
- * @param elementList
- * the element list
- */
- public void reveal(Iterable<?> elementList) {
- ArrayList<IMatchingItem> matchingItemsToSelect = new ArrayList<IMatchingItem>();
- // filter out non EMF objects
- Iterable<EObject> list = Iterables.transform(Iterables.filter(elementList, EObject.class), new Function<Object, EObject>() {
-
- public EObject apply(Object from) {
- return (EObject)from;
- }
- });
-
- for(EObject currentEObject : list) {
- //TODO The custom ModelExplorer Revealer feature has not yet been backported.
- //See bug 426360. For now, we only reveal the given EObjects.
- //EObject itemToSelect = ModelExplorerRevealerManager.getTargetObjectToRegveal(currentEObject);
- matchingItemsToSelect.add(new ModelElementItemMatchingItem(currentEObject));
-
- // Does the content provider exist?
- // if(treeViewer.getContentProvider() != null) {
-
- /*
- * reveal the ancestors tree using expandToLevel on each of them
- * in the good order. This is a lot faster than going through the whole tree
- * using getChildren of the ContentProvider since our Viewer uses a Hashtable
- * to keep track of the revealed elements.
- *
- * However we need to use a dedicated MatchingItem to do the matching,
- * and a specific comparer in our viewer so than the equals of MatchingItem is
- * used in priority.
- *
- * Please refer to MatchingItem for more infos.
- */
- //for(IMatchingItem item : ModelExplorerRevealerManager.getChainToReveal(itemToSelect)) {
- // treeViewer.expandToLevel(item, 1);
- //}
- //}
- }
- treeViewer.expandToLevel(new StructuredSelection(matchingItemsToSelect), TreeViewer.ALL_LEVELS);
- }
-
- /**
- * Select reveal.
- *
- * @param selection
- * the selection
- */
- public void selectReveal(ISelection selection) {
- if(treeViewer != null) {
- treeViewer.setSelection(selection, true);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.core.ui.IRevealSemanticElement#revealSemanticElement(java.util.List)
- */
- /**
- * Reveal semantic element.
- *
- * @param elementList
- * the element list
- */
- public void revealSemanticElement(List<?> elementList) {
- reveal(elementList);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.dialogs;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForWorkbenchPage;
+import org.eclipse.papyrus.infra.emf.providers.MoDiscoContentProvider;
+import org.eclipse.papyrus.uml.tools.model.UmlModel;
+import org.eclipse.papyrus.uml.tools.model.UmlUtils;
+import org.eclipse.papyrus.uml.tools.providers.SemanticUMLContentProvider;
+import org.eclipse.papyrus.views.modelexplorer.CustomCommonViewer;
+import org.eclipse.papyrus.views.modelexplorer.matching.IMatchingItem;
+import org.eclipse.papyrus.views.modelexplorer.matching.ModelElementItemMatchingItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+
+
+/**
+ * The Class PreviewDialog.
+ * The preview dialog is a generic dialog use to display feedback to the user using specific {@link ILabelProvider}
+ */
+public class PreviewDialog extends TitleAreaDialog {
+
+
+ /** The title. */
+ private String title;
+
+ /** The message. */
+ private String message;
+
+ /** The label provider. */
+ private ILabelProvider labelProvider;
+
+ /** The tree viewer. */
+ private TreeViewer treeViewer;
+
+ /** The objects to reveal. */
+ private Collection<EObject> objectsToReveal;
+
+
+
+ /**
+ * Sets the objects to reveal.
+ *
+ * @param objectToReveal
+ * the new objects to reveal
+ */
+ public void setObjectsToReveal(Collection<EObject> objectToReveal) {
+ this.objectsToReveal = objectToReveal;
+ }
+
+ /**
+ * Create contents of the dialog.
+ *
+ * @param parent
+ * the parent
+ * @return the control
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ setMessage(message);
+ setTitle(title);
+ Composite area = (Composite)super.createDialogArea(parent);
+ Composite container = new Composite(area, SWT.NONE);
+ container.setLayout(new FillLayout(SWT.HORIZONTAL));
+ container.setLayoutData(new GridData(GridData.FILL_BOTH));
+ treeViewer = new CustomCommonViewer("org.eclipse.papyrus.modelexplorer.modelexplorer", container, SWT.BORDER);
+ treeViewer.setContentProvider(new SemanticUMLContentProvider() {
+
+// @Override
+// protected static EObject[] getRoots(ResourceSet root) {
+// if(root instanceof ModelSet) {
+// ModelSet modelSet = (ModelSet)root;
+// UmlModel umlModel = (UmlUtils.getUmlModel(modelSet));
+//
+// if(umlModel == null)
+// return null;
+//
+// EList<EObject> contents = umlModel.getResource().getContents();
+// ArrayList<EObject> result = new ArrayList<EObject>();
+// Iterator<EObject> iterator = contents.iterator();
+// while(iterator.hasNext()) {
+// EObject eObject = (EObject)iterator.next();
+// //Shall be improved
+// if(eObject.eClass().getEPackage().getNsURI().contains("uml")) {
+// result.add(eObject);
+// }
+// }
+// }
+// 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()]);
+ }
+ });
+ treeViewer.setLabelProvider(labelProvider);
+
+ try {
+ IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ ServicesRegistry serviceRegistry = ServiceUtilsForWorkbenchPage.getInstance().getServiceRegistry(activePage);
+ treeViewer.setInput(serviceRegistry);
+ if(objectsToReveal != null) {
+ reveal(objectsToReveal);
+ }
+ } catch (ServiceException e) {
+ e.printStackTrace();
+ }
+
+ return area;
+ }
+
+ /**
+ * Create contents of the button bar.
+ *
+ * @param parent
+ * the parent
+ */
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+ createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
+ }
+
+ /**
+ * Return the initial size of the dialog.
+ *
+ * @return the initial size
+ */
+ @Override
+ protected Point getInitialSize() {
+ return new Point(600, 600);
+ }
+
+ /**
+ * Create the dialog.
+ *
+ * @param parentShell
+ * the parent shell
+ * @param labelProvider
+ * the label provider
+ * @param title
+ * the title
+ * @param message
+ * the message
+ */
+ public PreviewDialog(Shell parentShell, ILabelProvider labelProvider, String title, String message) {
+ super(parentShell);
+ setShellStyle(SWT.SHELL_TRIM);
+ setHelpAvailable(false);
+ this.title = title;
+ this.message = message;
+ this.labelProvider = labelProvider;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.window.Window#open()
+ */
+ @Override
+ public int open() {
+ int result = super.open();
+ return result;
+ }
+
+
+
+ /**
+ * Reveal.
+ *
+ * @param elementList
+ * the element list
+ */
+ public void reveal(Iterable<?> elementList) {
+ ArrayList<IMatchingItem> matchingItemsToSelect = new ArrayList<IMatchingItem>();
+ // filter out non EMF objects
+ Iterable<EObject> list = Iterables.transform(Iterables.filter(elementList, EObject.class), new Function<Object, EObject>() {
+
+ public EObject apply(Object from) {
+ return (EObject)from;
+ }
+ });
+
+ for(EObject currentEObject : list) {
+ //TODO The custom ModelExplorer Revealer feature has not yet been backported.
+ //See bug 426360. For now, we only reveal the given EObjects.
+ //EObject itemToSelect = ModelExplorerRevealerManager.getTargetObjectToRegveal(currentEObject);
+ matchingItemsToSelect.add(new ModelElementItemMatchingItem(currentEObject));
+
+ // Does the content provider exist?
+ // if(treeViewer.getContentProvider() != null) {
+
+ /*
+ * reveal the ancestors tree using expandToLevel on each of them
+ * in the good order. This is a lot faster than going through the whole tree
+ * using getChildren of the ContentProvider since our Viewer uses a Hashtable
+ * to keep track of the revealed elements.
+ *
+ * However we need to use a dedicated MatchingItem to do the matching,
+ * and a specific comparer in our viewer so than the equals of MatchingItem is
+ * used in priority.
+ *
+ * Please refer to MatchingItem for more infos.
+ */
+ //for(IMatchingItem item : ModelExplorerRevealerManager.getChainToReveal(itemToSelect)) {
+ // treeViewer.expandToLevel(item, 1);
+ //}
+ //}
+ }
+ treeViewer.expandToLevel(new StructuredSelection(matchingItemsToSelect), TreeViewer.ALL_LEVELS);
+ }
+
+ /**
+ * Select reveal.
+ *
+ * @param selection
+ * the selection
+ */
+ public void selectReveal(ISelection selection) {
+ if(treeViewer != null) {
+ treeViewer.setSelection(selection, true);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.core.ui.IRevealSemanticElement#revealSemanticElement(java.util.List)
+ */
+ /**
+ * Reveal semantic element.
+ *
+ * @param elementList
+ * the element list
+ */
+ public void revealSemanticElement(List<?> elementList) {
+ reveal(elementList);
+ }
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/items/LockStrategyItemProvider.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/items/LockStrategyItemProvider.java
index b1b023a..279ed24 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/items/LockStrategyItemProvider.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/items/LockStrategyItemProvider.java
@@ -1,74 +1,73 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.items;
-
-import java.util.Collection;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.LockAction;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.UIUtils;
-import org.eclipse.papyrus.team.collaborative.strategy.ILockingStrategy;
-import org.eclipse.papyrus.team.collaborative.utils.CollabUtils;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Collections2;
-
-
-/**
- * Item provider which fill the menu with all lock strategy.
- *
- * @author adaussy
- */
-public class LockStrategyItemProvider extends org.eclipse.ui.actions.CompoundContributionItem {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
- */
- @Override
- protected IContributionItem[] getContributionItems() {
- if(isEnabled()) {
- Collection<ActionContributionItem> contribution = Collections2.transform(ICollaborativeManager.INSTANCE.getStrategies().values(), new Function<ILockingStrategy.Descriptor, ActionContributionItem>() {
-
- @Override
- public ActionContributionItem apply(final ILockingStrategy.Descriptor from) {
-
- Action action = new LockAction(from);
- ActionContributionItem actionContributionItem = new ActionContributionItem(action);
- return actionContributionItem;
- }
- });
- return contribution.toArray(new IContributionItem[contribution.size()]);
- }
-
- return new IContributionItem[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.ContributionItem#isEnabled()
- */
- public boolean isEnabled() {
- EObject firstSelection = UIUtils.getFirstSelection();
- if(firstSelection != null) {
- return CollabUtils.isCollab(firstSelection);
- }
- return false;
- }
-
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.items;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.LockAction;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.UIUtils;
+import org.eclipse.papyrus.team.collaborative.strategy.ILockingStrategy;
+import org.eclipse.papyrus.team.collaborative.utils.CollabUtils;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
+
+
+/**
+ * Item provider which fill the menu with all lock strategy.
+ *
+ * @author adaussy
+ */
+public class LockStrategyItemProvider extends org.eclipse.ui.actions.CompoundContributionItem {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
+ */
+ @Override
+ protected IContributionItem[] getContributionItems() {
+ if(isEnabled()) {
+ Collection<ActionContributionItem> contribution = Collections2.transform(ICollaborativeManager.INSTANCE.getStrategies().values(), new Function<ILockingStrategy.Descriptor, ActionContributionItem>() {
+
+ public ActionContributionItem apply(final ILockingStrategy.Descriptor from) {
+
+ Action action = new LockAction(from);
+ ActionContributionItem actionContributionItem = new ActionContributionItem(action);
+ return actionContributionItem;
+ }
+ });
+ return contribution.toArray(new IContributionItem[contribution.size()]);
+ }
+
+ return new IContributionItem[0];
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.action.ContributionItem#isEnabled()
+ */
+ public boolean isEnabled() {
+ EObject firstSelection = UIUtils.getFirstSelection();
+ if(firstSelection != null) {
+ return CollabUtils.isCollab(firstSelection);
+ }
+ return false;
+ }
+
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/items/UnlockStrategyItemProvider.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/items/UnlockStrategyItemProvider.java
index e34e721..71a0724 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/items/UnlockStrategyItemProvider.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/items/UnlockStrategyItemProvider.java
@@ -1,73 +1,72 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.items;
-
-import java.util.Collection;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.UnlockAction;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.UIUtils;
-import org.eclipse.papyrus.team.collaborative.strategy.ILockingStrategy;
-import org.eclipse.papyrus.team.collaborative.utils.CollabUtils;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Collections2;
-
-
-/**
- * Item provider which fill the menu with all unlock strategy.
- */
-public class UnlockStrategyItemProvider extends org.eclipse.ui.actions.CompoundContributionItem {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
- */
- @Override
- protected IContributionItem[] getContributionItems() {
- if(isEnabled()) {
- Collection<ActionContributionItem> contribution = Collections2.transform(ICollaborativeManager.INSTANCE.getStrategies().values(), new Function<ILockingStrategy.Descriptor, ActionContributionItem>() {
-
- @Override
- public ActionContributionItem apply(final ILockingStrategy.Descriptor from) {
-
- Action action = new UnlockAction(from);
- ActionContributionItem actionContributionItem = new ActionContributionItem(action);
- return actionContributionItem;
- }
- });
-
-
- return contribution.toArray(new IContributionItem[contribution.size()]);
- }
-
- return new IContributionItem[0];
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.ContributionItem#isEnabled()
- */
- public boolean isEnabled() {
- EObject firstSelection = UIUtils.getFirstSelection();
- if(firstSelection != null) {
- return CollabUtils.isCollab(firstSelection);
- }
- return false;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.items;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.papyrus.team.collaborative.ICollaborativeManager;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.actions.UnlockAction;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.utils.UIUtils;
+import org.eclipse.papyrus.team.collaborative.strategy.ILockingStrategy;
+import org.eclipse.papyrus.team.collaborative.utils.CollabUtils;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
+
+
+/**
+ * Item provider which fill the menu with all unlock strategy.
+ */
+public class UnlockStrategyItemProvider extends org.eclipse.ui.actions.CompoundContributionItem {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
+ */
+ @Override
+ protected IContributionItem[] getContributionItems() {
+ if(isEnabled()) {
+ Collection<ActionContributionItem> contribution = Collections2.transform(ICollaborativeManager.INSTANCE.getStrategies().values(), new Function<ILockingStrategy.Descriptor, ActionContributionItem>() {
+
+ public ActionContributionItem apply(final ILockingStrategy.Descriptor from) {
+
+ Action action = new UnlockAction(from);
+ ActionContributionItem actionContributionItem = new ActionContributionItem(action);
+ return actionContributionItem;
+ }
+ });
+
+
+ return contribution.toArray(new IContributionItem[contribution.size()]);
+ }
+
+ return new IContributionItem[0];
+ }
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.action.ContributionItem#isEnabled()
+ */
+ public boolean isEnabled() {
+ EObject firstSelection = UIUtils.getFirstSelection();
+ if(firstSelection != null) {
+ return CollabUtils.isCollab(firstSelection);
+ }
+ return false;
+ }
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/providers/ExtensivePartitionNameLabelProvider.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/providers/ExtensivePartitionNameLabelProvider.java
index 7cdbdee..1259768 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/providers/ExtensivePartitionNameLabelProvider.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/ui/providers/ExtensivePartitionNameLabelProvider.java
@@ -1,226 +1,217 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.providers;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.model.ModelElementItem;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-
-import com.google.common.base.Predicate;
-
-
-/**
- * The Class ExtensiveLabelProvider. {@link ILabelProvider} that extend the one use by the model explorer view.
- * This label provider can customize label and color of display object using predicate
- */
-public class ExtensivePartitionNameLabelProvider implements IFontProvider, IColorProvider, ILabelProvider {
-
-
- private ILabelProvider internal;
-
-
- /** The color. */
- private Color color;
-
- /** The font. */
- private Font font;
-
- /** The predicate. */
- private Predicate<EObject> predicate;
-
- /**
- * Instantiates a new extensive label provider.
- *
- * @param predicate
- * the predicate
- */
- public ExtensivePartitionNameLabelProvider(Predicate<EObject> predicate, ILabelProvider internal) {
- super();
- this.predicate = predicate;
- this.internal = internal;
- }
-
- public ExtensivePartitionNameLabelProvider(ILabelProvider internal) {
- super();
- this.predicate = null;
- this.internal = internal;
- }
-
-
- /**
- * Sets the color.
- *
- * @param color
- * the new color
- */
- public void setColor(Color color) {
- this.color = color;
- }
-
-
- /**
- * Sets the font.
- *
- * @param font
- * the new font
- */
- public void setFont(Font font) {
- this.font = font;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.papyrus.modelexplorer.MoDiscoLabelProvider#getText(java.lang.Object)
- */
- @Override
- public String getText(Object element) {
- String superText = internal.getText(element);
- if(element instanceof ModelElementItem) {
- ModelElementItem elem = (ModelElementItem)element;
- EObject eObject = elem.getEObject();
- if(eObject != null) {
- String partitionName = getPartitionName(eObject);
- if(partitionName != null) {
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append(partitionName);
- stringBuilder.append(superText);
- superText = stringBuilder.toString();
- }
- }
- }
- return superText;
- }
-
- private static final String CLOSING_BRACKET = "] ";
-
- private static final String OPEN_BRACKET = "[";
-
-
- /**
- * Gets the partition name.
- *
- * @param eObject
- * the e object
- * @return the partition name
- */
- protected String getPartitionName(EObject eObject) {
- Resource resource = eObject.eResource();
- if(resource != null) {
- URI uri = resource.getURI().trimFileExtension();
- String partitionName = uri.segment(uri.segmentCount() - 1);
- StringBuilder builder = new StringBuilder(OPEN_BRACKET);
- builder.append(partitionName);
- builder.append(CLOSING_BRACKET);
- return builder.toString();
- }
- return null;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelLabelProvider#getFont(java.lang.Object)
- */
- @SuppressWarnings("restriction")
- @Override
- public Font getFont(Object element) {
- if(predicate != null) {
- if(element instanceof ModelElementItem) {
- ModelElementItem eObject = (ModelElementItem)element;
- if(font != null) {
- if(predicate.apply(eObject.getEObject())) {
- return font;
- }
- }
- }
- }
- if(internal instanceof IFontProvider) {
- return ((IFontProvider)internal).getFont(element);
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelLabelProvider#getForeground(java.lang.Object)
- */
- @SuppressWarnings("restriction")
- @Override
- public Color getForeground(Object element) {
- if(predicate != null) {
- if(element instanceof ModelElementItem) {
- ModelElementItem eObject = (ModelElementItem)element;
- if(color != null) {
- if(predicate.apply(eObject.getEObject())) {
- return color;
- }
- }
- }
- }
- if(internal instanceof IColorProvider) {
- return ((IColorProvider)internal).getForeground(element);
- }
- return null;
- }
-
-
- @Override
- public void addListener(ILabelProviderListener listener) {
- internal.addListener(listener);
-
- }
-
-
- @Override
- public void dispose() {
- internal.dispose();
-
- }
-
-
- @Override
- public boolean isLabelProperty(Object element, String property) {
- return internal.isLabelProperty(element, property);
- }
-
-
- @Override
- public void removeListener(ILabelProviderListener listener) {
- internal.removeListener(listener);
-
- }
-
-
- @Override
- public Image getImage(Object element) {
- return internal.getImage(element);
- }
-
-
- @Override
- public Color getBackground(Object element) {
- if(internal instanceof IColorProvider) {
- return ((IColorProvider)internal).getBackground(element);
- }
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.ui.providers;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.facet.infra.browser.uicore.internal.model.ModelElementItem;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.IFontProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+
+import com.google.common.base.Predicate;
+
+
+/**
+ * The Class ExtensiveLabelProvider. {@link ILabelProvider} that extend the one use by the model explorer view.
+ * This label provider can customize label and color of display object using predicate
+ */
+public class ExtensivePartitionNameLabelProvider implements IFontProvider, IColorProvider, ILabelProvider {
+
+
+ private ILabelProvider internal;
+
+
+ /** The color. */
+ private Color color;
+
+ /** The font. */
+ private Font font;
+
+ /** The predicate. */
+ private Predicate<EObject> predicate;
+
+ /**
+ * Instantiates a new extensive label provider.
+ *
+ * @param predicate
+ * the predicate
+ */
+ public ExtensivePartitionNameLabelProvider(Predicate<EObject> predicate, ILabelProvider internal) {
+ super();
+ this.predicate = predicate;
+ this.internal = internal;
+ }
+
+ public ExtensivePartitionNameLabelProvider(ILabelProvider internal) {
+ super();
+ this.predicate = null;
+ this.internal = internal;
+ }
+
+
+ /**
+ * Sets the color.
+ *
+ * @param color
+ * the new color
+ */
+ public void setColor(Color color) {
+ this.color = color;
+ }
+
+
+ /**
+ * Sets the font.
+ *
+ * @param font
+ * the new font
+ */
+ public void setFont(Font font) {
+ this.font = font;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.modelexplorer.MoDiscoLabelProvider#getText(java.lang.Object)
+ */
+ public String getText(Object element) {
+ String superText = internal.getText(element);
+ if(element instanceof ModelElementItem) {
+ ModelElementItem elem = (ModelElementItem)element;
+ EObject eObject = elem.getEObject();
+ if(eObject != null) {
+ String partitionName = getPartitionName(eObject);
+ if(partitionName != null) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append(partitionName);
+ stringBuilder.append(superText);
+ superText = stringBuilder.toString();
+ }
+ }
+ }
+ return superText;
+ }
+
+ private static final String CLOSING_BRACKET = "] ";
+
+ private static final String OPEN_BRACKET = "[";
+
+
+ /**
+ * Gets the partition name.
+ *
+ * @param eObject
+ * the e object
+ * @return the partition name
+ */
+ protected String getPartitionName(EObject eObject) {
+ Resource resource = eObject.eResource();
+ if(resource != null) {
+ URI uri = resource.getURI().trimFileExtension();
+ String partitionName = uri.segment(uri.segmentCount() - 1);
+ StringBuilder builder = new StringBuilder(OPEN_BRACKET);
+ builder.append(partitionName);
+ builder.append(CLOSING_BRACKET);
+ return builder.toString();
+ }
+ return null;
+ }
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelLabelProvider#getFont(java.lang.Object)
+ */
+ @SuppressWarnings("restriction")
+ public Font getFont(Object element) {
+ if(predicate != null) {
+ if(element instanceof ModelElementItem) {
+ ModelElementItem eObject = (ModelElementItem)element;
+ if(font != null) {
+ if(predicate.apply(eObject.getEObject())) {
+ return font;
+ }
+ }
+ }
+ }
+ if(internal instanceof IFontProvider) {
+ return ((IFontProvider)internal).getFont(element);
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelLabelProvider#getForeground(java.lang.Object)
+ */
+ @SuppressWarnings("restriction")
+ public Color getForeground(Object element) {
+ if(predicate != null) {
+ if(element instanceof ModelElementItem) {
+ ModelElementItem eObject = (ModelElementItem)element;
+ if(color != null) {
+ if(predicate.apply(eObject.getEObject())) {
+ return color;
+ }
+ }
+ }
+ }
+ if(internal instanceof IColorProvider) {
+ return ((IColorProvider)internal).getForeground(element);
+ }
+ return null;
+ }
+
+
+ public void addListener(ILabelProviderListener listener) {
+ internal.addListener(listener);
+
+ }
+
+
+ public void dispose() {
+ internal.dispose();
+
+ }
+
+
+ public boolean isLabelProperty(Object element, String property) {
+ return internal.isLabelProperty(element, property);
+ }
+
+
+ public void removeListener(ILabelProviderListener listener) {
+ internal.removeListener(listener);
+
+ }
+
+
+ public Image getImage(Object element) {
+ return internal.getImage(element);
+ }
+
+
+ public Color getBackground(Object element) {
+ if(internal instanceof IColorProvider) {
+ return ((IColorProvider)internal).getBackground(element);
+ }
+ return null;
+ }
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/utils/UIUtils.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/utils/UIUtils.java
index f6c336b..5bea48b 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/utils/UIUtils.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative.integration.papyrus/src/org/eclipse/papyrus/team/collaborative/integration/papyrus/utils/UIUtils.java
@@ -1,307 +1,291 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.integration.papyrus.utils;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.gmf.runtime.common.ui.dialogs.SaveAllDirtyEditorsDialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.resource.LocalResourceManager;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.infra.core.editor.CoreMultiDiagramEditor;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
-import org.eclipse.papyrus.team.collaborative.IExtendedURI;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.Activator;
-import org.eclipse.papyrus.team.collaborative.integration.papyrus.RefreshHelper;
-import org.eclipse.papyrus.team.collaborative.reports.CollabStatus;
-import org.eclipse.papyrus.team.collaborative.reports.LogHelper;
-import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
-import org.eclipse.papyrus.team.collaborative.utils.ModelsUtil;
-import org.eclipse.papyrus.uml.tools.model.UmlModel;
-import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.Collections2;
-
-
-/**
- * Utility class for User Interface interactions.
- *
- * @author adaussy
- */
-public class UIUtils {
-
- /** The resource manager. */
- public static LocalResourceManager RESOURCE_MANAGER = new LocalResourceManager(JFaceResources.getResources());
-
- /**
- * Save all dirty editor.
- *
- * @return the {@link IStatus}
- */
- public static IStatus saveAllDirtyEditor() {
- //Force save
- IEditorPart[] dirtyEditors = SaveAllDirtyEditorsDialog.getDirtyEditors();
- if(dirtyEditors.length > 0) {
- SaveAllDirtyEditorsDialog dialog = new SaveAllDirtyEditorsDialog(Display.getDefault().getActiveShell());
- if(dialog.open() == SaveAllDirtyEditorsDialog.CANCEL) {
- return Status.CANCEL_STATUS;
- } else {
- for(int i = 0; i < dirtyEditors.length; i++) {
- IEditorPart editorI = dirtyEditors[i];
- editorI.doSave(new NullProgressMonitor());
- }
- }
- }
- return Status.OK_STATUS;
- }
-
- /**
- * Gets the current resource set.
- *
- * @return the current resource set
- */
- public static ResourceSet getCurrentResourceSet() {
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if(editor instanceof CoreMultiDiagramEditor) {
- CoreMultiDiagramEditor papyrusEditor = (CoreMultiDiagramEditor)editor;
- return papyrusEditor.getEditingDomain().getResourceSet();
- }
- return null;
- }
-
- /**
- * Return all the leaf from the semantic meta model
- *
- * @param uris
- * Input set for the search of leaf
- * @param resourceSet
- * @return
- */
- public static Collection<EObject> getLeafSemanticElement(Collection<IExtendedURI> uris, ResourceSet resourceSet) {
- Collection<IExtendedURI> semanticURIS = Collections2.filter(uris, new Predicate<IExtendedURI>() {
-
- @Override
- public boolean apply(IExtendedURI arg0) {
- return UmlModel.UML_FILE_EXTENSION.equals(arg0.getUri().fileExtension());
- }
- });
- Collection<Collection<EObject>> eObjects = Collections2.transform(semanticURIS, CollabFunctionsFactory.getExtendedURIToEObjects(resourceSet));
- Set<EObject> semanticElements = new HashSet<EObject>();
- for(Collection<EObject> eos : eObjects) {
- semanticElements.addAll(eos);
- }
- return ModelsUtil.getRoots(semanticElements);
- }
-
- /**
- * Gets the first selection from the workbench
- *
- * @return the first selection
- */
- public static EObject getFirstSelection() {
- Collection<EObject> selection = getSelection();
- if(selection.isEmpty()) {
- return null;
- }
- return selection.iterator().next();
- }
-
- /**
- * Gets the selection from the workbench
- *
- * @return the selection
- */
- public static Collection<EObject> getSelection() {
- ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
- ISelection selection = selectionService.getSelection();
- if(selection != null) {
- if(selection instanceof IStructuredSelection) {
- List<EObject> result = new ArrayList<EObject>();
- Iterator<?> ite = ((IStructuredSelection)selection).iterator();
- while(ite.hasNext()) {
- Object next = ite.next();
- EObject eObject = getEObject(next);
- if(eObject != null) {
- result.add(eObject);
- }
- }
- return result;
- }
- }
- return Collections.emptyList();
- }
-
- /**
- * Refresh elements in model explorer view.
- *
- * @param uris
- * {@link IExtendedURI} to refresh
- * @param resourceSet
- * the resource set
- */
- public static void refreshModelExplorer(Set<IExtendedURI> uris, ResourceSet resourceSet) {
- for(Collection<EObject> objects : Collections2.transform(uris, CollabFunctionsFactory.getExtendedURIToEObjects(resourceSet))) {
- RefreshHelper.refreshModelExplorer(objects);
- }
- }
-
- /**
- * This reload the current editor
- * WARNING : BE careful after this action the ancient resourceSet will deprecated you may use getCurrentResourceSet() to retrieve the new one.
- */
- public static void reloadEditor() {
- Display.getCurrent().syncExec(new Runnable() {
-
- public void run() {
- IWorkbench wb = PlatformUI.getWorkbench();
- IWorkbenchPage page = wb.getActiveWorkbenchWindow().getActivePage();
- IEditorPart editor = page.getActiveEditor();
- IEditorInput input = editor.getEditorInput();
- page.closeEditor(editor, true);
- try {
- IEditorDescriptor desc = wb.getEditorRegistry().getDefaultEditor(input.getName());
- page.openEditor(input, desc.getId(), false);
- } catch (PartInitException e) {
- LogHelper.getInstance().logError("Error during reloading", Activator.PLUGIN_ID, e);
- }
- }
- });
- }
-
- /**
- * Gets the e object.
- *
- * @param in
- * the in
- * @return the e object
- */
- protected static EObject getEObject(Object in) {
- if(in instanceof EObject) {
- return (EObject)in;
- } else if(in instanceof IAdaptable) {
- return (EObject)((IAdaptable)in).getAdapter(EObject.class);
- } else {
- IAdapterManager adapterService = (IAdapterManager)PlatformUI.getWorkbench().getService(IAdapterManager.class);
- return (EObject)adapterService.getAdapter(in, EObject.class);
- }
- }
-
-
- /**
- * Display an error dialog using a status.
- *
- * @param errorStatus
- * the error status
- * @param title
- * the title
- */
- public static void errorDialog(IStatus errorStatus, String title) {
- ErrorDialog dialog = new ErrorDialog(Display.getDefault().getActiveShell(), title, errorStatus.getMessage(), errorStatus, Status.ERROR);
- dialog.open();
- LogHelper.getInstance().logError(errorStatus.getMessage(), Activator.PLUGIN_ID, errorStatus.getException());
- }
-
- /**
- * Error dialog.
- *
- * @param throwable
- * the throwable
- * @param title
- * the title
- * @param message
- * the message
- */
- public static void errorDialog(Throwable throwable, String title, String message) {
- errorDialog(CollabStatus.createErrorStatus(message, throwable), title);
- }
-
- /** The adapter factory. */
- private static ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- /**
- * Try to get a correct label from a Object
- * Handle: {@link EObject} {@link Resource}.
- *
- * @param object
- * the object
- * @return the label
- */
- public static String getLabel(Object object) {
- if(object instanceof EObject) {
- EObject eObject = (EObject)object;
- IItemLabelProvider labelProvider = (IItemLabelProvider)adapterFactory.adapt(eObject, IItemLabelProvider.class);
- return labelProvider.getText(eObject);
- } else if(object instanceof Resource) {
- return "Resouce " + ((Resource)object).getURI();
- }
- return object.toString();
- }
-
- public static ILabelProvider getModelExplorerLavelProvider(){
- ILabelProvider labelProvider = getLabelProvider(ModelExplorerView.LABEL_PROVIDER_SERVICE_CONTEXT);
- if(labelProvider == null){
- labelProvider = getLabelProvider();
- }
- return labelProvider;
- }
- public static ILabelProvider getLabelProvider(){
- return getLabelProvider(null);
- }
- public static ILabelProvider getLabelProvider(String context){
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if (editor instanceof CoreMultiDiagramEditor) {
- CoreMultiDiagramEditor coreEditor = (CoreMultiDiagramEditor) editor;
- try {
- LabelProviderService service = coreEditor.getServicesRegistry().getService(LabelProviderService.class);
- if(context != null){
- return service.getLabelProvider(context);
- }else {
- return service.getLabelProvider();
- }
- } catch (ServiceException e) {
- e.printStackTrace();
- return null;
- }
- }
- return null;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Atos
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arthur Daussy - initial implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.team.collaborative.integration.papyrus.utils;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.gmf.runtime.common.ui.dialogs.SaveAllDirtyEditorsDialog;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.core.editor.CoreMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForWorkbenchPage;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
+import org.eclipse.papyrus.team.collaborative.IExtendedURI;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.Activator;
+import org.eclipse.papyrus.team.collaborative.integration.papyrus.RefreshHelper;
+import org.eclipse.papyrus.team.collaborative.reports.CollabStatus;
+import org.eclipse.papyrus.team.collaborative.reports.LogHelper;
+import org.eclipse.papyrus.team.collaborative.utils.CollabFunctionsFactory;
+import org.eclipse.papyrus.team.collaborative.utils.ModelsUtil;
+import org.eclipse.papyrus.uml.tools.model.UmlModel;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+
+
+/**
+ * Utility class for User Interface interactions.
+ *
+ * @author adaussy
+ */
+public class UIUtils {
+
+ /** The resource manager. */
+ public static LocalResourceManager RESOURCE_MANAGER = new LocalResourceManager(JFaceResources.getResources());
+
+ /**
+ * Save all dirty editor.
+ *
+ * @return the {@link IStatus}
+ */
+ public static IStatus saveAllDirtyEditor() {
+ //Force save
+ IEditorPart[] dirtyEditors = SaveAllDirtyEditorsDialog.getDirtyEditors();
+ if(dirtyEditors.length > 0) {
+ SaveAllDirtyEditorsDialog dialog = new SaveAllDirtyEditorsDialog(Display.getDefault().getActiveShell());
+ if(dialog.open() == SaveAllDirtyEditorsDialog.CANCEL) {
+ return Status.CANCEL_STATUS;
+ } else {
+ for(int i = 0; i < dirtyEditors.length; i++) {
+ IEditorPart editorI = dirtyEditors[i];
+ editorI.doSave(new NullProgressMonitor());
+ }
+ }
+ }
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * Gets the current resource set.
+ *
+ * @return the current resource set
+ */
+ public static ResourceSet getCurrentResourceSet() {
+ IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if(editor instanceof CoreMultiDiagramEditor) {
+ CoreMultiDiagramEditor papyrusEditor = (CoreMultiDiagramEditor)editor;
+ return papyrusEditor.getEditingDomain().getResourceSet();
+ }
+ return null;
+ }
+
+ /**
+ * Return all the leaf from the semantic meta model
+ *
+ * @param uris
+ * Input set for the search of leaf
+ * @param resourceSet
+ * @return
+ */
+ public static Collection<EObject> getLeafSemanticElement(Collection<IExtendedURI> uris, ResourceSet resourceSet) {
+ Collection<IExtendedURI> semanticURIS = Collections2.filter(uris, new Predicate<IExtendedURI>() {
+
+ public boolean apply(IExtendedURI arg0) {
+ return UmlModel.UML_FILE_EXTENSION.equals(arg0.getUri().fileExtension());
+ }
+ });
+ Collection<Collection<EObject>> eObjects = Collections2.transform(semanticURIS, CollabFunctionsFactory.getExtendedURIToEObjects(resourceSet));
+ Set<EObject> semanticElements = new HashSet<EObject>();
+ for(Collection<EObject> eos : eObjects) {
+ semanticElements.addAll(eos);
+ }
+ return ModelsUtil.getRoots(semanticElements);
+ }
+
+ /**
+ * Gets the first selection from the workbench
+ *
+ * @return the first selection
+ */
+ public static EObject getFirstSelection() {
+ Collection<EObject> selection = getSelection();
+ if(selection.isEmpty()) {
+ return null;
+ }
+ return selection.iterator().next();
+ }
+
+ /**
+ * Gets the selection from the workbench
+ *
+ * @return the selection
+ */
+ public static Collection<EObject> getSelection() {
+ ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+ ISelection selection = selectionService.getSelection();
+ if(selection != null) {
+ if(selection instanceof IStructuredSelection) {
+ List<EObject> result = new ArrayList<EObject>();
+ Iterator<?> ite = ((IStructuredSelection)selection).iterator();
+ while(ite.hasNext()) {
+ Object next = ite.next();
+ EObject eObject = EMFHelper.getEObject(next);
+ if(eObject != null) {
+ result.add(eObject);
+ }
+ }
+ return result;
+ }
+ }
+ return Collections.emptyList();
+ }
+
+ /**
+ * Refresh elements in model explorer view.
+ *
+ * @param uris
+ * {@link IExtendedURI} to refresh
+ * @param resourceSet
+ * the resource set
+ */
+ public static void refreshModelExplorer(Set<IExtendedURI> uris, ResourceSet resourceSet) {
+ for(Collection<EObject> objects : Collections2.transform(uris, CollabFunctionsFactory.getExtendedURIToEObjects(resourceSet))) {
+ RefreshHelper.refreshModelExplorer(objects);
+ }
+ }
+
+ /**
+ * This reload the current editor
+ * WARNING : BE careful after this action the ancient resourceSet will deprecated you may use getCurrentResourceSet() to retrieve the new one.
+ */
+ public static void reloadEditor() {
+ Display.getCurrent().syncExec(new Runnable() {
+
+ public void run() {
+ IWorkbench wb = PlatformUI.getWorkbench();
+ IWorkbenchPage page = wb.getActiveWorkbenchWindow().getActivePage();
+ IEditorPart editor = page.getActiveEditor();
+ IEditorInput input = editor.getEditorInput();
+ page.closeEditor(editor, true);
+ try {
+ IEditorDescriptor desc = wb.getEditorRegistry().getDefaultEditor(input.getName());
+ page.openEditor(input, desc.getId(), false);
+ } catch (PartInitException e) {
+ LogHelper.getInstance().logError("Error during reloading", Activator.PLUGIN_ID, e);
+ }
+ }
+ });
+ }
+
+ /**
+ * Display an error dialog using a status.
+ *
+ * @param errorStatus
+ * the error status
+ * @param title
+ * the title
+ */
+ public static void errorDialog(IStatus errorStatus, String title) {
+ ErrorDialog dialog = new ErrorDialog(Display.getDefault().getActiveShell(), title, errorStatus.getMessage(), errorStatus, Status.ERROR);
+ dialog.open();
+ LogHelper.getInstance().logError(errorStatus.getMessage(), Activator.PLUGIN_ID, errorStatus.getException());
+ }
+
+ /**
+ * Error dialog.
+ *
+ * @param throwable
+ * the throwable
+ * @param title
+ * the title
+ * @param message
+ * the message
+ */
+ public static void errorDialog(Throwable throwable, String title, String message) {
+ errorDialog(CollabStatus.createErrorStatus(message, throwable), title);
+ }
+
+ /** The adapter factory. */
+ private static ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ /**
+ * Try to get a correct label from a Object
+ * Handle: {@link EObject} {@link Resource}.
+ *
+ * @param object
+ * the object
+ * @return the label
+ */
+ public static String getLabel(Object object) {
+ if(object instanceof EObject) {
+ EObject eObject = (EObject)object;
+ IItemLabelProvider labelProvider = (IItemLabelProvider)adapterFactory.adapt(eObject, IItemLabelProvider.class);
+ return labelProvider.getText(eObject);
+ } else if(object instanceof Resource) {
+ return "Resouce " + ((Resource)object).getURI();
+ }
+ return object.toString();
+ }
+
+ public static ILabelProvider getModelExplorerLavelProvider() {
+ ILabelProvider labelProvider = getLabelProvider(ModelExplorerView.LABEL_PROVIDER_SERVICE_CONTEXT);
+ if(labelProvider == null) {
+ labelProvider = getLabelProvider();
+ }
+ return labelProvider;
+ }
+
+ public static ILabelProvider getLabelProvider() {
+ return getLabelProvider(null);
+ }
+
+ public static ILabelProvider getLabelProvider(String context) {
+
+ try {
+ IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ ServicesRegistry serviceRegistry = ServiceUtilsForWorkbenchPage.getInstance().getServiceRegistry(activePage);
+ LabelProviderService service = serviceRegistry.getService(LabelProviderService.class);
+ if(context != null) {
+ return service.getLabelProvider(context);
+ } else {
+ return service.getLabelProvider();
+ }
+ } catch (ServiceException e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+
+}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/META-INF/MANIFEST.MF b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/META-INF/MANIFEST.MF
index d864e36..bef06bc 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/META-INF/MANIFEST.MF
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/META-INF/MANIFEST.MF
@@ -1,25 +1,25 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.papyrus.team.collaborative;singleton:=true
-Bundle-Version: 1.7.0.qualifier
-Bundle-ClassPath: .
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Bundle-Activator: org.eclipse.papyrus.team.collaborative.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.emf.ecore,
- com.google.guava,
- org.eclipse.core.resources;bundle-version="3.7.101",
- org.eclipse.emf.workspace
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Export-Package: org.eclipse.papyrus.team.collaborative,
- org.eclipse.papyrus.team.collaborative.participants,
- org.eclipse.papyrus.team.collaborative.participants.locker,
- org.eclipse.papyrus.team.collaborative.participants.version,
- org.eclipse.papyrus.team.collaborative.reports,
- org.eclipse.papyrus.team.collaborative.strategy,
- org.eclipse.papyrus.team.collaborative.utils,
- org.eclipse.papyrus.team.collaborative.utils.funtions;x-internal:=true
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.team.collaborative;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-Activator: org.eclipse.papyrus.team.collaborative.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.emf.ecore,
+ com.google.guava,
+ org.eclipse.core.resources;bundle-version="3.7.101",
+ org.eclipse.emf.workspace
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.eclipse.papyrus.team.collaborative,
+ org.eclipse.papyrus.team.collaborative.participants,
+ org.eclipse.papyrus.team.collaborative.participants.locker,
+ org.eclipse.papyrus.team.collaborative.participants.version,
+ org.eclipse.papyrus.team.collaborative.reports,
+ org.eclipse.papyrus.team.collaborative.strategy,
+ org.eclipse.papyrus.team.collaborative.utils,
+ org.eclipse.papyrus.team.collaborative.utils.funtions;x-internal:=true
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/plugin.xml b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/plugin.xml
index 016f4a1..f973539 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/plugin.xml
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/plugin.xml
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension-point id="collaborative" name="collaborative" schema="schema/collaborative.exsd"/>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension-point id="org.eclipse.papyrus.team.collaborative.contribution" name="contribution" schema="schema/contribution.exsd"/>
+
+</plugin>
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/pom.xml b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/pom.xml
deleted file mode 100644
index 901fbc6..0000000
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/pom.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2013 Atos.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Arthur Daussy <a href="mailto:arthur.daussy@atos.net"> - initial API and implementation
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <relativePath>../../../Releng/org.topcased.fast.tycho.master/pom.xml</relativePath>
- <groupId>org.topcased.fast</groupId>
- <artifactId>parent</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>org.eclipse.papyrus.team.collaborative</artifactId>
- <packaging>eclipse-plugin</packaging>
-
- <name>Alfa Editor</name>
-</project>
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/schema/collaborative.exsd b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/schema/contribution.exsd
index 863d5ab..37dde52 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/schema/collaborative.exsd
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/schema/contribution.exsd
@@ -1,151 +1,151 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.papyrus.team.collaborative" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.papyrus.team.collaborative" id="collaborative" name="collaborative"/>
- </appinfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <choice minOccurs="1" maxOccurs="unbounded">
- <element ref="ParticipantFactory"/>
- <element ref="LockingStrategy"/>
- </choice>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="LockingStrategy">
- <complexType>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="impl" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.team.collaborative.ILockingStrategy"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="ParticipantFactory">
- <annotation>
- <documentation>
- This extension aim to register participant to collaboration
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="impl" type="string" use="required">
- <annotation>
- <documentation>
- This is an implentation of a participant for the collaboration mode. Depending on the feature that this participant provide it as to inherite from ILocker, IUnlocker, IUpdater, ICommitter
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.team.collaborative.ICollabFactory"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="priority" type="string" use="required">
- <annotation>
- <documentation>
- Should be a int. The higher int is the most prioritary
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.papyrus.team.collaborative" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.papyrus.team.collaborative" id="contribution" name="Collaborative Mode Contribution"/>
+ </appinfo>
+ <documentation>
+ This extension point is used to register contributions to the collaborative framework, either as locking strategies (used to define which objects are to be affected) or as participants implementing one or more of 4 different actions
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <choice minOccurs="1" maxOccurs="unbounded">
+ <element ref="ParticipantFactory"/>
+ <element ref="LockingStrategy"/>
+ </choice>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="LockingStrategy">
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="impl" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.team.collaborative.ILockingStrategy"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="ParticipantFactory">
+ <annotation>
+ <documentation>
+ This extension aim to register participant to collaboration
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="impl" type="string" use="required">
+ <annotation>
+ <documentation>
+ This is an implentation of a participant for the collaboration mode. Depending on the feature that this participant provide it as to inherite from ILocker, IUnlocker, IUpdater, ICommitter
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.team.collaborative.ICollabFactory"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="priority" type="string" use="required">
+ <annotation>
+ <documentation>
+ Should be a int. The higher int is the most prioritary
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/Activator.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/Activator.java
index 3a6e9f6..3a6e9f6 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/Activator.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/Activator.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/ExtendedURI.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/ExtendedURI.java
index 88366e6..88366e6 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/ExtendedURI.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/ExtendedURI.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/ICollabFactory.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/ICollabFactory.java
index 54443ee..54443ee 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/ICollabFactory.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/ICollabFactory.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/ICollaborativeManager.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/ICollaborativeManager.java
index 3ef8f37..3ef8f37 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/ICollaborativeManager.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/ICollaborativeManager.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/IExtendedURI.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/IExtendedURI.java
index 3b4905a..3b4905a 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/IExtendedURI.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/IExtendedURI.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/impl/CollaborativeManager.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/impl/CollaborativeManager.java
index d82de14..d82de14 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/impl/CollaborativeManager.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/impl/CollaborativeManager.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/AbstractExtendedURIBuilder.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/AbstractExtendedURIBuilder.java
index 04bf8fa..04bf8fa 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/AbstractExtendedURIBuilder.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/AbstractExtendedURIBuilder.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/ICollabParticipant.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/ICollabParticipant.java
index fe7cddd..fe7cddd 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/ICollabParticipant.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/ICollabParticipant.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/IExtendedURISuperSet.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/IExtendedURISuperSet.java
index 2616569..2616569 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/IExtendedURISuperSet.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/IExtendedURISuperSet.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/locker/ILocker.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/locker/ILocker.java
index 5bf410a..5bf410a 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/locker/ILocker.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/locker/ILocker.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/locker/IUnlocker.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/locker/IUnlocker.java
index 70a47af..70a47af 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/locker/IUnlocker.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/locker/IUnlocker.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/version/ICommitter.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/version/ICommitter.java
index 16aa25a..16aa25a 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/version/ICommitter.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/version/ICommitter.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/version/IReverter.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/version/IReverter.java
index 18d5bd3..18d5bd3 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/version/IReverter.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/version/IReverter.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/version/IUpdater.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/version/IUpdater.java
index 22909a3..22909a3 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/version/IUpdater.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/version/IUpdater.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/version/IWorkOnModifiedElementParticipant.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/version/IWorkOnModifiedElementParticipant.java
index a4f0391..a4f0391 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/participants/version/IWorkOnModifiedElementParticipant.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/participants/version/IWorkOnModifiedElementParticipant.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/CollabStatus.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/reports/CollabStatus.java
index 928fced..928fced 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/CollabStatus.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/reports/CollabStatus.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/LogHelper.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/reports/LogHelper.java
index 7e269c7..7e269c7 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/LogHelper.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/reports/LogHelper.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/strategy/AbstractLockingStrategy.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/strategy/AbstractLockingStrategy.java
index 5c10d6a..5c10d6a 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/strategy/AbstractLockingStrategy.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/strategy/AbstractLockingStrategy.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/strategy/ILockingStrategy.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/strategy/ILockingStrategy.java
index 72c90c3..72c90c3 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/strategy/ILockingStrategy.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/strategy/ILockingStrategy.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/AbstractRunnableWithProgressWithResult.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/AbstractRunnableWithProgressWithResult.java
index eed22c0..eed22c0 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/AbstractRunnableWithProgressWithResult.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/AbstractRunnableWithProgressWithResult.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/CollabFunctionsFactory.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/CollabFunctionsFactory.java
index a616207..a616207 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/CollabFunctionsFactory.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/CollabFunctionsFactory.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/CollabUtils.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/CollabUtils.java
index 46ec466..46ec466 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/CollabUtils.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/CollabUtils.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/ExtendedURIUtil.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/ExtendedURIUtil.java
index 3d5de89..3d5de89 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/ExtendedURIUtil.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/ExtendedURIUtil.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/IRunnableWithProgressWithResult.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/IRunnableWithProgressWithResult.java
index 0dba93f..0dba93f 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/IRunnableWithProgressWithResult.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/IRunnableWithProgressWithResult.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/ModelsUtil.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/ModelsUtil.java
index 97c765c..97c765c 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/ModelsUtil.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/ModelsUtil.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/ResourceUtils.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/ResourceUtils.java
index 2204ad8..2204ad8 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/ResourceUtils.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/ResourceUtils.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/URIUtils.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/URIUtils.java
index 2320a26..2320a26 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/URIUtils.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/URIUtils.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/EObjectToExtendedURI.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/EObjectToExtendedURI.java
index b48c21a..b48c21a 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/EObjectToExtendedURI.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/EObjectToExtendedURI.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ExtendedURIToEObjects.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ExtendedURIToEObjects.java
index 08fa2fa..08fa2fa 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ExtendedURIToEObjects.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ExtendedURIToEObjects.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ExtendedURIToIResource.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ExtendedURIToIResource.java
index 5573646..5573646 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ExtendedURIToIResource.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ExtendedURIToIResource.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ExtendedURIToURI.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ExtendedURIToURI.java
index 683a8cf..683a8cf 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ExtendedURIToURI.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ExtendedURIToURI.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/IFileToFile.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/IFileToFile.java
index 58b9388..58b9388 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/IFileToFile.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/IFileToFile.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/IResourceToExtendedURI.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/IResourceToExtendedURI.java
index 550b495..550b495 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/IResourceToExtendedURI.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/IResourceToExtendedURI.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ResourceToIFile.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ResourceToIFile.java
index 97350f4..97350f4 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ResourceToIFile.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ResourceToIFile.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ResourceToURI.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ResourceToURI.java
index 7f37343..7f37343 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/ResourceToURI.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/ResourceToURI.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/URIToExtendedURI.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/URIToExtendedURI.java
index 4a40212..4a40212 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/URIToExtendedURI.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/URIToExtendedURI.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/URIToExtendedURIWithContainment.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/URIToExtendedURIWithContainment.java
index d0c3ca5..d0c3ca5 100644
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/utils/funtions/URIToExtendedURIWithContainment.java
+++ b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/core/utils/funtions/URIToExtendedURIWithContainment.java
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/copy/CollabStatus.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/copy/CollabStatus.java
deleted file mode 100644
index 90a4d1c..0000000
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/copy/CollabStatus.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.reports.copy;
-
-import org.eclipse.core.runtime.Status;
-
-/**
- * The Class CollabStatus.
- */
-public class CollabStatus extends Status {
-
- /**
- * Instantiates a new collab status.
- *
- * @param severity
- * the severity
- * @param pluginId
- * the plugin id
- * @param code
- * the code
- * @param message
- * the message
- * @param exception
- * the exception
- */
- public CollabStatus(int severity, String pluginId, int code, String message, Throwable exception) {
- super(severity, pluginId, code, message, exception);
- }
-
- /**
- * Instantiates a new collab status.
- *
- * @param severity
- * the severity
- * @param pluginId
- * the plugin id
- * @param message
- * the message
- * @param exception
- * the exception
- */
- public CollabStatus(int severity, String pluginId, String message, Throwable exception) {
- super(severity, pluginId, message, exception);
- }
-
- /**
- * Instantiates a new collab status.
- *
- * @param severity
- * the severity
- * @param pluginId
- * the plugin id
- * @param message
- * the message
- */
- public CollabStatus(int severity, String pluginId, String message) {
- super(severity, pluginId, message);
- }
-
- /**
- * Creates the error status.
- *
- * @param message
- * the message
- * @return the collab status
- */
- public static CollabStatus createErrorStatus(String message) {
- return new CollabStatus(ERROR, org.eclipse.papyrus.team.collaborative.Activator.PLUGIN_ID, message);
- }
-
- /**
- * Creates the error status.
- *
- * @param message
- * the message
- * @param e
- * the e
- * @return the collab status
- */
- public static CollabStatus createErrorStatus(String message, Throwable e) {
- return new CollabStatus(ERROR, org.eclipse.papyrus.team.collaborative.Activator.PLUGIN_ID, message, e);
- }
-
-
-
-}
diff --git a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/copy/LogHelper.java b/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/copy/LogHelper.java
deleted file mode 100644
index 65f704d..0000000
--- a/extraplugins/team.collaborative/org.eclipse.papyrus.team.collaborative/src/org/eclipse/papyrus/team/collaborative/reports/copy/LogHelper.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.papyrus.team.collaborative.reports.copy;
-
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.papyrus.team.collaborative.Activator;
-
-
-/**
- * The Class LogHelper.
- * This class intend to help the user to log stuff
- */
-public class LogHelper {
-
- /**
- * The Class SingletonHolder.
- */
- private static class SingletonHolder {
-
- /** The Constant INSTANCE. */
- private static final LogHelper INSTANCE = new LogHelper();
- }
-
- /**
- * Gets the single instance of LogHelper.
- *
- * @return single instance of LogHelper
- */
- public static LogHelper getInstance() {
- return SingletonHolder.INSTANCE;
- }
-
- /**
- * Log info.
- *
- * @param message
- * the message
- * @param bundleId
- * the bundle id
- */
- public void logInfo(String message, String bundleId) {
- getLogger().log(createWarningStatus(bundleId, message));
- }
-
- /**
- * Creates the warning status.
- *
- * @param bundleId
- * the bundle id
- * @param message
- * the message
- * @return the i status
- */
- protected IStatus createWarningStatus(String bundleId, String message) {
- return createStatus(Status.WARNING, bundleId, message);
- }
-
- /**
- * Log error.
- *
- * @param message
- * the message
- * @param bundleId
- * the bundle id
- * @param e
- * the e
- */
- public void logError(String message, String bundleId, Throwable e) {
- getLogger().log(createErrorStatus(bundleId, message, e));
- }
-
- /**
- * Log error.
- *
- * @param message
- * the message
- * @param bundleId
- * the bundle id
- */
- public void logError(String message, String bundleId) {
- getLogger().log(createErrorStatus(bundleId, message));
- }
-
- /**
- * Gets the logger.
- *
- * @return the logger
- */
- protected ILog getLogger() {
- return Activator.getDefault().getLog();
- }
-
- /**
- * Creates the error status.
- *
- * @param pluginId
- * the plugin id
- * @param message
- * the message
- * @return the i status
- */
- protected IStatus createErrorStatus(String pluginId, String message) {
- return createStatus(Status.ERROR, pluginId, message);
- }
-
- /**
- * Creates the error status.
- *
- * @param pluginId
- * the plugin id
- * @param message
- * the message
- * @param e
- * the e
- * @return the i status
- */
- protected IStatus createErrorStatus(String pluginId, String message, Throwable e) {
- return createStatus(Status.ERROR, pluginId, message, e);
- }
-
- /**
- * Creates the status.
- *
- * @param severity
- * the severity
- * @param pluginId
- * the plugin id
- * @param message
- * the message
- * @param e
- * the e
- * @return the i status
- */
- protected IStatus createStatus(int severity, String pluginId, String message, Throwable e) {
- return new Status(severity, pluginId, message, e);
- }
-
- /**
- * Creates the status.
- *
- * @param severity
- * the severity
- * @param pluginId
- * the plugin id
- * @param message
- * the message
- * @return the i status
- */
- protected IStatus createStatus(int severity, String pluginId, String message) {
- return new Status(severity, pluginId, message);
- }
-}