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


Java IWorkbenchBrowserSupport类代码示例

本文整理汇总了Java中org.eclipse.ui.browser.IWorkbenchBrowserSupport的典型用法代码示例。如果您正苦于以下问题:Java IWorkbenchBrowserSupport类的具体用法?Java IWorkbenchBrowserSupport怎么用?Java IWorkbenchBrowserSupport使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IWorkbenchBrowserSupport类属于org.eclipse.ui.browser包,在下文中一共展示了IWorkbenchBrowserSupport类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
@Override
public void run() {
	if (target==null){
		return;
	}
	try {
		URL url = new URL(target);
		// Open default external browser
		IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
		IWebBrowser externalBrowser = browserSupport.getExternalBrowser();
		externalBrowser.openURL(url);
		
	} catch (Exception ex) {
		EditorUtil.INSTANCE.logError("Was not able to open url in external browser", ex);
	}
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:17,代码来源:OpenInExternalBrowserAction.java

示例2: internalOpen

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
private static void internalOpen(final URL url, final boolean useExternalBrowser) {
	BusyIndicator.showWhile(null, new Runnable() {
		public void run() {
			URL helpSystemUrl= PlatformUI.getWorkbench().getHelpSystem().resolve(url.toExternalForm(), true);
			try {
				IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
				IWebBrowser browser;
				if (useExternalBrowser)
					browser= browserSupport.getExternalBrowser();
				else
					browser= browserSupport.createBrowser(null);
				browser.openURL(helpSystemUrl);
			} catch (PartInitException ex) {
			}
		}
	});
}
 
开发者ID:cplutte,项目名称:bts,代码行数:18,代码来源:OpenBrowserUtil.java

示例3: openHelpInBrowser

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
/**
 * Opens the internal help in the Studio's internal browser.
 * 
 * @param url
 * @return A boolean value indicating a successful operations or not.
 */
public static boolean openHelpInBrowser(String url)
{
	IWorkbench workbench = PlatformUI.getWorkbench();
	if (workbench != null)
	{
		IWorkbenchHelpSystem helpSystem = workbench.getHelpSystem();
		URL resolvedURL = helpSystem.resolve(url, true);
		if (resolvedURL != null)
		{
			return openInBroswer(resolvedURL, true, IWorkbenchBrowserSupport.AS_EDITOR
					| IWorkbenchBrowserSupport.STATUS);
		}
		else
		{
			IdeLog.logError(UIPlugin.getDefault(), "Unable to resolve the Help URL for " + url); //$NON-NLS-1$
			return false;
		}
	}
	return false;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:27,代码来源:UIUtils.java

示例4: openURL

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
/**
 * Opens an URL with the default settings (which will typically open in an internal browser with no toolbar/url
 * bar/etc).
 * 
 * @param url
 * @return
 */
public static IWebBrowser openURL(String url)
{
	try
	{
		IWorkbenchBrowserSupport workbenchBrowserSupport = PlatformUI.getWorkbench().getBrowserSupport();
		IWebBrowser webBrowser = workbenchBrowserSupport.createBrowser(null);
		if (webBrowser != null)
		{
			webBrowser.openURL(new URL(url));
		}
		return webBrowser;
	}
	catch (Exception e)
	{
		IdeLog.logError(UIPlugin.getDefault(), e);
	}
	return null;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:26,代码来源:WorkbenchBrowserUtil.java

示例5: internalOpen

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
private static void internalOpen(final URL url, final boolean useExternalBrowser) {
	BusyIndicator.showWhile(null, new Runnable() {
		public void run() {
			URL helpSystemUrl= PlatformUI.getWorkbench().getHelpSystem().resolve(url.toExternalForm(), true);
			if (helpSystemUrl == null) { // can happen if org.eclipse.help.ui is not available
				return; // the resolve() method already wrote "Unable to instantiate help UI" to the log
			}
			try {
				IWorkbenchBrowserSupport browserSupport= PlatformUI.getWorkbench().getBrowserSupport();
				IWebBrowser browser;
				if (useExternalBrowser)
					browser= browserSupport.getExternalBrowser();
				else
					browser= browserSupport.createBrowser(null);
				browser.openURL(helpSystemUrl);
			} catch (PartInitException ex) {
				// XXX: show dialog?
				JavaPlugin.logErrorStatus("Opening Javadoc failed", ex.getStatus()); //$NON-NLS-1$
			}
		}
	});
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:OpenBrowserUtil.java

示例6: openBrowserInEditor

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
private void openBrowserInEditor(LocationEvent event) {
    URL url;
    try {
        url = new URL(event.location);
    } catch (MalformedURLException ignored) {
        return;
    }
    IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
    try {
        IWebBrowser newBrowser = support.createBrowser(browserId);
        browserId = newBrowser.getId();
        newBrowser.openURL(url);
        return;
    } catch (PartInitException e) {
        FindbugsPlugin.getDefault().logException(e, "Can't open external browser");
    }
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:18,代码来源:BugInfoView.java

示例7: 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

示例8: run

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
@Override
public void run() {
  IWorkbenchBrowserSupport support
      = PlatformUI.getWorkbench().getBrowserSupport();
  try {
    support.getExternalBrowser().openURL(url);
  } catch (PartInitException e) {
    throw new IllegalStateException(
        "Eeep! Coudn't initialize part.", e);
  }
}
 
开发者ID:alfsch,项目名称:workspacemechanic,代码行数:12,代码来源:OpenUrlAction.java

示例9: OpenUriSelectionListener

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
@VisibleForTesting
OpenUriSelectionListener(QueryParameterProvider queryParameterProvider,
                         ErrorHandler errorHandler,
                         IWorkbenchBrowserSupport browserSupport) {
  this.queryParameterProvider = queryParameterProvider;
  this.errorHandler = errorHandler;
  this.browserSupport = browserSupport;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:9,代码来源:OpenUriSelectionListener.java

示例10: runInUIThread

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
	try {
		IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
		IWebBrowser browser = browserSupport.createBrowser(
				IWorkbenchBrowserSupport.LOCATION_BAR | IWorkbenchBrowserSupport.NAVIGATION_BAR, null, null, null);
		browser.openURL(new URL(serverURL));
	} catch (Exception e) {
		return new Status(IStatus.ERROR, AngularCLIPlugin.PLUGIN_ID, AngularCLIMessages.NgServeJob_error, e);
	}
	return Status.OK_STATUS;
}
 
开发者ID:angelozerr,项目名称:angular-eclipse,代码行数:13,代码来源:NgServeJob.java

示例11: openInExternalBrowser

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
private void openInExternalBrowser(URL url) {
	String browserId = "bookmark";
	try {
		IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();

		IWebBrowser browser = browserSupport.createBrowser(IWorkbenchBrowserSupport.AS_EXTERNAL, browserId, null,
				null);
		browser.openURL(url);
	} catch (PartInitException e) {
		StatusHelper.logError("Could not open browser", e);
	}

}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:14,代码来源:ViewInGDriveOperation.java

示例12: createOnlineCollaborationListener

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
private SelectionAdapter createOnlineCollaborationListener(final List list) {
	return new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			Client client = createClient(list);
			
			String managementURL = getManagementURL(list.getSelection());
			try {
				String rapPath = client.getOnlineCollaborationURL(goldRepositoryText.getText());
				URL u = new URL(managementURL);
				System.out.println(u.getHost());
				String rapURL = u.getProtocol() + "://" + u.getHost() + ":" + u.getPort() + rapPath;
				final IWebBrowser browser = PlatformUI.getWorkbench().getBrowserSupport().createBrowser(
						IWorkbenchBrowserSupport.AS_VIEW | IWorkbenchBrowserSupport.NAVIGATION_BAR, null, null,
						null);
				browser.openURL(new URL(rapURL));
			} catch (Exception e1) {
				String message = "Could not get online collaboration URL from server " + managementURL;
				logger.error(message);
				MessageBox mb = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_ERROR | SWT.OK);
				mb.setText("MONDO server management error");
				mb.setMessage(message);
				mb.open();
			}
		}
	};
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:28,代码来源:MONDOServerView.java

示例13: openWebBrowser

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
@Override
public void openWebBrowser(final String url) throws Exception
{
    final IWebBrowser browser = PlatformUI.getWorkbench().getBrowserSupport()
              .createBrowser(IWorkbenchBrowserSupport.NAVIGATION_BAR | IWorkbenchBrowserSupport.LOCATION_BAR,
                             "CSS", null, null);
    browser.openURL(new URL(url));
}
 
开发者ID:kasemir,项目名称:org.csstudio.display.builder,代码行数:9,代码来源:RCP_JFXRepresentation.java

示例14: launchBrowser

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
public static IWebBrowser launchBrowser(String targetUrl) throws MalformedURLException, PartInitException {
  Workbench workbench = Workbench.getInstance();
  if (workbench == null) {
    throw new PartInitException("No workbench is available");
  }

  IWorkbenchBrowserSupport browserSupport = workbench.getBrowserSupport();

  URL url = new URL(targetUrl);

  IWebBrowser browser = browserSupport.createBrowser(IWorkbenchBrowserSupport.AS_EXTERNAL, null, "GWT", "GWT");
  browser.openURL(url);
  return browser;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:15,代码来源:BrowserUtilities.java

示例15: openBrowser

import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入依赖的package包/类
private IStatus openBrowser(IProgressMonitor monitor) {

		final IWorkbenchBrowserSupport browserSupport = PlatformUI
				.getWorkbench().getBrowserSupport();
		List<?> resources = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection)
				.toList() : Collections.EMPTY_LIST;
		String browserId = null;

		Vector<IFile> ifiles = Utils.getFileResources(resources);
		monitor.beginTask(
				"Attempting to open " + ifiles.size() + " DITA files",
				ifiles.size());
		for (IFile ifile : ifiles) {
			if (monitor.isCanceled()) {
				return Status.CANCEL_STATUS;
			}
			String urlstring = ifile.getFullPath().toString();
			urlstring = urlstring.replace(".dita", ".html");
			urlstring = currentPrefix + urlstring;
			try {
				URL url = new URL(urlstring);
				browserSupport.createBrowser(browserId).openURL(url);
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			monitor.worked(1);
		}
		return Status.OK_STATUS;
	}
 
开发者ID:greenelk,项目名称:dita-tools,代码行数:31,代码来源:WebFileFinderAction.java


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