® Expeditor has an integrated browser application within the workbench. You can use the
Expeditor to implement a hypertext link in your application that, when clicked, opens the Web address in a browser view. You can set the browser view to be an embedded browser in the application tabs or an external browser.
To access a web address in your application by launching an integrated browser application, perform the following procedure:
package com.ibm.rcp.samples.ui.browser.launcher;
import java.util.HashMap;
import java.util.Map;
import com.ibm.rcp.ui.browser.BrowserPreference;
import com.ibm.rcp.ui.browser.launcher.BrowserLauncher;
public class urlLauncher{
private static final String BROWSER_VIEW_ID =
"com.ibm.rcp.ui.samples.browsertab"; //$NON-NLS-1$
private static int counter;
public boolean launchURL(String url){
BrowserLauncher launcher=BrowserLauncher.getLauncher();
return launcher.launchURLasDefault(url);
}
public boolean launchURLasEmbed(String url){
final String secondaryId = BROWSER_VIEW_ID + Integer.toString(++counter);
Map configMap = new HashMap();
configMap.put(BrowserPreference.ID, secondaryId);
BrowserLauncher bLauncher=BrowserLauncher.getLauncher();
return bLauncher.launchURLasEmbedded(url,null, configMap);
}
public boolean launchURLasExternal(String url){
BrowserLauncher launcher=BrowserLauncher.getLauncher();
return launcher.launchURLasExternal(url);
}
}