List of usage examples for com.google.gwt.user.client Window open
public static void open(String url, String name, String features)
From source file:com.badlogic.gdx.backends.gwt.GwtNet.java
License:Apache License
@Override public boolean openURI(String URI) { Window.open(URI, "_blank", null); return true; }
From source file:com.brainz.wokhei.client.home.OrderBrowserModulePart.java
private void setupDownloadStuff(final Status status) { downloadPanel = new VerticalPanel(); downloadPanel.setSpacing(5);/*from w w w. j a v a 2s . com*/ Label downloadPng = new Label(Messages.DOWNLOAD_RASTERIZED.getString()); downloadPng.setStyleName("labelButton"); downloadPng.addStyleName("downloadLabelLink"); downloadPng.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (status.equals(Status.BOUGHT)) { Window.open(GWT.getHostPageBaseURL() + "wokhei/getfile?orderid=" + _currentOrder.getId() + "&fileType=" + FileType.PNG_LOGO, "_new", ""); } } }); downloadPanel.add(downloadPng); if (status.equals(Status.BOUGHT)) { Label downloadPdf = new Label(Messages.DOWNLOAD_VECTORIAL.getString()); downloadPdf.setStyleName("labelButton"); downloadPdf.addStyleName("downloadLabelLink"); downloadPdf.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Window.open(GWT.getHostPageBaseURL() + "wokhei/getfile?orderid=" + _currentOrder.getId() + "&fileType=" + FileType.PDF_VECTORIAL_LOGO, "_new", ""); } }); downloadPanel.add(downloadPdf); } downloadPanelContainer.add(downloadPanel); }
From source file:com.bramosystems.oss.player.core.client.PlayerUtil.java
License:Apache License
/** * Returns a widget that may be used to notify the user when a required plugin * is not available. The widget provides a link to the plugin download page. * * <h4>CSS Style Rules</h4>//w w w . jav a 2s . co m * <ul> * <li>.player-MissingPlugin { the missing plugin widget }</li> * <li>.player-MissingPlugin-title { the title section }</li> * <li>.player-MissingPlugin-message { the message section }</li> * </ul> * * @param plugin the missing plugin * @param title the title of the message * @param message descriptive message to notify user about the missing plugin * @param asHTML {@code true} if {@code message} should be interpreted as HTML, * {@code false} otherwise. * * @return missing plugin widget. * @since 0.6 */ public static Widget getMissingPluginNotice(final Plugin plugin, String title, String message, boolean asHTML) { DockPanel dp = new DockPanel() { @Override public void onBrowserEvent(Event event) { super.onBrowserEvent(event); switch (event.getTypeInt()) { case Event.ONCLICK: if (plugin.getDownloadURL().length() > 0) { Window.open(plugin.getDownloadURL(), "dwnload", ""); } } } }; dp.setHorizontalAlignment(DockPanel.ALIGN_LEFT); dp.sinkEvents(Event.ONCLICK); dp.setWidth("200px"); Label titleLb = null, msgLb = null; if (asHTML) { titleLb = new HTML(title); msgLb = new HTML(message); } else { titleLb = new Label(title); msgLb = new Label(message); } dp.add(titleLb, DockPanel.NORTH); dp.add(msgLb, DockPanel.CENTER); titleLb.setStylePrimaryName("player-MissingPlugin-title"); msgLb.setStylePrimaryName("player-MissingPlugin-message"); dp.setStylePrimaryName("player-MissingPlugin"); DOM.setStyleAttribute(dp.getElement(), "cursor", "pointer"); return dp; }
From source file:com.codenvy.plugin.contribution.client.parts.contribute.ContributePartPresenter.java
License:Open Source License
@Override public void onOpenPullRequestOnVcsHost() { final Context context = workflow.getContext(); vcsHostingServiceProvider.getVcsHostingService(new AsyncCallback<VcsHostingService>() { @Override/*from w ww. j a va 2 s. c om*/ public void onFailure(final Throwable exception) { notificationHelper.showError(ContributePartPresenter.class, exception); } @Override public void onSuccess(final VcsHostingService vcsHostingService) { Window.open(vcsHostingService.makePullRequestUrl(context.getUpstreamRepositoryOwner(), context.getUpstreamRepositoryName(), context.getPullRequestIssueNumber()), "", ""); } }); }
From source file:com.codenvy.plugin.contribution.client.parts.contribute.ContributePartPresenter.java
License:Open Source License
@Override public void onNewContribution() { final Factory factory = appContext.getFactory(); if (factory != null) { final String createProjectUrl = FactoryHelper.getCreateProjectRelUrl(factory); if (createProjectUrl != null) { Window.open(createProjectUrl, "", ""); }// w w w .j a va2 s . c o m } else { final Context context = workflow.getContext(); vcsServiceProvider.getVcsService().checkoutBranch(context.getProject(), context.getClonedBranchName(), false, new AsyncCallback<String>() { @Override public void onFailure(final Throwable exception) { notificationHelper.showError(ContributePartPresenter.class, exception); } @Override public void onSuccess(final String branchName) { view.setContributionBranchName(context.getClonedBranchName()); view.setContributionBranchNameEnabled(true); view.setContributionTitle(""); view.setContributionTitleEnabled(true); view.setContributionComment(""); view.setContributionCommentEnabled(true); view.setContributeButtonText( messages.contributePartConfigureContributionSectionButtonContributeText()); view.hideStatusSection(); view.hideStatusSectionMessage(); view.hideNewContributionSection(); updateMode = false; updateControls(); notificationHelper .showInfo(messages.contributePartNewContributionBranchClonedCheckedOut( context.getClonedBranchName())); } }); } }
From source file:com.cubusmail.client.actions.message.ShowMessageSourceAction.java
License:Open Source License
public void execute() { long[] messageIds = getSelectedIds(); if (messageIds != null && messageIds.length > 0) { String messageId = Long.toString(messageIds[0]); String url = ServiceProvider.getMessageSourceServletUrl(messageId); Window.open(url, "MessageSource", ""); }/*from ww w . j av a2s .c o m*/ }
From source file:com.cubusmail.client.actions.message.ViewAttachmentAction.java
License:Open Source License
@Override public void execute() { long messageId = this.attachment.getMessageId(); int index = this.attachment.getIndex(); String url = ServiceProvider.getRetrieveAttachmentServletUrl(messageId, index); url += "&view=1"; Window.open(url, "Download", ""); }
From source file:com.data2semantics.yasgui.client.helpers.Helper.java
License:Open Source License
/** * Create a label element which opens a new window for a given url * /* ww w . j a v a2 s. c o m*/ * @param message Text of link * @param url Url to open page for * @return Label */ public static Label getLinkNewWindow(String message, final String url) { return getLink(message, new ClickHandler() { @Override public void onClick(ClickEvent event) { Window.open(url, "_blank", null); } }); }
From source file:com.data2semantics.yasgui.client.tab.results.output.ResultGrid.java
License:Open Source License
protected Canvas getRollOverCanvas(final Integer rowNum, Integer colNum) { rollOverRecord = getRecord(rowNum);/*from ww w.j a va 2s .c o m*/ if (rollOverRecord != null) { String varName = getFieldName(colNum); final String value = rollOverRecord.getAttribute(varName); if (value != null && value.startsWith("http")) { //the check above is done to avoid needing to use the solutions hashtable (might be a performance thingy) if (rollOverCanvas == null) { rollOverCanvas = new HLayout(); rollOverCanvas.setSnapTo("TR"); rollOverCanvas.setWidth(22); rollOverCanvas.setHeight(22); ImgButton openExtLink = new ImgButton(); openExtLink.setShowDown(false); openExtLink.setShowRollOver(false); openExtLink.setLayoutAlign(Alignment.CENTER); openExtLink.setSrc(Imgs.get(Imgs.EXTERNAL_LINK)); openExtLink.setPrompt("Open resource in new browser window"); openExtLink.setHeight(16); openExtLink.setWidth(16); openExtLink.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Window.open(value, "_blank", ""); } }); rollOverCanvas.addMember(openExtLink); } return rollOverCanvas; } } //this isnt a url. don't show rollover return getEmptyCanvas(); }
From source file:com.dawg6.web.dhcalc.client.GearPanel.java
License:Open Source License
protected void clickItem(Slot slot) { ItemHolder item = items.get(slot);/*from w ww . j ava 2 s.co m*/ if (item != null) { Window.open("json?realm=US&item=" + URL.encodeQueryString(item.tooltip), "_blank", ""); } }