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.drools.brms.client.packages.AssetAttachmentFileWidget.java

License:Apache License

protected void initWidgets(final String uuid, String formName) {
    form = new FormPanel();
    form.setAction(GWT.getModuleBaseURL() + "asset");
    form.setEncoding(FormPanel.ENCODING_MULTIPART);
    form.setMethod(FormPanel.METHOD_POST);

    FileUpload up = new FileUpload();
    up.setName(HTMLFileManagerFields.UPLOAD_FIELD_NAME_ATTACH);
    HorizontalPanel fields = new HorizontalPanel();
    fields.add(getHiddenField(HTMLFileManagerFields.FORM_FIELD_UUID, uuid));

    ok = new ImageButton("images/upload.gif", "Upload");

    fields.add(up);/*from  w ww.  j a  v  a 2  s .  co m*/
    fields.add(new Label("upload:"));
    fields.add(ok);

    form.add(fields);

    layout = new FormStyleLayout(getIcon(), formName);

    if (!this.asset.isreadonly)
        layout.addAttribute("Upload new version:", form);

    Button dl = new Button("Download");
    dl.addClickListener(new ClickListener() {
        public void onClick(Widget w) {
            Window.open(GWT.getModuleBaseURL() + "asset?" + HTMLFileManagerFields.FORM_FIELD_UUID + "=" + uuid,
                    "downloading", "resizable=no,scrollbars=yes,status=no");
        }
    });
    layout.addAttribute("Download current version:", dl);

    ok.addClickListener(new ClickListener() {
        public void onClick(Widget w) {
            showUploadingBusy();
            submitUpload();
        }
    });

    initWidget(layout);
    layout.setWidth("100%");
    this.setStyleName(getOverallStyleName());
}

From source file:org.drools.guvnor.client.admin.BackupManager.java

License:Apache License

private void exportRepository() {

    if (Window.confirm("Export the repository? This may take some time.")) {
        LoadingPopup.showMessage("Exporting repository, please wait, as this could take some time...");

        Window.open(GWT.getModuleBaseURL() + "backup?" + HTMLFileManagerFields.FORM_FIELD_REPOSITORY + "=true",
                "downloading", "resizable=no,scrollbars=yes,status=no");

        LoadingPopup.close();//w  w w.  ja  va2s  .co  m
    }
}

From source file:org.drools.guvnor.client.admin.BackupManager.java

License:Apache License

private void exportPackageFromRepository(String packageName) {

    if (Window.confirm("Export the package?")) {
        LoadingPopup.showMessage("Exporting package, please wait, as this could take some time...");

        Window.open(
                GWT.getModuleBaseURL() + "backup?" + HTMLFileManagerFields.FORM_FIELD_REPOSITORY
                        + "=true&packageName=" + packageName,
                "downloading", "resizable=no,scrollbars=yes,status=no");

        LoadingPopup.close();//from   ww  w . j a v a  2  s  .  c  o  m
    }
}

From source file:org.drools.guvnor.client.asseteditor.AssetAttachmentFileWidget.java

License:Apache License

protected void initWidgets(final String uuid, String formName) {
    form = new FormPanel();
    form.setAction(GWT.getModuleBaseURL() + "asset");
    form.setEncoding(FormPanel.ENCODING_MULTIPART);
    form.setMethod(FormPanel.METHOD_POST);

    FileUpload up = new FileUpload();
    up.setName(HTMLFileManagerFields.UPLOAD_FIELD_NAME_ATTACH);
    HorizontalPanel fields = new HorizontalPanel();
    fields.add(getHiddenField(HTMLFileManagerFields.FORM_FIELD_UUID, uuid));

    Button ok = new Button(ConstantsCore.INSTANCE.Upload());

    fields.add(up);/*from w ww  .ja v  a 2 s  .c  o m*/
    fields.add(ok);

    form.add(fields);

    layout = new FormStyleLayout(getIcon(), formName);

    if (!this.asset.isReadonly())
        layout.addAttribute(ConstantsCore.INSTANCE.UploadNewVersion(), form);

    Button dl = new Button(ConstantsCore.INSTANCE.Download());
    dl.setEnabled(this.asset.getVersionNumber() > 0);
    dl.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            Window.open(GWT.getModuleBaseURL() + "asset?" + HTMLFileManagerFields.FORM_FIELD_UUID + "=" + uuid,
                    "downloading", "resizable=no,scrollbars=yes,status=no");
        }
    });
    layout.addAttribute(ConstantsCore.INSTANCE.DownloadCurrentVersion(), dl);

    ok.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            showUploadingBusy();
            submitUpload();
        }
    });

    initWidget(layout);
    layout.setWidth("100%");
    this.setStyleName(getOverallStyleName());
}

