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


Java EditorColorsManager.getGlobalScheme方法代码示例

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


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

示例1: setupStyle

import com.intellij.openapi.editor.colors.EditorColorsManager; //导入方法依赖的package包/类
private void setupStyle() {
  Document document = myHTMLViewer.getDocument();
  if (!(document instanceof StyledDocument)) {
    return;
  }

  StyledDocument styledDocument = (StyledDocument)document;

  EditorColorsManager colorsManager = EditorColorsManager.getInstance();
  EditorColorsScheme scheme = colorsManager.getGlobalScheme();

  Style style = styledDocument.addStyle("active", null);
  StyleConstants.setFontFamily(style, scheme.getEditorFontName());
  StyleConstants.setFontSize(style, scheme.getEditorFontSize());
  styledDocument.setCharacterAttributes(0, document.getLength(), style, false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:Browser.java

示例2: applyFontSize

import com.intellij.openapi.editor.colors.EditorColorsManager; //导入方法依赖的package包/类
private void applyFontSize() {
  Document document = myEditorPane.getDocument();
  if (!(document instanceof StyledDocument)) {
    return;
  }

  final StyledDocument styledDocument = (StyledDocument)document;

  EditorColorsManager colorsManager = EditorColorsManager.getInstance();
  EditorColorsScheme scheme = colorsManager.getGlobalScheme();
  StyleConstants.setFontSize(myFontSizeStyle, scheme.getQuickDocFontSize().getSize());
  if (Registry.is("documentation.component.editor.font")) {
    StyleConstants.setFontFamily(myFontSizeStyle, scheme.getEditorFontName());
  }

  ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
    @Override
    public void run() {
      styledDocument.setCharacterAttributes(0, styledDocument.getLength(), myFontSizeStyle, false);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:DocumentationComponent.java

示例3: createMethodSeparatorLineMarker

import com.intellij.openapi.editor.colors.EditorColorsManager; //导入方法依赖的package包/类
@NotNull
public static LineMarkerInfo createMethodSeparatorLineMarker(@NotNull PsiElement startFrom, @NotNull EditorColorsManager colorsManager) {
  LineMarkerInfo info = new LineMarkerInfo<PsiElement>(
    startFrom, 
    startFrom.getTextRange(), 
    null, 
    Pass.UPDATE_ALL, 
    FunctionUtil.<Object, String>nullConstant(),
    null, 
    GutterIconRenderer.Alignment.RIGHT
  );
  EditorColorsScheme scheme = colorsManager.getGlobalScheme();
  info.separatorColor = scheme.getColor(CodeInsightColors.METHOD_SEPARATORS_COLOR);
  info.separatorPlacement = SeparatorPlacement.TOP;
  return info;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:LineMarkersPass.java

示例4: highlightElement

import com.intellij.openapi.editor.colors.EditorColorsManager; //导入方法依赖的package包/类
private static void highlightElement(@NotNull PsiElement element) {
  final Project project = element.getProject();
  final FileEditorManager editorManager =
    FileEditorManager.getInstance(project);
  final HighlightManager highlightManager =
    HighlightManager.getInstance(project);
  final EditorColorsManager editorColorsManager =
    EditorColorsManager.getInstance();
  final Editor editor = editorManager.getSelectedTextEditor();
  final EditorColorsScheme globalScheme =
    editorColorsManager.getGlobalScheme();
  final TextAttributes textattributes =
    globalScheme.getAttributes(
      EditorColors.SEARCH_RESULT_ATTRIBUTES);
  final PsiElement[] elements = new PsiElement[]{element};
  highlightManager.addOccurrenceHighlights(editor, elements,
                                           textattributes, true, null);

  StatusBar.Info.set(IntentionPowerPackBundle.message(
    "status.bar.escape.highlighting.message"), project);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:MoveDeclarationIntention.java

示例5: setSelected

import com.intellij.openapi.editor.colors.EditorColorsManager; //导入方法依赖的package包/类
@Override
public void setSelected(AnActionEvent e, boolean state) {
  if (!state) {
    mySettingsPanel.setVisible(false);
    return;
  }

  EditorColorsManager colorsManager = EditorColorsManager.getInstance();
  EditorColorsScheme scheme = colorsManager.getGlobalScheme();
  setFontSizeSliderSize(scheme.getQuickDocFontSize());
  mySettingsPanel.setVisible(true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:DocumentationComponent.java

示例6: setupStyle

import com.intellij.openapi.editor.colors.EditorColorsManager; //导入方法依赖的package包/类
private void setupStyle() {
  // Make the scrollPane transparent
  if (myScrollPane != null) {
    JViewport viewPort = myScrollPane.getViewport();
    viewPort.setOpaque(false);
    viewPort.setBackground(null);
    myScrollPane.setOpaque(false);
    myScrollPane.setBackground(null);
  }

  Document document = myHTMLViewer.getDocument();
  if (!(document instanceof StyledDocument)) {
    return;
  }

  StyledDocument styledDocument = (StyledDocument)document;

  EditorColorsManager colorsManager = EditorColorsManager.getInstance();
  EditorColorsScheme scheme = colorsManager.getGlobalScheme();

  Style style = styledDocument.addStyle("active", null);
  StyleConstants.setFontFamily(style, scheme.getEditorFontName());
  StyleConstants.setFontSize(style, scheme.getEditorFontSize());
  styledDocument.setCharacterAttributes(0, document.getLength(), style, false);

  // Make background semitransparent
  Color background = myHTMLViewer.getBackground();
  if (background != null) {
    background = new Color(background.getRed(), background.getGreen(), background.getBlue(), ERROR_PANEL_OPACITY);
    myHTMLViewer.setBackground(background);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:RenderErrorPanel.java


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