Example usage for com.google.gwt.core.client JavaScriptObject createObject

List of usage examples for com.google.gwt.core.client JavaScriptObject createObject

Introduction

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

Prototype

public static native JavaScriptObject createObject() ;

Source Link

Document

Returns a new object.

Usage

From source file:com.rhizospherejs.gwt.client.RhizosphereMetaModel.java

License:Open Source License

/**
 * Creates a new meta model.
 */
public static RhizosphereMetaModel create() {
    return JavaScriptObject.createObject().cast();
}

From source file:com.rhizospherejs.gwt.client.RhizosphereOptions.java

License:Open Source License

/**
 * Creates a new options instance.//from  w  w w. j  av  a 2 s.  c o m
 * @param <T> The models type for the Rhizosphere visualization these options
 *     will be given to.
 * @return The options instance.
 */
public static <T> RhizosphereOptions<T> create() {
    return JavaScriptObject.createObject().cast();
}

From source file:com.seanchenxi.gwt.webrtc.client.Constraint.java

License:Apache License

public static Constraint create() {
    return JavaScriptObject.createObject().cast();
}

From source file:com.seanchenxi.gwt.webrtc.client.media.UserMediaConstraints.java

License:Apache License

public static UserMediaConstraints create() {
    return JavaScriptObject.createObject().cast();
}

From source file:com.seanchenxi.gwt.webrtc.client.WebRTCImpl.java

License:Apache License

public final DataChannelInit createDataChannelInit(boolean reliable) {
    DataChannelInit init = JavaScriptObject.createObject().cast();
    init.setReliable(reliable);//w  w  w  .j a va  2s .c  o  m
    return init;
}

From source file:com.seanchenxi.gwt.webrtc.client.WebRTCImpl.java

License:Apache License

public final RTCIceServer createRTCIceServer(String url, String credential) {
    RTCIceServer server = JavaScriptObject.createObject().cast();
    server.setUrl(url);/*  w  ww  . j  a va2s .  c  om*/
    if (credential != null && !credential.trim().isEmpty())
        server.setCredential(credential);
    return server;
}

From source file:com.seanchenxi.gwt.webrtc.client.WebRTCImpl.java

License:Apache License

public final RTCConfiguration createRTCConfiguration(JsArray<RTCIceServer> iceServers) {
    RTCConfiguration config = JavaScriptObject.createObject().cast();
    config.setIceServers(iceServers);/*from w  w  w  .ja  v a  2 s  . c om*/
    return config;
}

From source file:com.smartgwt.client.data.DateRange.java

License:Open Source License

@Override
public JavaScriptObject getJsObj() {
    JavaScriptObject jsObj = JavaScriptObject.createObject();
    if (startDate != null) {
        JSOHelper.setAttribute(jsObj, "start", startDate);
    }/*from   w w  w.  ja v a 2 s.c  o m*/
    if (relativeStartDate != null) {
        if (relativeStartDate.getValue().startsWith("$")) {
            JSOHelper.setAttribute(jsObj, "start", relativeStartDate.getValue());
        } else {
            JSOHelper.setAttribute(jsObj, "start", relativeStartDate.getJsObj());
        }
    }
    if (endDate != null) {
        JSOHelper.setAttribute(jsObj, "end", endDate);
    }
    if (relativeEndDate != null) {
        if (relativeEndDate.getValue().startsWith("$")) {
            JSOHelper.setAttribute(jsObj, "end", relativeEndDate.getValue());
        } else {
            JSOHelper.setAttribute(jsObj, "end", relativeEndDate.getJsObj());
        }
    }
    return jsObj;
}

From source file:com.smartgwt.client.data.RelativeDate.java

License:Open Source License

@Override
public JavaScriptObject getJsObj() {
    JavaScriptObject jsObj = JavaScriptObject.createObject();
    JSOHelper.setAttribute(jsObj, "_constructor", "RelativeDate");
    if (rangePosition != null) {
        JSOHelper.setAttribute(jsObj, "rangePosition", rangePosition.getValue());
    }/*from   w  w w.ja v  a  2s  .c om*/
    JSOHelper.setAttribute(jsObj, "value",
            mapRelativeDateShortcut(value, rangePosition == null ? null : rangePosition.getValue()));
    return jsObj;
}

From source file:com.thezukunft.wave.connectormock.WaveMock.java

License:Open Source License

public void initRandomParticipants() {

    // init some viewer and add it
    ParticipantMock p = JavaScriptObject.createObject().cast();
    p.setupMock();//w w w .ja va  2  s.  c o m
    p.setDisplayName("Robin the Simple");
    p.setId("1a");
    p.setThumbnailUrl(GWT.getModuleBaseURL() + "robin.jpg");
    participants.push(p);

    // init some host and add it 50% of the time
    ParticipantMock h = JavaScriptObject.createObject().cast();
    h.setupMock();
    h.setDisplayName("Batman the Host");
    h.setId("2b");
    h.setThumbnailUrl(GWT.getModuleBaseURL() + "/batman.jpg");
    participants.push(h);

    viewer = Random.nextBoolean() ? p : h;
    host = Random.nextBoolean() ? h : p;

    eventBus.fireEvent(new ParticipantUpdateEvent(this));
}