Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.compare.structuremergeviewer
Class DiffTreeViewer


java.lang.Object
  extended by 

org.eclipse.jface.viewers.Viewer
      extended by 

org.eclipse.jface.viewers.ContentViewer
          extended by 

org.eclipse.jface.viewers.StructuredViewer
              extended by 

org.eclipse.jface.viewers.ColumnViewer
                  extended by 

org.eclipse.jface.viewers.AbstractTreeViewer
                      extended by 

org.eclipse.jface.viewers.TreeViewer
                          extended by 
org.eclipse.compare.structuremergeviewer.DiffTreeViewer
All Implemented Interfaces:
IInputProvider, IInputSelectionProvider, IPostSelectionProvider, ISelectionProvider
Direct Known Subclasses:
StructureDiffViewer

public class DiffTreeViewer
extends TreeViewer

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.

See Also:
IDiffContainer, IDiffElement
Restriction:
This class is not intended to be subclassed by clients.

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.viewers. StructuredViewer
StructuredViewer.ColorAndFontCollector, 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 DiffNodes 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 DiffNodes 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, assertContentProviderType, createChildren, createViewerEditor, disassociate, doGetColumnCount, editElement, getChild, getChildren, getColumnViewerOwner, getControl, getExpanded, getItemAt, getItemCount, getItemCount, getItems, getLabelProvider, getParentElement, getParentItem, getRawChildren, getSelection, getTree, getViewerRowFromItem, handleTreeCollapse, handleTreeExpand, hookControl, internalAdd, internalInitializeTree, internalRefreshStruct, isExpandable, mapElement, newItem, remove, removeAll, replace, setChildCount, setContentProvider, setExpanded, setHasChildren, setSelection, setSelection, showItem, updatePlus
 
Methods inherited from class org.eclipse.jface.viewers. AbstractTreeViewer
add, add, addSelectionListener, addTreeListener, associate, buildLabel, collapseAll, collapseToLevel, createTreeItem, doFindInputItem, doFindItem, doUpdateItem, doUpdateItem, expandAll, expandToLevel, expandToLevel, fireTreeCollapsed, fireTreeExpanded, getAutoExpandLevel, getChildren, getExpandedElements, getExpandedState, getExpandedTreePaths, getFilteredChildren, getNextItem, getPreviousItem, getSelection, getSelectionFromWidget, getSortedChildren, getTreePathFromItem, getVisibleExpandedElements, handleDoubleSelect, indexForElement, insert, internalCollapseToLevel, internalExpand, internalFindItems, internalGetWidgetToSelect, internalIsInputOrEmptyPath, internalRefresh, internalRefresh, internalRefresh, internalRemove, internalRemove, isSameSelection, labelProviderChanged, remove, remove, remove, removeTreeListener, reveal, scrollDown, scrollUp, setAutoExpandLevel, setExpandedElements, setExpandedState, setExpandedTreePaths, setSelectionToWidget, setSelectionToWidget, updateChildren
 
Methods inherited from class org.eclipse.jface.viewers. ColumnViewer
applyEditorValue, cancelEditing, checkBusy, getCell, getCellEditors, getCellModifier, getColumnProperties, getColumnViewerEditor, getItem, getLabelProvider, getViewerRow, hookEditingSupport, isBusy, isCellEditorActive, refresh, refresh, setBusy, setCellEditors, setCellModifier, setColumnProperties, setColumnViewerEditor, setLabelProvider, triggerEditorActivationEvent, update
 
Methods inherited from class org.eclipse.jface.viewers. StructuredViewer
addDoubleClickListener, addDragSupport, addDropSupport, addFilter, addOpenListener, addPostSelectionChangedListener, assertElementsNotNull, equals, filter, findItem, findItems, fireDoubleClick, fireOpen, firePostSelectionChanged, getColorAndFontCollector, getComparator, getComparer, getFilters, getRoot, getSorter, handleInvalidSelection, handleLabelProviderChanged, handleOpen, handlePostSelect, handleSelect, hasFilters, internalUpdate, needsRefilter, preservingSelection, refresh, refresh, refreshItem, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setFilters, setInput, setSorter, setUseHashlookup, testFindItem, testFindItems, unmapAllElements, unmapElement, unmapElement, update, updateItem, updateSelection, usingElementMap
 
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

