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.isotrol.impe3.pms.gui.client.widget.portalmanagement.PortalLeftMenu.java

License:Open Source License

/**
 * Preview the portal in offline mode//  w w w.  ja  va 2 s.  c  om
 * @param portalId
 * @param name
 */
private void tryGetOfflineUrl(String portalId, final String name) {

    AsyncCallback<String> callback = new AsyncCallback<String>() {
        public void onFailure(Throwable arg0) {
            errorProcessor.processError(arg0, errorMessageResolver,
                    getPmsMessages().msgErrorGetPortalOfflineUrl(name));
        }

        public void onSuccess(String arg0) {
            Window.open(arg0, name, PmsConstants.NEW_WINDOW_FEATURES);
        }
    };

    portalsService.getOfflineURL(portalId, callback);
}

From source file:com.isotrol.impe3.pms.gui.client.widget.portalmanagement.PortalLeftMenu.java

License:Open Source License

/**
 * Preview the portal in online mode//from w  w  w . j  a  va2  s.  c o  m
 * @param portalId
 * @param name
 */
private void tryGetOnlineUrl(String portalId, final String name) {

    AsyncCallback<String> callback = new AsyncCallback<String>() {
        public void onFailure(Throwable arg0) {
            errorProcessor.processError(arg0, errorMessageResolver,
                    getPmsMessages().msgErrorGetPortalOnlineUrl(name));
        }

        public void onSuccess(String arg0) {
            Window.open(arg0, name, PmsConstants.NEW_WINDOW_FEATURES);
        }
    };

    portalsService.getOnlineURL(portalId, callback);
}

From source file:com.italianasoftware.echoes.client.Echoes.java

License:Open Source License

private void createAboutDialog() {
    aboutDialog = new DialogBox();
    VerticalPanel vPanel = new VerticalPanel();
    vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
    aboutDialog.add(vPanel);//from   w ww  .j  a va  2 s.c o  m
    vPanel.add(new HTML("<strong>Echoes</strong>"));
    VerticalPanel cPanel = new VerticalPanel();
    vPanel.add(cPanel);
    cPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
    cPanel.addStyleName("margintop-2em");
    cPanel.add(new HTML("(C) 2008, <a href=\"mailto:fmontesi@italianasoftware.com\">Fabrizio Montesi</a>"));
    HTML oxygenTeam = new HTML(
            "Echoes logo by <a href=\"http://www.oxygen-icons.org/\" target=\"_new\">the Oxygen team</a>");
    oxygenTeam.addStyleName("margintop-1em");
    cPanel.add(oxygenTeam);

    HTML license = new HTML(
            "License: <a href=\"http://www.gnu.org/licenses/old-licenses/gpl-2.0.html\" target=\"_new\">GPLv2</a>");
    license.addStyleName("margintop-1em");
    cPanel.add(license);

    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    hPanel.addStyleName("margintop-1em");
    HTML poweredBy = new HTML("Powered by: ");
    hPanel.add(poweredBy);
    Image jolieImage = new Image("images/jolie.png");
    jolieImage.addClickListener(new ClickListener() {
        public void onClick(Widget arg0) {
            Window.open("http://jolie.sourceforge.net/", "_blank", "");
        }
    });
    hPanel.add(jolieImage);
    cPanel.add(hPanel);

    Button closeButton = new NativeButton("Close");
    closeButton.addStyleName("margintop-1em");
    closeButton.addClickListener(new ClickListener() {
        public void onClick(Widget arg0) {
            aboutDialog.hide();
        }
    });
    vPanel.add(closeButton);
}

From source file:com.jci.client.application.ui.socialmedia.ShareWindow.java

License:Apache License

void open(String url) {
    Window.open(url, NAME, features);
}

From source file:com.levigo.jadice.web.demo.desktop.client.OpenURLSelectionListener.java

License:Open Source License

@Override
public void componentSelected(MenuEvent me) {
    Window.open(url, "_blank", "");
}

From source file:com.mclub.client.app.AppModel.java

License:GNU General Public License

/**
 * Ana menu formunun sqg ust kisminda yer alacak diller combosunu doner, 
 * null donulurse coklu dil destegi olmayacaktir
 * /*w ww. j av  a2s  . co  m*/
 */
