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:cz.filmtit.client.callables.GetAuthenticationURL.java

License:Open Source License

@Override
public void onSuccessAfterLog(LoginSessionResponse response) {
    String url = response.getOpenIDURL();
    int authID = response.getAuthID();
    Gui.log("Authentication URL and authID arrived: " + authID + ", " + url);
    loginDialog.close();/*from w ww.j av a 2s. c o m*/

    // open the authentication window
    Window.open(url, "AuthenticationWindow", "width=600,height=500");

    // start polling for SessionID
    new SessionIDPolling(authID);
}

From source file:de.tudarmstadt.ukp.experiments.inviedit.client.gui.InViEditMenuBar.java

License:Apache License

public InViEditMenuBar(final VersionManagement versionManagement, boolean showLoad, boolean showSave,
        final String logOutURL) {
    this.versionManagement = versionManagement;

    if (showSave) {
        saveButton = new Button();
        saveButton.setTitle("Speichern");
        saveButton.setHeight100();//from w  w  w  .  j ava 2 s.  c om
        saveButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                versionManagement.save();
            }
        });
        addMember(saveButton);
    }

    if (showLoad) {
        loadButton = new Button();
        loadButton.setTitle("Laden");
        loadButton.setHeight100();
        loadButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                versionManagement.load();
            }
        });
        addMember(loadButton);
    }

    if (logOutURL != null) {
        Button logOutButton = new Button();
        logOutButton.setTitle("Abmelden");
        logOutButton.setHeight100();
        logOutButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                MainLayout.writeToJsConsole("Initializing SAVE");
                versionManagement.save(new Function() {
                    @Override
                    public void execute() {
                        MainLayout.writeToJsConsole("SAVE successful");
                        SC.say("Ihre Eingaben wurden gespeichert und das System wird nun beendet. Sie knnen sich bei Bedarf spter erneut anmelden.",
                                new BooleanCallback() {
                                    @Override
                                    public void execute(Boolean value) {
                                        Window.open(logOutURL, "_self", "");
                                    }
                                });
                    }
                }, true);
            }
        });
        this.addMember(logOutButton);
    }
}

From source file:de.uni_koeln.spinfo.maalr.webapp.ui.admin.client.general.dbsettings.DatabaseSettings.java

License:Apache License

/**
 * Initializes handlers for input fields and buttons.
 *///from w ww. j  a v  a  2  s.  c o m
private void initHandlers() {
    final AsyncCallback<String> resultCallback = new AsyncCallback<String>() {

        @Override
        public void onFailure(Throwable caught) {
            busyIndicator.setVisible(false);
            Dialog.showError("Operation failed", caught);
        }

        @Override
        public void onSuccess(String result) {
            updateDatabaseStatistics();
            busyIndicator.setVisible(false);
        }
    };

    exportAll.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            final Modal modal = new Modal();
            modal.setAnimation(true);
            modal.setTitle("Download Data...");
            VerticalPanel panel = new VerticalPanel();
            ControlGroup group = new ControlGroup();
            Controls all = new Controls();
            final CheckBox allButton = new CheckBox("Export complete version history");
            all.add(allButton);
            final CheckBox allData = new CheckBox("Anonymize data");
            all.add(allData);
            group.add(all);
            panel.add(group);
            panel.add(
                    new Label("For a full backup, export the version history and do not anonymize the entries. "
                            + "In any case, the downloaded file will contain a MD5-Checksum which can be used to verify "
                            + "the integrity of the data."));
            ModalFooter footer = new ModalFooter();
            Button export = new Button("Download");
            export.setType(ButtonType.PRIMARY);
            footer.add(export);
            export.addClickHandler(new ClickHandler() {

                @Override
                public void onClick(ClickEvent event) {
                    Window.open(
                            "../admin/export?all=" + allButton.getValue() + "&dropKeys=" + allData.getValue(),
                            "_blank", null);
                    modal.hide();
                }
            });
            Button cancel = new Button("Cancel");
            cancel.addClickHandler(new ClickHandler() {

                @Override
                public void onClick(ClickEvent event) {
                    modal.hide();
                }
            });
            footer.add(cancel);
            modal.add(panel);
            modal.add(footer);
            modal.show();
        }
    });
    importAll.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            ImportDialog dialog = new ImportDialog();
            dialog.show();
        }
    });

    drop.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Command ok = new Command() {

                @Override
                public void execute() {
                    busyIndicator.setVisible(true);
                    service.dropDatabase(resultCallback);
                }
            };
            Dialog.confirm("Deleting all entries",
                    "This operation will drop the entire database and cannot be undone. Do you really want to continue?",
                    "OK", "Cancel", ok, null, false);
        }
    });
    reload.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Command ok = new Command() {

                @Override
                public void execute() {
                    busyIndicator.setVisible(true);
                    service.reloadDatabase(resultCallback);
                }
            };
            Dialog.confirm("Reload database",
                    "This operation will reload the entire database. Do you really want to continue?", "OK",
                    "Cancel", ok, null, false);
        }
    });
    updateStats.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            updateDatabaseStatistics();
        }

    });
}

