All Known Subinterfaces:
All Known Implementing Classes:
public interface ICompareInput
Interface for objects used as input to a two-way or three-way compare viewer.
It defines API for accessing the three sides for the compare,
and a name and image which is used when displaying the three way input
in the UI, for example, in a title bar.
Note: at most two sides of an
ICompareInput can be
(as it is normal for additions or deletions) but not all three.
ICompareInput provides methods for registering
that get informed if one (or more)
of the three sides of an
ICompareInput object changes its value.
For example when accepting an incoming addition
null) left side of an
is copied to the right side by means of method
This should trigger a call to
compareInputChanged of registered
Clients can implement this interface, or use the convenience implementation
- Returns name of input.
This name is displayed when this input is shown in a viewer.
In many cases this name is the name of one of the non-
null sides or a combination
- name of input
- Returns an image representing this input.
This image is typically displayed when this input is shown in a viewer.
In many cases this image is the image of one of the non-
- image representing this input, or
null if no icon should be shown
- Returns the kind of difference between the
three sides ancestor, left and right.
This field is only meaningful if the
is the result of another compare. In this case it is used
getImage to compose a icon
which reflects the kind of difference between the two or three elements.
- kind of difference (see
- Returns the ancestor side of this input.
null if this input has no ancestor
or in the two-way compare case.
- the ancestor of this input, or
- Returns the left side of this input.
null if there is no left side (deletion or addition).
- the left side of this input, or
- Returns the right side of this input.
null if there is no right side (deletion or addition).
- the right side of this input, or
- Registers the given listener for notification.
If the identical listener is already registered the method has no effect.
listener - the listener to register for changes of this input
- Unregisters the given listener.
If the identical listener is not registered the method has no effect.
listener - the listener to unregister
void copy(boolean leftToRight)
- Copy one side (source) to the other side (destination) depending on the
leftToRight. This method is called from
a merge viewer if a corresponding action ("take left" or "take right")
has been pressed.
The implementation should handle the following cases:
In addition the implementation should send out notification to the registered
if the source side is
null the destination must be deleted,
if the destination is
null the destination must be created
and filled with the contents from the source,
if both sides are non-
null the contents of source must be copied to destination.
leftToRight - if
true the left side is copied to the right side.
false the right side is copied to the left side
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.