|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.viewers.Viewer
org.eclipse.jface.viewers.ContentViewer
org.eclipse.compare.contentmergeviewer.ContentMergeViewer
org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeViewer
public class ModelContentMergeViewer
Compare and merge viewer with two side-by-side content areas and an optional content area for the ancestor.
Field Summary | |
---|---|
protected int |
activeTabIndex
Keeps track of the currently selected tab for this viewer part. |
protected ModelContentMergeTabFolder |
ancestorPart
Ancestor part of the three possible parts of this content viewer. |
static java.lang.String |
BUNDLE_NAME
Name of the bundle resources property file. |
static int |
CENTER_WIDTH
Width to affect to the center area. |
protected org.eclipse.compare.CompareConfiguration |
configuration
CompareConfiguration controls various aspect of the GUI elements. |
protected java.util.List<DiffElement> |
currentSelection
Keeps track of the current diff Selection. |
protected boolean |
isThreeWay
Indicates that this is a three-way comparison. |
protected ModelContentMergeTabFolder |
leftPart
Left of the three possible parts of this content viewer. |
protected ModelContentMergeTabFolder |
rightPart
Right of the three possible parts of this content viewer. |
Fields inherited from class org.eclipse.jface.viewers.Viewer |
---|
WIDGET_DATA_KEY |
Constructor Summary | |
---|---|
ModelContentMergeViewer(org.eclipse.swt.widgets.Composite parent,
org.eclipse.compare.CompareConfiguration config)
Creates a new model content merge viewer and initializes it. |
Method Summary | |
---|---|
protected void |
copy(boolean leftToRight)
|
protected void |
copy(java.util.List<DiffElement> diffs,
boolean leftToRight)
Copies a list of DiffElement s or DiffGroup s in the given direction, then updates the
toolbar items states as well as the dirty state of both the left and the right models. |
protected void |
copyDiffLeftToRight()
Undoes the changes implied by the currently selected diff . |
protected void |
copyDiffRightToLeft()
Applies the changes implied by the currently selected diff . |
protected void |
createControls(org.eclipse.swt.widgets.Composite composite)
|
protected org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider |
createMergeViewerContentProvider()
Creates and return our content provider. |
protected ModelCompareInput |
createModelCompareInput(ICompareInputDetailsProvider provider,
ComparisonSnapshot snapshot)
Creates the ModelCompareInput for this particular viewer. |
protected ModelContentMergeTabFolder |
createModelContentMergeTabFolder(org.eclipse.swt.widgets.Composite composite,
int side)
Creates a new tab folder for the specified side (left,
right or ancestor). |
protected void |
createToolItems(org.eclipse.jface.action.ToolBarManager tbm)
|
protected void |
fireSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
|
org.eclipse.swt.widgets.Canvas |
getCenterPart()
Returns the center Canvas appearing between the viewer parts. |
static org.eclipse.swt.graphics.RGB |
getColor(java.lang.String key)
Returns the color identified by the given key in colors . |
org.eclipse.compare.CompareConfiguration |
getConfiguration()
Returns the compare configuration of this viewer. |
protected byte[] |
getContents(boolean left)
|
protected java.util.List<DiffElement> |
getVisibleDiffs()
This will minimize the list of differences to the visible differences. |
protected void |
handleDispose(org.eclipse.swt.events.DisposeEvent event)
|
protected void |
handleResizeAncestor(int x,
int y,
int width,
int height)
|
protected void |
handleResizeLeftRight(int x,
int y,
int leftWidth,
int centerWidth,
int rightWidth,
int height)
|
protected void |
navigate(boolean down)
Selects the next or previous DiffElement as compared to the currently selected one. |
void |
setInput(java.lang.Object input)
|
void |
setSelection(DiffElement diff)
Sets the parts' tree selection given the DiffElement to select. |
void |
setSelection(java.util.List<DiffElement> diffs)
Sets the parts' tree selection given the list of DiffElement s to select. |
static boolean |
shouldDrawDiffMarkers()
Returns True if the trees and center have to draw markers over the differences. |
protected void |
switchCopyState(boolean enabled)
This will enable or disable the toolbar's copy actions according to the given boolean . |
void |
update()
Redraws this viewer. |
void |
updateCenter()
Redraws the center Control. |
protected void |
updateContent(java.lang.Object ancestor,
java.lang.Object left,
java.lang.Object right)
|
protected void |
updatePreferences()
Updates the values of all the variables using preferences values. |
protected void |
updateToolItems()
|
Methods inherited from class org.eclipse.compare.contentmergeviewer.ContentMergeViewer |
---|
addPropertyChangeListener, buildControl, createCenterControl, doSave, flush, flushContent, getCenterControl, getCenterWidth, getCompareConfiguration, getControl, getResourceBundle, getSelection, getTitle, getToolBarManager, handleCompareInputChange, handlePropertyChangeEvent, handleSetFocus, inputChanged, isAncestorVisible, isLeftDirty, isRightDirty, isThreeWay, refresh, removePropertyChangeListener, save, setConfirmSave, setContentProvider, setLeftDirty, setRightDirty, setSelection, updateHeader |
Methods inherited from class org.eclipse.jface.viewers.ContentViewer |
---|
getContentProvider, getInput, getLabelProvider, handleLabelProviderChanged, hookControl, labelProviderChanged, setLabelProvider |
Methods inherited from class org.eclipse.jface.viewers.Viewer |
---|
addHelpListener, addSelectionChangedListener, fireHelpRequested, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BUNDLE_NAME
public static final int CENTER_WIDTH
protected int activeTabIndex
protected ModelContentMergeTabFolder ancestorPart
protected final java.util.List<DiffElement> currentSelection
protected ModelContentMergeTabFolder leftPart
protected ModelContentMergeTabFolder rightPart
protected final org.eclipse.compare.CompareConfiguration configuration
CompareConfiguration
controls various aspect of the GUI elements. This will keep track of the
one used to created this compare editor.
protected boolean isThreeWay
Constructor Detail |
---|
public ModelContentMergeViewer(org.eclipse.swt.widgets.Composite parent, org.eclipse.compare.CompareConfiguration config)
parent
- Parent composite for this viewer.config
- The configuration object.Method Detail |
---|
public static final org.eclipse.swt.graphics.RGB getColor(java.lang.String key)
colors
.
key
- Key of the color to return.
public static boolean shouldDrawDiffMarkers()
True
if the trees and center have to draw markers over the differences.
True
if the trees and center have to draw markers over the differences,
False
otherwise.public org.eclipse.swt.widgets.Canvas getCenterPart()
Canvas
appearing between the viewer parts.
Canvas
.public org.eclipse.compare.CompareConfiguration getConfiguration()
public void setInput(java.lang.Object input)
setInput
in class org.eclipse.jface.viewers.ContentViewer
protected ModelCompareInput createModelCompareInput(ICompareInputDetailsProvider provider, ComparisonSnapshot snapshot)
ModelCompareInput
for this particular viewer.
provider
- The input provider instance that is in charge of this comparison.snapshot
- Snapshot describing the current comparison.
ModelCompareInput
for this particular viewer.public void setSelection(DiffElement diff)
DiffElement
to select.
diff
- DiffElement
backing the current selection.public void setSelection(java.util.List<DiffElement> diffs)
DiffElement
s to select.
diffs
- DiffElement
backing the current selection.public void update()
public void updateCenter()
protected void copy(boolean leftToRight)
copy
in class org.eclipse.compare.contentmergeviewer.ContentMergeViewer
ContentMergeViewer.copy(boolean)
protected void copy(java.util.List<DiffElement> diffs, boolean leftToRight)
DiffElement
s or DiffGroup
s in the given direction, then updates the
toolbar items states as well as the dirty state of both the left and the right models.
diffs
- Element
s to copy.leftToRight
- Direction of the copy.ModelCompareInput.copy(List, boolean)
protected void copyDiffLeftToRight()
diff
.
protected void copyDiffRightToLeft()
diff
.
protected void createControls(org.eclipse.swt.widgets.Composite composite)
createControls
in class org.eclipse.compare.contentmergeviewer.ContentMergeViewer
ContentMergeViewer.createControls(Composite)
protected org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider createMergeViewerContentProvider()
content provider
for this merge viewer.protected ModelContentMergeTabFolder createModelContentMergeTabFolder(org.eclipse.swt.widgets.Composite composite, int side)
tab folder
for the specified side
(left,
right or ancestor). Clients may override this method in order to create their custom part.
composite
- The parent Composite
of the part to create.side
- The side where the created part is going to be displayed.
protected void createToolItems(org.eclipse.jface.action.ToolBarManager tbm)
createToolItems
in class org.eclipse.compare.contentmergeviewer.ContentMergeViewer
ContentMergeViewer.createToolItems(ToolBarManager)
protected void fireSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
fireSelectionChanged
in class org.eclipse.jface.viewers.Viewer
Viewer.fireSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
protected byte[] getContents(boolean left)
getContents
in class org.eclipse.compare.contentmergeviewer.ContentMergeViewer
ContentMergeViewer.getContents(boolean)
protected java.util.List<DiffElement> getVisibleDiffs()
DiffAdapterFactory.shouldBeHidden(org.eclipse.emf.ecore.EObject)
returns false on
it.
List
of the visible differences for this comparison.protected void handleDispose(org.eclipse.swt.events.DisposeEvent event)
handleDispose
in class org.eclipse.compare.contentmergeviewer.ContentMergeViewer
ContentMergeViewer.handleDispose(org.eclipse.swt.events.DisposeEvent)
protected void handleResizeAncestor(int x, int y, int width, int height)
handleResizeAncestor
in class org.eclipse.compare.contentmergeviewer.ContentMergeViewer
ContentMergeViewer.handleResizeAncestor(int, int, int, int)
protected void handleResizeLeftRight(int x, int y, int leftWidth, int centerWidth, int rightWidth, int height)
handleResizeLeftRight
in class org.eclipse.compare.contentmergeviewer.ContentMergeViewer
ContentMergeViewer#handleResizeLeftRight(int, int, int, int)
protected void navigate(boolean down)
DiffElement
as compared to the currently selected one.
down
- True
if we seek the next DiffElement
, False
for the
previous.protected void switchCopyState(boolean enabled)
boolean
. The
"copy diff left to right" action will be enabled if enable
is True
, but the
"copy diff right to left" action will only be activated if enable
is True
AND
the left model isn't a remote model.
enabled
- True
if we seek to enable the actions, False
otherwise.protected void updateContent(java.lang.Object ancestor, java.lang.Object left, java.lang.Object right)
updateContent
in class org.eclipse.compare.contentmergeviewer.ContentMergeViewer
ContentMergeViewer.updateContent(Object, Object, Object)
protected void updatePreferences()
protected void updateToolItems()
updateToolItems
in class org.eclipse.compare.contentmergeviewer.ContentMergeViewer
ContentMergeViewer.updateToolItems()
|
Copyright 2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |