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:org.eclipse.che.ide.ext.svn.client.export.ExportPresenter.java
License:Open Source License
/** {@inheritDoc} */ @Override/*from w w w. j av a 2s.c o m*/ public void onExportClicked() { final String projectPath = getCurrentProjectPath(); if (projectPath == null) { return; } final String exportPath = MoreObjects.firstNonNull( Strings.emptyToNull(relPath(projectPath, ((StorableNode) selectedNode).getPath())), "."); final String revision = view.isRevisionSpecified() ? view.getRevision() : null; final Notification notification = new Notification(constants.exportStarted(exportPath), PROGRESS); notificationManager.showNotification(notification); view.onClose(); char prefix = '?'; StringBuilder url = new StringBuilder(baseHttpUrl + "/export" + projectPath); if (!Strings.isNullOrEmpty(exportPath)) { url.append(prefix).append("path").append('=').append(exportPath); prefix = '&'; } if (!Strings.isNullOrEmpty(revision)) { url.append(prefix).append("revision").append('=').append(revision); } Window.open(url.toString(), "_self", ""); }
From source file:org.eclipse.che.ide.ext.web.html.PreviewAction.java
License:Open Source License
@Override public void actionPerformed(ActionEvent e) { final Resource selectedResource = appContext.getResource(); if (Resource.FILE == selectedResource.getResourceType()) { final String contentUrl = ((File) selectedResource).getContentUrl(); Window.open(wsAgentURLModifier.modify(contentUrl), "_blank", null); }/* ww w .ja v a2 s . co m*/ }
From source file:org.eclipse.che.ide.extension.builder.client.actions.BrowseTargetFolderAction.java
License:Open Source License
/** {@inheritDoc} */ @Override//from w ww . jav a 2s. c o m public void actionPerformed(ActionEvent e) { eventLogger.log(this); if (buildContext.getBuildTaskDescriptor() != null) { String url = Window.Location.getProtocol() + "//" + Window.Location.getHost() + baseUrl + "/builder/" + Config.getCurrentWorkspace().getId() + "/browse/" + buildContext.getBuildTaskDescriptor().getTaskId() + "?path=target"; Window.open(url, "", ""); } }
From source file:org.eclipse.che.ide.imageviewer.PreviewImageAction.java
License:Open Source License
@Override public void actionPerformed(ActionEvent e) { final Resource selectedResource = appContext.getResource(); if (Resource.FILE == selectedResource.getResourceType()) { final String contentUrl = ((File) selectedResource).getContentUrl(); Window.open(wsAgentURLModifier.modify(contentUrl), "_blank", null); }/*from w w w .j a va 2s . c o m*/ }
From source file:org.eclipse.che.plugin.artik.ide.apidocs.ShowDocsAction.java
License:Open Source License
@Override public void actionPerformed(ActionEvent e) { Window.open(docsPartPresenter.getDocURL(), "_blank", null); }
From source file:org.eclipse.che.plugin.artik.ide.keyworddoc.ShowKeywordDocsAction.java
License:Open Source License
@Override public void actionPerformed(ActionEvent e) { EditorPartPresenter activeEditor = editorAgent.getActiveEditor(); if (activeEditor instanceof TextEditor) { final Document document = ((TextEditor) activeEditor).getDocument(); final TextRange textRange = document.getSelectedTextRange(); final String selectedContent = document.getContentRange(textRange); keywordDocsServiceClient.getLink(selectedContent).then(new Operation<String>() { @Override//from w ww. j ava2s.c o m public void apply(String link) throws OperationException { Window.open(appContext.getDevMachine().getAddress() + link, "_blank", null); } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError promiseError) throws OperationException { notificationManager.notify("", promiseError.getMessage(), FAIL, FLOAT_MODE); } }); } }
From source file:org.eclipse.che.plugin.pullrequest.client.parts.contribute.ContributePartPresenter.java
License:Open Source License
@Override public void onOpenPullRequestOnVcsHost() { final Context context = workflowExecutor.getCurrentContext(); Window.open(context.getVcsHostingService().makePullRequestUrl(context.getUpstreamRepositoryOwner(), context.getUpstreamRepositoryName(), context.getPullRequestIssueNumber()), "", ""); }
From source file:org.eclipse.che.plugin.svn.ide.export.ExportPresenter.java
License:Open Source License
private void openExportPopup(final String projectPath, final String exportPath, final String revision, final StatusNotification notification) { final StringBuilder url = new StringBuilder(appContext.getDevMachine().getWsAgentBaseUrl() + "/svn/" + appContext.getWorkspaceId() + "/export" + projectPath); char separator = '?'; if (!".".equals(exportPath)) { url.append(separator).append("path").append('=').append(exportPath); separator = '&'; }//from w ww .j a v a2s . co m if (!isNullOrEmpty(revision)) { url.append(separator).append("revision").append('=').append(revision); } Window.open(url.toString(), "_self", ""); notification.setTitle(constants.exportSuccessful(exportPath)); notification.setStatus(SUCCESS); }
From source file:org.eclipse.che.plugin.tour.client.action.impl.OpenURLExternalAction.java
License:Open Source License
/** * Open URL link (after performing a check). * @param link the URL link to open//w w w. ja va 2 s . c o m */ @Override public void execute(String link) { String uri = UriUtils.sanitizeUri(link); log.debug("Opening URI {0}", uri); Window.open(uri, "_blank", ""); }
From source file:org.eclipse.kapua.app.console.client.device.DeviceConfigSnapshots.java
License:Open Source License
private void downloadSnapshot() { GwtSnapshot snapshot = m_grid.getSelectionModel().getSelectedItem(); if (m_selectedDevice != null && snapshot != null) { StringBuilder sbUrl = new StringBuilder(); if (UserAgentUtils.isSafari() || UserAgentUtils.isChrome()) { sbUrl.append("console/device_snapshots?"); } else {/*from w ww . j av a2 s . com*/ sbUrl.append("device_snapshots?"); } sbUrl.append("&scopeId=").append(URL.encodeQueryString(m_currentSession.getSelectedAccount().getId())) .append("&deviceId=").append(URL.encodeQueryString(m_selectedDevice.getId())) .append("&snapshotId=").append(snapshot.getSnapshotId()); Window.open(sbUrl.toString(), "_blank", "location=no"); } }