|
Eclipse Platform Release 3.1 |
|||||||||||
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.jface.viewers.StructuredViewer
org.eclipse.jface.viewers.AbstractTreeViewer
org.eclipse.jface.viewers.TreeViewer
org.eclipse.compare.structuremergeviewer.DiffTreeViewer
A tree viewer that works on objects implementing
the IDiffContainer
and IDiffElement
interfaces.
This class may be instantiated; it is not intended to be subclassed outside this package.
IDiffContainer
,
IDiffElement
Nested Class Summary |
---|
Nested classes inherited from class org.eclipse.jface.viewers.StructuredViewer |
---|
StructuredViewer.ColorAndFontCollectorWithProviders |
Field Summary |
---|
Fields inherited from class org.eclipse.jface.viewers.AbstractTreeViewer |
---|
ALL_LEVELS |
Fields inherited from class org.eclipse.jface.viewers.Viewer |
---|
WIDGET_DATA_KEY |
Constructor Summary | |
---|---|
DiffTreeViewer(Composite parent,
CompareConfiguration configuration)
Creates a new viewer under the given SWT parent and with the specified configuration. |
|
DiffTreeViewer(Tree tree,
CompareConfiguration configuration)
Creates a new viewer for the given SWT tree control with the specified configuration. |
Method Summary | |
---|---|
protected void |
copyOne(ICompareInput node,
boolean leftToRight)
Called to copy one side of the given node to the other. |
protected void |
copySelected(boolean leftToRight)
Copies one side of all DiffNode s in the current selection to the other side.
|
protected void |
createToolItems(ToolBarManager toolbarManager)
This factory method is called after the viewer's controls have been created. |
protected boolean |
dontExpand(Object o)
This hook method is called from within internalExpandToLevel
to control whether a given model node should be expanded or not.
|
protected void |
expandSelection()
Expands to infinity all items in the selection. |
protected void |
fillContextMenu(IMenuManager manager)
This method is called to add actions to the viewer's context menu. |
protected ResourceBundle |
getBundle()
Returns the resource bundle. |
CompareConfiguration |
getCompareConfiguration()
Returns the compare configuration of this viewer. |
String |
getTitle()
Returns the viewer's name. |
protected void |
handleDispose(DisposeEvent event)
Called on the viewer disposal. |
protected void |
initialSelection()
This hook method is called from within inputChanged
after a new input has been set but before any controls are updated.
|
protected void |
inputChanged(Object in,
Object oldInput)
Internal hook method called when the input to this viewer is initially set or subsequently changed. |
protected void |
internalExpandToLevel(Widget node,
int level)
Overridden to avoid expanding DiffNode s that shouldn't expand. |
protected void |
navigate(boolean next)
Selects the next (or previous) node of the current selection. |
protected void |
propertyChange(PropertyChangeEvent event)
Tracks property changes of the configuration object. |
Methods inherited from class org.eclipse.jface.viewers.TreeViewer |
---|
addTreeListener, cancelEditing, doUpdateItem, editElement, getCellEditors, getCellModifier, getChild, getChildren, getColumnProperties, getControl, getExpanded, getItem, getItemCount, getItemCount, getItems, getLabelProvider, getParentItem, getSelection, getTree, hookControl, isCellEditorActive, isSameSelection, newItem, removeAll, setCellEditors, setCellModifier, setColumnProperties, setExpanded, setLabelProvider, setSelection, showItem |
Methods inherited from class org.eclipse.jface.viewers.ContentViewer |
---|
getContentProvider, getInput |
Methods inherited from class org.eclipse.jface.viewers.Viewer |
---|
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, setData, setSelection |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.jface.viewers.ISelectionProvider |
---|
addSelectionChangedListener, removeSelectionChangedListener, setSelection |
Constructor Detail |
public DiffTreeViewer(Tree tree, CompareConfiguration configuration)
tree
- the tree controlconfiguration
- the configuration for this viewerpublic DiffTreeViewer(Composite parent, CompareConfiguration configuration)
parent
- the SWT control under which to create the viewerconfiguration
- the configuration for this viewerMethod Detail |
public String getTitle()
protected ResourceBundle getBundle()
public CompareConfiguration getCompareConfiguration()
protected void handleDispose(DisposeEvent event)
handleDispose
in class ContentViewer
event
- dispose event that triggered call to this methodprotected void propertyChange(PropertyChangeEvent event)
event
- property change event that triggered call to this methodprotected void inputChanged(Object in, Object oldInput)
Viewer
The default implementation does nothing. Subclassers may override this method to do something when a viewer's input is set. A typical use is populate the viewer.
inputChanged
in class AbstractTreeViewer
protected void initialSelection()
inputChanged
after a new input has been set but before any controls are updated.
This default implementation calls navigate(true)
to select and expand the first leaf node.
Clients can override this method and are free to decide whether
they want to call the inherited method.
protected void internalExpandToLevel(Widget node, int level)
DiffNode
s that shouldn't expand.
internalExpandToLevel
in class AbstractTreeViewer
node
- the node to expandlevel
- non-negative level, or ALL_LEVELS
to collapse all levels of the treeprotected boolean dontExpand(Object o)
internalExpandToLevel
to control whether a given model node should be expanded or not.
This default implementation checks whether the object is a DiffNode
and
calls dontExpand()
on it.
Clients can override this method and are free to decide whether
they want to call the inherited method.
o
- the model object to be expanded
false
if a node should be expanded, true
to prevent expandingprotected void createToolItems(ToolBarManager toolbarManager)
ToolBarManager
. Two actions
allow for copying one side of a DiffNode
to the other side.
Two other actions are for navigating from one node to the next (previous).
Clients can override this method and are free to decide whether they want to call the inherited method.
toolbarManager
- the toolbar manager for which to add the actionsprotected void fillContextMenu(IMenuManager manager)
DiffNode
to the other side.
Clients can override this method and are free to decide whether they want to call
the inherited method.
manager
- the menu manager for which to add the actionsprotected void expandSelection()
protected void copySelected(boolean leftToRight)
DiffNode
s in the current selection to the other side.
Called from the (internal) actions for copying the sides of a DiffNode
.
Clients may override.
leftToRight
- if true
the left side is copied to the right side.
If false
the right side is copied to the left sideprotected void copyOne(ICompareInput node, boolean leftToRight)
ICompareInput.copy(...)
.
Clients may override.
node
- the node to copyleftToRight
- if true
the left side is copied to the right side.
If false
the right side is copied to the left sideprotected void navigate(boolean next)
next
- if true
the next node is selected, otherwise the previous node
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.