public abstract class CompareViewerSwitchingPane extends CompareViewerPane implements ISelectionChangedListener, ISelectionProvider, IDoubleClickListener
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.
borderInsideRGB, borderMiddleRGB, borderOutsideRGB, horizontalSpacing, marginHeight, marginWidth, verticalSpacing| Constructor and Description |
|---|
CompareViewerSwitchingPane(Composite parent,
int style)
Creates a
CompareViewerSwitchingPane as a child of the given parent and with the
specified SWT style bits. |
CompareViewerSwitchingPane(Composite parent,
int style,
boolean visibility)
Creates a
CompareViewerSwitchingPane as a child of the given parent and with the
specified SWT style bits. |
| Modifier and Type | Method and Description |
|---|---|
void |
addDoubleClickListener(IDoubleClickListener l) |
void |
addOpenListener(IOpenListener l) |
void |
addSelectionChangedListener(ISelectionChangedListener l)
Adds a listener for selection changes in this selection provider.
|
void |
doubleClick(DoubleClickEvent event)
Notifies of a double click.
|
Object |
getInput()
Returns the current input of this pane or null if the pane has no input.
|
ISelection |
getSelection()
Returns the current selection for this provider.
|
String |
getTitleArgument()
Returns the optional title argument that has been set with
setTitelArgument
or null if no optional title argument has been set. |
Viewer |
getViewer()
Returns the current viewer.
|
protected abstract Viewer |
getViewer(Viewer oldViewer,
Object input)
Returns a viewer which is able to display the given input.
|
boolean |
isEmpty()
Returns
true if no viewer is installed or if the current viewer
is a NullViewer. |
void |
removeDoubleClickListener(IDoubleClickListener l) |
void |
removeOpenListener(IOpenListener l) |
void |
removeSelectionChangedListener(ISelectionChangedListener l)
Removes the given selection change listener from this selection provider.
|
void |
selectionChanged(SelectionChangedEvent ev)
Notifies that the selection has changed.
|
void |
setInput(Object input)
Sets the input object of this pane.
|
void |
setSelection(ISelection s)
Sets the current selection for this selection provider.
|
void |
setTitleArgument(String argument)
Sets an additional and optional argument for the pane's title.
|
clearToolBar, getToolBarManager, setImage, setTextcomputeTrim, getClientArea, getContent, getTopCenter, getTopLeft, getTopRight, setBorderVisible, setContent, setLayout, setTopCenter, setTopCenterSeparate, setTopLeft, setTopRightchanged, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayoutDeferred, setTabListgetHorizontalBar, getVerticalBaraddControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, updateaddDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toStringpublic CompareViewerSwitchingPane(Composite parent, int style)
CompareViewerSwitchingPane as a child of the given parent and with the
specified SWT style bits.parent - a widget which will be the parent of the new instance (cannot be null)style - the style of widget to constructIllegalArgumentException - SWTException - public CompareViewerSwitchingPane(Composite parent, int style, boolean visibility)
CompareViewerSwitchingPane as a child of the given parent and with the
specified SWT style bits.parent - a widget which will be the parent of the new instance (cannot be null)style - the style of widget to constructvisibility - the initial visibility of the CompareViewerSwitchingPaneIllegalArgumentException - SWTException - public Viewer getViewer()
public String getTitleArgument()
setTitelArgument
or null if no optional title argument has been set.
Note: this method is for internal use only. Clients should not call this method.
nullpublic boolean isEmpty()
true if no viewer is installed or if the current viewer
is a NullViewer.true if no viewer is installed or if the current viewer is a NullViewerpublic void addSelectionChangedListener(ISelectionChangedListener l)
ISelectionProvideraddSelectionChangedListener in interface ISelectionProviderl - a selection changed listenerpublic void removeSelectionChangedListener(ISelectionChangedListener l)
ISelectionProviderremoveSelectionChangedListener in interface ISelectionProviderl - a selection changed listenerpublic void addDoubleClickListener(IDoubleClickListener l)
public void removeDoubleClickListener(IDoubleClickListener l)
public void addOpenListener(IOpenListener l)
public void removeOpenListener(IOpenListener l)
public void doubleClick(DoubleClickEvent event)
IDoubleClickListenerdoubleClick in interface IDoubleClickListenerevent - event object describing the double-clickpublic ISelection getSelection()
ISelectionProvidergetSelection in interface ISelectionProviderpublic void setSelection(ISelection s)
ISelectionProvidersetSelection in interface ISelectionProviders - the new selectionpublic void selectionChanged(SelectionChangedEvent ev)
ISelectionChangedListenerselectionChanged in interface ISelectionChangedListenerev - event object describing the changepublic void setInput(Object input)
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.input - the new input object or nullpublic void setTitleArgument(String argument)
argument - an optional argument for the pane's titlepublic Object getInput()
Object that is the input to this pane or null if the pane has no input.protected abstract Viewer getViewer(Viewer oldViewer, Object input)
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).oldViewer - the currently installed viewer or nullinput - the input object for which a viewer must be determined or nullnull if no viewer can be determinedGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.