Package com.ponysdk.ui.server.basic.PScript

Examples of com.ponysdk.ui.server.basic.PScript.ExecutionCallback


        js.append("window.colors.gray = \"#" + gray.getValue() + "\";");
        js.append("window.colors.grayLight = \"#" + grayLight.getValue() + "\";");
        js.append("window.colors.grayLighter = \"#" + grayLighter.getValue() + "\";");
        js.append("window.colors.white = \"#" + white.getValue() + "\";");
        js.append("less.refresh();");
        PScript.get().execute(js.toString(), new ExecutionCallback() {

            @Override
            public void onSuccess(final String msg) {}

            @Override
View Full Code Here


    protected void executeJS(final String js) {
        commands.add(js);
        history.add(new PLabel("> " + js));
        inputTextBox.setText("");
        PScript.get().execute(js, new ExecutionCallback() {

            @Override
            public void onSuccess(final String msg) {
                history.add(new PLabel(msg));
                scroll.scrollToBottom();
View Full Code Here

        // execute OK
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                PScript.get().execute("var i = 5; i + 2;", new ExecutionCallback() {

                    @Override
                    public void onSuccess(final String msg) {
                        eventsListener.stackCommandResult(new PTestEvent(this, "JS result: 7"));
                    }

                    @Override
                    public void onFailure(final String msg) {
                        log.error(msg);
                    }
                });
            }
        });

        final PTestEvent e1 = eventsListener.poll();
        Assert.assertEquals("JS result: 7", e1.getBusinessMessage());

        // execute KO
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                PScript.get().execute("j + 2;", new ExecutionCallback() {

                    @Override
                    public void onSuccess(final String msg) {
                        log.error(msg);
                    }
View Full Code Here

TOP

Related Classes of com.ponysdk.ui.server.basic.PScript.ExecutionCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.