public class ScrolledCompositeSyncListener extends Object
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 which uses a deep copy of
scrolledComposites . |
ScrolledCompositeSyncListener(ScrolledComposite[] scrolledComposites,
boolean horizontal)
Creates a new instance of this class which uses a deep copy of
scrolledComposites . |
Modifier and Type | Method and Description |
---|---|
boolean |
isHorizontal() |
boolean |
isVertical() |
static ScrolledCompositeSyncListener |
newLinkedInstance(Iterable<ScrolledComposite> scrolledComposites,
boolean horizontal)
Creates a new instance of this class that uses the specified collection as the source.
|
void |
registerToAll()
Registers this object as the selection listener at all according scroll bars of the specified
ScrolledComposite s. |
public ScrolledCompositeSyncListener(Collection<ScrolledComposite> scrolledComposites, boolean horizontal)
scrolledComposites
. That means future changes
to scrolledComposites
will not be reflected by this instance. If you need this functionality use
newLinkedInstance(Iterable, boolean)
instead.
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)
scrolledComposites
. That means future changes
to scrolledComposites
will not be reflected by this instance. If you need this functionality use
newLinkedInstance(Iterable, boolean)
instead.
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 static ScrolledCompositeSyncListener newLinkedInstance(Iterable<ScrolledComposite> scrolledComposites, boolean horizontal)
ScrolledCompositeSyncListener(Collection, boolean)
instead.scrolledComposites
- horizontal
- public boolean isHorizontal()
public boolean isVertical()
public void registerToAll()
ScrolledComposite
s.
This method should only be called once to avoid that this instance is registered several times as a listener for some components.