com.vaadin.ui
Class Button.ClickEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.vaadin.ui.Component.Event
          extended by com.vaadin.ui.Button.ClickEvent
All Implemented Interfaces:
Serializable
Enclosing class:
Button

public class Button.ClickEvent
extends Component.Event

Click event. This event is thrown, when the button is clicked.

Since:
3.0
Version:
7.0.0.alpha3
Author:
Vaadin Ltd.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
Button.ClickEvent(Component source)
          New instance of text change event.
Button.ClickEvent(Component source, MouseEventDetails details)
          Constructor with mouse details
 
Method Summary
 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 java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Button.ClickEvent

public Button.ClickEvent(Component source)
New instance of text change event.

Parameters:
source - the Source of the event.

Button.ClickEvent

public Button.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


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.