@Override
public Component getLangListWidget() {
    ComboBox<ImageItem> combo = InstantComponent.getComboLang();
    combo.setForceSelection(true);
    combo.setEditable(false);
    combo.setTypeAhead(true);
    combo.setTriggerAction(TriggerAction.ALL);

    String currentLocale = LocaleInfo.getCurrentLocale().getLocaleName();
    if (currentLocale.equals("default"))
        currentLocale = "tr";

    for (ImageItem ii : combo.getStore().getModels()) {
        if (ii.getStringVal().equals(currentLocale)) {
            combo.setValue(ii);
        }
    }

    combo.addSelectionChangedListener(new SelectionChangedListener<ImageItem>() {
        @Override
        public void selectionChanged(SelectionChangedEvent<ImageItem> se) {

            String url = Window.Location.getHref();
            int pos = url.indexOf("locale=");

            if (pos > 0) {
                url = url.substring(0, pos + 7) + se.getSelectedItem().getStringVal();
            } else {
                url += "&locale=" + se.getSelectedItem().getStringVal();
            }
            Window.open(url, "_self", "");
        }
    });

    return combo;
}

From source file:com.mecatran.otp.gwt.client.view.AlertWidget.java

License:Open Source License

public AlertWidget(AlertBean alert) {
    VerticalPanel rootPanel = new VerticalPanel();

    FocusPanel headerPanel = new FocusPanel();
    rootPanel.add(headerPanel);// w  ww .  ja  v a 2  s  . c  o  m
    headerPanel.addStyleName("alert-header");
    HorizontalPanel titleAndButtonPanel = new HorizontalPanel();
    headerPanel.add(titleAndButtonPanel);
    Label icon = new Label("");
    icon.addStyleName(alert.getLevel() == AlertBean.LEVEL_INFO ? "info-icon" : "warn-icon");
    titleAndButtonPanel.add(icon);
    Label alertTitle = new Label(alert.getTitle());
    alertTitle.addStyleName("alert-title");
    titleAndButtonPanel.add(alertTitle);

    final SimplePanel collapsibleOuterPanel = new SimplePanel();
    rootPanel.add(collapsibleOuterPanel);
    collapsibleOuterPanel.addStyleName("alert-details-outer");
    VerticalPanel collapsibleInnerPanel = new VerticalPanel();
    collapsibleOuterPanel.add(collapsibleInnerPanel);
    collapsibleInnerPanel.addStyleName("alert-details-inner");
    if (DISPLAY_ALERT_DATE && alert.isPublishActiveRange()
            && (alert.getFrom() != null || alert.getTo() != null)) {
        Label dateRangeLabel = new Label(formatDateRange(alert.getFrom(), alert.getTo()));
        collapsibleInnerPanel.add(dateRangeLabel);
        dateRangeLabel.addStyleName("alert-datetime");
    }
    Label descriptionLabel = new Label(alert.getDescription());
    collapsibleInnerPanel.add(descriptionLabel);
    descriptionLabel.addStyleName("alert-description");
    if (alert.getUrl() != null && alert.getUrl().length() > 0) {
        final String url = alert.getUrl();
        Anchor moreInfoAnchor = new Anchor(I18nUtils.tr("more.info.alert"));
        moreInfoAnchor.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                Window.open(url, "_blank", "");
            }
        });
        moreInfoAnchor.addStyleName("alert-url");
        collapsibleInnerPanel.add(moreInfoAnchor);
    }
    initWidget(rootPanel);
}

From source file:com.msco.mil.client.com.sencha.gxt.explorer.client.forms.AdvancedComboBoxExample.java

License:sencha.com license

