Java Code Examples for com.google.gwt.user.client.Window#open()

The following examples show how to use com.google.gwt.user.client.Window#open() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseWidgetMenuItemFactory.java    From EasyML with Apache License 2.0 6 votes vote down vote up
/**
 * Create DownloadDataItem
 * @param com
 * @return DownloadDataItem
 */
public static MenuItem createDownloadData(HasRightMouseUpMenu com) {
	Command command = new MenuItemCommand(com) {

		@Override
		public void execute() {

			DatasetWidget widget = (DatasetWidget) this.component;
			widget.getContextMenu().hide();
			OutNodeShape shape = widget.getOutNodeShapes().get(0);
			String filename = shape.getAbsolutePath() + "/" + shape.getFileId();
			String url = GWT.getModuleBaseURL().split("EMLStudio")[0]
					+ "EMLStudioMonitor/filedownload?filename=" + filename;
			Window.open(url, "_blank", "status=0,toolbar=0,menubar=0,location=0");

		}

	};

	MenuItem item = new MenuItem("Download", command);
	return item;
}
 
Example 2
Source File: FileCallback.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
public void onSuccess(RepresentationResponse result) {
    removeRequest();
    try {
        FileResponse resp = (FileResponse) result;
        Window.open(GWT.getHostPageBaseURL() + resp.getURL(), "_blank", "width=500,height=500");
        EventBus.getMainEventBus().fireEvent(new ExportFinishedEvent());
    }
    catch (Exception e) {
        ExceptionHandler.handleUnexpectedException(e);
    }
}
 
Example 3
Source File: LogStore.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Process(actionType = DownloadLogFile.class)
public void downloadLogFile(final DownloadLogFile action, final Dispatcher.Channel channel) {
    if (bootstrap.isSsoEnabled()) 
        DownloadUtil.downloadHttpGet(streamUrl(action.getName()), action.getName(), DMRHandler.getBearerToken());
    else 
        Window.open(streamUrl(action.getName()), "", "");
    
    channel.ack();
}
 
Example 4
Source File: ErrorPopup.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
public void onClick(ClickEvent event) {
	Log.debug("onClick(" + event + ")");
	hide();
	// Removes all previous text for next errors messages, varios errors can be added simultanealy
	// on show(String msg )
	text.setText("");

	if (logout) {
		Log.debug("onClick: redirect");
		Window.open("index.jsp", "_self", "");
	}

	Log.debug("onClick: void");
}
 
Example 5
Source File: UniTimeMenuBar.java    From unitime with Apache License 2.0 5 votes vote down vote up
protected void openUrl(String name, String url, String target) {
	if (target == null)
		LoadingWidget.getInstance().show();
	if ("dialog".equals(target)) {
		UniTimeFrameDialog.openDialog(name, url);
	} else if ("eval".equals(target)) {
		ToolBox.eval(url);
	} else if ("download".equals(target)) {
		ToolBox.open(url);
	} else if ("tab".equals(target)) {
		Window.open(url, "_blank", "");
	} else {
		ToolBox.open(GWT.getHostPageBaseURL() + url);
	}
}
 
Example 6
Source File: FoxmlViewAction.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public void view(String pid, String batchId) {
    if (pid == null) {
        throw new IllegalArgumentException("pid");
    }
    StringBuilder sb = new StringBuilder();
    sb.append(RestConfig.URL_DIGOBJECT_DISSEMINATION);
    sb.append('?').append(DigitalObjectResourceApi.DIGITALOBJECT_PID).append('=').append(pid);
    if (batchId != null) {
        sb.append('&').append(DigitalObjectResourceApi.BATCHID_PARAM).append('=').append(batchId);
    }
    Window.open(sb.toString(), "_blanc", "");
}
 
Example 7
Source File: UniTimeSideBar.java    From unitime with Apache License 2.0 5 votes vote down vote up
protected void openUrl(String name, String url, String target) {
	if (target == null)
		LoadingWidget.getInstance().show();
	if ("dialog".equals(target)) {
		UniTimeFrameDialog.openDialog(name, url);
	} else if ("download".equals(target)) {
		ToolBox.open(url);
	} else if ("eval".equals(target)) {
		ToolBox.eval(url);
	} else if ("tab".equals(target)) {
		Window.open(url, "_blank", "");
	} else {
		ToolBox.open(GWT.getHostPageBaseURL() + url);
	}
}
 
Example 8
Source File: UniTimeMobileMenu.java    From unitime with Apache License 2.0 5 votes vote down vote up
protected void openUrl(String name, String url, String target) {
	if (target == null)
		LoadingWidget.getInstance().show();
	if ("dialog".equals(target)) {
		UniTimeFrameDialog.openDialog(name, url);
	} else if ("download".equals(target)) {
		ToolBox.open(url);
	} else if ("eval".equals(target)) {
		ToolBox.eval(url);
	} else if ("tab".equals(target)) {
		Window.open(url, "_blank", "");
	} else {
		ToolBox.open(GWT.getHostPageBaseURL() + url);
	}
}
 
Example 9
Source File: GettingStartedView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnDemoStarter")
void onDemoStarter(ClickEvent e) {
    Window.open(constants.demoStarterUrl(), "_blank", "");
}
 
Example 10
Source File: AbstractSocialButton.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 4 votes vote down vote up
protected void socialize() {
	String url = this.buildSocialUrl();
	Window.open(url, "", this.buildPopupFeature());
}
 
Example 11
Source File: TableDisplayerView.java    From dashbuilder with Apache License 2.0 4 votes vote down vote up
@Override
public void exportFileUrl(String url) {
    Window.open(url, "downloading", "resizable=no,scrollbars=yes,status=no");
}
 
Example 12
Source File: GettingStartedView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnSourceStarter")
void onSourceStarter(ClickEvent e) {
    Window.open(constants.sourceStarterUrl(), "_blank", "");
}
 
Example 13
Source File: ApplicationView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("imgGPlus")
void onGPlus(ClickEvent e) {
    Window.open("https://plus.google.com/communities/108005250093449814286", "", "_blank");
}
 
Example 14
Source File: CubaFileDownloaderConnector.java    From cuba with Apache License 2.0 4 votes vote down vote up
public void viewDocumentById(String resourceId) {
    final String url = getResourceUrl(resourceId);
    if (url != null && !url.isEmpty()) {
        Window.open(url, "_blank", "");
    }
}
 
Example 15
Source File: MainMenu.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void execute() {
	Window.open(Main.CONTEXT + "/admin/index.jsp", "Administration", "");
}
 
Example 16
Source File: LogoutPopup.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
public void onClick(ClickEvent event) {
	super.hide();
	Window.open("index.jsp", "_self", null);
}
 
Example 17
Source File: TopPanel.java    From appinventor-extensions with Apache License 2.0 4 votes vote down vote up
@Override
public void onClick(ClickEvent clickEvent) {
  Window.open(url, WINDOW_OPEN_LOCATION, WINDOW_OPEN_FEATURES);
}
 
Example 18
Source File: TopToolbar.java    From appinventor-extensions with Apache License 2.0 4 votes vote down vote up
@Override
public void execute() {
  Window.open(url, WINDOW_OPEN_LOCATION, WINDOW_OPEN_FEATURES);
}