Package org.eclipse.compare.internal
Class ImageMergeViewer
java.lang.Object
org.eclipse.jface.viewers.Viewer
org.eclipse.jface.viewers.ContentViewer
org.eclipse.compare.contentmergeviewer.ContentMergeViewer
org.eclipse.compare.internal.ImageMergeViewer
- All Implemented Interfaces:
IFlushable
,IFlushable2
,IPropertyChangeNotifier
,IInputProvider
,IInputSelectionProvider
,ISelectionProvider
-
Field Summary
Fields inherited from class org.eclipse.jface.viewers.Viewer
WIDGET_DATA_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
copy
(boolean leftToRight) Copies the content of one side to the other side.void
createControls
(Composite composite) Creates the SWT controls for the ancestor, left, and right content areas of this compare viewer.protected byte[]
getContents
(boolean left) Returns the byte contents of the left or right side.protected void
handleResizeAncestor
(int x, int y, int width, int height) Lays out the ancestor area of the compare viewer.protected void
handleResizeLeftRight
(int x, int y, int width1, int centerWidth, int width2, int height) Lays out the left and right areas of the compare viewer.protected void
updateContent
(Object ancestor, Object left, Object right) Initializes the controls of the three content areas with the given input objects.Methods inherited from class org.eclipse.compare.contentmergeviewer.ContentMergeViewer
addPropertyChangeListener, buildControl, createCenterControl, createToolItems, doSave, flush, flushContent, flushLeft, flushRight, getCenterControl, getCenterWidth, getCompareConfiguration, getControl, getResourceBundle, getSelection, getTitle, getToolBarManager, handleCompareInputChange, handleDispose, handlePropertyChangeEvent, handleSetFocus, hookControl, inputChanged, internalIsLeftDirty, internalIsRightDirty, isAncestorVisible, isLeftDirty, isLeftEditable, isRightDirty, isRightEditable, isThreeWay, refresh, removePropertyChangeListener, save, setConfirmSave, setContentProvider, setLeftDirty, setRightDirty, setSelection, updateHeader, updateToolItems
Methods inherited from class org.eclipse.jface.viewers.ContentViewer
getContentProvider, getInput, getLabelProvider, handleLabelProviderChanged, labelProviderChanged, setInput, setLabelProvider
Methods inherited from class org.eclipse.jface.viewers.Viewer
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
-
Constructor Details
-
ImageMergeViewer
-
-
Method Details
-
updateContent
Description copied from class:ContentMergeViewer
Initializes the controls of the three content areas with the given input objects.- Specified by:
updateContent
in classContentMergeViewer
- Parameters:
ancestor
- the input for the ancestor arealeft
- the input for the left arearight
- the input for the right area
-
getContents
protected byte[] getContents(boolean left) Description copied from class:ContentMergeViewer
Returns the byte contents of the left or right side. If the viewer has no editable contentnull
can be returned.- Specified by:
getContents
in classContentMergeViewer
- Parameters:
left
- iftrue
, the byte contents of the left area is returned; iffalse
, the byte contents of the right area- Returns:
- the content as an array of bytes, or
null
-
createControls
Description copied from class:ContentMergeViewer
Creates the SWT controls for the ancestor, left, and right content areas of this compare viewer. Implementations typically hold onto the controls so that they can be initialized with the input objects in methodupdateContent
.- Specified by:
createControls
in classContentMergeViewer
- Parameters:
composite
- the container for the three areas
-
handleResizeAncestor
protected void handleResizeAncestor(int x, int y, int width, int height) Description copied from class:ContentMergeViewer
Lays out the ancestor area of the compare viewer. It is called whenever the viewer is resized or when the sashes between the areas are moved to adjust the size of the areas.- Specified by:
handleResizeAncestor
in classContentMergeViewer
- Parameters:
x
- the horizontal position of the ancestor area within its containery
- the vertical position of the ancestor area within its containerwidth
- the width of the ancestor areaheight
- the height of the ancestor area
-
handleResizeLeftRight
protected void handleResizeLeftRight(int x, int y, int width1, int centerWidth, int width2, int height) Description copied from class:ContentMergeViewer
Lays out the left and right areas of the compare viewer. It is called whenever the viewer is resized or when the sashes between the areas are moved to adjust the size of the areas.- Specified by:
handleResizeLeftRight
in classContentMergeViewer
- Parameters:
x
- the horizontal position of the left area within its containery
- the vertical position of the left and right area within its containerwidth1
- the width of the left areacenterWidth
- the width of the gap between the left and right areaswidth2
- the width of the right areaheight
- the height of the left and right areas
-
copy
protected void copy(boolean leftToRight) Description copied from class:ContentMergeViewer
Copies the content of one side to the other side. Called from the (internal) actions for copying the sides of the viewer's input object.- Specified by:
copy
in classContentMergeViewer
- Parameters:
leftToRight
- iftrue
, the left side is copied to the right side; iffalse
, the right side is copied to the left side
-