Example usage for com.vaadin.shared MouseEventDetails getButtonName

List of usage examples for com.vaadin.shared MouseEventDetails getButtonName

Introduction

In this page you can find the example usage for com.vaadin.shared MouseEventDetails getButtonName.

Prototype

public String getButtonName() 

Source Link

Usage

From source file:com.peter.vaadin.components.others.mycomponent.client.MyComponentConnector.java

License:Apache License

public MyComponentConnector() {
    registerRpc(MyComponentClientRpc.class, new MyComponentClientRpc() {
        private static final long serialVersionUID = -1056192951789062628L;

        public void alert(String message) {
            // TODO Do something useful
            Window.alert(message);
        }//  www .j  ava  2 s .  c  o  m
    });

    // TODO ServerRpc usage example, do something useful instead
    getWidget().addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            final MouseEventDetails mouseDetails = MouseEventDetailsBuilder
                    .buildMouseEventDetails(event.getNativeEvent(), getWidget().getElement());
            MyComponentServerRpc rpc = getRpcProxy(MyComponentServerRpc.class);
            rpc.clicked(mouseDetails.getButtonName());
        }
    });

}