|
||||||||||
| 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 java.util.List<DiffElement> |
currentSelection
Keeps track of the current diff Selection. |
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 intializes it. |
|
| Method Summary | |
|---|---|
protected void |
copy(boolean leftToRight)
|
protected void |
copy(java.util.List<DiffElement> diffs,
boolean leftToRight)
Copies a list of DiffElements or DiffGroups 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 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 DiffElements 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
| 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.ContentViewerpublic void setSelection(DiffElement diff)
DiffElement to select.
diff - DiffElement backing the current selection.public void setSelection(java.util.List<DiffElement> diffs)
DiffElements 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.ContentMergeViewerContentMergeViewer.copy(boolean)
protected void copy(java.util.List<DiffElement> diffs,
boolean leftToRight)
DiffElements or DiffGroups 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 - Elements 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.ContentMergeViewerContentMergeViewer.createControls(Composite)protected void createToolItems(org.eclipse.jface.action.ToolBarManager tbm)
createToolItems in class org.eclipse.compare.contentmergeviewer.ContentMergeViewerContentMergeViewer.createToolItems(ToolBarManager)protected void fireSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
fireSelectionChanged in class org.eclipse.jface.viewers.ViewerViewer.fireSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)protected byte[] getContents(boolean left)
getContents in class org.eclipse.compare.contentmergeviewer.ContentMergeViewerContentMergeViewer.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.ContentMergeViewerContentMergeViewer.handleDispose(org.eclipse.swt.events.DisposeEvent)
protected void handleResizeAncestor(int x,
int y,
int width,
int height)
handleResizeAncestor in class org.eclipse.compare.contentmergeviewer.ContentMergeViewerContentMergeViewer.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.ContentMergeViewerContentMergeViewer#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.ContentMergeViewerContentMergeViewer.updateContent(Object, Object, Object)protected void updatePreferences()
protected void updateToolItems()
updateToolItems in class org.eclipse.compare.contentmergeviewer.ContentMergeViewerContentMergeViewer.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 | |||||||||