Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikaël Barbero2013-10-22 09:09:02 -0400
committerMikaël Barbero2013-10-22 09:09:38 -0400
commit19e0129584dd440b993812cf78f9f2aa6bfd3141 (patch)
tree061e1e6fdf38e281de994ed95b4010fced59e56c /plugins/org.eclipse.emf.compare.ide.ui/src
parent98fee6ae740510c9520ef68fc3ec290ae437d388 (diff)
downloadorg.eclipse.emf.compare-19e0129584dd440b993812cf78f9f2aa6bfd3141.tar.gz
org.eclipse.emf.compare-19e0129584dd440b993812cf78f9f2aa6bfd3141.tar.xz
org.eclipse.emf.compare-19e0129584dd440b993812cf78f9f2aa6bfd3141.zip
Fix center control drawing and icon display
Diffstat (limited to 'plugins/org.eclipse.emf.compare.ide.ui/src')
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewer.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewer.java
index 757669136..9f9deaf8c 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewer.java
@@ -12,6 +12,8 @@ package org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.table;
import static com.google.common.base.Predicates.equalTo;
+import com.google.common.base.Objects;
+import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
@@ -202,7 +204,7 @@ public class TableContentMergeViewer extends EMFCompareContentMergeViewer {
// selectable on Windows platform. The labels of placeholders in (Tree/Table)Viewer
// are one whitespace. Placeholder are then selectable at the very left of itself.
// Add a 42 whitespaces label to workaround.
- text = " ";
+ text = Strings.repeat(" ", 42);
} else {
text = super.getColumnText(value, columnIndex);
}
@@ -224,7 +226,13 @@ public class TableContentMergeViewer extends EMFCompareContentMergeViewer {
if (((IMergeViewerItem)object).isInsertionPoint()) {
return null;
} else {
- return super.getColumnImage(mergeViewerItem.getSideValue(side), columnIndex);
+ Object sideValue = mergeViewerItem.getSideValue(side);
+ Image superImage = super.getColumnImage(sideValue, columnIndex);
+ if (superImage == null) {
+ return getDefaultImage(sideValue);
+ } else {
+ return superImage;
+ }
}
}
return super.getColumnImage(object, columnIndex);
@@ -275,7 +283,6 @@ public class TableContentMergeViewer extends EMFCompareContentMergeViewer {
final boolean selected = Iterables.any(selection, equalTo(leftItem));
IMergeViewerItem leftData = (IMergeViewerItem)leftItem.getData();
final Diff leftDiff = ((IMergeViewerItem)leftItem.getData()).getDiff();
- boolean doPaint = true;
if (leftDiff != null) {
if (MergeViewerUtil.isVisibleInMergeViewer(leftDiff, getDifferenceGroupProvider(),
getDifferenceFilterPredicate())) {
@@ -337,16 +344,17 @@ public class TableContentMergeViewer extends EMFCompareContentMergeViewer {
}
private TableItem findRightTableItemFromLeftDiff(TableItem[] rightItems, Diff leftDiff,
- IMergeViewerItem rightData) {
+ IMergeViewerItem leftData) {
TableItem ret = null;
for (int i = 0; i < rightItems.length && ret == null; i++) {
TableItem rightItem = rightItems[i];
+ IMergeViewerItem rightData = (IMergeViewerItem)rightItem.getData();
final Diff rightDiff = ((IMergeViewerItem)rightItem.getData()).getDiff();
if (leftDiff == rightDiff) {
ret = rightItem;
- } else if (rightData.getAncestor() == rightData.getAncestor()
- && rightData.getRight() == rightData.getRight()
- && rightData.getLeft() == rightData.getLeft()) {
+ } else if (Objects.equal(rightData.getAncestor(), leftData.getAncestor())
+ && Objects.equal(rightData.getRight(), leftData.getRight())
+ && Objects.equal(rightData.getLeft(), leftData.getLeft())) {
ret = rightItem;
}
}

Back to the top