Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-10-05 01:33:22 -0400
committerEike Stepper2016-10-05 01:33:22 -0400
commit95d11d623b78209da114873fe169995fee7af59c (patch)
tree7f214e0b0a42ef63cd22cf83d167b30f3277ed98 /plugins/org.eclipse.emf.cdo.ui
parent023a17a1a415b2c6272ff1a81f54c0b6f7b4e51a (diff)
downloadcdo-95d11d623b78209da114873fe169995fee7af59c.tar.gz
cdo-95d11d623b78209da114873fe169995fee7af59c.tar.xz
cdo-95d11d623b78209da114873fe169995fee7af59c.zip
[504014] Make merge information available in CDOCommitInfo
https://bugs.eclipse.org/bugs/show_bug.cgi?id=504014
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.ui')
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/CDOClient1.launch50
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/CDOClient2.launch2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF36
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Branch.java26
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Commit.java146
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Net.java178
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/NetRenderer.java224
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Segment.java55
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/SegmentList.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Track.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/CommitHistoryComposite.java148
11 files changed, 699 insertions, 214 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/CDOClient1.launch b/plugins/org.eclipse.emf.cdo.ui/CDOClient1.launch
index 28acd859bb..b228702446 100644
--- a/plugins/org.eclipse.emf.cdo.ui/CDOClient1.launch
+++ b/plugins/org.eclipse.emf.cdo.ui/CDOClient1.launch
@@ -6,31 +6,31 @@
<setEntry value="org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf.edit:1.0.300.qualifier:default:true"/>
<setEntry value="org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.gmf.edit:1.0.300.qualifier:default:true"/>
<setEntry value="org.eclipse.emf.cdo.dawn.examples.acore.edit:1.0.400.qualifier:default:true"/>
-<setEntry value="org.eclipse.emf.cdo.edit:4.4.0.qualifier:default:true"/>
+<setEntry value="org.eclipse.emf.cdo.edit:4.4.100.qualifier:default:true"/>
<setEntry value="org.eclipse.emf.cdo.examples.company.edit:4.0.400.qualifier:default:true"/>
-<setEntry value="org.eclipse.emf.cdo.expressions.edit:4.3.100.qualifier:default:true"/>
-<setEntry value="org.eclipse.emf.cdo.security.edit:4.3.100.qualifier:default:true"/>
-<setEntry value="org.eclipse.emf.compare.edit:4.2.0.201509130440:default:true"/>
-<setEntry value="org.eclipse.emf.databinding.edit:1.3.0.v20150904-1501:default:true"/>
-<setEntry value="org.eclipse.emf.ecore.edit:2.9.0.v20150904-1501:default:true"/>
-<setEntry value="org.eclipse.emf.ecore.editor:2.11.0.v20150904-1501:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.view.categorization.model.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.view.compoundcontrol.model.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.view.custom.model.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.view.group.model.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.view.horizontal.model.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.view.label.model.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.view.model.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.view.rule.model.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.view.stack.model.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.view.table.model.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.view.template.model.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.view.treemasterdetail.model.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.ecp.view.vertical.model.edit:1.5.0.20141210-1818:default:true"/>
-<setEntry value="org.eclipse.emf.edit:2.12.0.v20150904-1501:default:true"/>
-<setEntry value="org.eclipse.gmf.codegen.edit:2.9.0.201406111907:default:true"/>
-<setEntry value="org.eclipse.gmf.runtime.notation.edit:1.7.0.201505312221:default:true"/>
+<setEntry value="org.eclipse.emf.cdo.expressions.edit:4.3.200.qualifier:default:true"/>
+<setEntry value="org.eclipse.emf.cdo.security.edit:4.3.200.qualifier:default:true"/>
+<setEntry value="org.eclipse.emf.compare.edit:4.2.1.201608311750:default:true"/>
+<setEntry value="org.eclipse.emf.databinding.edit:1.3.0.v20160526-0356:default:true"/>
+<setEntry value="org.eclipse.emf.ecore.edit:2.9.0.v20160526-0356:default:true"/>
+<setEntry value="org.eclipse.emf.ecore.editor:2.12.0.v20160526-0356:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.view.categorization.model.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.view.compoundcontrol.model.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.view.custom.model.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.view.group.model.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.view.horizontal.model.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.view.label.model.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.view.model.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.view.rule.model.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.view.stack.model.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.view.table.model.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.view.template.model.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.view.treemasterdetail.model.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.ecp.view.vertical.model.edit:1.10.0.20160912-1709:default:true"/>
+<setEntry value="org.eclipse.emf.edit:2.12.0.v20160526-0356:default:true"/>
+<setEntry value="org.eclipse.gmf.codegen.edit:2.9.0.201509291144:default:true"/>
+<setEntry value="org.eclipse.gmf.runtime.notation.edit:1.7.0.201606071631:default:true"/>
</setAttribute>
<booleanAttribute key="append.args" value="true"/>
<booleanAttribute key="askclear" value="true"/>
@@ -59,7 +59,7 @@
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -nosplash&#13;&#10;-clean"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-XX:MaxPermSize=512m&#13;&#10;-Xms40m&#13;&#10;-Xmx2g&#13;&#10;-Dosgi.console.enable.builtin=true&#13;&#10;-Dosgi.checkConfiguration=false"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-XX:MaxPermSize=512m&#13;&#10;-Xms40m&#13;&#10;-Xmx2g&#13;&#10;-Dosgi.console.enable.builtin=true&#13;&#10;-Dosgi.checkConfiguration=false&#13;&#10;-Dorg.eclipse.emf.cdo.ui.team.history.test=false"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<setAttribute key="selected_features">
diff --git a/plugins/org.eclipse.emf.cdo.ui/CDOClient2.launch b/plugins/org.eclipse.emf.cdo.ui/CDOClient2.launch
index 0313f9168e..99eb590748 100644
--- a/plugins/org.eclipse.emf.cdo.ui/CDOClient2.launch
+++ b/plugins/org.eclipse.emf.cdo.ui/CDOClient2.launch
@@ -24,7 +24,7 @@
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -nosplash&#13;&#10;-console"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx1g&#13;&#10;-Dosgi.console.enable.builtin=true&#13;&#10;-Dosgi.checkConfiguration=false"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx1g&#13;&#10;-Dosgi.console.enable.builtin=true&#13;&#10;-Dosgi.checkConfiguration=false&#13;&#10;-Dorg.eclipse.emf.cdo.ui.team.history.test=false"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<stringAttribute key="selectedPlugin" value="org.eclipse.emf.cdo"/>
diff --git a/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF
index 6d1ea311e2..cfab906df5 100644
--- a/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.cdo.ui;singleton:=true
-Bundle-Version: 4.5.100.qualifier
+Bundle-Version: 4.6.0.qualifier
Bundle-Activator: org.eclipse.emf.cdo.internal.ui.bundle.OM$Activator
Bundle-Vendor: %providerName
Bundle-ClassPath: .
@@ -27,7 +27,7 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)";reso
org.eclipse.emf.ecp.edit;bundle-version="[1.5.0,2.0.0)";resolution:=optional,
org.eclipse.emf.ecp.edit.swt;bundle-version="[1.5.0,2.0.0)";resolution:=optional,
org.eclipse.emf.ecp.ui.view.swt;bundle-version="[1.5.0,2.0.0)";resolution:=optional
-Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
+Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.6.0";
x-friends:="org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
@@ -36,7 +36,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.actions;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.actions;version="4.6.0";
x-friends:="org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
@@ -45,7 +45,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.handlers;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.handlers;version="4.6.0";
x-friends:="org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
@@ -54,9 +54,9 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.actions.delegates;version="4.5.100";x-internal:=true,
- org.eclipse.emf.cdo.internal.ui.bundle;version="4.5.100";x-internal:=true,
- org.eclipse.emf.cdo.internal.ui.dialogs;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.actions.delegates;version="4.6.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.ui.bundle;version="4.6.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.ui.dialogs;version="4.6.0";
x-friends:="org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
@@ -65,7 +65,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.dnd;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.dnd;version="4.6.0";
x-friends:="org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
@@ -74,7 +74,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.editor;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.editor;version="4.6.0";
x-friends:="org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
@@ -83,7 +83,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.filters;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.filters;version="4.6.0";
x-friends:="org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
@@ -92,7 +92,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.history;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.history;version="4.6.0";
x-friends:="org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
@@ -101,7 +101,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.messages;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.messages;version="4.6.0";
x-friends:="org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
@@ -110,7 +110,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.perspectives;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.perspectives;version="4.6.0";
x-friends:="org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
@@ -119,7 +119,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.preferences;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.preferences;version="4.6.0";
x-friends:="org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
@@ -128,7 +128,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.transfer;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.transfer;version="4.6.0";
x-friends:="org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
@@ -137,7 +137,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.views;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.views;version="4.6.0";
x-friends:="org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
@@ -146,5 +146,5 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.ui;version="4.5.100",
- org.eclipse.emf.cdo.ui.widgets;version="4.5.100"
+ org.eclipse.emf.cdo.ui;version="4.6.0",
+ org.eclipse.emf.cdo.ui.widgets;version="4.6.0"
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Branch.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Branch.java
index 80eb9f40ba..82a9818012 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Branch.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Branch.java
@@ -25,7 +25,7 @@ import org.eclipse.swt.graphics.Color;
/**
* @author Eike Stepper
*/
-public class Branch extends SegmentList
+public final class Branch extends SegmentList
{
private final CDOBranch cdoBranch;
@@ -74,26 +74,22 @@ public class Branch extends SegmentList
firstCommitTime = firstCommit.getTimeStamp();
}
- CDOCommitInfo lastCommit = commitInfoManager.getLastOfBranch(cdoBranch);
- if (lastCommit != null)
- {
- lastCommitTime = lastCommit.getTimeStamp();
- }
+ lastCommitTime = commitInfoManager.getLastCommitOfBranch(cdoBranch, true);
}
}
- public final CDOBranch getCDOBranch()
+ public CDOBranch getCDOBranch()
{
return cdoBranch;
}
- public final Color getColor()
+ public Color getColor()
{
return color;
}
@Deprecated
- public final Branch getBaseBranch()
+ public Branch getBaseBranch()
{
CDOBranchPoint cdoBase = cdoBranch.getBase();
CDOBranch cdoBaseBranch = cdoBase.getBranch();
@@ -107,34 +103,34 @@ public class Branch extends SegmentList
}
@Deprecated
- public final long getBaseTime()
+ public long getBaseTime()
{
return cdoBranch.getBase().getTimeStamp();
}
- public final Branch getBaseCommitBranch()
+ public Branch getBaseCommitBranch()
{
determineBaseCommitIfNeeded();
return baseCommitBranch;
}
- public final long getBaseCommitTime()
+ public long getBaseCommitTime()
{
determineBaseCommitIfNeeded();
return baseCommitTime;
}
- public final long getFirstCommitTime()
+ public long getFirstCommitTime()
{
return firstCommitTime;
}
- public final long getLastCommitTime()
+ public long getLastCommitTime()
{
return lastCommitTime;
}
- public final Segment getSegmentFrom(Segment[] segments)
+ public Segment getSegmentFrom(Segment[] segments)
{
for (int i = 0; i < segments.length; i++)
{
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Commit.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Commit.java
index 53c9f1f536..974b6fb997 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Commit.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Commit.java
@@ -12,10 +12,15 @@ package org.eclipse.emf.cdo.internal.ui.history;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.ListIterator;
+
/**
* @author Eike Stepper
*/
-public class Commit
+public final class Commit
{
private final CDOCommitInfo commitInfo;
@@ -25,32 +30,74 @@ public class Commit
private int commitCounter = -1;
+ private Commit mergeSource;
+
+ private List<Commit> mergeTargets;
+
+ private Segment mergeSegment;
+
public Commit(CDOCommitInfo commitInfo, Segment segment)
{
this.segment = segment;
this.commitInfo = commitInfo;
+
+ CDOCommitInfo mergedCommitInfo = commitInfo.getMergedCommitInfo();
+ if (mergedCommitInfo != null)
+ {
+ Net net = getNet();
+
+ mergeSource = net.getCommit(mergedCommitInfo);
+ if (mergeSource != null)
+ {
+ mergeSource.addMergeTargets(Collections.singletonList(this));
+ }
+ else
+ {
+ net.addDanglingMergeTarget(mergedCommitInfo, this);
+ }
+ }
}
- public final CDOCommitInfo getCommitInfo()
+ public CDOCommitInfo getCommitInfo()
{
return commitInfo;
}
- public final Net getNet()
+ public Net getNet()
{
return segment.getNet();
}
- public final Branch getBranch()
+ public Track getTrack()
+ {
+ return segment.getTrack();
+ }
+
+ public Branch getBranch()
{
return segment.getBranch();
}
- public final long getTime()
+ public long getTime()
{
return commitInfo.getTimeStamp();
}
+ public Commit getMergeSource()
+ {
+ return mergeSource;
+ }
+
+ public List<Commit> getMergeTargets()
+ {
+ return mergeTargets;
+ }
+
+ public Segment getMergeSegment()
+ {
+ return mergeSegment;
+ }
+
public final Segment getSegment()
{
return segment;
@@ -65,6 +112,26 @@ public class Commit
{
long time = getTime();
rowSegments = net.createRowSegments(time);
+
+ // int xxx;
+ // String dump = "row = " + time + " --> ";
+ // for (Segment segment : rowSegments)
+ // {
+ // if (segment == null)
+ // {
+ // dump += " ";
+ // }
+ // else if (segment.isMerge())
+ // {
+ // dump += ":";
+ // }
+ // else
+ // {
+ // dump += "|";
+ // }
+ // }
+ // System.out.println(dump);
+
commitCounter = netCommitCounter;
}
@@ -88,4 +155,73 @@ public class Commit
{
return "Commit[" + getTime() + " --> " + segment + "]";
}
+
+ void setMergeSource(Commit mergeSource)
+ {
+ this.mergeSource = mergeSource;
+ }
+
+ void addMergeTargets(List<Commit> mergeTargets)
+ {
+ for (Commit mergeTarget : mergeTargets)
+ {
+ addMergeTargetToList(mergeTarget);
+ }
+
+ computeMergeSegment();
+ }
+
+ private void addMergeTargetToList(Commit mergeTarget)
+ {
+ if (mergeTargets == null)
+ {
+ mergeTargets = new ArrayList<Commit>(1);
+ }
+ else
+ {
+ for (ListIterator<Commit> it = mergeTargets.listIterator(); it.hasNext();)
+ {
+ Commit commit = it.next();
+ if (commit.getTime() > mergeTarget.getTime())
+ {
+ it.previous();
+ it.add(mergeTarget);
+ return;
+ }
+ }
+ }
+
+ mergeTargets.add(mergeTarget);
+ }
+
+ private void computeMergeSegment()
+ {
+ if (mergeSegment != null)
+ {
+ mergeSegment.getTrack().removeSegment(mergeSegment);
+ mergeSegment = null;
+ }
+
+ Commit lastMergeTarget = mergeTargets.get(mergeTargets.size() - 1);
+ long lastMergeTime = lastMergeTarget.getTime();
+
+ Net net = getNet();
+ Track track = getTrack();
+ Branch branch = getBranch();
+ long commitTime = getTime();
+
+ if (isLastInBranch() && !track.hasSegment(commitTime + 1, lastMergeTime))
+ {
+ mergeSegment = new Segment(track, branch, this);
+ mergeSegment.adjustCommitTimes(commitTime + 1);
+ mergeSegment.adjustCommitTimes(lastMergeTime);
+ track.addSegment(mergeSegment, true);
+ }
+ else // if (net.hasBranchCommitBetween(mergeTarget.getBranch(), commitTime, lastMergeTime))
+ {
+ mergeSegment = net.createMergeSegment(this, lastMergeTime);
+ mergeSegment.adjustCommitTimes(commitTime);
+ mergeSegment.adjustCommitTimes(lastMergeTime);
+ }
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Net.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Net.java
index 978834948a..fab90ad52e 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Net.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Net.java
@@ -19,7 +19,9 @@ import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
@@ -29,8 +31,8 @@ import java.util.WeakHashMap;
public class Net
{
private static final RGB[] RGBS = new RGB[] { new RGB(133, 166, 214), new RGB(221, 205, 93), new RGB(199, 134, 57),
- new RGB(131, 150, 98), new RGB(197, 123, 127), new RGB(139, 136, 140), new RGB(48, 135, 144),
- new RGB(190, 93, 66), new RGB(143, 163, 54), new RGB(180, 148, 74), new RGB(101, 101, 217), new RGB(72, 153, 119),
+ new RGB(131, 150, 98), new RGB(197, 123, 127), new RGB(139, 136, 140), new RGB(48, 135, 144),
+ new RGB(190, 93, 66), new RGB(143, 163, 54), new RGB(180, 148, 74), new RGB(101, 101, 217), new RGB(72, 153, 119),
new RGB(23, 101, 160), new RGB(132, 164, 118), new RGB(255, 230, 59), new RGB(136, 176, 70), new RGB(255, 138, 1),
new RGB(123, 187, 95), new RGB(233, 88, 98), new RGB(93, 158, 254), new RGB(175, 215, 0), new RGB(140, 134, 142),
new RGB(232, 168, 21), new RGB(0, 172, 191), new RGB(251, 58, 4), new RGB(63, 64, 255), new RGB(27, 194, 130),
@@ -48,9 +50,11 @@ public class Net
private Track[] tracks = {};
- private Map<CDOBranch, Branch> branches = new HashMap<CDOBranch, Branch>();
+ private final Map<CDOBranch, Branch> branches = new HashMap<CDOBranch, Branch>();
- private Map<CDOCommitInfo, Commit> commits = new WeakHashMap<CDOCommitInfo, Commit>();
+ private final Map<CDOCommitInfo, Commit> commits = new WeakHashMap<CDOCommitInfo, Commit>();
+
+ private final Map<CDOCommitInfo, List<Commit>> danglingMergeTargets = new WeakHashMap<CDOCommitInfo, List<Commit>>();
private int commitCounter;
@@ -58,6 +62,8 @@ public class Net
private Commit lastCommit;
+ private boolean hideExceptions;
+
public Net(CDOSession session, CDOID objectID, ResourceManager resourceManager)
{
this.session = session;
@@ -90,44 +96,47 @@ public class Net
return lastCommit;
}
- public Color getColor(int number)
+ public final Branch getBranch(CDOBranch cdoBranch)
{
- if (colors == null)
- {
- colors = new Color[RGBS.length];
- }
-
- int index = number % RGBS.length;
- if (colors[index] == null)
+ Branch branch = branches.get(cdoBranch);
+ if (branch == null)
{
- RGB rgb = RGBS[index];
- colors[index] = resourceManager.createColor(rgb);
+ branch = new Branch(this, cdoBranch);
+ branches.put(cdoBranch, branch);
}
- return colors[index];
+ return branch;
}
- @Override
- public String toString()
+ public final Commit getCommit(CDOCommitInfo commitInfo)
{
- return "Net[" + session + ", " + objectID + "]";
+ return commits.get(commitInfo);
}
- public final Branch getBranch(CDOBranch cdoBranch)
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public final boolean hasBranchCommitBetween(Branch branch, long fromTime, long toTime)
{
- Branch branch = branches.get(cdoBranch);
- if (branch == null)
+ for (Commit commit : commits.values())
{
- branch = new Branch(this, cdoBranch);
- branches.put(cdoBranch, branch);
+ if (commit.getBranch() == branch)
+ {
+ long time = commit.getTime();
+ if (fromTime < time && time < toTime)
+ {
+ return true;
+ }
+ }
}
- return branch;
+ return false;
}
- public final Commit getCommit(CDOCommitInfo commitInfo)
+ public final Commit getOrAddCommit(CDOCommitInfo commitInfo)
{
- Commit commit = commits.get(commitInfo);
+ Commit commit = getCommit(commitInfo);
if (commit == null)
{
commit = addCommit(commitInfo);
@@ -136,6 +145,29 @@ public class Net
return commit;
}
+ public Color getColor(int number)
+ {
+ if (colors == null)
+ {
+ colors = new Color[RGBS.length];
+ }
+
+ int index = number % RGBS.length;
+ if (colors[index] == null)
+ {
+ RGB rgb = RGBS[index];
+ colors[index] = resourceManager.createColor(rgb);
+ }
+
+ return colors[index];
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Net[" + session + ", " + objectID + "]";
+ }
+
private final Segment getSegment(CDOCommitInfo commitInfo)
{
CDOBranch cdoBranch = commitInfo.getBranch();
@@ -267,7 +299,7 @@ public class Net
track = createTrack();
}
- Segment segment = new Segment(track, branch);
+ Segment segment = new Segment(track, branch, null);
track.addSegment(segment, afterLast);
branch.addSegment(segment, afterLast);
@@ -338,6 +370,64 @@ public class Net
return segments;
}
+ Segment createMergeSegment(Commit mergeSource, long toTime)
+ {
+ Branch branch = mergeSource.getBranch();
+ long fromTime = mergeSource.getTime();
+
+ for (int i = 0; i < tracks.length; i++)
+ {
+ Track track = tracks[i];
+
+ Segment segment = track.getFirstSegment();
+ long previousLastTime = 0;
+
+ while (segment != null)
+ {
+ if (previousLastTime < fromTime && toTime < segment.getFirstVisualTime())
+ {
+ Segment mergeSegment = new Segment(track, branch, mergeSource);
+
+ Segment previousInTrack = segment.getPreviousInTrack();
+ if (previousInTrack != null)
+ {
+ mergeSegment.setNextInTrack(segment);
+ segment.setPreviousInTrack(mergeSegment);
+
+ mergeSegment.setPreviousInTrack(previousInTrack);
+ previousInTrack.setNextInTrack(mergeSegment);
+ }
+ else
+ {
+ track.addSegment(mergeSegment, false);
+ }
+
+ return mergeSegment;
+ }
+
+ previousLastTime = segment.getLastCommitTime();
+ if (previousLastTime > fromTime)
+ {
+ break;
+ }
+
+ segment = segment.getNextInTrack();
+ }
+
+ if (previousLastTime < fromTime && toTime < lastCommit.getTime())
+ {
+ Segment mergeSegment = new Segment(track, branch, mergeSource);
+ track.addSegment(mergeSegment, true);
+ return mergeSegment;
+ }
+ }
+
+ Track track = createTrack();
+ Segment mergeSegment = new Segment(track, branch, mergeSource);
+ track.addSegment(mergeSegment, true);
+ return mergeSegment;
+ }
+
Commit addCommit(CDOCommitInfo commitInfo)
{
Segment segment = getSegment(commitInfo);
@@ -368,11 +458,45 @@ public class Net
}
commits.put(commitInfo, commit);
+
+ List<Commit> mergeTargets = danglingMergeTargets.remove(commitInfo);
+ if (mergeTargets != null)
+ {
+ for (Commit mergeTarget : mergeTargets)
+ {
+ mergeTarget.setMergeSource(commit);
+ }
+
+ commit.addMergeTargets(mergeTargets);
+ }
+
return commit;
}
+ void addDanglingMergeTarget(CDOCommitInfo mergedCommitInfo, Commit mergeTarget)
+ {
+ List<Commit> mergeTargets = danglingMergeTargets.get(mergedCommitInfo);
+ if (mergeTargets == null)
+ {
+ mergeTargets = new ArrayList<Commit>(1);
+ danglingMergeTargets.put(mergedCommitInfo, mergeTargets);
+ }
+
+ mergeTargets.add(mergeTarget);
+ }
+
int getCommitCounter()
{
return commitCounter;
}
+
+ boolean isHideExceptions()
+ {
+ return hideExceptions;
+ }
+
+ void hideExceptions()
+ {
+ hideExceptions = true;
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/NetRenderer.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/NetRenderer.java
index e64d20fdde..3407d77ca2 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/NetRenderer.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/NetRenderer.java
@@ -11,11 +11,13 @@
package org.eclipse.emf.cdo.internal.ui.history;
import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.commit.CDOCommitHistory.TriggerLoadElement;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.internal.ui.bundle.OM;
import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.transaction.CDOTransactionCommentator;
import org.eclipse.emf.cdo.ui.widgets.CommitHistoryComposite.Input;
import org.eclipse.emf.cdo.ui.widgets.CommitHistoryComposite.LabelProvider;
@@ -37,10 +39,12 @@ import org.eclipse.swt.widgets.TableItem;
/**
* @author Eike Stepper
*/
-public class NetRenderer implements Listener
+public final class NetRenderer implements Listener
{
private static final int ROUND_EDGE = 3;
+ private static final int ARC_SIZE = 8;
+
private static final int TRACK_OFFSET = 4;
private static final int TRACK_WIDTH = 14;
@@ -53,6 +57,10 @@ public class NetRenderer implements Listener
private final Color colorDotOutline;
+ private final Color colorBadgeFill;
+
+ private final Color colorBadgeOutline;
+
private Net net;
private GC gc;
@@ -86,6 +94,8 @@ public class NetRenderer implements Listener
ResourceManager resourceManager = labelProvider.getResourceManager();
colorDotFill = resourceManager.createColor(new RGB(220, 220, 220));
colorDotOutline = resourceManager.createColor(new RGB(110, 110, 110));
+ colorBadgeFill = resourceManager.createColor(new RGB(188, 220, 188));
+ colorBadgeOutline = resourceManager.createColor(new RGB(0, 128, 0));
Table table = tableViewer.getTable();
table.addListener(SWT.MeasureItem, this);
@@ -93,7 +103,7 @@ public class NetRenderer implements Listener
table.addListener(SWT.EraseItem, this);
}
- public final Net getNet()
+ public Net getNet()
{
return net;
}
@@ -180,7 +190,12 @@ public class NetRenderer implements Listener
}
catch (Throwable ex)
{
- OM.LOG.error(ex);
+ if (!net.isHideExceptions())
+ {
+ OM.LOG.error(ex);
+ net.hideExceptions();
+ }
+
return 0;
}
}
@@ -213,21 +228,40 @@ public class NetRenderer implements Listener
}
String text = labelProvider.getColumnText(commitInfo, columnIndex);
- int width = drawText(text, x, cellHeightHalf, justMeasureWidth);
+
+ if (columnIndex == 1)
+ {
+ CDOBranchPoint mergeSource = commitInfo.getMergeSource();
+ if (mergeSource != null && !text.startsWith(CDOTransactionCommentator.MERGE_PREFIX))
+ {
+ StringBuilder builder = new StringBuilder();
+ CDOTransactionCommentator.appendMerge(builder, mergeSource);
+
+ if (text.length() != 0)
+ {
+ builder.append(", ");
+ builder.append(text);
+ }
+
+ text = builder.toString();
+ }
+ }
+
+ int width = drawText(text, x, cellHeightHalf, false, justMeasureWidth);
x += width;
if (commitInfo instanceof TriggerLoadElement)
{
if (width != 0)
{
- width += 2 * TRACK_OFFSET;
+ width += 4 * TRACK_OFFSET;
}
if (!justMeasureWidth)
{
int y = cellHeightHalf + 1;
int x2 = gc.getClipping().width;
- drawLine(colorDotOutline, width, y, x2, y);
+ drawLine(width, y, x2, y, colorDotOutline);
}
}
@@ -236,83 +270,122 @@ public class NetRenderer implements Listener
private int drawCommit(CDOCommitInfo commitInfo, boolean justMeasureWidth)
{
- Commit commit = net.getCommit(commitInfo);
+ Commit commit = net.getOrAddCommit(commitInfo);
Segment[] segments = commit.getRowSegments();
+ Segment commitSegment = commit.getSegment();
+ long commitTime = commit.getTime();
+ boolean commitLastInBranch = commitTime == commitSegment.getLastCommitTime();
if (!justMeasureWidth)
{
- Segment commitSegment = commit.getSegment();
- long commitTime = commit.getTime();
+ Track commitTrack = commitSegment.getTrack();
+ Color commitColor = commitSegment.getBranch().getColor();
+ int commitTrackPosition = commitTrack.getPosition();
+ int commitTrackCenter = getTrackCenter(commitTrackPosition);
for (int i = 0; i < segments.length; i++)
{
Segment segment = segments[i];
- if (segment != null)
+ if (segment != null && segment != commitSegment)
{
Branch branch = segment.getBranch();
- Color color = branch.getColor();
+ boolean merge = segment.isMerge();
+ Color color = branch.getColor();
+ int lineStyle = merge ? SWT.LINE_DOT : SWT.LINE_SOLID;
int trackCenter = getTrackCenter(i);
- if (segment != commitSegment)
+
+ int positionDelta = Math.abs(i - commitTrackPosition);
+
+ int horizontal = (positionDelta - 1) * TRACK_WIDTH + 6 + ROUND_EDGE;
+ if (i < commitTrackPosition)
{
- if (commitTime == segment.getFirstVisualTime() && segment.isComplete())
- {
- Track commitTrack = commitSegment.getTrack();
- int commitTrackPosition = commitTrack.getPosition();
- int commitTrackCenter = getTrackCenter(commitTrackPosition);
- int positionDelta = Math.abs(i - commitTrackPosition);
-
- int horizontal = (positionDelta - 1) * TRACK_WIDTH + 6 + ROUND_EDGE;
- if (i < commitTrackPosition)
- {
- horizontal = -horizontal;
- }
-
- LinePlotter plotter = new LinePlotter(color, commitTrackCenter, cellHeightHalf);
- plotter.relative(horizontal, 0);
- plotter.absolute(getTrackCenter(i), ROUND_EDGE);
- plotter.relative(0, -ROUND_EDGE);
- }
- else
+ horizontal = -horizontal;
+ }
+
+ if (merge ? commitTime == segment.getLastCommitTime() || commitTime == segment.getFirstCommitTime()
+ : commitTime == segment.getFirstVisualTime() && segment.isComplete())
+ {
+ // Plot horizontal line to left or right and a round edge up or down.
+ boolean down = merge && commitTime == segment.getLastCommitTime();
+ drawHorizontalLineWithRoundEdge(color, lineStyle, commitTrackCenter, trackCenter, horizontal, down);
+ }
+ else
+ {
+ Commit mergeSource = commit.getMergeSource();
+ if (mergeSource != null && mergeSource == segment.getMergeSource())
{
- // Full vertical line
- drawLine(color, trackCenter, 0, trackCenter, cellHeight);
+ drawHorizontalLineWithRoundEdge(color, lineStyle, commitTrackCenter, trackCenter, horizontal, true);
}
+
+ // Draw full vertical line.
+ drawLine(trackCenter, 0, trackCenter, cellHeight, color, lineStyle);
}
}
+ }
- Color color = commitSegment.getBranch().getColor();
- int position = commitSegment.getTrack().getPosition();
- int trackCenter = getTrackCenter(position);
-
- if (commitTime < commitSegment.getLastCommitTime())
+ if (!commitLastInBranch)
+ {
+ // Draw half vertical line up (solid).
+ drawLine(commitTrackCenter, 0, commitTrackCenter, cellHeightHalf, commitColor);
+ }
+ else if (commit.getMergeTargets() != null)
+ {
+ Segment mergeSegment = commit.getMergeSegment();
+ if (mergeSegment != null && mergeSegment.getTrack() == commitTrack)
{
- // Half vertical line to top
- drawLine(color, trackCenter, 0, trackCenter, cellHeightHalf);
+ // Draw half vertical line up (dotted).
+ drawLine(commitTrackCenter, 0, commitTrackCenter, cellHeightHalf, commitColor, SWT.LINE_DOT);
}
+ }
- if (commitTime > commitSegment.getFirstVisualTime() || !commitSegment.isComplete())
+ if (commitTime > commitSegment.getFirstVisualTime() || !commitSegment.isComplete())
+ {
+ if (!commitInfo.isInitialCommit())
{
- if (!commitInfo.isInitialCommit())
- {
- // Half vertical line to bottom
- drawLine(color, trackCenter, cellHeightHalf, trackCenter, cellHeight);
- }
+ // Draw half vertical line down (solid).
+ drawLine(commitTrackCenter, cellHeightHalf, commitTrackCenter, cellHeight, commitColor);
}
-
- int dotX = trackCenter - dotSizeHalf - 1;
- int dotY = cellHeightHalf - dotSizeHalf;
- drawDot(dotX, dotY, dotSize, dotSize);
}
+
+ // Draw center dot.
+ int dotX = commitTrackCenter - dotSizeHalf - 1;
+ int dotY = cellHeightHalf - dotSizeHalf;
+ drawDot(dotX, dotY, dotSize, dotSize);
}
- return getTrackX(segments.length);
+ int x = getTrackX(segments.length);
+
+ if (commitLastInBranch)
+ {
+ String branchLabel = labelProvider.getBranchString(commit.getBranch().getCDOBranch());
+
+ x += TRACK_OFFSET;
+ x += drawText(branchLabel, x + TRACK_OFFSET, cellHeightHalf, true, justMeasureWidth);
+ }
+
+ return x;
}
- private void drawLine(Color color, int x1, int y1, int x2, int y2)
+ private void drawHorizontalLineWithRoundEdge(Color color, int lineStyle, int commitTrackCenter, int trackCenter,
+ int horizontal, boolean down)
+ {
+ LinePlotter plotter = new LinePlotter(color, lineStyle, commitTrackCenter, cellHeightHalf);
+ plotter.relative(horizontal, 0);
+ plotter.absolute(trackCenter, down ? cellHeight - ROUND_EDGE : ROUND_EDGE);
+ plotter.relative(0, down ? ROUND_EDGE : -ROUND_EDGE);
+ }
+
+ private void drawLine(int x1, int y1, int x2, int y2, Color color)
+ {
+ drawLine(x1, y1, x2, y2, color, SWT.LINE_SOLID);
+ }
+
+ private void drawLine(int x1, int y1, int x2, int y2, Color color, int lineStyle)
{
gc.setForeground(color);
gc.setLineWidth(LINE_WIDTH);
+ gc.setLineStyle(lineStyle);
gc.drawLine(cellX + x1, cellY + y1, cellX + x2, cellY + y2);
}
@@ -322,26 +395,52 @@ public class NetRenderer implements Listener
int dotY = cellY + y + 1;
int dotW = w - 2;
int dotH = h - 2;
+
gc.setBackground(colorDotFill);
gc.fillOval(dotX, dotY, dotW, dotH);
+
gc.setForeground(colorDotOutline);
gc.setLineWidth(2);
+ gc.setLineStyle(SWT.LINE_SOLID);
gc.drawOval(dotX, dotY, dotW, dotH);
}
- private int drawText(final String msg, final int x, final int y, boolean justMeasureWidth)
+ private int drawText(String msg, int x, int y, boolean badge, boolean justMeasureWidth)
{
Point extent = gc.textExtent(msg);
+ int width = extent.x;
+
+ if (badge)
+ {
+ width += 2 * TRACK_OFFSET;
+ }
+
if (!justMeasureWidth)
{
- int textY = (y * 2 - extent.y) / 2;
+ x += cellX;
+ y = (y * 2 - extent.y) / 2 + cellY - 1;
+ int height = extent.y + 1;
+
+ if (badge)
+ {
+ gc.setBackground(colorBadgeFill);
+ gc.fillRoundRectangle(x + 2, y + 2, width - 3, height - 3, ARC_SIZE, ARC_SIZE);
+
+ gc.setLineWidth(1);
+ gc.setLineStyle(SWT.LINE_SOLID);
+ gc.setForeground(colorBadgeOutline);
+ gc.drawRoundRectangle(x, y, width, height, ARC_SIZE, ARC_SIZE);
+ }
+ else
+ {
+ gc.setBackground(cellBackground);
+ }
+
gc.setForeground(cellForeground);
- gc.setBackground(cellBackground);
- gc.setBackground(cellBackground);
- gc.drawString(msg, cellX + x, cellY + textY, true);
+ gc.drawString(msg, x + TRACK_OFFSET + 1, y + 1, true);
}
- return extent.x;
+ return width;
}
private int getTrackX(int position)
@@ -361,13 +460,16 @@ public class NetRenderer implements Listener
{
private final Color color;
+ private final int lineStyle;
+
private int x;
private int y;
- public LinePlotter(Color color, int x, int y)
+ public LinePlotter(Color color, int lineStyle, int x, int y)
{
this.color = color;
+ this.lineStyle = lineStyle;
this.x = x;
this.y = y;
}
@@ -378,12 +480,12 @@ public class NetRenderer implements Listener
int fromY = y;
x += width;
y += height;
- drawLine(color, fromX, fromY, x, y);
+ drawLine(fromX, fromY, x, y, color, lineStyle);
}
public void absolute(int x, int y)
{
- drawLine(color, this.x, this.y, x, y);
+ drawLine(this.x, this.y, x, y, color, lineStyle);
this.x = x;
this.y = y;
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Segment.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Segment.java
index 4621cc0dda..58d0e01a01 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Segment.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Segment.java
@@ -13,12 +13,14 @@ package org.eclipse.emf.cdo.internal.ui.history;
/**
* @author Eike Stepper
*/
-public class Segment
+public final class Segment
{
private final Track track;
private final Branch branch;
+ private final Commit mergeSource;
+
private boolean complete;
private long firstVisualTime;
@@ -35,73 +37,84 @@ public class Segment
private Segment nextInBranch;
- public Segment(Track track, Branch branch)
+ public Segment(Track track, Branch branch, Commit mergeSource)
{
this.track = track;
this.branch = branch;
+ this.mergeSource = mergeSource;
}
- public final Net getNet()
+ public Net getNet()
{
return track.getNet();
}
- public final Track getTrack()
+ public Track getTrack()
{
return track;
}
- public final Branch getBranch()
+ public Branch getBranch()
{
return branch;
}
- public final boolean isComplete()
+ public Commit getMergeSource()
+ {
+ return mergeSource;
+ }
+
+ public boolean isMerge()
+ {
+ return mergeSource != null;
+ }
+
+ public boolean isComplete()
{
return complete;
}
- public final long getFirstVisualTime()
+ public long getFirstVisualTime()
{
return firstVisualTime;
}
- public final long getFirstCommitTime()
+ public long getFirstCommitTime()
{
return firstCommitTime;
}
- public final long getLastCommitTime()
+ public long getLastCommitTime()
{
return lastCommitTime;
}
- public final Segment getPreviousInTrack()
+ public Segment getPreviousInTrack()
{
return previousInTrack;
}
- public final Segment getNextInTrack()
+ public Segment getNextInTrack()
{
return nextInTrack;
}
- public final Segment getPreviousInBranch()
+ public Segment getPreviousInBranch()
{
return previousInBranch;
}
- public final Segment getNextInBranch()
+ public Segment getNextInBranch()
{
return nextInBranch;
}
- public final boolean containsCommitTime(long time)
+ public boolean containsCommitTime(long time)
{
return time >= firstCommitTime && time <= lastCommitTime;
}
- public final boolean containsVisualTime(long time)
+ public boolean containsVisualTime(long time)
{
return time >= getFirstVisualTime() && time <= lastCommitTime;
}
@@ -114,9 +127,17 @@ public class Segment
void adjustVisualTime(long time, boolean complete)
{
- if (firstVisualTime == 0 || time < firstVisualTime)
+ if (isMerge())
+ {
+ firstVisualTime = firstCommitTime;
+ this.complete = true;
+ }
+ else
{
- firstVisualTime = time;
+ if (firstVisualTime == 0 || time < firstVisualTime)
+ {
+ firstVisualTime = time;
+ }
}
this.complete |= complete;
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/SegmentList.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/SegmentList.java
index 6aa7b0895c..8fcef0aae9 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/SegmentList.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/SegmentList.java
@@ -78,6 +78,30 @@ public abstract class SegmentList
}
}
+ void removeSegment(Segment segment)
+ {
+ Segment nextSegment = getNextSegment(segment);
+ Segment previousSegment = getPreviousSegment(segment);
+
+ if (nextSegment != null)
+ {
+ setPreviousSegment(nextSegment, previousSegment);
+ }
+ else
+ {
+ lastSegment = previousSegment;
+ }
+
+ if (previousSegment != null)
+ {
+ setNextSegment(previousSegment, nextSegment);
+ }
+ else
+ {
+ firstSegment = nextSegment;
+ }
+ }
+
protected abstract Segment getNextSegment(Segment segment);
protected abstract void setNextSegment(Segment segment, Segment nextSegment);
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Track.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Track.java
index e6fbde769a..2d4c08453a 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Track.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/history/Track.java
@@ -13,7 +13,7 @@ package org.eclipse.emf.cdo.internal.ui.history;
/**
* @author Eike Stepper
*/
-public class Track extends SegmentList
+public final class Track extends SegmentList
{
private final int position;
@@ -28,6 +28,28 @@ public class Track extends SegmentList
return position;
}
+ public boolean hasSegment(long fromTime, long toTime)
+ {
+ Segment segment = getLastSegment();
+
+ while (segment != null)
+ {
+ if (segment.getLastCommitTime() < fromTime)
+ {
+ return false;
+ }
+
+ if (segment.getFirstVisualTime() < toTime)
+ {
+ return true;
+ }
+
+ segment = segment.getPreviousInTrack();
+ }
+
+ return false;
+ }
+
@Override
public String toString()
{
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/CommitHistoryComposite.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/CommitHistoryComposite.java
index 7fdbb63793..58c544ba42 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/CommitHistoryComposite.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/CommitHistoryComposite.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.ui.widgets;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.CDOState;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.commit.CDOCommitHistory;
import org.eclipse.emf.cdo.common.commit.CDOCommitHistory.TriggerLoadElement;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
@@ -50,8 +51,6 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.spi.cdo.CDOSessionProtocol;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.IOpenListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -83,6 +82,20 @@ public class CommitHistoryComposite extends Composite
}
};
+ private CDOCommitInfoHandler revealElementHandler = new CDOCommitInfoHandler()
+ {
+ public void handleCommitInfo(final CDOCommitInfo commitInfo)
+ {
+ getDisplay().asyncExec(new Runnable()
+ {
+ public void run()
+ {
+ tableViewer.reveal(commitInfo);
+ }
+ });
+ }
+ };
+
private int viewerStyle;
private TableViewer tableViewer;
@@ -116,14 +129,6 @@ public class CommitHistoryComposite extends Composite
}
});
- tableViewer.addDoubleClickListener(new IDoubleClickListener()
- {
- public void doubleClick(DoubleClickEvent event)
- {
- doubleClicked();
- }
- });
-
tableViewer.addOpenListener(new IOpenListener()
{
public void open(OpenEvent event)
@@ -198,18 +203,31 @@ public class CommitHistoryComposite extends Composite
public void refreshLayout()
{
+ refreshLayout(false);
+ }
+
+ /**
+ * @since 4.6
+ */
+ public void refreshLayout(boolean refreshCommits)
+ {
+ Table table = tableViewer.getTable();
+ int topIndex = table.getTopIndex();
+
netRenderer.setInput(input);
- CDOCommitInfo[] elements = history.getElements();
- for (int i = 0; i < elements.length; i++)
+
+ if (refreshCommits)
{
- CDOCommitInfo commitInfo = elements[i];
- netRenderer.addCommit(commitInfo);
+ CDOCommitInfo[] elements = history.getElements();
+ for (int i = 0; i < elements.length; i++)
+ {
+ CDOCommitInfo commitInfo = elements[i];
+ netRenderer.addCommit(commitInfo);
+ }
}
- Table table = tableViewer.getTable();
- table.setTopIndex(0);
tableViewer.setInput(history);
- table.setTopIndex(0);
+ table.setTopIndex(topIndex);
}
public final CDOCommitHistory getHistory()
@@ -273,7 +291,7 @@ public class CommitHistoryComposite extends Composite
{
if (commitInfo instanceof TriggerLoadElement)
{
- history.triggerLoad(new RevealElementHandler());
+ history.triggerLoad(revealElementHandler);
}
else
{
@@ -283,23 +301,6 @@ public class CommitHistoryComposite extends Composite
}
/**
- * @author Eike Stepper
- */
- private final class RevealElementHandler implements CDOCommitInfoHandler
- {
- public void handleCommitInfo(final CDOCommitInfo commitInfo)
- {
- getDisplay().asyncExec(new Runnable()
- {
- public void run()
- {
- tableViewer.reveal(commitInfo);
- }
- });
- }
- }
-
- /**
* Encapsulates the input of a {@link CommitHistoryComposite}.
*
* @author Eike Stepper
@@ -600,6 +601,8 @@ public class CommitHistoryComposite extends Composite
private boolean formatTimeStamps = true;
+ private boolean shortenBranchPaths = true;
+
public LabelProvider()
{
addColumn(new Column<CDOCommitInfo>("Time", 160)
@@ -612,12 +615,7 @@ public class CommitHistoryComposite extends Composite
return StringUtil.EMPTY;
}
- if (formatTimeStamps)
- {
- return CDOCommonUtil.formatTimeStamp(commitInfo.getTimeStamp());
- }
-
- return "" + commitInfo.getTimeStamp();
+ return getTimeStampString(commitInfo.getTimeStamp());
}
@Override
@@ -697,11 +695,11 @@ public class CommitHistoryComposite extends Composite
{
if (builder == null)
{
- builder = new StringBuilder(commitBranch.getPathName());
+ builder = new StringBuilder(getBranchString(commitBranch));
}
builder.append(", ");
- builder.append(childBranch.getPathName());
+ builder.append(getBranchString(childBranch));
}
}
@@ -710,7 +708,7 @@ public class CommitHistoryComposite extends Composite
return builder.toString();
}
- return commitBranch.getPathName();
+ return getBranchString(commitBranch);
}
@Override
@@ -729,6 +727,26 @@ public class CommitHistoryComposite extends Composite
return (Image)getResource(BRANCH_GRAY);
}
});
+
+ addColumn(new Column<CDOCommitInfo>("Merge Source", 160)
+ {
+ @Override
+ public String getText(CDOCommitInfo commitInfo)
+ {
+ if (commitInfo instanceof CDOCommitHistory.TriggerLoadElement)
+ {
+ return null;
+ }
+
+ CDOBranchPoint mergeSource = commitInfo.getMergeSource();
+ if (mergeSource != null)
+ {
+ return getBranchString(mergeSource.getBranch()) + ", " + getTimeStampString(mergeSource.getTimeStamp());
+ }
+
+ return null;
+ }
+ });
}
public String getLocalUserID()
@@ -760,5 +778,47 @@ public class CommitHistoryComposite extends Composite
{
this.formatTimeStamps = formatTimeStamps;
}
+
+ /**
+ * @since 4.6
+ */
+ public boolean isShortenBranchPaths()
+ {
+ return shortenBranchPaths;
+ }
+
+ /**
+ * @since 4.6
+ */
+ public void setShortenBranchPaths(boolean shortenBranchPaths)
+ {
+ this.shortenBranchPaths = shortenBranchPaths;
+ }
+
+ /**
+ * @since 4.6
+ */
+ public String getBranchString(CDOBranch branch)
+ {
+ if (shortenBranchPaths)
+ {
+ return branch.getName();
+ }
+
+ return branch.getPathName();
+ }
+
+ /**
+ * @since 4.6
+ */
+ public String getTimeStampString(long timeStamp)
+ {
+ if (formatTimeStamps)
+ {
+ return CDOCommonUtil.formatTimeStamp(timeStamp);
+ }
+
+ return "" + timeStamp;
+ }
}
}

Back to the top