|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.maryanovsky.gwtutils.client.ui.mouse.gestures.MouseGestureRecognizer
com.maryanovsky.gwtutils.client.ui.mouse.gestures.click.ClickRecognizer
public class ClickRecognizer
Recognizes and fires click events.
Field Summary |
---|
Fields inherited from class com.maryanovsky.gwtutils.client.ui.mouse.gestures.MouseGestureRecognizer |
---|
handlerManager |
Constructor Summary | |
---|---|
ClickRecognizer(Object clickEventsSource)
Creates a new ClickRecognizer which will fire click events with
the specified source object. |
|
ClickRecognizer(Object clickEventsSource,
Condition<? super ClickEvent> clickCondition)
Creates a new ClickRecognizer which will fire click events with
the specified source object and consult the specified click condition
before doing so. |
|
ClickRecognizer(Object clickEventsSource,
H mouseEventsSource)
Creates a new ClickRecognizer which will fire click events with
the specified source object and use the specified source of mouse events. |
|
ClickRecognizer(Object clickEventsSource,
H mouseEventsSource,
Condition<? super ClickEvent> clickCondition)
Creates a new ClickRecognizer which will fire events with the
specified source object, use the specified source of mouse events and
consult the specified click condition before firing click events. |
Method Summary | |
---|---|
HandlerRegistration |
addClickHandler(ClickHandler handler)
Adds a click handler. |
protected boolean |
clickCondition(ClickEvent evt)
Returns whether the specified ClickEvent should be delivered to
the handlers. |
protected void |
onMouseDown(MouseDownEvent event)
Invoked when a mouse button is pressed. |
protected void |
onMouseUp(MouseUpEvent event)
Invoked when a mouse button is released. |
Methods inherited from class com.maryanovsky.gwtutils.client.ui.mouse.gestures.MouseGestureRecognizer |
---|
fireEvent, onMouseMove, onMouseOut, onMouseOver, onMouseWheel, setMouseEventsSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClickRecognizer(Object clickEventsSource)
ClickRecognizer
which will fire click events with
the specified source object.
public ClickRecognizer(Object clickEventsSource, H mouseEventsSource)
ClickRecognizer
which will fire click events with
the specified source object and use the specified source of mouse events.
public ClickRecognizer(Object clickEventsSource, Condition<? super ClickEvent> clickCondition)
ClickRecognizer
which will fire click events with
the specified source object and consult the specified click condition
before doing so.
public ClickRecognizer(Object clickEventsSource, H mouseEventsSource, Condition<? super ClickEvent> clickCondition)
ClickRecognizer
which will fire events with the
specified source object, use the specified source of mouse events and
consult the specified click condition before firing click events. See the
documentation of clickCondition(ClickEvent)
for more information
on the click condition.
Method Detail |
---|
public HandlerRegistration addClickHandler(ClickHandler handler)
addClickHandler
in interface HasClickHandlers
protected boolean clickCondition(ClickEvent evt)
ClickEvent
should be delivered to
the handlers. This allows filtering click gestures to only those you
really want. For example, if you only want to recognize right-clicks, you
would override this method and return
evt.getButton() == NativeEvent.BUTTON_RIGHT
.
The default implementation delegates the decision to the click condition
passed in the constructor.
protected void onMouseDown(MouseDownEvent event)
onMouseDown
in class MouseGestureRecognizer
protected void onMouseUp(MouseUpEvent event)
onMouseUp
in class MouseGestureRecognizer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |