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


Java DebuggerUtilsEx.getCodeFragmentFactories方法代码示例

本文整理汇总了Java中com.intellij.debugger.impl.DebuggerUtilsEx.getCodeFragmentFactories方法的典型用法代码示例。如果您正苦于以下问题:Java DebuggerUtilsEx.getCodeFragmentFactories方法的具体用法?Java DebuggerUtilsEx.getCodeFragmentFactories怎么用?Java DebuggerUtilsEx.getCodeFragmentFactories使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.debugger.impl.DebuggerUtilsEx的用法示例。


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

示例1: createLanguagePopup

import com.intellij.debugger.impl.DebuggerUtilsEx; //导入方法依赖的package包/类
private ListPopup createLanguagePopup() {
  DefaultActionGroup actions = new DefaultActionGroup();
  for (final CodeFragmentFactory fragmentFactory : DebuggerUtilsEx.getCodeFragmentFactories(myContext)) {
    actions.add(new AnAction(fragmentFactory.getFileType().getLanguage().getDisplayName(), null, fragmentFactory.getFileType().getIcon()) {
      @Override
      public void actionPerformed(AnActionEvent e) {
        setFactory(fragmentFactory);
        setText(getText());
        IdeFocusManager.getInstance(getProject()).requestFocus(DebuggerEditorImpl.this, true);
      }
    });
  }

  DataContext dataContext = DataManager.getInstance().getDataContext(this);
  return JBPopupFactory.getInstance().createActionGroupPopup("Choose Language", actions, dataContext,
                                                             JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
                                                             false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:DebuggerEditorImpl.java

示例2: setContext

import com.intellij.debugger.impl.DebuggerUtilsEx; //导入方法依赖的package包/类
@Override
public void setContext(@Nullable PsiElement context) {
  myContext = context;

  List<CodeFragmentFactory> factories = DebuggerUtilsEx.getCodeFragmentFactories(context);
  boolean many = factories.size() > 1;
  if (myInitialFactory) {
    myInitialFactory = false;
    setFactory(factories.get(0));
    myChooseFactory.setVisible(many);
  }
  myChooseFactory.setVisible(myChooseFactory.isVisible() || many);
  myChooseFactory.setEnabled(many && factories.contains(myFactory));

  updateEditorUi();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:DebuggerEditorImpl.java

示例3: createLanguagePopup

import com.intellij.debugger.impl.DebuggerUtilsEx; //导入方法依赖的package包/类
private ListPopup createLanguagePopup() {
  DefaultActionGroup actions = new DefaultActionGroup();
  for (final CodeFragmentFactory fragmentFactory : DebuggerUtilsEx.getCodeFragmentFactories(myContext)) {
    actions.add(new AnAction(fragmentFactory.getFileType().getLanguage().getDisplayName(), null, fragmentFactory.getFileType().getIcon()) {
      @Override
      public void actionPerformed(AnActionEvent e) {
        setFactory(fragmentFactory);
        setText(getText());
        IdeFocusManager.getInstance(getProject()).requestFocus(DebuggerEditorImpl.this, true);
      }
    });
  }

  DataContext dataContext = DataManager.getInstance().getDataContext(this);
  return JBPopupFactory.getInstance().createActionGroupPopup("Choose language", actions, dataContext,
                                                                        JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
                                                                        false);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:DebuggerEditorImpl.java

示例4: getSupportedLanguages

import com.intellij.debugger.impl.DebuggerUtilsEx; //导入方法依赖的package包/类
@NotNull
@Override
public Collection<Language> getSupportedLanguages(@NotNull Project project, @Nullable XSourcePosition sourcePosition)
{
	if(sourcePosition != null)
	{
		PsiElement context = getContextElement(sourcePosition.getFile(), sourcePosition.getOffset(), project);
		Collection<Language> res = new ArrayList<Language>();
		for(CodeFragmentFactory factory : DebuggerUtilsEx.getCodeFragmentFactories(context))
		{
			res.add(factory.getFileType().getLanguage());
		}
		return res;
	}
	return Collections.emptyList();
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:17,代码来源:JavaDebuggerEditorsProvider.java

示例5: getSupportedLanguages

import com.intellij.debugger.impl.DebuggerUtilsEx; //导入方法依赖的package包/类
@NotNull
@Override
public Collection<Language> getSupportedLanguages(@NotNull Project project, @Nullable XSourcePosition sourcePosition) {
  if (sourcePosition != null) {
    PsiElement context = getContextElement(sourcePosition.getFile(), sourcePosition.getOffset(), project);
    Collection<Language> res = new ArrayList<Language>();
    for (CodeFragmentFactory factory : DebuggerUtilsEx.getCodeFragmentFactories(context)) {
      res.add(factory.getFileType().getLanguage());
    }
    return res;
  }
  return Collections.emptyList();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:JavaDebuggerEditorsProvider.java

示例6: findAppropriateFactory

import com.intellij.debugger.impl.DebuggerUtilsEx; //导入方法依赖的package包/类
@NotNull
private static CodeFragmentFactory findAppropriateFactory(@NotNull TextWithImports text, @Nullable PsiElement context) {
  for (CodeFragmentFactory factory : DebuggerUtilsEx.getCodeFragmentFactories(context)) {
    if (factory.getFileType().equals(text.getFileType())) {
      return factory;
    }
  }
  return DefaultCodeFragmentFactory.getInstance();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:DebuggerEditorImpl.java

示例7: setContext

import com.intellij.debugger.impl.DebuggerUtilsEx; //导入方法依赖的package包/类
public void setContext(@Nullable PsiElement context) {
  myContext = context;

  List<CodeFragmentFactory> factories = DebuggerUtilsEx.getCodeFragmentFactories(context);
  boolean many = factories.size() > 1;
  if (myInitialFactory) {
    myInitialFactory = false;
    setFactory(factories.get(0));
    myChooseFactory.setVisible(many);
  }
  myChooseFactory.setVisible(myChooseFactory.isVisible() || many);
  myChooseFactory.setEnabled(many && factories.contains(myFactory));

  updateEditorUi();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:DebuggerEditorImpl.java

示例8: findAppropriateFactory

import com.intellij.debugger.impl.DebuggerUtilsEx; //导入方法依赖的package包/类
@NotNull
public static CodeFragmentFactory findAppropriateFactory(@NotNull TextWithImports text, @NotNull PsiElement context) {
  for (CodeFragmentFactory factory : DebuggerUtilsEx.getCodeFragmentFactories(context)) {
    if (factory.getFileType().equals(text.getFileType())) {
      return factory;
    }
  }
  return DefaultCodeFragmentFactory.getInstance();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:DebuggerEditorImpl.java


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