public class ScrolledCompositeSyncListener extends Object implements SelectionListener
ScrolledComposite
components in horizontal or vertical direction.
Both the ScrolledComposite
s as well as their content areas need to have the same lengths in the selected
direction.Constructor and Description |
---|
ScrolledCompositeSyncListener(Collection<ScrolledComposite> scrolledComposites,
boolean horizontal)
Creates a new instance of this class and registers it as selection listeners at the according scroll bars
of
scrolledComposites . |
ScrolledCompositeSyncListener(ScrolledComposite[] scrolledComposites,
boolean horizontal)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isHorizontal() |
boolean |
isVertical() |
void |
registerToAll()
Registers this object as the selection listener at all according scroll bars of the specified
ScrolledComposite s. |
void |
widgetDefaultSelected(SelectionEvent e) |
void |
widgetSelected(SelectionEvent e) |
public ScrolledCompositeSyncListener(Collection<ScrolledComposite> scrolledComposites, boolean horizontal)
scrolledComposites
.
Note that all ScrolledComposite
s need to have a scroll bar in the according direction. Otherwise
a NullPointerException
will occur.
scrolledComposites
- the scroll components to be synchronizedhorizontal
- Specify true
here of you want to synchronize horizontal scrolling or false
for vertical scrolling.public ScrolledCompositeSyncListener(ScrolledComposite[] scrolledComposites, boolean horizontal)
Note that all ScrolledComposite
s need to have a scroll bar in the according direction. Otherwise
a NullPointerException
will occur.
scrolledComposites
- the scroll components to be synchronizedhorizontal
- Specify true
here of you want to synchronize horizontal scrolling or false
for vertical scrolling.public boolean isHorizontal()
public boolean isVertical()
public void registerToAll()
ScrolledComposite
s.public void widgetDefaultSelected(SelectionEvent e)
widgetDefaultSelected
in interface SelectionListener
public void widgetSelected(SelectionEvent e)
widgetSelected
in interface SelectionListener