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:com.gsr.myschool.common.client.request.SummaryRequestBuilder.java

License:Apache License

public void sendRequest() {
    if (GWT.isScript()) {
        Window.open("/preinscription/resource/summary?" + postData.toString(), "_blank", "");
    } else {//from   w  ww  .ja va 2  s  .c  om
        Window.open("/resource/summary?" + postData.toString(), "_blank", "");
    }
}

From source file:com.gwtcx.client.presenter.AbstractAccountsPresenter.java

License:Open Source License

public void onExportButtonClicked() {

    StringBuilder url = new StringBuilder();
    url.append(DEFAULT_FILE_DOWNLOAD_SERVICE_PATH).append(FILE_DOWNLOAD_HOST_FILENAME).append("?");

    String arg0Name = URL.encodeQueryString(RECORD_TYPE);
    url.append(arg0Name);/*from w  w  w  .j a  va  2 s  . co m*/
    url.append("=");
    String arg0Value = URL.encodeQueryString("Account");
    url.append(arg0Value);
    // url.append(encodeBase64(arg0Value));

    Log.debug("Window.open() getRelativeURL: " + GwtCxEntryPoint.getRelativeURL(url.toString()));
    Window.open(GwtCxEntryPoint.getRelativeURL(url.toString()), NAME, FEATURES);
}

From source file:com.gwtcx.client.presenter.AbstractImportsPresenter.java

License:Open Source License

public void onNewButtonClicked() {
    StringBuilder url = new StringBuilder();
    url.append(HOST_FILENAME);//w ww.ja va  2 s .  c o m

    Window.open(GwtCxEntryPoint.getRelativeURL(url.toString()), NAME, FEATURES);
}

From source file:com.gwtcx.client.presenter.AbstractPagingPresenter.java

License:Open Source License

public static void openHostFile(String filename, String queryString, String id, String features) {

    StringBuilder url = new StringBuilder();
    url.append(filename).append("?");

    String arg0Name = URL.encodeQueryString(ID);
    url.append(arg0Name);//  w  w w  . jav  a  2s  .c o  m
    url.append("=");
    String arg0Value = URL.encodeQueryString(id);
    url.append(GwtCxEntryPoint.encodeBase64(arg0Value));
    Log.debug("Window.open() arg0Value: " + arg0Value + " Base64: " + GwtCxEntryPoint.encodeBase64(arg0Value));
    url.append(PARAMETER_SEPERATOR);

    String arg1Name = URL.encodeQueryString(ACTIVITY);
    url.append(arg1Name);
    url.append("=");
    String arg1Value = URL.encodeQueryString(queryString);
    url.append(GwtCxEntryPoint.encodeBase64(arg1Value));
    Log.debug("Window.open() arg1Value: " + arg1Value + " Base64: " + GwtCxEntryPoint.encodeBase64(arg1Value));

    Window.open(GwtCxEntryPoint.getRelativeURL(url.toString()), NAME, features);
}

From source file:com.gwtcx.client.presenter.AbstractReportsPresenter.java

License:Open Source License

public void onRecordDoubleClicked(String reportFilename) {

    StringBuilder url = new StringBuilder();
    url.append(DEFAULT_REPORTS_SERVICE_PATH).append(HOST_FILENAME).append("?");

    String arg0Name = URL.encodeQueryString(REPORT_FILENAME);
    url.append(arg0Name);/*w  w w  . j a  v a2 s . com*/
    url.append("=");
    String arg0Value = URL.encodeQueryString(reportFilename);
    url.append(arg0Value);

    Window.open(GwtCxEntryPoint.getRelativeURL(url.toString()), NAME, FEATURES);
}

From source file:com.gwtext.sample.showcase2.client.combo.LiveSearchSample.java

License:Open Source License

