Example usage for com.google.gwt.coreext.client DataBag getStringProperty

List of usage examples for com.google.gwt.coreext.client DataBag getStringProperty

Introduction

In this page you can find the example usage for com.google.gwt.coreext.client DataBag getStringProperty.

Prototype

public static final native String getStringProperty(JavaScriptObject obj, String prop) ;

Source Link

Usage

From source file:com.google.speedtracer.client.model.BreakyWorkerHost.java

License:Apache License

/**
 * Initialize the event handlers for the host.
 *//*from ww  w .  j  av  a  2s . c o  m*/
private void init() {
    breakyWorker.setOnError(new ErrorHandler() {
        public void onError(ErrorEvent event) {
            UncaughtExceptionHandler ueh = GWT.getUncaughtExceptionHandler();
            if (ueh != null) {
                try {
                    onBreakyException(event);
                } catch (Exception ex) {
                    ueh.onUncaughtException(ex);
                }
            } else {
                onBreakyException(event);
            }
        }
    });

    breakyWorker.setOnMessage(new MessageHandler() {
        public void onMessage(MessageEvent event) {
            UncaughtExceptionHandler ueh = GWT.getUncaughtExceptionHandler();
            if (ueh != null) {
                try {
                    fireOnBreakyMessage(event);
                } catch (Exception ex) {
                    ueh.onUncaughtException(ex);
                }
            } else {
                fireOnBreakyMessage(event);
            }
        }

        /**
         * Turn a breaky message into a synthesized hint record.
         * 
         * @param event breaky message
         */
        private void fireOnBreakyMessage(MessageEvent event) {
            JavaScriptObject breakyMessage = event.getDataAsJSO();
            int sequence = DataBag.getIntProperty(breakyMessage, "sequence");
            String message = DataBag.getStringProperty(breakyMessage, "message");
            Logging.getLogger().logTextError("Breaky Error:(#" + sequence + ") " + message);

            EventRecord record = dataDispatcher.findEventRecordFromSequence(sequence);
            if (record == null) {
                Logging.getLogger().logTextError("Breaky cannot find record with sequence #" + sequence);
            } else {
                HintRecord validationHint = HintRecord.create("Validation Error", record.getTime(),
                        HintRecord.SEVERITY_VALIDATION, message, sequence);
                hintletHost.onSynthesizedHint(validationHint);
            }
        }
    });
}

From source file:com.google.speedtracer.client.model.CustomEvent.java

License:Apache License

public final String getColorString() {
    return DataBag.getStringProperty(this, "color");
}

From source file:com.google.speedtracer.client.model.CustomEvent.java

License:Apache License

public final String getTypeName() {
    return DataBag.getStringProperty(this, "typeName");
}