From source file:de.uni_koeln.spinfo.maalr.webapp.ui.admin.client.user.details.UserDetails.java

License:Apache License

private void initListeners() {
    ChangeHandler handler = new ChangeHandler() {

        @Override/*from ww w .j a  va  2  s .  co  m*/
        public void onChange(ChangeEvent event) {
            if (workingCopy == null)
                return;
            workingCopy.setEmail(email.getText());
            workingCopy.setFirstName(firstName.getText());
            workingCopy.setLastName(lastName.getText());
            String roleId = role.getValue(role.getSelectedIndex());
            Role r = Role.valueOf(roleId);
            workingCopy.setRole(r);
        }
    };

    email.addChangeHandler(handler);
    firstName.addChangeHandler(handler);
    lastName.addChangeHandler(handler);
    role.addChangeHandler(handler);
    save.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            if (unmodified == null)
                return;
            save(unmodified, unmodified);
        }
    });
    cancel.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            if (unmodified == null)
                return;
            createWorkingCopy(unmodified);
        }
    });
    delete.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            if (unmodified == null)
                return;
            Command command = new Command() {

                @Override
                public void execute() {
                    service.deleteUser(unmodified, new AsyncCallback<Boolean>() {

                        @Override
                        public void onFailure(Throwable caught) {
                            // TODO Auto-generated method stub

                        }

                        @Override
                        public void onSuccess(Boolean result) {
                            userList.reset();
                        }
                    });
                }
            };
            Dialog.confirm("Confirm deletion", "Do you really want to delete user \"" + unmodified.getEmail()
                    + "\"? This cannot be undone!", "OK", "Cancel", command, null, false);
        }
    });
    mailto.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Window.open("mailto:" + email.getText(), "_blank", "");
        }
    });
    edits.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            Window.alert("This feature is not yet implemented.");
        }
    });
}

From source file:edu.caltech.ipac.firefly.fftools.ExtViewer.java

public static void plotExternal_OLD_2(JscriptRequest jspr, String target) {
    WebPlotRequest wpr = RequestConverter.convertToRequest(jspr, FFToolEnv.isAdvertise());
    findURLAndMakeFull(wpr);/*  ww  w  .  jav a2 s .  c  o  m*/
    String url = getHost(GWT.getModuleBaseURL()) + "/fftools/app.html"; // TODO: need to fixed this
    List<Param> pList = new ArrayList(5);
    pList.add(new Param(Request.ID_KEY, "FFToolsImageCmd"));
    pList.add(new Param(CommonParams.DO_PLOT, "true"));
    for (Param p : wpr.getParams()) {
        if (p.getName() != Request.ID_KEY)
            pList.add(p);
    }

    url = WebUtil.encodeUrl(url, WebUtil.ParamType.POUND, pList);
    if (target == null)
        target = "_blank";
    Window.open(url, target, "");
}

From source file:edu.cudenver.bios.glimmpse.client.panels.WizardPanel.java

License:Open Source License

/**
 * Open the help manual in a new tab/window
 *//*from   www  .  ja  va  2 s. c  o  m*/
