Package com.vaadin.ui
Class Button.ClickEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.event.ConnectorEvent
-
- com.vaadin.ui.Component.Event
-
- com.vaadin.ui.Button.ClickEvent
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Button
public static class Button.ClickEvent extends Component.Event
Click event. This event is thrown, when the button is clicked.- Since:
- 3.0
- Author:
- Vaadin Ltd.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description ClickEvent(Component source)
New instance of text change event.ClickEvent(Component source, MouseEventDetails details)
Constructor with mouse details
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Button
getButton()
Gets the Button where the event occurred.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.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
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.-
Methods inherited from class com.vaadin.ui.Component.Event
getComponent
-
Methods inherited from class com.vaadin.event.ConnectorEvent
getConnector
-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Constructor Detail
-
ClickEvent
public ClickEvent(Component source)
New instance of text change event.- Parameters:
source
- the Source of the event.
-
ClickEvent
public ClickEvent(Component source, MouseEventDetails details)
Constructor with mouse details- Parameters:
source
- The source where the click took placedetails
- Details about the mouse click
-
-
Method Detail
-
getButton
public Button getButton()
Gets the Button where the event occurred.- Returns:
- the Source of the event.
-
getClientX
public int getClientX()
Returns the mouse position (x coordinate) when the click took place. The position is relative to the browser client area.- Returns:
- The mouse cursor x position or -1 if unknown
-
getClientY
public int getClientY()
Returns the mouse position (y coordinate) when the click took place. The position is relative to the browser client area.- Returns:
- The mouse cursor y position or -1 if unknown
-
getRelativeX
public int getRelativeX()
Returns the relative mouse position (x coordinate) when the click took place. The position is relative to the clicked component.- Returns:
- The mouse cursor x position relative to the clicked layout component or -1 if no x coordinate available
-
getRelativeY
public int getRelativeY()
Returns the relative mouse position (y coordinate) when the click took place. The position is relative to the clicked component.- Returns:
- The mouse cursor y position relative to the clicked layout component or -1 if no y coordinate available
-
isAltKey
public boolean isAltKey()
Checks if the Alt key was down when the mouse event took place.- Returns:
- true if Alt was down when the event occured, false otherwise or if unknown
-
isCtrlKey
public boolean isCtrlKey()
Checks if the Ctrl key was down when the mouse event took place.- Returns:
- true if Ctrl was pressed when the event occured, false otherwise or if unknown
-
isMetaKey
public boolean isMetaKey()
Checks if the Meta key was down when the mouse event took place.- Returns:
- true if Meta was pressed when the event occured, false otherwise or if unknown
-
isShiftKey
public boolean isShiftKey()
Checks if the Shift key was down when the mouse event took place.- Returns:
- true if Shift was pressed when the event occured, false otherwise or if unknown
-
-