本文整理汇总了Java中org.eclipse.ui.browser.IWorkbenchBrowserSupport.isInternalWebBrowserAvailable方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkbenchBrowserSupport.isInternalWebBrowserAvailable方法的具体用法?Java IWorkbenchBrowserSupport.isInternalWebBrowserAvailable怎么用?Java IWorkbenchBrowserSupport.isInternalWebBrowserAvailable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.browser.IWorkbenchBrowserSupport
的用法示例。
在下文中一共展示了IWorkbenchBrowserSupport.isInternalWebBrowserAvailable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startWebBrowser
import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入方法依赖的package包/类
/**
* Starts the web browser.
*
* @param url the URL to open.
*/
private void startWebBrowser(URL url) {
IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench()
.getBrowserSupport();
if (browserSupport.isInternalWebBrowserAvailable()) {
try {
IWebBrowser browser = browserSupport.createBrowser(
IWorkbenchBrowserSupport.LOCATION_BAR
| IWorkbenchBrowserSupport.NAVIGATION_BAR
| IWorkbenchBrowserSupport.AS_EDITOR,
CONST_INTERNAL_BROWSER_ID, CONST_INTERNAL_BROWSER_NAME,
CONST_INTERNAL_BROWSER_TOOLTIP);
browser.openURL(url);
} catch (PartInitException e) {
throw new DcaseSystemException(Messages.COMMON_EXCEPTION_partInit, e,
MessageTypeImpl.OPEN_URL_CRITICAL_FAILED);
}
} else {
throw new DcaseSystemException(Messages.OpenUrlHandler_4, null,
MessageTypeImpl.OPEN_URL_CRITICAL_FAILED);
}
}
示例2: run
import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入方法依赖的package包/类
public void run(IAction action) {
try {
IWorkbenchBrowserSupport workbenchBrowserSupport = PlatformUI.getWorkbench().getBrowserSupport();
if (workbenchBrowserSupport.isInternalWebBrowserAvailable()) {
IWebBrowser webBrowser = workbenchBrowserSupport.createBrowser(IWorkbenchBrowserSupport.AS_EDITOR | IWorkbenchBrowserSupport.LOCATION_BAR | IWorkbenchBrowserSupport.NAVIGATION_BAR | IWorkbenchBrowserSupport.STATUS, null, null, null);
if (webBrowser != null) {
webBrowser.openURL(null);
}
}
} catch (PartInitException e) {
IdeLog.logError(BrowserPlugin.getDefault(), e);
}
}
示例3: execute
import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入方法依赖的package包/类
public Object execute(ExecutionEvent event) throws ExecutionException
{
if (browserURL == null)
{
return null;
}
try
{
IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
if (support.isInternalWebBrowserAvailable())
{
support.createBrowser(
IWorkbenchBrowserSupport.NAVIGATION_BAR | IWorkbenchBrowserSupport.LOCATION_BAR
| IWorkbenchBrowserSupport.AS_EDITOR | IWorkbenchBrowserSupport.STATUS, browserId,
null, // Set the name to null so that the browser tab will display the title of page loaded in
// the browser
null).openURL(browserURL);
}
else
{
support.getExternalBrowser().openURL(browserURL);
}
}
catch (PartInitException e)
{
IdeLog.logError(UIPlugin.getDefault(), e);
}
return null;
}
示例4: execute
import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入方法依赖的package包/类
public Object execute(ExecutionEvent event) throws ExecutionException
{
if (RELEASE_NOTES_URL == null)
{
return null;
}
try
{
IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
if (support.isInternalWebBrowserAvailable())
{
support.createBrowser(
IWorkbenchBrowserSupport.NAVIGATION_BAR | IWorkbenchBrowserSupport.LOCATION_BAR
| IWorkbenchBrowserSupport.AS_EDITOR | IWorkbenchBrowserSupport.STATUS,
"ViewReleaseNotes", //$NON-NLS-1$
null, // Set the name to null. That way the browser tab will display the title of page loaded in
// the browser.
null).openURL(RELEASE_NOTES_URL);
}
else
{
support.getExternalBrowser().openURL(RELEASE_NOTES_URL);
}
}
catch (PartInitException e)
{
IdeLog.logError(UIPlugin.getDefault(), e);
}
return null;
}
示例5: openInBroswer
import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入方法依赖的package包/类
/**
* Open a URL in a browser.
*
* @param url
* @param internal
* In case true, the system will try to open the internal browser if it's available.
* @param style
* the Browser's style, in case an internal browser is requested.
* @return A boolean value indicating a successful operations or not.
*/
public static boolean openInBroswer(URL url, boolean internal, int style)
{
IWorkbench workbench = PlatformUI.getWorkbench();
if (workbench != null)
{
IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
try
{
if (internal && support.isInternalWebBrowserAvailable())
{
support.createBrowser(style, INTERNAL_HELP_BROWSER_ID, null, null).openURL(url);
}
else
{
support.getExternalBrowser().openURL(url);
}
}
catch (PartInitException e)
{
IdeLog.logError(UIPlugin.getDefault(), "Error opening the help", e); //$NON-NLS-1$
return false;
}
return true;
}
return false;
}