public void openHelpManual() {
    // open manual
    Window.open(HELP_URL, "_blank", null);
}

From source file:edu.du.penrose.systems.fedoraApp.web.gwt.batchIngest.client.BatchIngestStatus.java

License:Open Source License

void enableNewBatch(String batch_set) {

    BatchIngestThreadManagerServiceAsync threadMangerService = this.getThreadManagerService();

    AsyncCallback callBackResults = new AsyncCallback() {
        public void onFailure(Throwable exception) {
            displayException(exception);
        }//w w  w . ja  va 2 s  . co m

        public void onSuccess(Object result) {
            displayStatusBar("New batch set enabled");
            Window.open(contextURL + "batchIngest.htm", "_self", null);
        }
    };

    threadMangerService.removeBatchset(batch_set, callBackResults);
}

From source file:edu.du.penrose.systems.fedoraApp.web.gwt.batchIngest.client.BatchIngestStatus.java

License:Open Source License

protected void forceImediateStopOfBatchIngest(String batch_set) {

    BatchIngestThreadManagerServiceAsync threadMangerService = this.getThreadManagerService();

    AsyncCallback callBackResults = new AsyncCallback() {
        public void onFailure(Throwable exception) {
            displayException(exception);
        }//from  w  ww .  ja  v a2s .com

        public void onSuccess(Object result) {
            displayStatusBar("New batch set enabled");
            Window.open(contextURL + "batchIngest.htm", "_self", null);
        }
    };

    threadMangerService.forceHardStop(batch_set, callBackResults);
}

From source file:edu.du.penrose.systems.fedoraApp.web.gwt.batchIngest.client.BatchIngestStatus.java

License:Open Source License

protected Panel getIngestCompletePanel(String batch_set) {

    final String myBatch_set = batch_set;

    final Button viewIngestReportBtn = new Button("View Ingest Report"); // TBD magic#
    final Button viewPidReportBtn = new Button("View PID Report");
    final Button enableNewBatchBtn = new Button("Enable New Batch");

    viewIngestReportBtn.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            displayStatusBar("Opening Batch Ingest Report");
            Window.open(CONTEXT_URL + "batchIngestReport.htm?" + BATCH_SET_REQUEST_PARAM + "=" + myBatch_set,
                    "_blank", null);
        }/*w w  w.  ja  v a  2s.c  om*/
    });
    viewPidReportBtn.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            displayStatusBar("Opening Batch PID Report");
            Window.open(CONTEXT_URL + "batchIngestPidReport.htm?" + BATCH_SET_REQUEST_PARAM + "=" + myBatch_set,
                    "_blank", null);
        }
    });
    enableNewBatchBtn.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            displayStatusBar("Enabling new Batch Ingest for " + myBatch_set);
            enableNewBatch(myBatch_set);
        }
    });

    VerticalPanel statusBtnPanel = new VerticalPanel();
    statusBtnPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    statusBtnPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    statusBtnPanel.add(viewIngestReportBtn);
    statusBtnPanel.add(viewPidReportBtn);

    statusBtnPanel.add(new HTML("<br>"));

    /*
     * Normally we don't want to display the enable new batch button for remote or background tasks, since they will be re-enabled
     * automatically UNLESS they were stopped by the user, in which case the user has to re-enable them.
     */
    if (!(myBatch_set.contains(REMOTE_TASK_NAME_SUFFIX) || myBatch_set.contains(BACKGROUND_TASK_NAME_SUFFIX))) {
        statusBtnPanel.add(enableNewBatchBtn);
    } else {
        if (userStopptedStatus) {
            statusBtnPanel.add(enableNewBatchBtn);
        }

    }

    statusBtnPanel.setStyleName("statusBtnPanel");

    return statusBtnPanel;
}

From source file:edu.iastate.airl.semtus.client.SEMTUSWEBAPP.java

License:Open Source License

