Package org.eclipse.compare.internal
Class MirroredMergeViewerContentProvider
java.lang.Object
org.eclipse.compare.internal.MergeViewerContentProvider
org.eclipse.compare.internal.MirroredMergeViewerContentProvider
- All Implemented Interfaces:
IMergeViewerContentProvider
,IContentProvider
This class just swaps the left and right input for display.
The model values for left and right are not changed.
We must extend from the class and not the interface, because some implementations expect the class.
-
Field Summary
Fields inherited from class org.eclipse.compare.internal.MergeViewerContentProvider
ANCESTOR_CONTRIBUTOR, LEFT_CONTRIBUTOR, RIGHT_CONTRIBUTOR
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptiongetAncestorContent
(Object input) Returns the contents for the ancestor side of aContentMergeViewer
.getAncestorImage
(Object input) Returns an optional image for the ancestor side of aContentMergeViewer
.getAncestorLabel
(Object input) Returns the label for the ancestor side of aContentMergeViewer
.getLeftContent
(Object input) Returns the contents for the left side of aContentMergeViewer
.getLeftImage
(Object input) Returns an optional image for the left side of aContentMergeViewer
.getLeftLabel
(Object input) Returns the label for the left side of aContentMergeViewer
.getRightContent
(Object input) Returns the contents for the right side of aContentMergeViewer
.getRightImage
(Object input) Returns an optional image for the right side of aContentMergeViewer
.getRightLabel
(Object input) Returns the label for the right side of aContentMergeViewer
.boolean
isLeftEditable
(Object input) Returns whether the left side is editable.boolean
isRightEditable
(Object input) Returns whether the right side is editable.void
saveLeftContent
(Object input, byte[] bytes) Saves new contents for the left side of theContentMergeViewer
.void
saveRightContent
(Object input, byte[] bytes) Saves new contents for the right side of theContentMergeViewer
.void
setAncestorError
(String errorMessage) void
setLeftError
(String errorMessage) void
setRightError
(String errorMessage) boolean
showAncestor
(Object input) Returns whether the ancestor side of the given input element should be shown.Methods inherited from class org.eclipse.compare.internal.MergeViewerContentProvider
dispose, inputChanged
-
Constructor Details
-
MirroredMergeViewerContentProvider
public MirroredMergeViewerContentProvider(CompareConfiguration cc, MergeViewerContentProvider delegate)
-
-
Method Details
-
getLeftLabel
Description copied from interface:IMergeViewerContentProvider
Returns the label for the left side of aContentMergeViewer
.- Specified by:
getLeftLabel
in interfaceIMergeViewerContentProvider
- Overrides:
getLeftLabel
in classMergeViewerContentProvider
- Parameters:
input
- the input object of theContentMergeViewer
- Returns:
- the label for the left side of a
ContentMergeViewer
-
getLeftImage
Description copied from interface:IMergeViewerContentProvider
Returns an optional image for the left side of aContentMergeViewer
.- Specified by:
getLeftImage
in interfaceIMergeViewerContentProvider
- Overrides:
getLeftImage
in classMergeViewerContentProvider
- Parameters:
input
- the input object of theContentMergeViewer
- Returns:
- the image for the left side of a
ContentMergeViewer
, ornull
if none
-
getLeftContent
Description copied from interface:IMergeViewerContentProvider
Returns the contents for the left side of aContentMergeViewer
. The interpretation of the returned object depends on the concreteContentMergeViewer
.- Specified by:
getLeftContent
in interfaceIMergeViewerContentProvider
- Overrides:
getLeftContent
in classMergeViewerContentProvider
- Parameters:
input
- the input object of theContentMergeViewer
- Returns:
- the content for the left side of a
ContentMergeViewer
, ornull
if none
-
isLeftEditable
Description copied from interface:IMergeViewerContentProvider
Returns whether the left side is editable.- Specified by:
isLeftEditable
in interfaceIMergeViewerContentProvider
- Overrides:
isLeftEditable
in classMergeViewerContentProvider
- Parameters:
input
- the input object of theContentMergeViewer
- Returns:
true
if the left side of aContentMergeViewer
is editable
-
saveLeftContent
Description copied from interface:IMergeViewerContentProvider
Saves new contents for the left side of theContentMergeViewer
.- Specified by:
saveLeftContent
in interfaceIMergeViewerContentProvider
- Overrides:
saveLeftContent
in classMergeViewerContentProvider
- Parameters:
input
- the input object of theContentMergeViewer
bytes
- the new contents to save for the left side
-
getRightLabel
Description copied from interface:IMergeViewerContentProvider
Returns the label for the right side of aContentMergeViewer
.- Specified by:
getRightLabel
in interfaceIMergeViewerContentProvider
- Overrides:
getRightLabel
in classMergeViewerContentProvider
- Parameters:
input
- the input object of theContentMergeViewer
- Returns:
- the label for the right side of a
ContentMergeViewer
-
getRightImage
Description copied from interface:IMergeViewerContentProvider
Returns an optional image for the right side of aContentMergeViewer
.- Specified by:
getRightImage
in interfaceIMergeViewerContentProvider
- Overrides:
getRightImage
in classMergeViewerContentProvider
- Parameters:
input
- the input object of theContentMergeViewer
- Returns:
- the image for the right side of a
ContentMergeViewer
, ornull
if none
-
getRightContent
Description copied from interface:IMergeViewerContentProvider
Returns the contents for the right side of aContentMergeViewer
. The interpretation of the returned object depends on the concreteContentMergeViewer
.- Specified by:
getRightContent
in interfaceIMergeViewerContentProvider
- Overrides:
getRightContent
in classMergeViewerContentProvider
- Parameters:
input
- the input object of theContentMergeViewer
- Returns:
- the content for the right side of a
ContentMergeViewer
, ornull
if none
-
isRightEditable
Description copied from interface:IMergeViewerContentProvider
Returns whether the right side is editable.- Specified by:
isRightEditable
in interfaceIMergeViewerContentProvider
- Overrides:
isRightEditable
in classMergeViewerContentProvider
- Parameters:
input
- the input object of theContentMergeViewer
- Returns:
true
if the right side of aContentMergeViewer
is editable
-
saveRightContent
Description copied from interface:IMergeViewerContentProvider
Saves new contents for the right side of theContentMergeViewer
.- Specified by:
saveRightContent
in interfaceIMergeViewerContentProvider
- Overrides:
saveRightContent
in classMergeViewerContentProvider
- Parameters:
input
- the input object of theContentMergeViewer
bytes
- the new contents to save for the right side
-
getAncestorLabel
Description copied from interface:IMergeViewerContentProvider
Returns the label for the ancestor side of aContentMergeViewer
.- Specified by:
getAncestorLabel
in interfaceIMergeViewerContentProvider
- Overrides:
getAncestorLabel
in classMergeViewerContentProvider
- Parameters:
input
- the input object of theContentMergeViewer
- Returns:
- the label for the ancestor side of a
ContentMergeViewer
-
getAncestorImage
Description copied from interface:IMergeViewerContentProvider
Returns an optional image for the ancestor side of aContentMergeViewer
.- Specified by:
getAncestorImage
in interfaceIMergeViewerContentProvider
- Overrides:
getAncestorImage
in classMergeViewerContentProvider
- Parameters:
input
- the input object of theContentMergeViewer
- Returns:
- the image for the ancestor side of a
ContentMergeViewer
, ornull
if none
-
getAncestorContent
Description copied from interface:IMergeViewerContentProvider
Returns the contents for the ancestor side of aContentMergeViewer
. The interpretation of the returned object depends on the concreteContentMergeViewer
.- Specified by:
getAncestorContent
in interfaceIMergeViewerContentProvider
- Overrides:
getAncestorContent
in classMergeViewerContentProvider
- Parameters:
input
- the input object of theContentMergeViewer
- Returns:
- the content for the ancestor side of a
ContentMergeViewer
, ornull
if none
-
showAncestor
Description copied from interface:IMergeViewerContentProvider
Returns whether the ancestor side of the given input element should be shown.- Specified by:
showAncestor
in interfaceIMergeViewerContentProvider
- Overrides:
showAncestor
in classMergeViewerContentProvider
- Parameters:
input
- the merge viewer's input- Returns:
true
if the ancestor side of the given input element should be shown
-
setAncestorError
- Overrides:
setAncestorError
in classMergeViewerContentProvider
-
setLeftError
- Overrides:
setLeftError
in classMergeViewerContentProvider
-
setRightError
- Overrides:
setRightError
in classMergeViewerContentProvider
-