Interface ICompareInput
- All Known Subinterfaces:
- ISynchronizationCompareInput,- ISynchronizeModelElement
- All Known Implementing Classes:
- DiffNode
 Note: at most two sides of an ICompareInput can be null,
 (as it is normal for additions or deletions) but not all three.
 
 ICompareInput provides methods for registering
 ICompareInputChangeListeners
 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
 the (non-null) left side of an ICompareInput
 is copied to the right side by means of method copy.
 This should trigger a call to ICompareInputChangeListener.compareInputChanged(org.eclipse.compare.structuremergeviewer.ICompareInput) of registered
 ICompareInputChangeListeners.
 
 Clients can implement this interface, or use the convenience implementation
 DiffNode.
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionvoidRegisters the given listener for notification.voidcopy(boolean leftToRight) Copy one side (source) to the other side (destination) depending on the value ofleftToRight.Returns the ancestor side of this input.getImage()Returns an image representing this input.intgetKind()Returns the kind of difference between the three sides ancestor, left and right.getLeft()Returns the left side of this input.getName()Returns name of input.getRight()Returns the right side of this input.voidUnregisters the given listener.
- 
Method Details- 
getNameString getName()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-nullsides or a combination thereof.- Returns:
- name of input
 
- 
getImageImage getImage()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-nullsides.- Returns:
- image representing this input, or nullif no icon should be shown
 
- 
getKindint getKind()Returns the kind of difference between the three sides ancestor, left and right. This field is only meaningful if theICompareInputis the result of another compare. In this case it is used together withgetImage()to compose an icon which reflects the kind of difference between the two or three elements.- Returns:
- kind of difference (see Differencer)
 
- 
getAncestorITypedElement getAncestor()Returns the ancestor side of this input. Returnsnullif this input has no ancestor or in the two-way compare case.- Returns:
- the ancestor of this input, or null
 
- 
getLeftITypedElement getLeft()Returns the left side of this input. Returnsnullif there is no left side (deletion or addition).- Returns:
- the left side of this input, or null
 
- 
getRightITypedElement getRight()Returns the right side of this input. Returnsnullif there is no right side (deletion or addition).- Returns:
- the right side of this input, or null
 
- 
addCompareInputChangeListenerRegisters the given listener for notification. If the identical listener is already registered the method has no effect.- Parameters:
- listener- the listener to register for changes of this input
 
- 
removeCompareInputChangeListenerUnregisters the given listener. If the identical listener is not registered the method has no effect.- Parameters:
- listener- the listener to unregister
 
- 
copyvoid copy(boolean leftToRight) Copy one side (source) to the other side (destination) depending on the value ofleftToRight. 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: - 
 if the source side is nullthe destination must be deleted,
- 
 if the destination is nullthe destination must be created and filled with the contents from the source,
- 
 if both sides are non-nullthe contents of source must be copied to destination.
 ICompareInputChangeListener.- Parameters:
- leftToRight- if- truethe left side is copied to the right side. If- falsethe right side is copied to the left side
 
- 
 if the source side is 
 
-