本文整理汇总了Java中com.intellij.ide.browsers.BrowserLauncher类的典型用法代码示例。如果您正苦于以下问题:Java BrowserLauncher类的具体用法?Java BrowserLauncher怎么用?Java BrowserLauncher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BrowserLauncher类属于com.intellij.ide.browsers包,在下文中一共展示了BrowserLauncher类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processTerminated
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
@Override
public void processTerminated(ProcessEvent processEvent) {
executionCounter.setEndTime(System.currentTimeMillis());
if (processEvent.getExitCode() == 0) {
try {
LivingDocExecution execution = getLivingDocExecution();
updateStatusLine(execution);
File resultFile = loadResultFile(execution);
BrowserLauncher browser = new BrowserLauncherImpl();
browser.open(resultFile.getPath());
} catch (IOException | LivingDocException e) {
LOG.error(e);
}
} else {
statusLine.setText(I18nSupport.getValue("run.execution.error.process"));
statusLine.setStatusColor(ColorProgressBar.RED);
statusLine.setFraction(100d);
}
}
示例2: launchSearch
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
private void launchSearch(final String query) {
if (query == null) {
Messages.showMessageDialog("query == null",
"Error When Launching the Browser",
Messages.getErrorIcon());
System.err.println("Error When Launching the Browser: query == null");
return;
}
try {
final String uriString = searchEngine.generateSearchUri(query);
BrowserLauncher.getInstance().open(uriString);
} catch (IOException ex) {
Messages.showMessageDialog(ex.toString(),
"Error When Launching the Browser",
Messages.getErrorIcon());
System.err.println("Error When Launching the Browser: " + ex.toString());
}
}
示例3: openInBrowserHandler
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
public OpenInBrowserHandler openInBrowserHandler()
{
if (!this.hasApplicationService(OpenInBrowserHandler.class)) {
this.registerApplicationService(new OpenInBrowserHandler(BrowserLauncher.getInstance()));
}
return (OpenInBrowserHandler)this.applicationService(OpenInBrowserHandler.class);
}
示例4: testOpensInBrowser
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
@Test
@UseDataProvider("urlProvider")
public void testOpensInBrowser(URL url, String expected) throws MalformedURLException, UrlHandlerException
{
BrowserLauncher browserLauncher = mock(BrowserLauncher.class);
UrlHandler handler = new OpenInBrowserHandler(browserLauncher);
handler.handle(url);
verify(browserLauncher, times(1)).open(expected);
}
示例5: getNoJavaFXFoundPanel
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
private static JPanel getNoJavaFXFoundPanel() {
JPanel noJavaFXFoundPanel = new JPanel(new GridBagLayout());
JEditorPane noJavaFXFoundPane = new JEditorPane();
noJavaFXFoundPane.setContentType("text/html");
noJavaFXFoundPane.setEditable(false);
noJavaFXFoundPane.setOpaque(false);
noJavaFXFoundPane.setText(NO_JAVAFX_FOUND_MESSAGE);
noJavaFXFoundPane.addHyperlinkListener(e -> {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
BrowserLauncher.getInstance().browse(e.getDescription(), WebBrowserManager.getInstance().getFirstActiveBrowser());
}
});
noJavaFXFoundPanel.add(noJavaFXFoundPane);
return noJavaFXFoundPanel;
}
示例6: doExecute
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
@Override
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException {
final RunProfile runProfileRaw = env.getRunProfile();
if (runProfileRaw instanceof UI5RunConfiguration) {
FileDocumentManager.getInstance().saveAllDocuments();
final UI5RunConfiguration runProfile = (UI5RunConfiguration) runProfileRaw;
final UI5RunnerParameters params = runProfile.getRunnerParameters();
BuiltInServerManager serverManager = BuiltInServerManager.getInstance().waitForStart();
BrowserLauncher.getInstance().browse("http://localhost:" + serverManager.getPort()
+ getClientApplicationPath(env.getProject()), params.getWebBrowser(), env.getProject());
}
return super.doExecute(state, env);
}
示例7: OpenInBrowserHandler
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
public OpenInBrowserHandler(BrowserLauncher browserLauncher)
{
this.browserLauncher = browserLauncher;
}
示例8: actionPerformed
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
public void actionPerformed(AnActionEvent event) {
BrowserLauncher.getInstance().browse(UrlManager.getMainPage() , WebBrowserManager.getInstance().getFirstActiveBrowser());
}
示例9: openBrowser
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
public void openBrowser(String url) {
BrowserLauncher.getInstance().browse(url, WebBrowserManager.getInstance().getFirstActiveBrowser());
}
示例10: getBrowserLauncher
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
private static BrowserLauncher getBrowserLauncher() {
BrowserLauncher launcher = ApplicationManager.getApplication() == null ? null : BrowserLauncher.getInstance();
return launcher == null ? new BrowserLauncherAppless() : launcher;
}
示例11: openUrl
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
@Override
public boolean openUrl(@NotNull WebBrowser browser, @NotNull String url, @Nullable Project project) {
return BrowserLauncher.getInstance().browseUsingPath(url, null, browser, project, ArrayUtil.EMPTY_STRING_ARRAY);
}
示例12: actionPerformed
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent event) {
BrowserLauncher.getInstance().browse(formatUrl(), /* browser= */ null, /* project= */ null);
}
示例13: getBrowserLauncher
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
private static BrowserLauncher getBrowserLauncher() {
BrowserLauncher launcher = ApplicationManager.getApplication() == null ? null : BrowserLauncher.getInstance();
return launcher == null ? BrowserLauncherAppless.INSTANCE : launcher;
}
示例14: openUrl
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
@Override
public boolean openUrl(@NotNull WebBrowser browser, @NotNull String url, @Nullable Project project)
{
return BrowserLauncher.getInstance().browseUsingPath(url, null, browser, project, ArrayUtil.EMPTY_STRING_ARRAY);
}
示例15: actionPerformed
import com.intellij.ide.browsers.BrowserLauncher; //导入依赖的package包/类
/**
* Action handler. Only specification nodes will open in the web browser.
*
* @param actionEvent Carries information on the invocation place
*/
@Override
public void actionPerformed(AnActionEvent actionEvent) {
DefaultMutableTreeNode[] selectedNodes = repositoryTree.getSelectedNodes(DefaultMutableTreeNode.class, null);
Object userObject = selectedNodes[0].getUserObject();
if (((Node) userObject).getType() == NodeType.SPECIFICATION) {
SpecificationNode specificationNode = (SpecificationNode) userObject;
RepositoryNode repositoryNode = RepositoryViewUtils.getRepositoryNode(specificationNode);
BrowserLauncher browser = new BrowserLauncherImpl();
for (DefaultMutableTreeNode selectedNode : selectedNodes) {
userObject = selectedNode.getUserObject();
specificationNode = (SpecificationNode) userObject;
LivingDocConnector livingDocConnector = LivingDocConnector.newInstance(ProjectSettings.getInstance(actionEvent.getProject()));
String url = livingDocConnector.getSpecificationRemoteUrl(specificationNode, repositoryNode);
browser.open(url);
}
}
}