public class DefaultScrollingProvider extends java.lang.Object implements IScrollingProvider
IScrollingProvider
interface.
This class registers a selection listener on the scrollable control for
monitoring scrolling events.IScrollingProvider
HORIZONTAL_SCROLLING, VERTICAL_SCROLLING
Constructor and Description |
---|
DefaultScrollingProvider(org.eclipse.swt.widgets.Scrollable control,
IContentViewerPane pane)
Constructs a new DefaultScrollingProvider
|
Modifier and Type | Method and Description |
---|---|
void |
addScrollingEventListener(IScrollingListener listener)
Adds a listener for scrolling changes.
|
protected org.eclipse.core.runtime.ListenerList |
getScrollingListeners()
Returns the scrolling listeners
|
int |
getSelection(int scrollingType)
Gets the single selection that is the receiver's value for the specified
scrolling type.
|
protected void |
notifyListeners(int scrollingType,
org.eclipse.swt.events.SelectionEvent event)
Notifies the scrolling listeners
|
void |
removeScrollingEventListener(IScrollingListener listener)
Removes a listener for scrolling changes.
|
void |
setSelection(int scrollingType,
int selection)
Sets the single selection that is the receiver's value to the specified
selection which must be greater than or equal to zero for the specified
scrolling type.
|
public DefaultScrollingProvider(org.eclipse.swt.widgets.Scrollable control, IContentViewerPane pane)
control
- the scrollable controlpane
- the content viewer panepublic final void addScrollingEventListener(IScrollingListener listener)
IScrollingProvider
addScrollingEventListener
in interface IScrollingProvider
listener
- a scrolling listenerIScrollingProvider.addScrollingEventListener(com.ibm.xtools.comparemerge.ui.listeners.IScrollingListener)
public int getSelection(int scrollingType)
IScrollingProvider
getSelection
in interface IScrollingProvider
scrollingType
- the type of scrolling, e.g. HORIZONTAL_SCROLLING
IScrollingProvider.getSelection(int)
public final void removeScrollingEventListener(IScrollingListener listener)
IScrollingProvider
removeScrollingEventListener
in interface IScrollingProvider
listener
- a scrolling listenerIScrollingProvider.removeScrollingEventListener(com.ibm.xtools.comparemerge.ui.listeners.IScrollingListener)
public void setSelection(int scrollingType, int selection)
IScrollingProvider
setSelection
in interface IScrollingProvider
scrollingType
- the type of scrolling , e.g. HORIZONTAL_SCROLLING
selection
- the new selection (must be zero or greater)IScrollingProvider.setSelection(int,
int)
protected void notifyListeners(int scrollingType, org.eclipse.swt.events.SelectionEvent event)
scrollingType
- the scrolling typeevent
- the eventprotected final org.eclipse.core.runtime.ListenerList getScrollingListeners()