Class MouseEvents.ClickEvent

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static com.vaadin.shared.MouseEventDetails.MouseButton BUTTON_LEFT
      Deprecated.
      As of 7.0, use MouseEventDetails.MouseButton.LEFT instead.
      static com.vaadin.shared.MouseEventDetails.MouseButton BUTTON_MIDDLE
      Deprecated.
      As of 7.0, use MouseEventDetails.MouseButton.MIDDLE instead.
      static com.vaadin.shared.MouseEventDetails.MouseButton BUTTON_RIGHT
      Deprecated.
      As of 7.0, use MouseEventDetails.MouseButton.RIGHT instead.
      • Fields inherited from class java.util.EventObject

        source
    • Constructor Summary

      Constructors 
      Constructor Description
      ClickEvent​(Component source, com.vaadin.shared.MouseEventDetails mouseEventDetails)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.vaadin.shared.MouseEventDetails.MouseButton getButton()
      Returns an identifier describing which mouse button the user pushed.
      java.lang.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.
      com.vaadin.shared.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.
      • Methods inherited from class java.util.EventObject

        getSource, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • BUTTON_LEFT

        @Deprecated
        public static final com.vaadin.shared.MouseEventDetails.MouseButton BUTTON_LEFT
        Deprecated.
        As of 7.0, use MouseEventDetails.MouseButton.LEFT instead.
      • BUTTON_MIDDLE

        @Deprecated
        public static final com.vaadin.shared.MouseEventDetails.MouseButton BUTTON_MIDDLE
        Deprecated.
        As of 7.0, use MouseEventDetails.MouseButton.MIDDLE instead.
      • BUTTON_RIGHT

        @Deprecated
        public static final com.vaadin.shared.MouseEventDetails.MouseButton BUTTON_RIGHT
        Deprecated.
        As of 7.0, use MouseEventDetails.MouseButton.RIGHT instead.
    • Constructor Detail

      • ClickEvent

        public ClickEvent​(Component source,
                          com.vaadin.shared.MouseEventDetails mouseEventDetails)
    • Method Detail

      • getButton

        public com.vaadin.shared.MouseEventDetails.MouseButton getButton()
        Returns an identifier describing which mouse button the user pushed. Compare with MouseEventDetails.MouseButton.LEFT,MouseEventDetails.MouseButton.MIDDLE, MouseEventDetails.MouseButton.RIGHT to find out which button it is.
        Returns:
        one of MouseEventDetails.MouseButton.LEFT, MouseEventDetails.MouseButton.MIDDLE, MouseEventDetails.MouseButton.RIGHT.
      • 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
      • 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
      • 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
      • isDoubleClick

        public boolean isDoubleClick()
        Checks if the event is a double click event.
        Returns:
        true if the event is a double click event, false otherwise
      • 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 occurred, false otherwise
      • 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 occurred, false otherwise
      • 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 occurred, false otherwise
      • 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 occurred, false otherwise
      • getButtonName

        public java.lang.String getButtonName()
        Returns a human readable string representing which button has been pushed. This is meant for debug purposes only and the string returned could change. Use getButton() to check which button was pressed.
        Returns:
        A string representation of which button was pushed.
        Since:
        6.3
      • getMouseEventDetails

        public com.vaadin.shared.MouseEventDetails getMouseEventDetails()
        Returns an information about mouse event like position, buttons pressed etc.
        Returns:
        An information about mouse event
        Since:
        8.1