Package com.vaadin.ui

Class 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
    • 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 place
        details - 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