Package org.eclipse.compare
Class CompareViewerSwitchingPane
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
- All Implemented Interfaces:
- IAdaptable,- IDoubleClickListener,- IOpenListener,- ISelectionChangedListener,- ISelectionProvider,- Drawable
- Direct Known Subclasses:
- CompareContentViewerSwitchingPane,- CompareStructureViewerSwitchingPane
A custom 
CompareViewerPane that supports dynamic viewer switching.
 
 Clients must implement the viewer switching strategy by implementing
 the getViewer(Viewer, Object) method.
 
 If a property with the name CompareUI.COMPARE_VIEWER_TITLE is set
 on the top level SWT control of a viewer, it is used as a title in the CompareViewerPane's
 title bar.
- Since:
- 2.0
- 
Field SummaryFields inherited from class org.eclipse.swt.custom.ViewFormborderInsideRGB, borderMiddleRGB, borderOutsideRGB, horizontalSpacing, marginHeight, marginWidth, verticalSpacingFields inherited from class org.eclipse.swt.widgets.WidgetnativeZoom
- 
Constructor SummaryConstructorsConstructorDescriptionCompareViewerSwitchingPane(Composite parent, int style) Creates aCompareViewerSwitchingPaneas a child of the given parent and with the specified SWT style bits.CompareViewerSwitchingPane(Composite parent, int style, boolean visibility) Creates aCompareViewerSwitchingPaneas a child of the given parent and with the specified SWT style bits.
- 
Method SummaryModifier and TypeMethodDescription<T> TgetAdapter(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.Returns the current selection for this provider.Returns the optional title argument that has been set withsetTitelArgumentornullif no optional title argument has been set.Returns the current viewer.protected abstract ViewerReturns a viewer which is able to display the given input.protected booleaninputChanged(Object input) booleanisEmpty()Returnstrueif no viewer is installed or if the current viewer is aNullViewer.booleansetFocus()Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it.voidSets the input object of this pane.voidSets the current selection for this selection provider.voidsetTitleArgument(String argument) Sets an additional and optional argument for the pane's title.Methods inherited from class org.eclipse.compare.CompareViewerPaneaddDoubleClickListener, addOpenListener, addSelectionChangedListener, clearToolBar, createTopLeft, doubleClick, getInput, getToolBarManager, open, removeDoubleClickListener, removeOpenListener, removeSelectionChangedListener, selectionChanged, setImage, setTextMethods inherited from class org.eclipse.swt.custom.ViewFormcomputeTrim, getClientArea, getContent, getTopCenter, getTopLeft, getTopRight, setBorderVisible, setContent, setLayout, setTopCenter, setTopCenterSeparate, setTopLeft, setTopRightMethods inherited from class org.eclipse.swt.widgets.Compositechanged, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setLayoutDeferred, setTabList, toStringMethods inherited from class org.eclipse.swt.widgets.ScrollablegetHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsModeMethods inherited from class org.eclipse.swt.widgets.ControladdControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, 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, updateMethods inherited from class org.eclipse.swt.widgets.WidgetaddDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setDataMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.swt.graphics.DrawableisAutoScalable
- 
Constructor Details- 
CompareViewerSwitchingPaneCreates aCompareViewerSwitchingPaneas a child of the given parent and with the specified SWT style bits.- Parameters:
- parent- a widget which will be the parent of the new instance (cannot be null)
- style- the style of widget to construct
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
 
- SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
 
 
- 
CompareViewerSwitchingPaneCreates aCompareViewerSwitchingPaneas a child of the given parent and with the specified SWT style bits.- Parameters:
- parent- a widget which will be the parent of the new instance (cannot be null)
- style- the style of widget to construct
- visibility- the initial visibility of the CompareViewerSwitchingPane
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
 
- SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
 
 
 
- 
- 
Method Details- 
getViewerReturns the current viewer.- Returns:
- the current viewer
 
- 
getTitleArgumentReturns the optional title argument that has been set withsetTitelArgumentornullif no optional title argument has been set.- Returns:
- the optional title argument or null
- Restriction:
- This method is for internal use only. Clients should not call this method.
- Restriction:
- This method is not intended to be re-implemented or extended by clients.
 
- 
isEmptypublic boolean isEmpty()Returnstrueif no viewer is installed or if the current viewer is aNullViewer.- Returns:
- trueif no viewer is installed or if the current viewer is a- NullViewer
 
- 
getSelectionDescription copied from interface:ISelectionProviderReturns the current selection for this provider.- Specified by:
- getSelectionin interface- ISelectionProvider
- Overrides:
- getSelectionin class- CompareViewerPane
- Returns:
- the current selection
 
- 
setSelectionDescription copied from interface:ISelectionProviderSets the current selection for this selection provider.- Specified by:
- setSelectionin interface- ISelectionProvider
- Overrides:
- setSelectionin class- CompareViewerPane
- Parameters:
- s- the new selection
 
- 
inputChanged- Parameters:
- input- the input
- Returns:
- true, if the input is considered as changed
- Restriction:
- This method is not intended to be referenced by clients.
- Restriction:
- This method is not intended to be re-implemented or extended by clients.
 
- 
setInputSets the input object of this pane. For this input object a suitable viewer is determined by calling the abstract methodgetViewer(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 itssetInput(Object)method. If new and old viewer don't differ no new viewer is installed but justsetInput(Object)is called. If the input isnullthe pane is cleared, that is the current viewer is disposed.- Overrides:
- setInputin class- CompareViewerPane
- Parameters:
- input- the new input object or- null
 
- 
setTitleArgumentSets an additional and optional argument for the pane's title.- Parameters:
- argument- an optional argument for the pane's title
- Restriction:
- This method is for internal use only. Clients should not call this method.
- Restriction:
- This method is not intended to be re-implemented or extended by clients.
 
- 
getAdapterDescription copied from interface:IAdaptableReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.Clients may implement this method but should generally call Adapters.adapt(Object, Class, boolean)rather than invoking it directly.- Specified by:
- getAdapterin interface- IAdaptable
- Overrides:
- getAdapterin class- CompareViewerPane
- Type Parameters:
- T- the class type
- Parameters:
- adapter- the adapter class to look up
- Returns:
- a object of the given class, or nullif this object does not have an adapter for the given class
 
- 
setFocuspublic boolean setFocus()Description copied from class:ControlCauses the receiver to have the keyboard focus, such that all keyboard events will be delivered to it. Focus reassignment will respect applicable platform constraints.
- 
getViewerReturns a viewer which is able to display the given input. If no viewer can be found,nullis returned. The additional argument oldViewer represents the viewer currently installed in the pane (ornullif 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).- 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 nullif no viewer can be determined
 
 
-