public static class MouseEvents.ClickEvent extends Component.Event
MouseEvents.ClickEvent
is fired when the user clicks on a
Component
.
The information available for click events are terminal dependent.
Correct values for all event details cannot be guaranteed.MouseEvents.ClickListener
,
Serialized FormModifier and Type | Field and Description |
---|---|
static MouseEventDetails.MouseButton |
BUTTON_LEFT
Deprecated.
As of 7.0, use
MouseEventDetails.MouseButton.LEFT instead. |
static MouseEventDetails.MouseButton |
BUTTON_MIDDLE
Deprecated.
As of 7.0, use
MouseEventDetails.MouseButton.MIDDLE instead. |
static MouseEventDetails.MouseButton |
BUTTON_RIGHT
Deprecated.
As of 7.0, use
MouseEventDetails.MouseButton.RIGHT instead. |
source
Constructor and Description |
---|
ClickEvent(Component source,
MouseEventDetails mouseEventDetails) |
Modifier and Type | Method and Description |
---|---|
MouseEventDetails.MouseButton |
getButton()
Returns an identifier describing which mouse button the user pushed.
|
String |
getButtonName()
Returns a human readable string representing which button has been
pushed.
|
int |
getClientX()
Returns the mouse position (x coordinate) when the click took place.
|
int |
getClientY()
Returns the mouse position (y coordinate) when the click took place.
|
MouseEventDetails |
getMouseEventDetails()
Returns an information about mouse event like position, buttons
pressed etc.
|
int |
getRelativeX()
Returns the relative mouse position (x coordinate) when the click
took place.
|
int |
getRelativeY()
Returns the relative mouse position (y coordinate) when the click
took place.
|
boolean |
isAltKey()
Checks if the Alt key was down when the mouse event took place.
|
boolean |
isCtrlKey()
Checks if the Ctrl key was down when the mouse event took place.
|
boolean |
isDoubleClick()
Checks if the event is a double click event.
|
boolean |
isMetaKey()
Checks if the Meta key was down when the mouse event took place.
|
boolean |
isShiftKey()
Checks if the Shift key was down when the mouse event took place.
|
getComponent
getConnector
getSource, toString
@Deprecated public static final MouseEventDetails.MouseButton BUTTON_LEFT
MouseEventDetails.MouseButton.LEFT
instead.@Deprecated public static final MouseEventDetails.MouseButton BUTTON_MIDDLE
MouseEventDetails.MouseButton.MIDDLE
instead.@Deprecated public static final MouseEventDetails.MouseButton BUTTON_RIGHT
MouseEventDetails.MouseButton.RIGHT
instead.public ClickEvent(Component source, MouseEventDetails mouseEventDetails)
public MouseEventDetails.MouseButton getButton()
MouseEventDetails.MouseButton.LEFT
,MouseEventDetails.MouseButton.MIDDLE
,
MouseEventDetails.MouseButton.RIGHT
to find out which button it is.public int getClientX()
public int getClientY()
public int getRelativeX()
public int getRelativeY()
public boolean isDoubleClick()
public boolean isAltKey()
public boolean isCtrlKey()
public boolean isMetaKey()
public boolean isShiftKey()
public String getButtonName()
getButton()
to check which button was
pressed.public MouseEventDetails getMouseEventDetails()
Copyright © 2022 Vaadin Ltd. All rights reserved.