Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-03-19 07:35:48 -0400
committerEike Stepper2013-03-19 07:35:48 -0400
commit1a7d7568c7699b02a944c5ac62c637f1f85017e9 (patch)
tree750854929ae0ad63feb461fbf66d68e38b798176
parentac7fc9579e8ab4af50bf6c80151e8989cf31fb81 (diff)
downloadcdo-1a7d7568c7699b02a944c5ac62c637f1f85017e9.tar.gz
cdo-1a7d7568c7699b02a944c5ac62c637f1f85017e9.tar.xz
cdo-1a7d7568c7699b02a944c5ac62c637f1f85017e9.zip
[400926] Move plugins that depends on EMF Compare to an independent and
optional feature https://bugs.eclipse.org/bugs/show_bug.cgi?id=400926
-rw-r--r--features/org.eclipse.emf.cdo-feature/feature.xml14
-rw-r--r--features/org.eclipse.emf.cdo.compare-feature/.project27
-rw-r--r--features/org.eclipse.emf.cdo.compare-feature/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--features/org.eclipse.emf.cdo.compare-feature/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--features/org.eclipse.emf.cdo.compare-feature/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--features/org.eclipse.emf.cdo.compare-feature/build.properties13
-rw-r--r--features/org.eclipse.emf.cdo.compare-feature/feature.properties8
-rw-r--r--features/org.eclipse.emf.cdo.compare-feature/feature.xml51
-rw-r--r--features/org.eclipse.emf.cdo.sdk-feature/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--features/org.eclipse.emf.cdo.sdk-feature/feature.xml4
-rw-r--r--features/org.eclipse.emf.cdo.site-feature/feature.xml4
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoManager.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoManagerImpl.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/InternalCDOCommitInfoManager.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionImpl.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.compare/plugin.xml23
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/compare/CDOCompareEditorUtil.java36
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/internal/compare/CompareWithPreviousVersionAction.java80
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.team/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.team/src/org/eclipse/emf/cdo/ui/internal/team/history/CDOHistoryPage.java41
21 files changed, 292 insertions, 50 deletions
diff --git a/features/org.eclipse.emf.cdo-feature/feature.xml b/features/org.eclipse.emf.cdo-feature/feature.xml
index e74219abd7..7937f53e90 100644
--- a/features/org.eclipse.emf.cdo-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo-feature/feature.xml
@@ -154,13 +154,6 @@
unpack="false"/>
<plugin
- id="org.eclipse.emf.cdo.ui.compare"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
id="org.eclipse.emf.cdo.ui.team"
download-size="0"
install-size="0"
@@ -231,13 +224,6 @@
unpack="false"/>
<plugin
- id="org.eclipse.emf.cdo.compare"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
id="org.eclipse.emf.cdo.ecore.retrofit"
download-size="0"
install-size="0"
diff --git a/features/org.eclipse.emf.cdo.compare-feature/.project b/features/org.eclipse.emf.cdo.compare-feature/.project
new file mode 100644
index 0000000000..8bbdabc721
--- /dev/null
+++ b/features/org.eclipse.emf.cdo.compare-feature/.project
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.cdo.compare-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.emf.cdo.releng.version.VersionBuilder</name>
+ <arguments>
+ <dictionary>
+ <key>release.path</key>
+ <value>/org.eclipse.emf.cdo.releng.release/release.xml</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ <nature>org.eclipse.emf.cdo.releng.version.VersionNature</nature>
+ </natures>
+</projectDescription>
diff --git a/features/org.eclipse.emf.cdo.compare-feature/.settings/org.eclipse.ltk.core.refactoring.prefs b/features/org.eclipse.emf.cdo.compare-feature/.settings/org.eclipse.ltk.core.refactoring.prefs
new file mode 100644
index 0000000000..9b58a30859
--- /dev/null
+++ b/features/org.eclipse.emf.cdo.compare-feature/.settings/org.eclipse.ltk.core.refactoring.prefs
@@ -0,0 +1,3 @@
+#Mon Jul 04 12:36:04 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/features/org.eclipse.emf.cdo.compare-feature/.settings/org.eclipse.mylyn.tasks.ui.prefs b/features/org.eclipse.emf.cdo.compare-feature/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 0000000000..d573634502
--- /dev/null
+++ b/features/org.eclipse.emf.cdo.compare-feature/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Thu Feb 04 10:06:10 CET 2010
+eclipse.preferences.version=1
+project.repository.kind=bugzilla
+project.repository.url=https\://bugs.eclipse.org/bugs
diff --git a/features/org.eclipse.emf.cdo.compare-feature/.settings/org.eclipse.mylyn.team.ui.prefs b/features/org.eclipse.emf.cdo.compare-feature/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 0000000000..4d86eb45ba
--- /dev/null
+++ b/features/org.eclipse.emf.cdo.compare-feature/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Thu Feb 04 10:06:10 CET 2010
+commit.comment.template=[${task.id}] ${task.description} \r\n${task.url}
+eclipse.preferences.version=1
diff --git a/features/org.eclipse.emf.cdo.compare-feature/build.properties b/features/org.eclipse.emf.cdo.compare-feature/build.properties
new file mode 100644
index 0000000000..702432df1e
--- /dev/null
+++ b/features/org.eclipse.emf.cdo.compare-feature/build.properties
@@ -0,0 +1,13 @@
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# 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:
+# Eike Stepper - initial API and implementation
+
+# NLS_MESSAGEFORMAT_VAR
+
+bin.includes = feature.xml,\
+ feature.properties
diff --git a/features/org.eclipse.emf.cdo.compare-feature/feature.properties b/features/org.eclipse.emf.cdo.compare-feature/feature.properties
new file mode 100644
index 0000000000..3478c30992
--- /dev/null
+++ b/features/org.eclipse.emf.cdo.compare-feature/feature.properties
@@ -0,0 +1,8 @@
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# 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
+
+featureName = CDO Model Repository Client (Compare Integration)
+description = Contains the core and user interface plugins of the CDO / EMF Compare integration. This feature is optional and requires EMF Compare 2.1 or higher.
diff --git a/features/org.eclipse.emf.cdo.compare-feature/feature.xml b/features/org.eclipse.emf.cdo.compare-feature/feature.xml
new file mode 100644
index 0000000000..f601f41712
--- /dev/null
+++ b/features/org.eclipse.emf.cdo.compare-feature/feature.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ 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:
+ Eike Stepper - initial API and implementation
+-->
+<feature
+ id="org.eclipse.emf.cdo.compare"
+ label="%featureName"
+ version="4.2.0.qualifier"
+ provider-name="%providerName"
+ license-feature="org.eclipse.emf.cdo.license"
+ license-feature-version="0.0.0">
+
+ <description>
+ %description
+ </description>
+
+ <copyright url="%copyrightURL">
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <update label="%updateSiteName" url="http://www.eclipse.org/modeling/updates/"/>
+ <discovery label="%updateSiteName" url="http://www.eclipse.org/modeling/updates/"/>
+ </url>
+
+ <plugin
+ id="org.eclipse.emf.cdo.compare"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.emf.cdo.ui.compare"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/features/org.eclipse.emf.cdo.sdk-feature/.settings/org.eclipse.core.resources.prefs b/features/org.eclipse.emf.cdo.sdk-feature/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000000..b9743bf086
--- /dev/null
+++ b/features/org.eclipse.emf.cdo.sdk-feature/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/.project=UTF-8
diff --git a/features/org.eclipse.emf.cdo.sdk-feature/feature.xml b/features/org.eclipse.emf.cdo.sdk-feature/feature.xml
index 4d32fe2d4b..1787fe81a5 100644
--- a/features/org.eclipse.emf.cdo.sdk-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo.sdk-feature/feature.xml
@@ -83,6 +83,10 @@
id="org.eclipse.emf.cdo.examples.installer"
version="0.0.0"/>
+ <includes
+ id="org.eclipse.emf.cdo.compare.source"
+ version="0.0.0"/>
+
<plugin
id="org.eclipse.emf.cdo.sdk"
download-size="0"
diff --git a/features/org.eclipse.emf.cdo.site-feature/feature.xml b/features/org.eclipse.emf.cdo.site-feature/feature.xml
index 7778607571..312743a70c 100644
--- a/features/org.eclipse.emf.cdo.site-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo.site-feature/feature.xml
@@ -79,6 +79,10 @@
version="0.0.0"/>
<includes
+ id="org.eclipse.emf.cdo.compare"
+ version="0.0.0"/>
+
+ <includes
id="org.eclipse.emf.cdo.server.hibernate"
version="0.0.0"/>
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoManager.java
index 481bba7d50..33e721eed7 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoManager.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoManager.java
@@ -10,6 +10,7 @@
*/
package org.eclipse.emf.cdo.common.commit;
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
/**
@@ -26,6 +27,11 @@ public interface CDOCommitInfoManager extends CDOCommitInfoProvider,
CDOCommitHistory.Provider<CDOBranch, CDOCommitHistory>
{
/**
+ * @since 4.2
+ */
+ public CDOCommonRepository getRepository();
+
+ /**
* @since 4.0
*/
public CDOCommitInfo getCommitInfo(long timeStamp);
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoManagerImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoManagerImpl.java
index 198102a825..195e7a811b 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoManagerImpl.java
@@ -11,6 +11,7 @@
*/
package org.eclipse.emf.cdo.internal.common.commit;
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.commit.CDOCommitData;
@@ -39,6 +40,8 @@ public class CDOCommitInfoManagerImpl extends CDOCommitHistoryProviderImpl<CDOBr
private final Map<CDOBranch, BranchInfoCache> branches = new WeakHashMap<CDOBranch, BranchInfoCache>();
+ private CDOCommonRepository repository;
+
private CommitInfoLoader loader;
private List<CDOCommitInfoHandler> handlers = new ArrayList<CDOCommitInfoHandler>();
@@ -55,6 +58,17 @@ public class CDOCommitInfoManagerImpl extends CDOCommitHistoryProviderImpl<CDOBr
}
}
+ public CDOCommonRepository getRepository()
+ {
+ return repository;
+ }
+
+ public void setRepository(CDOCommonRepository repository)
+ {
+ checkInactive();
+ this.repository = repository;
+ }
+
public CommitInfoLoader getCommitInfoLoader()
{
return loader;
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/InternalCDOCommitInfoManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/InternalCDOCommitInfoManager.java
index 5d33eeb9d6..c8f8cd345c 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/InternalCDOCommitInfoManager.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/InternalCDOCommitInfoManager.java
@@ -10,6 +10,7 @@
*/
package org.eclipse.emf.cdo.spi.common.commit;
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.commit.CDOCommitData;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
@@ -28,6 +29,11 @@ import org.eclipse.net4j.util.lifecycle.ILifecycle;
*/
public interface InternalCDOCommitInfoManager extends CDOCommitInfoManager, ILifecycle
{
+ /**
+ * @since 4.2
+ */
+ public void setRepository(CDOCommonRepository repository);
+
public CommitInfoLoader getCommitInfoLoader();
public void setCommitInfoLoader(CommitInfoLoader commitInfoLoader);
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionImpl.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionImpl.java
index 45fbe8b67c..6498b5da49 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionImpl.java
@@ -174,6 +174,7 @@ public class CDONet4jSessionImpl extends CDOSessionImpl implements org.eclipse.e
setCommitInfoManager(commitInfoManager);
}
+ commitInfoManager.setRepository(getRepositoryInfo());
commitInfoManager.setCommitInfoLoader(getSessionProtocol());
commitInfoManager.activate();
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
index ec2d3615fb..aae31efc84 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
@@ -1846,6 +1846,7 @@ public class Repository extends Container<Object> implements InternalRepository
revisionManager.setRevisionLoader(this);
sessionManager.setRepository(this);
queryManager.setRepository(this);
+ commitInfoManager.setRepository(this);
commitInfoManager.setCommitInfoLoader(this);
commitManager.setRepository(this);
getLockingManager().setRepository(this);
diff --git a/plugins/org.eclipse.emf.cdo.ui.compare/plugin.xml b/plugins/org.eclipse.emf.cdo.ui.compare/plugin.xml
index e64dc84554..bdb503dd73 100644
--- a/plugins/org.eclipse.emf.cdo.ui.compare/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.ui.compare/plugin.xml
@@ -18,7 +18,7 @@
id="org.eclipse.emf.cdo.ui.compare.contribution1"
objectClass="org.eclipse.emf.cdo.transaction.CDOTransaction">
<menu
- id="org.eclipse.emf.cdo.ui.compare.menu"
+ id="org.eclipse.emf.cdo.ui.compare.MergeMenu"
label="Merge"
path="additions">
<separator name="group1"/>
@@ -26,16 +26,29 @@
<action
class="org.eclipse.emf.cdo.ui.internal.compare.MergeAction$FromBranchPoint"
enablesFor="1"
- id="org.eclipse.emf.cdo.ui.compare.newAction"
+ id="org.eclipse.emf.cdo.ui.compare.MergeFromBranchPointAction"
label="From Branch Point..."
- menubarPath="org.eclipse.emf.cdo.ui.compare.menu/group1">
+ menubarPath="org.eclipse.emf.cdo.ui.compare.MergeMenu/group1">
</action>
<action
class="org.eclipse.emf.cdo.ui.internal.compare.MergeAction$FromBranch"
enablesFor="1"
- id="org.eclipse.emf.cdo.ui.compare.newAction"
+ id="org.eclipse.emf.cdo.ui.compare.MergeFromBranchAction"
label="From Branch..."
- menubarPath="org.eclipse.emf.cdo.ui.compare.menu/group1">
+ menubarPath="org.eclipse.emf.cdo.ui.compare.MergeMenu/group1">
+ </action>
+ </objectContribution>
+ <objectContribution
+ adaptable="true"
+ id="org.eclipse.emf.cdo.ui.compare.contribution2"
+ objectClass="org.eclipse.emf.cdo.common.commit.CDOCommitInfo">
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.compare.CompareWithPreviousVersionAction"
+ enablesFor="1"
+ id="org.eclipse.emf.cdo.ui.compare.CompareWithPreviousVersionAction"
+ label="Compare With Previous Version..."
+ menubarPath="additions"
+ style="push">
</action>
</objectContribution>
</extension>
diff --git a/plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/compare/CDOCompareEditorUtil.java b/plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/compare/CDOCompareEditorUtil.java
index 03c2149dc1..b7959a44e8 100644
--- a/plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/compare/CDOCompareEditorUtil.java
+++ b/plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/compare/CDOCompareEditorUtil.java
@@ -10,10 +10,17 @@
*/
package org.eclipse.emf.cdo.ui.compare;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.compare.CDOCompare;
import org.eclipse.emf.cdo.compare.CDOCompareUtil;
+import org.eclipse.emf.cdo.session.CDORepositoryInfo;
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.spi.common.branch.CDOBranchUtil;
import org.eclipse.emf.cdo.view.CDOView;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.domain.ICompareEditingDomain;
@@ -33,6 +40,35 @@ import org.eclipse.compare.CompareUI;
*/
public class CDOCompareEditorUtil
{
+ public static boolean openDialog(CDOCommitInfo commitInfo)
+ {
+ long previousTimeStamp = commitInfo.getPreviousTimeStamp();
+ if (previousTimeStamp == CDOBranchPoint.UNSPECIFIED_DATE)
+ {
+ return false;
+ }
+
+ CDORepositoryInfo repositoryInfo = (CDORepositoryInfo)commitInfo.getCommitInfoManager().getRepository();
+ CDOSession session = repositoryInfo.getSession();
+ CDOBranchPoint previous = CDOBranchUtil.normalizeBranchPoint(commitInfo.getBranch(), previousTimeStamp);
+
+ CDOView leftView = null;
+ CDOView rightView = null;
+
+ try
+ {
+ leftView = session.openView(commitInfo);
+ rightView = session.openView(previous);
+
+ return openDialog(leftView, rightView, null);
+ }
+ finally
+ {
+ LifecycleUtil.deactivate(rightView);
+ LifecycleUtil.deactivate(leftView);
+ }
+ }
+
public static boolean openDialog(CDOView leftView, CDOView rightView, CDOView[] originView)
{
Comparison comparison = CDOCompareUtil.compare(leftView, rightView, originView);
diff --git a/plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/internal/compare/CompareWithPreviousVersionAction.java b/plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/internal/compare/CompareWithPreviousVersionAction.java
new file mode 100644
index 0000000000..055e01a9d0
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/internal/compare/CompareWithPreviousVersionAction.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.ui.internal.compare;
+
+import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
+import org.eclipse.emf.cdo.ui.compare.CDOCompareEditorUtil;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * @author Eike Stepper
+ */
+public class CompareWithPreviousVersionAction implements IObjectActionDelegate
+{
+ private CDOCommitInfo commitInfo;
+
+ public CompareWithPreviousVersionAction()
+ {
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart)
+ {
+ // Do nothing
+ }
+
+ public void selectionChanged(IAction action, ISelection selection)
+ {
+ commitInfo = null;
+ if (selection instanceof IStructuredSelection)
+ {
+ Object selectedElement = ((IStructuredSelection)selection).getFirstElement();
+ if (selectedElement instanceof CDOCommitInfo)
+ {
+ commitInfo = getAdapter(selectedElement, CDOCommitInfo.class);
+ }
+ }
+ }
+
+ public void run(IAction action)
+ {
+ if (commitInfo != null)
+ {
+ CDOCompareEditorUtil.openDialog(commitInfo);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> T getAdapter(Object adaptable, Class<T> c)
+ {
+ if (c.isInstance(adaptable))
+ {
+ return (T)adaptable;
+ }
+
+ if (adaptable instanceof IAdaptable)
+ {
+ IAdaptable a = (IAdaptable)adaptable;
+ Object adapter = a.getAdapter(c);
+ if (c.isInstance(adapter))
+ {
+ return (T)adapter;
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.team/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.ui.team/META-INF/MANIFEST.MF
index cc5f029b13..dbf17b2b08 100644
--- a/plugins/org.eclipse.emf.cdo.ui.team/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.ui.team/META-INF/MANIFEST.MF
@@ -12,7 +12,6 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.team.ui;bundle-version="[3.5.0,4.0.0)",
org.eclipse.emf.cdo.ui;bundle-version="[4.2.0,5.0.0)";visibility:=reexport,
- org.eclipse.emf.cdo.ui.compare;bundle-version="[4.2.0,5.0.0)";visibility:=reexport,
org.eclipse.emf.cdo.ui.shared;bundle-version="[4.0.0,5.0.0)"
Export-Package: org.eclipse.emf.cdo.ui.internal.team.actions;version="4.2.0";x-internal:=true,
org.eclipse.emf.cdo.ui.internal.team.bundle;version="4.2.0";x-internal:=true,
diff --git a/plugins/org.eclipse.emf.cdo.ui.team/src/org/eclipse/emf/cdo/ui/internal/team/history/CDOHistoryPage.java b/plugins/org.eclipse.emf.cdo.ui.team/src/org/eclipse/emf/cdo/ui/internal/team/history/CDOHistoryPage.java
index 342bc962f4..f3e29bfebc 100644
--- a/plugins/org.eclipse.emf.cdo.ui.team/src/org/eclipse/emf/cdo/ui/internal/team/history/CDOHistoryPage.java
+++ b/plugins/org.eclipse.emf.cdo.ui.team/src/org/eclipse/emf/cdo/ui/internal/team/history/CDOHistoryPage.java
@@ -11,20 +11,16 @@
package org.eclipse.emf.cdo.ui.internal.team.history;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoManager;
import org.eclipse.emf.cdo.eresource.CDOResourceFolder;
import org.eclipse.emf.cdo.session.CDOSession;
-import org.eclipse.emf.cdo.spi.common.branch.CDOBranchUtil;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.transaction.CDOTransactionCommentator;
-import org.eclipse.emf.cdo.ui.compare.CDOCompareEditorUtil;
import org.eclipse.emf.cdo.ui.widgets.CommitHistoryComposite;
import org.eclipse.emf.cdo.ui.widgets.CommitHistoryComposite.Input;
import org.eclipse.emf.cdo.ui.widgets.CommitHistoryComposite.LabelProvider;
-import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.lifecycle.ILifecycle;
@@ -35,9 +31,11 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
import org.eclipse.team.ui.history.HistoryPage;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.part.IPageSite;
@@ -47,6 +45,8 @@ import org.eclipse.ui.part.IPageSite;
*/
public class CDOHistoryPage extends HistoryPage
{
+ private static final String POPUP_ID = "org.eclipse.emf.cdo.ui.team.historyPageContributions";
+
private CommitHistoryComposite commitHistoryComposite;
private boolean commitOnDoubleClick;
@@ -103,31 +103,6 @@ public class CDOHistoryPage extends HistoryPage
{
testCommit(commitInfo);
}
- else
- {
- long previousTimeStamp = commitInfo.getPreviousTimeStamp();
- if (previousTimeStamp != CDOBranchPoint.UNSPECIFIED_DATE)
- {
- CDOBranchPoint previous = CDOBranchUtil.normalizeBranchPoint(commitInfo.getBranch(), previousTimeStamp);
-
- CDOView leftView = null;
- CDOView rightView = null;
-
- try
- {
- CDOSession session = input.getSession();
- leftView = session.openView(commitInfo);
- rightView = session.openView(previous);
-
- CDOCompareEditorUtil.openDialog(leftView, rightView, null);
- }
- finally
- {
- LifecycleUtil.deactivate(rightView);
- LifecycleUtil.deactivate(leftView);
- }
- }
- }
}
private void testCommit(CDOCommitInfo commitInfo)
@@ -175,7 +150,13 @@ public class CDOHistoryPage extends HistoryPage
};
IPageSite site = getSite();
- site.setSelectionProvider(commitHistoryComposite.getTableViewer());
+ TableViewer tableViewer = commitHistoryComposite.getTableViewer();
+
+ MenuManager menuManager = new MenuManager();
+ Menu menu = menuManager.createContextMenu(tableViewer.getControl());
+ tableViewer.getControl().setMenu(menu);
+ site.registerContextMenu(POPUP_ID, menuManager, tableViewer);
+ site.setSelectionProvider(tableViewer);
IActionBars actionBars = site.getActionBars();
setupToolBar(actionBars.getToolBarManager());

Back to the top