Example usage for com.google.gwt.core.client JsArrayInteger toString

List of usage examples for com.google.gwt.core.client JsArrayInteger toString

Introduction

In this page you can find the example usage for com.google.gwt.core.client JsArrayInteger toString.

Prototype

@Override
public final String toString() 

Source Link

Document

Makes a best-effort attempt to get a useful debugging string describing the given JavaScriptObject.

Usage

From source file:com.gwtdaily.interapp.eventbus.client.ModuleAEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {

    if (!InterAppEventBus.isSupported()) {
        Window.alert("Sorry, Custom event in this browser.");
    }/*from  ww w  .  java2  s .co m*/

    Button button = new Button();
    button.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            JsArrayInteger data = ((JsArrayInteger) JsArrayInteger.createArray(1));
            data.push(1);
            data.push(2);
            InterAppEventBus.fireEvent("test1", data);
        }
    });

    InterAppEventBus.addListener(new InterAppEventHandler() {

        @Override
        public void onEvent(JavaScriptObject data) {
            Window.alert(getType() + " event captured in parent module and data is " + data.toString());
        }

        @Override
        public String getType() {
            return "test1";
        }
    });

    button.setText("Test");

    RootPanel.get("module_A").add(button);
}