public Widget asWidget() {

    if (vp == null) {
        vp = new VerticalPanel();
        vp.setSpacing(10);/*from   w  ww .  j  ava 2  s.  c o m*/

        String url = "http://www.sencha.com/forum/topics-remote.php";

        ScriptTagProxy<ForumLoadConfig> proxy = new ScriptTagProxy<ForumLoadConfig>(url);
        proxy.setWriter(
                new UrlEncodingWriter<ForumLoadConfig>(TestAutoBeanFactory.instance, ForumLoadConfig.class));

        JsoReader<ForumListLoadResult, ForumCollection> reader = new JsoReader<ForumListLoadResult, ForumCollection>(
                TestAutoBeanFactory.instance, ForumCollection.class) {
            @Override
            protected ForumListLoadResult createReturnData(Object loadConfig, ForumCollection records) {
                PagingLoadConfig cfg = (PagingLoadConfig) loadConfig;
                ForumListLoadResult res = TestAutoBeanFactory.instance.dataLoadResult().as();
                res.setData(records.getTopics());
                res.setOffset(cfg.getOffset());
                res.setTotalLength(Integer.parseInt(records.getTotalCount()));
                return res;
            }
        };

        PagingLoader<ForumLoadConfig, ForumListLoadResult> loader = new PagingLoader<ForumLoadConfig, ForumListLoadResult>(
                proxy, reader);
        loader.useLoadConfig(TestAutoBeanFactory.instance.loadConfig().as());
        loader.addBeforeLoadHandler(new BeforeLoadHandler<ForumLoadConfig>() {
            @Override
            public void onBeforeLoad(BeforeLoadEvent<ForumLoadConfig> event) {
                String query = combo.getText();
                if (query != null && !query.equals("")) {
                    event.getLoadConfig().setQuery(query);
                }
            }
        });

        ForumProperties props = GWT.create(ForumProperties.class);

        ListStore<Forum> store = new ListStore<Forum>(props.topicId());
        loader.addLoadHandler(
                new LoadResultListStoreBinding<ForumLoadConfig, Forum, ForumListLoadResult>(store));

        final Bundle b = GWT.create(Bundle.class);
        b.css().ensureInjected();

        final ExampleTemplate template = GWT.create(ExampleTemplate.class);

        ListView<Forum, Forum> view = new ListView<Forum, Forum>(store, new IdentityValueProvider<Forum>());
        view.setCell(new AbstractCell<Forum>() {

            @Override
            public void render(com.google.gwt.cell.client.Cell.Context context, Forum value,
                    SafeHtmlBuilder sb) {
                sb.append(template.render(value, b.css()));
            }
        });

        ComboBoxCell<Forum> cell = new ComboBoxCell<Forum>(store, props.title(), view);

        combo = new ComboBox<Forum>(cell);
        combo.setLoader(loader);
        combo.setWidth(580);
        combo.setHideTrigger(true);
        combo.setPageSize(10);
        combo.addBeforeSelectionHandler(new BeforeSelectionHandler<Forum>() {

            @Override
            public void onBeforeSelection(BeforeSelectionEvent<Forum> event) {
                event.cancel();
                Forum f = combo.getListView().getSelectionModel().getSelectedItem();
                Window.open(
                        "http://sencha.com/forum/showthread.php?t=" + f.getTopicId() + "&p=" + f.getPostId(),
                        null, null);
            }
        });

        combo.getElement().getStyle().setMargin(10, Unit.PX);

        ContentPanel cp = new ContentPanel();
        cp.setWidth(600);
        cp.setHeadingText("Search the Sencha Forums");
        cp.add(combo);
        cp.setResize(false);

        vp.add(cp);
    }

    return vp;
}

From source file:com.nabla.wapp.report.client.PrintManager.java

License:Apache License

private void displayReport(final Integer reportId) {
    // open window and display report
    if (reportId != null) {
        final String reportUrl = reportUrlFormat + reportId.toString();
        log.fine("report= " + reportUrl);
        Window.open(reportUrl, "_blank", null);
    }//from w w  w  .  j ava 2 s  . c  o  m
}

From source file:com.objetdirect.gwt.umldrawer.client.DrawerContainer.java

License:Open Source License

@UiHandler("exportToSvg")
void clickExportToSvg(ClickEvent event) {
    String svg = "<?xml version='1.0' standalone='no'?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>";
    //      Session.getActiveCanvas().clearArrows(); //TODO
    svg += DOM.getInnerHTML((Element) umlCanvas.getContainer().getElement().getFirstChildElement());
    Window.open("data:image/xml+svg;charset=utf-8," + svg, "SVG export", "top");
    //      Session.getActiveCanvas().makeArrows(); //TODO
}