public Widget createMenu() {

    Command menuCommandNws = new Command() {

        public void execute() {

            tabPanel.selectTab(0);//from w  ww  .  j a  v a 2s.c  o  m
            inputField.selectAll();
            resultField.selectAll();
            panelHoldingTabPanel.setVisible(true);
        }
    };

    Command menuCommandLom = new Command() {

        public void execute() {

            uploadBox.center();
        }
    };

    Command menuCommandEx = new Command() {

        public void execute() {

            tabPanel.selectTab(0);
            inputField.setText(
                    "Input some text based on the uploaded ontology for analysis.\n\n [PS: Remember to upload an ontology model for your domain to get relevant results.");
            resultField.setText("Send some text for processing before trying to view the results in this tab.");
            level = LEVEL_ONE;
            panelHoldingTabPanel.setVisible(false);
        }
    };

    Command menuCommandPod = new Command() {

        public void execute() {

            announcementLabel.setHTML(
                    "<p align=\"center\"><b>SEMANTIXS Analysis Level has been set to 1 (default).</b><br/><br/>"
                            + "In this setting, SEMANTIXS expects an rdf/owl file as input (via upload option under File menu), containing the domain ontology (TBOX: class concepts + relationships) as well as instance assertions (A-BOX) that you expect in text.</p>");

            announcementBox.center();

            level = LEVEL_ONE;
        }
    };

    Command menuCommandUone = new Command() {

        public void execute() {

            announcementLabel
                    .setHTML("<p align=\"center\"><b>SEMANTIXS Analysis Level has been set to 2.</b><br/><br/>"
                            + "In this setting, SEMANTIXS still expects an rdf/owl file as input (via upload option under File menu), however it doesn't assume that it's complete in the sense of covering all the instances expected in text. "
                            + "It thus utilizes some pre-generated instance data (for eg., FOAF, DBPedia) in addition "
                            + "to the given ontology for acquiring knowledge, however in the current version, it won't attempt to automatically map those instances to the input ontology and instead, retain their original references.</center>");

            announcementBox.center();

            level = LEVEL_TWO;
        }
    };

    Command menuCommandUowe = new Command() {

        public void execute() {

            announcementLabel
                    .setHTML("<p align=\"center\"><b>SEMANTIXS Analysis Level has been set to 3.</b><br/><br/>"
                            + "In this setting, SEMANTIXS still expects an rdf/owl file as input (via upload option under File menu), however it doesn't assume that it's complete in the sense of covering all the relationships expected in text, or the instance data. "
                            + "Thus, it sacrifices some correctness for exploring wilderness in trying to enrich the given ontology by learning new relationships and possible classes / instances as it reads text.</center>");

            announcementBox.center();

            level = LEVEL_THREE;
        }
    };

    Command menuCommandVsg = new Command() {

        public void execute() {

            Window.open(
                    "http://" + SEMTUS_HOSTING_SERVER_NAME + ":" + SEMTUS_HOSTING_PORT_NAME + "/"
                            + SEMTUS_APP_NAME + "/visualize?lang=visual&model=output.rdf&search=&submit=search",
                    "_blank", "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no");
        }
    };

    Command menuCommandVcg = new Command() {

        public void execute() {

            tabPanel.selectTab(0);

            dialogBox.setHTML(
                    "<p align=\"center\"><font color=\"#000000\" face=\"verdana\" size=\"2\">Visualize Complete RDF Graph</font></p>");

            serverResponseLabel.removeStyleName("serverResponseLabelError");

            serverResponseLabel.setHTML("<p align=\"center\">"
                    + "In order to visualize the entire RDF graph, please click on the following button to go to the W3 Visualization servlet."
                    + " On the servlet page, please copy-paste the RDF structure generated by SEMANTIXS into the textarea titled - <b>Check by Direct Input</b>."
                    + " Set the <b>Display Result Options</b> to <b>Graph only</b> and click on <b>Parse RDF</b> to generate the graph.</p>");

            w3Button = new Button("Go to W3 Validator Servlet");

            w3Button.getElement().setId("closeButton");

            dialogVPanel.remove(closeButton);

            dialogVPanel.add(w3Button);

            dialogBox.center();

            // Add a handler to invoke W3 Servlet
            w3Button.addClickHandler(new ClickHandler() {

                public void onClick(ClickEvent event) {

                    Window.open("http://www.w3.org/RDF/Validator/", "_blank",
                            "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no");

                    dialogBox.hide();

                    dialogVPanel.remove(w3Button);

                    dialogVPanel.add(closeButton);
                }
            });
        }
    };

    Command menuCommandSo = new Command() {

        public void execute() {

        }
    };

    Command menuCommandUg = new Command() {

        public void execute() {

            panelHoldingTabPanel.setVisible(true);
        }
    };

    Command menuCommandAs = new Command() {

        public void execute() {

            tabPanel.selectTab(0);

            dialogBox.setHTML(
                    "<p align=\"center\"><font color=\"#000000\" face=\"verdana\" size=\"2\">About SEMANTIXS</font></p>");

            serverResponseLabel.removeStyleName("serverResponseLabelError");

            serverResponseLabel.setHTML("<p align=\"center\"><font color=\"#a29364\" face=\"Times\" size=\"6\">"
                    + "<b>SEMANTIXS</b></font>"
                    + "<br/><font color=\"#a29364\" face=\"Times\" size=\"3\">version 1.0.0</font><br/><br/></br></br>"
                    + "Copyright (c) <a href=\"http://sushain.com\" target=\"_blank\">Sushain Pandit</a>. All rights reserved."

                    + "<br/>"
                    + "<a href=\"http://www.cs.iastate.edu/~honavar/aigroup.html\" target=\"_blank\">Artificial Intelligence Research Lab</a>, Iowa State University.</p>");

            dialogBox.center();
        }
    };

    // Create a menu bar
    MenuBar menu = new MenuBar();
    menu.setAutoOpen(true);
    menu.setWidth("400px");
    menu.setAnimationEnabled(true);

    // menu.setStylePrimaryName("menu");

    // Create the file menu
    MenuBar fileMenu = new MenuBar(true);
    fileMenu.setAnimationEnabled(true);
    menu.addItem(new MenuItem("File", fileMenu));

    String[] fileOptions = new String[] { "New Workspace", "Load Ontology Model", "Exit" };

    fileMenu.addItem(fileOptions[0], menuCommandNws);
    fileMenu.addSeparator();
    fileMenu.addItem(fileOptions[1], menuCommandLom);
    fileMenu.addSeparator();
    fileMenu.addItem(fileOptions[2], menuCommandEx);

    menu.addSeparator();

    // Create the edit menu
    MenuBar editMenu = new MenuBar(true);
    menu.addItem(new MenuItem("Analysis Complexity", editMenu));
    String[] editOptions = new String[] { "Level 1 (default) - Purely Ontology Dependent [No Enrichment]",
            "Level 2 - Utilizes Ontology + other sources [No Enrichment]",
            "Level 3 - Utilizes Ontology + other sources [With Enrichment]" };

    editMenu.addItem(editOptions[0], menuCommandPod);
    editMenu.addSeparator();
    editMenu.addItem(editOptions[1], menuCommandUone);
    editMenu.addSeparator();
    editMenu.addItem(editOptions[2], menuCommandUowe);

    menu.addSeparator();

    // Create the GWT menu
    MenuBar gwtMenu = new MenuBar(true);
    menu.addItem(new MenuItem("User Options", true, gwtMenu));
    String[] gwtOptions = new String[] { "Analyze RDF sub-graphs", "Visualize complete RDF graph",
            "Output file in .rdf Format" };

    gwtMenu.addItem(gwtOptions[0], menuCommandVsg);
    gwtMenu.addSeparator();
    gwtMenu.addItem(gwtOptions[1], menuCommandVcg);
    gwtMenu.addSeparator();
    gwtMenu.addItem(gwtOptions[2], menuCommandSo);

    // Create the help menu
    MenuBar helpMenu = new MenuBar(true);
    menu.addSeparator();
    menu.addItem(new MenuItem("Help", helpMenu));
    String[] helpOptions = new String[] { "User Guide", "About SEMANTIXS" };

    helpMenu.addItem(helpOptions[0], menuCommandUg);
    helpMenu.addSeparator();
    helpMenu.addItem(helpOptions[1], menuCommandAs);

    // Return the menu
    menu.ensureDebugId("cwMenuBar");

    return menu;
}