• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java WebBrowserManager类的典型用法和代码示例

java 1次浏览

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

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

示例1: addRunConfiguration

点赞 3

import com.intellij.ide.browsers.WebBrowserManager; //导入依赖的package包/类
/**
 * Adds a run configuration to project
 * @param project
 */
public static void addRunConfiguration(@NotNull final Project project) {
    final Runnable r = new Runnable() {
        @Override
        public void run() {
            final RunManager runManager = RunManager.getInstance(project);
            final RunnerAndConfigurationSettings settings = runManager.
                    createRunConfiguration(project.getName(), UI5RunConfigurationType.getInstance().getFactory());
            final UI5RunConfiguration configuration = (UI5RunConfiguration) settings.getConfiguration();

            configuration.setName("Run " + project.getName());
            configuration.getRunnerParameters().setWebBrowser(WebBrowserManager.getInstance().getFirstActiveBrowser());

            runManager.addConfiguration(settings, false);
            runManager.setSelectedConfiguration(settings);
        }
    };
    r.run();
}
 

开发者ID:asebak,
项目名称:ui5-intellij-plugin,
代码行数:23,
代码来源:ProjectHelper.java

示例2: getNoJavaFXFoundPanel

点赞 2

import com.intellij.ide.browsers.WebBrowserManager; //导入依赖的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;
}
 

开发者ID:vcu-swim-lab,
项目名称:stack-intheflow,
代码行数:16,
代码来源:SearchToolWindowFactory.java

示例3: createChildrenProvider

点赞 2

