Package org.eclipse.compare.internal

# Class CompareContentViewerSwitchingPane

java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.custom.ViewForm
org.eclipse.compare.CompareViewerPane
org.eclipse.compare.CompareViewerSwitchingPane
org.eclipse.compare.internal.CompareContentViewerSwitchingPane

All Implemented Interfaces:
  `IAdaptable`, `IDoubleClickListener`, `IOpenListener`, `ISelectionChangedListener`, `ISelectionProvider`, `Drawable`

public class CompareContentViewerSwitchingPane extends CompareViewerSwitchingPane

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`DISABLE_CAPPING_TEMPORARILY`
`static final String`
`OPTIMIZED_ALGORITHM_USED`

### Fields inherited from class org.eclipse.swt.custom.ViewForm

`borderInsideRGB, borderMiddleRGB, borderOutsideRGB, horizontalSpacing, marginHeight, marginWidth, verticalSpacing`

### Fields inherited from class org.eclipse.swt.widgets.Control

`handle`

### Fields inherited from class org.eclipse.swt.widgets.Widget

`nativeZoom`

## Constructor Summary

Constructors
Constructor
Description
`CompareContentViewerSwitchingPane(Splitter parent, int style, CompareEditorInput editorInput)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addMouseListener(MouseListener listener)`
Adds the listener to the collection of listeners who will be notified when mouse buttons are pressed and released, by sending it one of the messages defined in the `MouseListener` interface.
`protected Control`
`createTopLeft(Composite p)`
`protected Viewer`
`getViewer(Viewer oldViewer, Object input)`
Returns a viewer which is able to display the given input.
`protected boolean`
`inputChanged(Object input)`
`void`
`setImage(Image image)`
Set the pane's title Image.
`void`
`setInput(Object input)`
Sets the input object of this pane.
`void`
`setText(String text)`
Set the pane's title text.

### Methods inherited from class org.eclipse.compare.CompareViewerSwitchingPane

`getAdapter, getSelection, getTitleArgument, getViewer, isEmpty, setFocus, setSelection, setTitleArgument`

### Methods inherited from class org.eclipse.compare.CompareViewerPane

`addDoubleClickListener, addOpenListener, addSelectionChangedListener, clearToolBar, doubleClick, getInput, getToolBarManager, open, removeDoubleClickListener, removeOpenListener, removeSelectionChangedListener, selectionChanged`

### Methods inherited from class org.eclipse.swt.custom.ViewForm

`computeTrim, getClientArea, getContent, getTopCenter, getTopLeft, getTopRight, setBorderVisible, setContent, setLayout, setTopCenter, setTopCenterSeparate, setTopLeft, setTopRight`

### Methods inherited from class org.eclipse.swt.widgets.Composite

`changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setLayoutDeferred, setTabList, toString`

### Methods inherited from class org.eclipse.swt.widgets.Scrollable

`getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsMode`

### Methods inherited from class org.eclipse.swt.widgets.Control

`addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update`

### Methods inherited from class org.eclipse.swt.widgets.Widget

`addDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.eclipse.swt.graphics.Drawable

`isAutoScalable`

## Field Details

### OPTIMIZED_ALGORITHM_USED

public static final String OPTIMIZED_ALGORITHM_USED

See Also:
  - Constant Field Values

### DISABLE_CAPPING_TEMPORARILY

public static final String DISABLE_CAPPING_TEMPORARILY

See Also:
  - Constant Field Values

## Constructor Details

### CompareContentViewerSwitchingPane

public CompareContentViewerSwitchingPane(Splitter parent, int style, CompareEditorInput editorInput)

## Method Details

### getViewer

protected Viewer getViewer(Viewer oldViewer, Object input)
Description copied from class: `CompareViewerSwitchingPane`
Returns a viewer which is able to display the given input. If no viewer can be found, `null` is returned. The additional argument oldViewer represents the viewer currently installed in the pane (or `null` if no viewer is installed). It can be returned from this method if the current viewer can deal with the input (and no new viewer must be created).

Specified by:
  `getViewer` in class `CompareViewerSwitchingPane`
Parameters:
  `oldViewer` - the currently installed viewer or `null`
  `input` - the input object for which a viewer must be determined or `null`
Returns:
  a viewer for the given input, or `null` if no viewer can be determined

### createTopLeft

protected Control createTopLeft(Composite p)

Overrides:
  `createTopLeft` in class `CompareViewerPane`
Parameters:
  `p` - a widget which will be the parent of the control (cannot be null)
Returns:
  the control to be placed in the top left corner of the pane

### inputChanged

protected boolean inputChanged(Object input)

Overrides:
  `inputChanged` in class `CompareViewerSwitchingPane`
Parameters:
  `input` - the input
Returns:
  true, if the input is considered as changed

### setInput

public void setInput(Object input)
Description copied from class: `CompareViewerSwitchingPane`
Sets the input object of this pane. For this input object a suitable viewer is determined by calling the abstract method `getViewer(Viewer, Object)`. If the returned viewer differs from the current one, the old viewer is disposed and the new one installed. Then the input object is fed into the newly installed viewer by calling its `setInput(Object)` method. If new and old viewer don't differ no new viewer is installed but just `setInput(Object)` is called. If the input is `null` the pane is cleared, that is the current viewer is disposed.

Overrides:
  `setInput` in class `CompareViewerSwitchingPane`
Parameters:
  `input` - the new input object or `null`

### setText

public void setText(String text)
Description copied from class: `CompareViewerPane`
Set the pane's title text. The value `null` clears it.

Overrides:
  `setText` in class `CompareViewerPane`
Parameters:
  `text` - the text to be displayed in the pane or null

### setImage

public void setImage(Image image)
Description copied from class: `CompareViewerPane`
Set the pane's title Image. The value `null` clears it.

Overrides:
  `setImage` in class `CompareViewerPane`
Parameters:
  `image` - the image to be displayed in the pane or null

### addMouseListener

public void addMouseListener(MouseListener listener)
Description copied from class: `Control`
Adds the listener to the collection of listeners who will be notified when mouse buttons are pressed and released, by sending it one of the messages defined in the `MouseListener` interface.

Overrides:
  `addMouseListener` in class `Control`
Parameters:
  `listener` - the listener which should be notified
See Also:
  - `MouseListener`
  - `Control.removeMouseListener(org.eclipse.swt.events.MouseListener)`