当前位置: 首页>>代码示例>>Java>>正文


Java IWorkbenchBrowserSupport.isInternalWebBrowserAvailable方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:d-case,项目名称:d-case_editor,代码行数:27,代码来源:OpenUrlHandler.java

示例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);
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:14,代码来源:ShowBrowserEditorAction.java

示例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;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:33,代码来源:BrowserCommandHandler.java

示例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;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:34,代码来源:ViewReleaseNotesCommandHandler.java

示例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;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:39,代码来源:UIUtils.java


注:本文中的org.eclipse.ui.browser.IWorkbenchBrowserSupport.isInternalWebBrowserAvailable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。