From source file:org.drools.guvnor.client.asseteditor.drools.serviceconfig.ServiceConfigEditor.java

License:Apache License

@UiHandler("btnDownloadWar")
public void downloadWarFile(ClickEvent e) {
    Window.open(GWT.getModuleBaseURL() + "serviceWarBuilderAndDownloadHandler?uuid=" + assetUUID,
            "service download", "");
}

From source file:org.drools.guvnor.client.explorer.navigation.admin.widget.BackupManager.java

License:Apache License

private void exportRepository() {

    if (Window.confirm(constants.ExportRepoWarning())) {
        LoadingPopup.showMessage(constants.ExportRepoWait());

        Window.open(GWT.getModuleBaseURL() + "backup?" + HTMLFileManagerFields.FORM_FIELD_REPOSITORY + "=true",
                "downloading", "resizable=no,scrollbars=yes,status=no");

        LoadingPopup.close();/*  ww  w.  ja  v  a  2 s.  c o m*/
    }
}

From source file:org.drools.guvnor.client.packages.AssetAttachmentFileWidget.java

License:Apache License

protected void initWidgets(final String uuid, String formName) {
    form = new FormPanel();
    form.setAction(GWT.getModuleBaseURL() + "asset");
    form.setEncoding(FormPanel.ENCODING_MULTIPART);
    form.setMethod(FormPanel.METHOD_POST);

    FileUpload up = new FileUpload();
    up.setName(HTMLFileManagerFields.UPLOAD_FIELD_NAME_ATTACH);
    HorizontalPanel fields = new HorizontalPanel();
    fields.add(getHiddenField(HTMLFileManagerFields.FORM_FIELD_UUID, uuid));

    ok = new Button("Upload");

    fields.add(up);//from w  ww .j ava2  s.  c o  m
    //fields.add(new Label("upload:"));
    fields.add(ok);

    form.add(fields);

    layout = new FormStyleLayout(getIcon(), formName);

    if (!this.asset.isreadonly)
        layout.addAttribute("Upload new version:", form);

    Button dl = new Button("Download");
    dl.addClickListener(new ClickListener() {
        public void onClick(Widget w) {
            Window.open(GWT.getModuleBaseURL() + "asset?" + HTMLFileManagerFields.FORM_FIELD_UUID + "=" + uuid,
                    "downloading", "resizable=no,scrollbars=yes,status=no");
        }
    });
    layout.addAttribute("Download current version:", dl);

    ok.addClickListener(new ClickListener() {
        public void onClick(Widget w) {
            showUploadingBusy();
            submitUpload();
        }
    });

    initWidget(layout);
    layout.setWidth("100%");
    this.setStyleName(getOverallStyleName());
}

From source file:org.drools.guvnor.client.perspective.PerspectivesPanel.java

License:Apache License

public void onLogout() {
    clientFactory.getSecurityService().logout(new GenericCallback() {
        public void onSuccess(Object result) {
            Window.open(GWT.getModuleBaseURL() + "Guvnor.jsp", "_self", "");
        }/* w ww . j  a  v  a2  s  .  c  om*/
    });
}

From source file:org.drools.guvnor.client.ruleeditor.BPELWrapper.java

License:Apache License

public BPELWrapper(RuleAsset asset, RuleViewer viewer) {

    final String uuid = asset.uuid;
    final String fileName = asset.metaData.name;
    final String dirName = asset.metaData.packageName;
    final String servletName = "workflowmanager";
    final String isNew = (asset.content == null ? "true" : "false");

    AssetAttachmentFileWidget uploadWidget = new DefaultContentUploadEditor(asset, viewer);

    VerticalPanel panel = new VerticalPanel();
    panel.add(uploadWidget);/* ww  w  .j av a  2s.c om*/

    Button viewSource = new Button();
    viewSource.setText(constants.OpenEditorInNewWindow());

    final String url = Format.format(
            "bpeleditor/BPELEditor.html?uuid={0}&fileName={1}&dirName={2}&servletName={3}&isNew={4}",
            new String[] { uuid, fileName, dirName, servletName, isNew });
    viewSource.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent arg0) {
            Window.open(url, "_" + fileName, null);
        }
    });

    panel.add(viewSource);

    initWidget(panel);

    this.setStyleName(getOverallStyleName());
}

From source file:org.drools.guvnor.client.rulelist.AssetTable.java

License:Apache License

@UiHandler("feedImage")
void openFeed(ClickEvent e) {
    Window.open(feedURL, "_blank", null);
}