/******************************************************************************* * Copyright (c) 2012, 2015 EclipseSource and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * EclipseSource - initial API and implementation ******************************************************************************/ package org.eclipse.rap.rwt.internal.client; import org.eclipse.rap.json.JsonObject; import org.eclipse.rap.rwt.RWT; import org.eclipse.rap.rwt.client.service.UrlLauncher; import org.eclipse.rap.rwt.internal.remote.ConnectionImpl; import org.eclipse.rap.rwt.remote.RemoteObject; public class UrlLauncherImpl implements UrlLauncher { private static final String TYPE = "rwt.client.UrlLauncher"; private final RemoteObject remoteObject; public UrlLauncherImpl() { ConnectionImpl connection = ( ConnectionImpl )RWT.getUISession().getConnection(); remoteObject = connection.createServiceObject( TYPE ); } @Override public void openURL( String url ) { remoteObject.call( "openURL", new JsonObject().add( "url", url ) ); } }