本文整理汇总了Java中org.eclipse.ui.browser.IWorkbenchBrowserSupport.createBrowser方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkbenchBrowserSupport.createBrowser方法的具体用法?Java IWorkbenchBrowserSupport.createBrowser怎么用?Java IWorkbenchBrowserSupport.createBrowser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.browser.IWorkbenchBrowserSupport
的用法示例。
在下文中一共展示了IWorkbenchBrowserSupport.createBrowser方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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");
}
}
示例3: 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);
}
}
示例4: 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;
}
示例5: 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);
}
}
示例6: 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;
}
示例7: 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);
}
}
示例8: editOnActivate
import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入方法依赖的package包/类
@Override
public boolean editOnActivate(ParameterFacet<T> facet, IUndoContext undoContext, TreeItem item, int index) {
EStructuralFeature feature = facet.getFeature();
EClassifier type = feature.getEType();
if (isCheckboxType(type)) {
Boolean value = (Boolean) facet.getValue();
boolean newValue = (value == null ? true : !value);
modify(facet, newValue, undoContext);
return true;
}
if (type == CommonPackage.Literals.EURL) {
URL url = (URL)facet.getValue();
if ((url == null) || "".equals(url.toString())) {
MessageDialog.openInformation(new Shell(), "No URL", "No URL is set");
} else {
IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
try {
IWebBrowser browser = browserSupport.createBrowser("");
browser.openURL(url);
} catch (PartInitException e1) {
LogUtil.error("Failed to INIT part for opening WebBrowser in URLEditor", e1);
}
}
return false;
}
return false;
}
示例9: widgetSelected
import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入方法依赖的package包/类
@Override
public void widgetSelected(SelectionEvent e) {
IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
String url = WIKI_WWW + modelType.getName();
try {
IWebBrowser browser = support.createBrowser("MMINT Wiki");
browser.openURL(new URL(url));
}
catch (Exception ex) {
MMINTException.print(IStatus.ERROR, "Error opening wiki page " + url, ex);
}
}
示例10: widgetSelected
import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入方法依赖的package包/类
@Override
public void widgetSelected(SelectionEvent e) {
String formType = "/Model_Type/";
String args = "?";
int i = 1;
if (modelType.getName() != null)
args = args + "name=" + modelType.getName();
if (modelType.getSupertype() != null)
args = args + "&supertype=" + modelType.getSupertype().getName();
if (modelType instanceof ModelRel) {
formType = "/Relationship_Type/";
ModelRel modelRelType = (ModelRel) modelType;
if (!modelRelType.getModelEndpoints().isEmpty())
args = args + "&arguments=";
for (ModelEndpoint modelEndpoint : modelRelType.getModelEndpoints()) {
if (i != 1)
args = args + ", ";
args = args + modelEndpoint.getName() + ";" + modelEndpoint.getTarget().getName();
i++;
}
}
IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
String url = WIKI_WWW + formType + modelType.getName() + args;
try {
IWebBrowser browser = support.createBrowser("MMINT Wiki");
browser.openURL(new URL(url));
}
catch (Exception ex) {
MMINTException.print(IStatus.ERROR, "Error opening wiki page " + url, ex);
}
}
示例11: execute
import org.eclipse.ui.browser.IWorkbenchBrowserSupport; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
try {
IWebBrowser browser = support.createBrowser("MMINT Wiki");
browser.openURL(new URL(WIKI_WWW));
}
catch (Exception ex) {
MMINTException.print(IStatus.ERROR, "Error opening wiki page " + WIKI_WWW, ex);
}
return null;
}