Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2007-04-24 20:01:09 +0000
committerMichael Valenta2007-04-24 20:01:09 +0000
commit389f5668cddc34c8ba1ef3fc54f4d206d074bb6a (patch)
tree384122e68611691e520edde6a7940932d8ebb69a /bundles/org.eclipse.compare
parentb80cc773dff8123f56d6e92f384248045818783c (diff)
downloadeclipse.platform.team-389f5668cddc34c8ba1ef3fc54f4d206d074bb6a.tar.gz
eclipse.platform.team-389f5668cddc34c8ba1ef3fc54f4d206d074bb6a.tar.xz
eclipse.platform.team-389f5668cddc34c8ba1ef3fc54f4d206d074bb6a.zip
Bug 91236 [Viewers] The ">" center button in TextMergeViewer alway copy diff to left
Diffstat (limited to 'bundles/org.eclipse.compare')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java12
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java12
2 files changed, 16 insertions, 8 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index b36e72227..e59fa9bab 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -105,6 +105,8 @@ import com.ibm.icu.text.MessageFormat;
*/
public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
+ private static final String COPY_LEFT_TO_RIGHT_INDICATOR = ">"; //$NON-NLS-1$
+ private static final String COPY_RIGHT_TO_LEFT_INDICATOR = "<"; //$NON-NLS-1$
private static final char ANCESTOR_CONTRIBUTOR = MergeViewerContentProvider.ANCESTOR_CONTRIBUTOR;
private static final char RIGHT_CONTRIBUTOR = MergeViewerContentProvider.RIGHT_CONTRIBUTOR;
private static final char LEFT_CONTRIBUTOR = MergeViewerContentProvider.LEFT_CONTRIBUTOR;
@@ -2242,7 +2244,7 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
fCenterButton= new Button(canvas, fIsCarbon ? SWT.FLAT : SWT.PUSH);
if (fNormalCursor == null) fNormalCursor= new Cursor(canvas.getDisplay(), SWT.CURSOR_ARROW);
fCenterButton.setCursor(fNormalCursor);
- fCenterButton.setText("<"); //$NON-NLS-1$
+ fCenterButton.setText(COPY_RIGHT_TO_LEFT_INDICATOR);
fCenterButton.pack();
fCenterButton.setVisible(false);
fCenterButton.addSelectionListener(
@@ -2251,7 +2253,9 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
fCenterButton.setVisible(false);
if (fButtonDiff != null) {
setCurrentDiff(fButtonDiff, false);
- copy(fCurrentDiff, false, fCurrentDiff.fDirection != RangeDifference.CONFLICT);
+ copy(fCurrentDiff,
+ fCenterButton.getText().equals(COPY_LEFT_TO_RIGHT_INDICATOR),
+ fCurrentDiff.fDirection != RangeDifference.CONFLICT);
}
}
}
@@ -2274,14 +2278,14 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
if (diff != null) {
if (fLeft.isEditable()) {
fButtonDiff= diff;
- fCenterButton.setText("<"); //$NON-NLS-1$
+ fCenterButton.setText(COPY_RIGHT_TO_LEFT_INDICATOR);
String tt= fCopyDiffRightToLeftItem.getAction().getToolTipText();
fCenterButton.setToolTipText(tt);
fCenterButton.setBounds(r);
fCenterButton.setVisible(true);
} else if (fRight.isEditable()) {
fButtonDiff= diff;
- fCenterButton.setText(">"); //$NON-NLS-1$
+ fCenterButton.setText(COPY_LEFT_TO_RIGHT_INDICATOR);
String tt= fCopyDiffLeftToRightItem.getAction().getToolTipText();
fCenterButton.setToolTipText(tt);
fCenterButton.setBounds(r);
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index b36e72227..e59fa9bab 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -105,6 +105,8 @@ import com.ibm.icu.text.MessageFormat;
*/
public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
+ private static final String COPY_LEFT_TO_RIGHT_INDICATOR = ">"; //$NON-NLS-1$
+ private static final String COPY_RIGHT_TO_LEFT_INDICATOR = "<"; //$NON-NLS-1$
private static final char ANCESTOR_CONTRIBUTOR = MergeViewerContentProvider.ANCESTOR_CONTRIBUTOR;
private static final char RIGHT_CONTRIBUTOR = MergeViewerContentProvider.RIGHT_CONTRIBUTOR;
private static final char LEFT_CONTRIBUTOR = MergeViewerContentProvider.LEFT_CONTRIBUTOR;
@@ -2242,7 +2244,7 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
fCenterButton= new Button(canvas, fIsCarbon ? SWT.FLAT : SWT.PUSH);
if (fNormalCursor == null) fNormalCursor= new Cursor(canvas.getDisplay(), SWT.CURSOR_ARROW);
fCenterButton.setCursor(fNormalCursor);
- fCenterButton.setText("<"); //$NON-NLS-1$
+ fCenterButton.setText(COPY_RIGHT_TO_LEFT_INDICATOR);
fCenterButton.pack();
fCenterButton.setVisible(false);
fCenterButton.addSelectionListener(
@@ -2251,7 +2253,9 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
fCenterButton.setVisible(false);
if (fButtonDiff != null) {
setCurrentDiff(fButtonDiff, false);
- copy(fCurrentDiff, false, fCurrentDiff.fDirection != RangeDifference.CONFLICT);
+ copy(fCurrentDiff,
+ fCenterButton.getText().equals(COPY_LEFT_TO_RIGHT_INDICATOR),
+ fCurrentDiff.fDirection != RangeDifference.CONFLICT);
}
}
}
@@ -2274,14 +2278,14 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
if (diff != null) {
if (fLeft.isEditable()) {
fButtonDiff= diff;
- fCenterButton.setText("<"); //$NON-NLS-1$
+ fCenterButton.setText(COPY_RIGHT_TO_LEFT_INDICATOR);
String tt= fCopyDiffRightToLeftItem.getAction().getToolTipText();
fCenterButton.setToolTipText(tt);
fCenterButton.setBounds(r);
fCenterButton.setVisible(true);
} else if (fRight.isEditable()) {
fButtonDiff= diff;
- fCenterButton.setText(">"); //$NON-NLS-1$
+ fCenterButton.setText(COPY_LEFT_TO_RIGHT_INDICATOR);
String tt= fCopyDiffLeftToRightItem.getAction().getToolTipText();
fCenterButton.setToolTipText(tt);
fCenterButton.setBounds(r);

Back to the top