Thursday, October 17, 2013

Launching a URL in external browser from an eclipse plugin

public class HelpHandler extends AbstractHandler implements IHandler{


public static final String HELP_LIBRARY = "http:/kk.com/KKLibrary/";

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {

try {
PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(HELP_LIBRARY ));
} catch (PartInitException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
}
return null;
}
}

No comments:

Post a Comment