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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcopy(boolean leftToRight) Copies the content of one side to the other side.voidcreateControls(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 voidhandleResizeAncestor(int x, int y, int width, int height) Lays out the ancestor area of the compare viewer.protected voidhandleResizeLeftRight(int x, int y, int width1, int centerWidth, int width2, int height) Lays out the left and right areas of the compare viewer.protected voidupdateContent(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, updateToolItemsMethods inherited from class org.eclipse.jface.viewers.ContentViewer
getContentProvider, getInput, getLabelProvider, handleLabelProviderChanged, labelProviderChanged, setInput, setLabelProviderMethods 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:ContentMergeViewerInitializes the controls of the three content areas with the given input objects.- Specified by:
updateContentin 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:ContentMergeViewerReturns the byte contents of the left or right side. If the viewer has no editable contentnullcan be returned.- Specified by:
getContentsin 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:ContentMergeViewerCreates 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:
createControlsin 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:ContentMergeViewerLays 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:
handleResizeAncestorin 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:ContentMergeViewerLays 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:
handleResizeLeftRightin 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:ContentMergeViewerCopies 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:
copyin classContentMergeViewer- Parameters:
leftToRight- iftrue, the left side is copied to the right side; iffalse, the right side is copied to the left side
-