public class CompareViewerPane extends ViewForm implements ISelectionProvider, IDoubleClickListener, ISelectionChangedListener, IOpenListener, IAdaptable
CompareViewerPane
is a convenience class which installs a
CLabel
and a Toolbar
in a ViewForm
.
Double clicking onto the CompareViewerPane
's title bar maximizes
the CompareViewerPane
to the size of an enclosing Splitter
(if there is one).
If more Splitters
are nested maximizing walks up and
maximizes to the outermost Splitter
.
borderInsideRGB, borderMiddleRGB, borderOutsideRGB, horizontalSpacing, marginHeight, marginWidth, verticalSpacing
Constructor and Description |
---|
CompareViewerPane(Composite container,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
Modifier and Type | Method and Description |
---|---|
void |
addDoubleClickListener(IDoubleClickListener listener)
Add a double-click listener to the pane.
|
void |
addOpenListener(IOpenListener listener)
Add an open listener to the pane.
|
void |
addSelectionChangedListener(ISelectionChangedListener l)
Adds a listener for selection changes in this selection provider.
|
static void |
clearToolBar(Composite parent)
Clears tool items in the
CompareViewerPane 's control bar. |
protected Control |
createTopLeft(Composite parent) |
void |
doubleClick(DoubleClickEvent event)
Notifies of a double click.
|
<T> T |
getAdapter(Class<T> adapter)
Returns an object which is an instance of the given class
associated with this object.
|
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.
|
static ToolBarManager |
getToolBarManager(Composite parent)
Returns a
ToolBarManager if the given parent is a
CompareViewerPane or null otherwise. |
void |
open(OpenEvent event)
Notifies of an open event.
|
void |
removeDoubleClickListener(IDoubleClickListener listener)
Remove a double-click listener.
|
void |
removeOpenListener(IOpenListener listener)
Remove an open listener.
|
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 |
setImage(Image image)
Set the pane's title Image.
|
void |
setInput(Object input)
Sets the input object of this pane.
|
void |
setSelection(ISelection s)
Sets the current selection for this selection provider.
|
void |
setText(String label)
Set the pane's title text.
|
computeTrim, getClientArea, getContent, getTopCenter, getTopLeft, getTopRight, setBorderVisible, setContent, setLayout, setTopCenter, setTopCenterSeparate, setTopLeft, setTopRight
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayoutDeferred, setTabList
getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, 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, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isAutoScalable
public CompareViewerPane(Composite container, int style)
container
- a widget which will be the container of the new instance (cannot be null)style
- the style of widget to constructIllegalArgumentException
- SWTException
- protected Control createTopLeft(Composite parent)
parent
- a widget which will be the parent of the control (cannot be
null)public void setText(String label)
null
clears it.label
- the text to be displayed in the pane or nullpublic void setImage(Image image)
null
clears it.image
- the image to be displayed in the pane or nullpublic static ToolBarManager getToolBarManager(Composite parent)
ToolBarManager
if the given parent is a
CompareViewerPane
or null
otherwise.parent
- a Composite
or null
ToolBarManager
if the given parent is a CompareViewerPane
otherwise null
public static void clearToolBar(Composite parent)
CompareViewerPane
's control bar.parent
- a Composite
or null
public Object getInput()
Object
that is the input to this pane or null if the pane has no input.public void setInput(Object input)
input
- the new input object or null
public void addSelectionChangedListener(ISelectionChangedListener l)
ISelectionProvider
addSelectionChangedListener
in interface ISelectionProvider
l
- a selection changed listenerpublic void removeSelectionChangedListener(ISelectionChangedListener l)
ISelectionProvider
removeSelectionChangedListener
in interface ISelectionProvider
l
- a selection changed listenerpublic ISelection getSelection()
ISelectionProvider
getSelection
in interface ISelectionProvider
public void setSelection(ISelection s)
ISelectionProvider
setSelection
in interface ISelectionProvider
s
- the new selectionpublic void selectionChanged(SelectionChangedEvent ev)
ISelectionChangedListener
selectionChanged
in interface ISelectionChangedListener
ev
- event object describing the changepublic void doubleClick(DoubleClickEvent event)
IDoubleClickListener
doubleClick
in interface IDoubleClickListener
event
- event object describing the double-clickpublic void addDoubleClickListener(IDoubleClickListener listener)
listener
- the listenerpublic void removeDoubleClickListener(IDoubleClickListener listener)
listener
- the listenerpublic void addOpenListener(IOpenListener listener)
listener
- the listenerpublic void removeOpenListener(IOpenListener listener)
listener
- the listenerpublic void open(OpenEvent event)
IOpenListener
open
in interface IOpenListener
event
- event object describing the open eventpublic <T> T getAdapter(Class<T> adapter)
IAdaptable
null
if
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.
getAdapter
in interface IAdaptable
adapter
- the adapter class to look upnull
if this object does not
have an adapter for the given class
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.