Package com.explodingpixels.macwidgets
Interface SourceListClickListener
public interface SourceListClickListener
An interface to hook into clicks on
SourceListCategory
s and
SourceListItem
s. This interface is similar to what
SourceListSelectionListener
offers, but provides mouse clicks
including which mouse button was pressed the number of clicks that occured.
It is, for example, possible to handle left mouse button double clicks on an
item, which can be done with an implementation like this:
SourceListClickListener clickListener = new SourceListClickListener() { public void sourceListItemClicked(SourceListItem item, Button button, int clickCount) { boolean isLeftButton = button == SourceListClickListener.Button.LEFT; if (isLeftButton invalid input: '&'invalid input: '&' clickCount == 2) { // do something here. } } public void sourceListCategoryClicked(SourceListCategory category, Button button, int clickCount) { // no implementation. } };
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Corresponds to a button on a mouse. -
Method Summary
Modifier and TypeMethodDescriptionvoid
sourceListCategoryClicked
(SourceListCategory category, SourceListClickListener.Button button, int clickCount) Called when aSourceListCategory
is clicked.void
sourceListItemClicked
(SourceListItem item, SourceListClickListener.Button button, int clickCount) Called when aSourceListItem
is clicked.
-
Method Details
-
sourceListItemClicked
void sourceListItemClicked(SourceListItem item, SourceListClickListener.Button button, int clickCount) Called when aSourceListItem
is clicked.- Parameters:
item
- theSourceListItem
that was clicked. Will not be null.button
- the mouse button that was used to perform the click.clickCount
- the number of times the mouse button was clicked.
-
sourceListCategoryClicked
void sourceListCategoryClicked(SourceListCategory category, SourceListClickListener.Button button, int clickCount) Called when aSourceListCategory
is clicked.- Parameters:
category
- theSourceListCategory
that was clicked. Will not be null.button
- the mouse button that was used to perform the click.clickCount
- the number of times the mouse button was clicked.
-