public Panel getViewPanel() {
    if (panel == null) {
        panel = new Panel();
        panel.setId("livesearch");

        //Use a ScriptTagProxy because you are getting data from a different domain using
        //a Json web service. If getting data from your own domain, then should use HttpProxy
        DataProxy dataProxy = new ScriptTagProxy("http://extjs.com/forum/topics-remote.php");

        RecordDef recordDef = new RecordDef(new FieldDef[] { new StringFieldDef("title", "topic_title"),
                new StringFieldDef("topicId", "topic_id"), new StringFieldDef("author", "author"),
                new DateFieldDef("lastPost", "post_time", "timestamp"),
                new StringFieldDef("excerpt", "post_text") });

        JsonReader reader = new JsonReader(recordDef);
        reader.setRoot("topics");
        reader.setTotalProperty("totalCount");
        reader.setId("post_id");

        final Store store = new Store(dataProxy, reader);
        store.load();/*www .j ava 2 s .co  m*/

        final String resultTpl = "<div class=\"search-item\"><h3><span>{lastPost:date(\"M j, Y\")}<br />"
                + "by {author}</span>{title}</h3>{excerpt}</div>";

        ComboBox cb = new ComboBox();
        cb.setStore(store);
        cb.setDisplayField("title");
        cb.setTypeAhead(false);
        cb.setLoadingText("Searching...");
        cb.setWidth(440);
        cb.setPageSize(10);
        cb.setHideTrigger(true);
        cb.setTpl(resultTpl);
        cb.setMode(ComboBox.REMOTE);
        cb.setTitle("ExtJS Forums");
        cb.setHideLabel(true);
        cb.setItemSelector("div.search-item");

        cb.addListener(new ComboBoxListenerAdapter() {
            public void onSelect(ComboBox comboBox, Record record, int index) {
                String[] args = new String[] { record.getAsString("topicId"), record.getId() };
                String url = Format.format("http://extjs.com/forum/showthread.php?t={0}&p={1}", args);
                Window.open(url, "forum", "");
            }
        });

        Panel searchPanel = new Panel();
        searchPanel.setWidth(490);
        searchPanel.setHeight(150);
        searchPanel.setPaddings(20);
        searchPanel.setTitle("Search ExtJS Forums");
        searchPanel.setFrame(true);

        FormPanel form = new FormPanel();
        form.setBorder(false);
        form.add(cb);
        searchPanel.add(form);

        Panel instructionPanel = new Panel();
        instructionPanel.setBorder(false);
        instructionPanel.setPaddings(4, 0, 0, 0);
        instructionPanel.setHtml("Live search requires a minimum of 4 characters.");
        searchPanel.add(instructionPanel);

        panel.add(searchPanel);
    }
    return panel;
}

From source file:com.gwtmodel.table.Utils.java

License:Apache License

public static void openTabUrl(String url, String title) {
    Window.open(url, "_blank", "");
}

From source file:com.haulmont.cuba.web.toolkit.ui.client.downloader.CubaFileDownloaderConnector.java

License:Apache License

public void viewDocumentById(String resourceId) {
    final String url = getResourceUrl(resourceId);
    if (url != null && !url.isEmpty()) {
        Window.open(url, "_blank", "");
    }//from   w  ww  .j a v  a2  s .  c  o  m
}

From source file:com.ics.tcg.web.workflow.client.AbstractConnections.java

License:Apache License

/**
 * Nothing really important. Presents links to source code on examples
 * panel./*from   www .ja v a 2 s.  co m*/
 * 
 * @see com.ics.tcg.web.workflow.client.AbstractEditRegion#sources()
 */
@Override
protected List sources() {
    ArrayList sources = new ArrayList();

    int dot = GWT.getTypeName(this).lastIndexOf('.');
    String className = GWT.getTypeName(this).substring(dot + 1);

    sources.add(new Hyperlink(className + ".java", ""));
    sources.add(new Hyperlink("AbstractExample.java", ""));
    sources.add(new Hyperlink("AbstractConnectionsExample.java", ""));

    for (Iterator i = sources.iterator(); i.hasNext();) {
        final Hyperlink h = (Hyperlink) i.next();
        h.addStyleName("gwt-diagrams-source-link");
        h.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                Window.open("../source/" + h.getText(), "", "");
            }
        });
    }

    return sources;
}

From source file:com.ics.tcg.web.workflow.client.examples.AbstractConnectionsExample.java

License:Apache License

/**
 * Nothing really important. Presents links to source code on examples
 * panel.//from  w  w w . j a va  2s.c  o  m
 * 
 * @see com.ics.tcg.web.workflow.client.examples.AbstractExample#sources()
 */
protected List sources() {
    ArrayList sources = new ArrayList();

    int dot = GWT.getTypeName(this).lastIndexOf('.');
    String className = GWT.getTypeName(this).substring(dot + 1);

    sources.add(new Hyperlink(className + ".java", ""));
    sources.add(new Hyperlink("AbstractExample.java", ""));
    sources.add(new Hyperlink("AbstractConnectionsExample.java", ""));

    for (Iterator i = sources.iterator(); i.hasNext();) {
        final Hyperlink h = (Hyperlink) i.next();
        h.addStyleName("gwt-diagrams-source-link");
        h.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                Window.open("../source/" + h.getText(), "", "");
            }
        });
    }

    return sources;
}