Example usage for com.google.gwt.user.client Window open

List of usage examples for com.google.gwt.user.client Window open

Introduction

In this page you can find the example usage for com.google.gwt.user.client Window open.

Prototype

public static void open(String url, String name, String features) 

Source Link

Usage

From source file:org.jdna.eloaa.client.util.UIUtils.java

License:Apache License

public static final ClickHandler openIMDBHandler(final GMovie movie) {
    return new ClickHandler() {
        @Override/*from www. j a v a 2 s . c  o m*/
        public void onClick(ClickEvent event) {
            if (movie.getImdbid() != null) {
                Window.open(Utils.toIMDBUrl(movie), "imdb", "");
            } else {
                EloaaService.Instance.get().findIMDBID(movie.getId(), new AsyncCallback<GResponse<String>>() {
                    @Override
                    public void onFailure(Throwable caught) {
                    }

                    @Override
                    public void onSuccess(GResponse<String> result) {
                        if (result.isOK()) {
                            Window.open(Utils.toIMDBUrl(result.get()), "imdb", "");
                        }
                    }
                });
            }
        }
    };
}

From source file:org.jdna.eloaa.client.util.UIUtils.java

License:Apache License

public static final ClickHandler openPreviewImage(final NzbItem nzbItem) {
    return new ClickHandler() {
        @Override//from w  ww .  j  av  a 2s  . com
        public void onClick(ClickEvent event) {
            Window.open(getPreviewURL(nzbItem), "preview", "");
        }
    };
}

From source file:org.kaaproject.avro.ui.sandbox.client.servlet.ServletHelper.java

License:Apache License

public static void downloadJsonSchema(String key) {
    String getUrl = composeURL(UPLOAD_SERVLET_PATH, JSON_KEY + "=" + key, FILE_NAME + "=" + JSON_SCHEMA_FILE);
    String url = GWT.getModuleBaseURL() + getUrl;
    Window.open(url, "_self", "enabled");
}

From source file:org.kaaproject.avro.ui.sandbox.client.servlet.ServletHelper.java

License:Apache License

public static void downloadJsonRecord(String key) {
    String getUrl = composeURL(UPLOAD_SERVLET_PATH, JSON_KEY + "=" + key, FILE_NAME + "=" + JSON_RECORD_FILE);
    String url = GWT.getModuleBaseURL() + getUrl;
    Window.open(url, "_self", "enabled");
}

From source file:org.kaaproject.kaa.sandbox.web.client.mvp.activity.HeaderActivity.java

License:Apache License

private void goToKaaProjectSite() {
    Analytics.sendEvent(Analytics.GOTO_KAA_PROJECT_SITE_ACTION);
    Window.open(KAA_PROJECT_URL, "", "");
}

From source file:org.kaaproject.kaa.sandbox.web.client.servlet.ServletHelper.java

License:Apache License

public static void downloadProjectFile(String projectId, ProjectDataType type) {
    String getUrl = composeURL(SANDBOX_PROJECT_FILE_SERVLET_PATH,
            ProjectDataKey.PROJECT_ID_PARAMETER + "=" + projectId,
            ProjectDataKey.PROJECT_DATA_TYPE_PARAMETER + "=" + type.name());
    String url = GWT.getModuleBaseURL() + getUrl;
    Window.open(url, "_self", "enabled");
}

From source file:org.kaaproject.kaa.server.admin.client.mvp.view.struct.BaseStructView.java

License:Apache License

private void init() {

    getColumnFormatter().setWidth(0, "400px");
    getColumnFormatter().setWidth(1, "400px");

    // IE workaround
    getColumnFormatter().getElement(2).setAttribute("width", "0px");

    FlexTable dateTable = new FlexTable();
    FlexTable userTable = new FlexTable();

    dateTable.getColumnFormatter().setWidth(0, "200px");
    dateTable.getColumnFormatter().setWidth(1, "200px");

    userTable.getColumnFormatter().setWidth(0, "200px");
    userTable.getColumnFormatter().setWidth(1, "200px");

    dateTimeCreatedLabel = new Label(Utils.constants.dateTimeCreated());
    dateTimeCreatedLabel.setWidth("200px");
    createdDateTime = new KaaAdminSizedTextBox(-1, false, false);
    createdDateTime.setWidth("200px");
    dateTable.setWidget(0, 0, dateTimeCreatedLabel);
    dateTable.setWidget(0, 1, createdDateTime);

    dateTimeModifiedLabel = new Label(Utils.constants.dateTimeModified());
    dateTimeModifiedLabel.setWidth("200px");
    modifiedDateTime = new KaaAdminSizedTextBox(-1, false, false);
    modifiedDateTime.setWidth("200px");
    dateTable.setWidget(1, 0, dateTimeModifiedLabel);
    dateTable.setWidget(1, 1, modifiedDateTime);

    dateTimeActivatedLabel = new Label(Utils.constants.dateTimeActivated());
    dateTimeActivatedLabel.setWidth("200px");
    activatedDateTime = new KaaAdminSizedTextBox(-1, false, false);
    activatedDateTime.setWidth("200px");
    dateTable.setWidget(2, 0, dateTimeActivatedLabel);
    dateTable.setWidget(2, 1, activatedDateTime);

    dateTimeDeactivatedLabel = new Label(Utils.constants.dateTimeDectivated());
    dateTimeDeactivatedLabel.setWidth("200px");
    deactivatedDateTime = new KaaAdminSizedTextBox(-1, false, false);
    deactivatedDateTime.setWidth("200px");
    dateTable.setWidget(3, 0, dateTimeDeactivatedLabel);
    dateTable.setWidget(3, 1, deactivatedDateTime);

    authorLabel = new Label(Utils.constants.author());
    authorLabel.setWidth("200px");
    createdUsername = new KaaAdminSizedTextBox(-1, false, false);
    createdUsername.setWidth("200px");
    userTable.setWidget(0, 0, authorLabel);
    userTable.setWidget(0, 1, createdUsername);

    modifiedByLabel = new Label(Utils.constants.lastModifiedBy());
    modifiedByLabel.setWidth("200px");
    modifiedUsername = new KaaAdminSizedTextBox(-1, false, false);
    modifiedUsername.setWidth("200px");
    userTable.setWidget(1, 0, modifiedByLabel);
    userTable.setWidget(1, 1, modifiedUsername);

    activatedByLabel = new Label(Utils.constants.activatedBy());
    activatedByLabel.setWidth("200px");
    activatedUsername = new KaaAdminSizedTextBox(-1, false, false);
    activatedUsername.setWidth("200px");
    userTable.setWidget(2, 0, activatedByLabel);
    userTable.setWidget(2, 1, activatedUsername);

    deactivatedByLabel = new Label(Utils.constants.deactivatedBy());
    deactivatedByLabel.setWidth("200px");
    deactivatedUsername = new KaaAdminSizedTextBox(-1, false, false);
    deactivatedUsername.setWidth("200px");
    userTable.setWidget(3, 0, deactivatedByLabel);
    userTable.setWidget(3, 1, deactivatedUsername);

    setWidget(0, 0, dateTable);// w w  w  .  ja v  a2 s  .  com
    setWidget(0, 1, userTable);

    FlexTable detailsTable = new FlexTable();
    setWidget(1, 0, detailsTable);
    getFlexCellFormatter().setColSpan(1, 0, 3);

    detailsTable.getColumnFormatter().setWidth(0, "200px");
    detailsTable.getColumnFormatter().setWidth(1, "600px");

    // IE workaround
    detailsTable.getColumnFormatter().getElement(2).setAttribute("width", "0px");

    description = new SizedTextArea(1024);
    description.setWidth("600px");
    description.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 100);
    Label descriptionLabel = new Label(Utils.constants.description());
    descriptionLabel.setWidth("200px");
    detailsTable.setWidget(0, 0, descriptionLabel);
    detailsTable.setWidget(0, 1, description);

    detailsTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);

    body = createBody(hasErrorMessage);

    if (hasLabel()) {
        bodyLabel = new Label(Utils.constants.body());
        bodyLabel.setWidth("200px");
        ((Widget) body).setWidth("600px");
        detailsTable.setWidget(1, 0, bodyLabel);
        detailsTable.setWidget(1, 1, (Widget) body);
        detailsTable.getCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP);
    } else {
        detailsTable.setWidget(1, 0, (Widget) body);
        detailsTable.getFlexCellFormatter().setColSpan(1, 0, 3);
    }

    buttonsPanel = new HorizontalPanel();
    buttonsPanel.setSpacing(5);

    detailsTable.setWidget(2, 0, buttonsPanel);
    detailsTable.getCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT);
    detailsTable.getFlexCellFormatter().setColSpan(2, 0, 2);

    saveButton = new Button(Utils.constants.save());
    activateButton = new Button(Utils.constants.activate());
    deactivateButton = new Button(Utils.constants.deactivate());
    downloadConfigurationButton = new Button(Utils.constants.downloadConfiguration());
    buttonsPanel.add(saveButton);
    buttonsPanel.add(activateButton);
    buttonsPanel.add(deactivateButton);
    buttonsPanel.add(downloadConfigurationButton);

    description.setFocus(true);

    saveButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            updateSaveButton(false, false);
        }
    });

    downloadConfigurationButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent clickEvent) {
            String url = Window.Location.getHref();
            Window.open("/kaaAdmin/servlet/kaaConfigurationDownloadServlet?schemaId="
                    + Utils.getSchemaIdFromUrl(url) + "&endGroupId=" + Utils.getEndpointGroupIdFromUrl(url),
                    "_blank", "status=0,toolbar=0,menubar=0,location=0");
        }
    });
}

From source file:org.kaaproject.kaa.server.admin.client.servlet.ServletHelper.java

License:Apache License

public static void downloadSdk(String key) {
    String getUrl = composeURL(KAA_SDK_SERVLET_PATH, SDK_KEY_PARAMETER + "=" + URL.encodeQueryString(key));
    String url = GWT.getModuleBaseURL() + getUrl;
    Window.open(url, "_self", "enabled");
}

From source file:org.kaaproject.kaa.server.admin.client.servlet.ServletHelper.java

License:Apache License

public static void downloadRecordLibrary(String key) {
    String getUrl = composeURL(KAA_RECORD_LIBRARY_SERVLET_PATH,
            RECORD_KEY_PARAMETER + "=" + URL.encodeQueryString(key));
    String url = GWT.getModuleBaseURL() + getUrl;
    Window.open(url, "_self", "enabled");
}

From source file:org.kaaproject.kaa.server.admin.client.servlet.ServletHelper.java

License:Apache License

public static void exportCtlSchema(String key) {
    String getUrl = composeURL(KAA_CTL_EXPORT_SERVLET_PATH,
            CTL_EXPORT_KEY_PARAMETER + "=" + URL.encodeQueryString(key));
    String url = GWT.getModuleBaseURL() + getUrl;
    Window.open(url, "_self", "enabled");
}