import com.intellij.ide.browsers.WebBrowserManager; //导入依赖的package包/类
@NotNull
@Override
protected final CachedValueProvider<AnAction[]> createChildrenProvider(@NotNull final ActionManager actionManager) {
  return new CachedValueProvider<AnAction[]>() {
    @Nullable
    @Override
    public Result<AnAction[]> compute() {
      List<WebBrowser> browsers = WebBrowserManager.getInstance().getBrowsers();
      boolean addDefaultBrowser = isPopup();
      int offset = addDefaultBrowser ? 1 : 0;
      AnAction[] actions = new AnAction[browsers.size() + offset];

      if (addDefaultBrowser) {
        if (myDefaultBrowserAction == null) {
          myDefaultBrowserAction = new OpenFileInDefaultBrowserAction();
          myDefaultBrowserAction.getTemplatePresentation().setText("Default");
          myDefaultBrowserAction.getTemplatePresentation().setIcon(AllIcons.Nodes.PpWeb);
        }
        actions[0] = myDefaultBrowserAction;
      }

      for (int i = 0, size = browsers.size(); i < size; i++) {
        actions[i + offset] = new BaseWebBrowserAction(browsers.get(i));
      }

      return Result.create(actions, WebBrowserManager.getInstance());
    }
  };
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:30,
代码来源:OpenInBrowserBaseGroupAction.java

示例4: createChildrenProvider

点赞 2

import com.intellij.ide.browsers.WebBrowserManager; //导入依赖的package包/类
@NotNull
@Override
protected final CachedValueProvider<AnAction[]> createChildrenProvider(@NotNull final ActionManager actionManager)
{
	return new CachedValueProvider<AnAction[]>()
	{
		@Nullable
		@Override
		public Result<AnAction[]> compute()
		{
			List<WebBrowser> browsers = WebBrowserManager.getInstance().getBrowsers();
			boolean addDefaultBrowser = isPopup();
			int offset = addDefaultBrowser ? 1 : 0;
			AnAction[] actions = new AnAction[browsers.size() + offset];

			if(addDefaultBrowser)
			{
				if(myDefaultBrowserAction == null)
				{
					myDefaultBrowserAction = new OpenFileInDefaultBrowserAction();
					myDefaultBrowserAction.getTemplatePresentation().setText("Default");
					myDefaultBrowserAction.getTemplatePresentation().setIcon(AllIcons.Nodes.PpWeb);
				}
				actions[0] = myDefaultBrowserAction;
			}

			for(int i = 0, size = browsers.size(); i < size; i++)
			{
				actions[i + offset] = new BaseWebBrowserAction(browsers.get(i));
			}

			return Result.create(actions, WebBrowserManager.getInstance());
		}
	};
}
 

开发者ID:consulo,
项目名称:consulo-xml,
代码行数:36,
代码来源:OpenInBrowserBaseGroupAction.java

示例5: findUsingBrowser

点赞 2

import com.intellij.ide.browsers.WebBrowserManager; //导入依赖的package包/类
@Nullable
private static WebBrowser findUsingBrowser()
{
	WebBrowserManager browserManager = WebBrowserManager.getInstance();
	if(browserManager.getDefaultBrowserMode() == WebBrowserManager.DefaultBrowser.FIRST)
	{
		return browserManager.getDefaultBrowser();
	}
	else if(browserManager.getDefaultBrowserMode() == WebBrowserManager.DefaultBrowser.ALTERNATIVE)
	{
		String path = GeneralSettings.getInstance().getBrowserPath();
		if(!StringUtil.isEmpty(path))
		{
			WebBrowser browser = browserManager.findBrowserById(path);
			if(browser == null)
			{
				for(WebBrowser item : browserManager.getActiveBrowsers())
				{
					if(path.equals(item.getPath()))
					{
						return item;
					}
				}
			}
		}
	}
	return null;
}
 

开发者ID:consulo,
项目名称:consulo-xml,
代码行数:29,
代码来源:OpenFileInDefaultBrowserAction.java

示例6: actionPerformed

点赞 2

import com.intellij.ide.browsers.WebBrowserManager; //导入依赖的package包/类
public void actionPerformed(AnActionEvent event) {
    BrowserLauncher.getInstance().browse(UrlManager.getMainPage() , WebBrowserManager.getInstance().getFirstActiveBrowser());
}
 

开发者ID:zhengjunbase,
项目名称:codehelper.generator,
代码行数:4,
代码来源:ShowLearnMoreAction.java

示例7: openBrowser

点赞 2

import com.intellij.ide.browsers.WebBrowserManager; //导入依赖的package包/类
public void openBrowser(String url) {
    BrowserLauncher.getInstance().browse(url, WebBrowserManager.getInstance().getFirstActiveBrowser());
}
 

开发者ID:vcu-swim-lab,
项目名称:stack-intheflow,
代码行数:4,
代码来源:SearchToolWindowGUI.java

示例8: getBrowser

点赞 2

import com.intellij.ide.browsers.WebBrowserManager; //导入依赖的package包/类
@Nullable
@Override
protected WebBrowser getBrowser(@NotNull AnActionEvent event) {
  return WebBrowserManager.getInstance().isActive(browser) && browser.getPath() != null ? browser : null;
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:6,
代码来源:BaseWebBrowserAction.java

示例9: update

点赞 2

import com.intellij.ide.browsers.WebBrowserManager; //导入依赖的package包/类
@Override
public void update(@NotNull AnActionEvent e) {
  final WebBrowserManager browserManager = WebBrowserManager.getInstance();
  e.getPresentation().setVisible(browserManager.isShowBrowserHover() && !browserManager.getActiveBrowsers().isEmpty());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:6,
代码来源:OpenInBrowserBaseGroupAction.java

示例10: getBrowser

点赞 2

import com.intellij.ide.browsers.WebBrowserManager; //导入依赖的package包/类
@Nullable
@Override
protected WebBrowser getBrowser(@NotNull AnActionEvent event)
{
	return WebBrowserManager.getInstance().isActive(browser) && browser.getPath() != null ? browser : null;
}
 

开发者ID:consulo,
项目名称:consulo-xml,
代码行数:7,
代码来源:BaseWebBrowserAction.java

示例11: update

点赞 2

import com.intellij.ide.browsers.WebBrowserManager; //导入依赖的package包/类
@Override
public void update(@NotNull AnActionEvent e)
{
	e.getPresentation().setVisible(!WebBrowserManager.getInstance().getBrowsers().isEmpty());
}
 

开发者ID:consulo,
项目名称:consulo-xml,
代码行数:6,
代码来源:OpenInBrowserBaseGroupAction.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)