DiffTreeViewer

public DiffTreeViewer(
Tree tree,
                      
CompareConfiguration configuration)
Creates a new viewer for the given SWT tree control with the specified configuration.

Parameters:
tree - the tree control
configuration - the configuration for this viewer

DiffTreeViewer

public DiffTreeViewer(
Composite parent,
                      
CompareConfiguration configuration)
Creates a new viewer under the given SWT parent and with the specified configuration.

Parameters:
parent - the SWT control under which to create the viewer
configuration - the configuration for this viewer
Method Detail

getTitle

public 
String getTitle()
Returns the viewer's name.

Returns:
the viewer's name

getBundle

protected 
ResourceBundle getBundle()
Returns the resource bundle.

Returns:
the viewer's resource bundle

getCompareConfiguration

public 
CompareConfiguration getCompareConfiguration()
Returns the compare configuration of this viewer.

Returns:
the compare configuration of this viewer

handleDispose

protected void handleDispose(
DisposeEvent event)
Called on the viewer disposal. Unregisters from the compare configuration. Clients may extend if they have to do additional cleanup.

Overrides:
handleDispose in class StructuredViewer
Parameters:
event - dispose event that triggered call to this method

propertyChange

protected void propertyChange(
PropertyChangeEvent event)
Tracks property changes of the configuration object. Clients may extend to track their own property changes.

Parameters:
event - property change event that triggered call to this method

inputChanged

protected void inputChanged(
Object in,
                            
Object oldInput)
Description copied from class: Viewer
Internal hook method called when the input to this viewer is initially set or subsequently changed.

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.

Overrides:
inputChanged in class AbstractTreeViewer
Parameters:
in - the new input of this viewer, or null if none
oldInput - the old input element or null if there was previously no input

initialSelection

protected void initialSelection()
This hook method is called from within 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.

Since:
2.0

internalExpandToLevel

protected void internalExpandToLevel(
Widget node,
                                     int level)
Overridden to avoid expanding DiffNodes that shouldn't expand.

Overrides:
internalExpandToLevel in class AbstractTreeViewer
Parameters:
node - the node to expand
level - non-negative level, or ALL_LEVELS to collapse all levels of the tree

dontExpand

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. 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.

Parameters:
o - the model object to be expanded
Returns:
false if a node should be expanded, true to prevent expanding
Since:
2.0

createToolItems

protected void createToolItems(
ToolBarManager toolbarManager)
This factory method is called after the viewer's controls have been created. It installs four actions in the given 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.

Parameters:
toolbarManager - the toolbar manager for which to add the actions

fillContextMenu

protected void fillContextMenu(
IMenuManager manager)
This method is called to add actions to the viewer's context menu. It installs actions for expanding tree nodes, copying one side of a DiffNode to the other side. Clients can override this method and are free to decide whether they want to call the inherited method.

Parameters:
manager - the menu manager for which to add the actions

expandSelection

protected void expandSelection()
Expands to infinity all items in the selection.

Since:
2.0

copySelected

protected void copySelected(boolean leftToRight)
Copies one side of all DiffNodes in the current selection to the other side. Called from the (internal) actions for copying the sides of a DiffNode. Clients may override.

Parameters:
leftToRight - if true the left side is copied to the right side. If false the right side is copied to the left side

copyOne

protected void copyOne(
ICompareInput node,
                       boolean leftToRight)
Called to copy one side of the given node to the other. This default implementation delegates the call to ICompareInput.copy(...). Clients may override.

Parameters:
node - the node to copy
leftToRight - if true the left side is copied to the right side. If false the right side is copied to the left side

navigate

protected void navigate(boolean next)
Selects the next (or previous) node of the current selection. If there is no current selection the first (last) node in the tree is selected. Wraps around at end or beginning. Clients may override.

Parameters:
next - if true the next node is selected, otherwise the previous node

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire