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


Java EditorColorsScheme.getEditorFontName方法代码示例

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


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

示例1: createTaskInfoPanel

import com.intellij.openapi.editor.colors.EditorColorsScheme; //导入方法依赖的package包/类
@Override
public JComponent createTaskInfoPanel(Project project) {
  myTaskTextPane = new JTextPane();
  final JBScrollPane scrollPane = new JBScrollPane(myTaskTextPane);
  myTaskTextPane.setContentType(new HTMLEditorKit().getContentType());
  final EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
  int fontSize = editorColorsScheme.getEditorFontSize();
  final String fontName = editorColorsScheme.getEditorFontName();
  final Font font = new Font(fontName, Font.PLAIN, fontSize);
  String bodyRule = "body { font-family: " + font.getFamily() + "; " +
                    "font-size: " + font.getSize() + "pt; }" +
                    "pre {font-family: Courier; display: inline; ine-height: 50px; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; background-color:"
                    + ColorUtil.toHex(ColorUtil.dimmer(UIUtil.getPanelBackground())) + ";}" +
                    "code {font-family: Courier; display: flex; float: left; background-color:"
                    + ColorUtil.toHex(ColorUtil.dimmer(UIUtil.getPanelBackground())) + ";}";
  ((HTMLDocument)myTaskTextPane.getDocument()).getStyleSheet().addRule(bodyRule);
  myTaskTextPane.setEditable(false);
  if (!UIUtil.isUnderDarcula()) {
    myTaskTextPane.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground());
  }
  myTaskTextPane.setBorder(new EmptyBorder(20, 20, 0, 10));
  myTaskTextPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
  return scrollPane;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:25,代码来源:StudySwingToolWindow.java

示例2: createTaskTextPane

import com.intellij.openapi.editor.colors.EditorColorsScheme; //导入方法依赖的package包/类
@NotNull
private static JTextPane createTaskTextPane() {
  final JTextPane taskTextPane = new JTextPane();
  taskTextPane.setContentType(new HTMLEditorKit().getContentType());
  final EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
  int fontSize = editorColorsScheme.getEditorFontSize();
  final String fontName = editorColorsScheme.getEditorFontName();
  final Font font = new Font(fontName, Font.PLAIN, fontSize);
  String bodyRule = "body { font-family: " + font.getFamily() + "; " +
                    "font-size: " + font.getSize() + "pt; }";
  ((HTMLDocument)taskTextPane.getDocument()).getStyleSheet().addRule(bodyRule);
  taskTextPane.setEditable(false);
  if (!UIUtil.isUnderDarcula()) {
    taskTextPane.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground());
  }
  taskTextPane.setBorder(new EmptyBorder(15, 20, 0, 100));
  return taskTextPane;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:StudyToolWindow.java

示例3: FQNameCellRenderer

import com.intellij.openapi.editor.colors.EditorColorsScheme; //导入方法依赖的package包/类
public FQNameCellRenderer() {
  EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
  FONT = new Font(scheme.getEditorFontName(), Font.PLAIN, scheme.getEditorFontSize());
  setOpaque(true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:FQNameCellRenderer.java

示例4: getEditorFont

import com.intellij.openapi.editor.colors.EditorColorsScheme; //导入方法依赖的package包/类
public static Font getEditorFont() {
  EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
  int size = UISettings.getInstance().PRESENTATION_MODE
             ? UISettings.getInstance().PRESENTATION_MODE_FONT_SIZE - 4 : scheme.getEditorFontSize();
  return new Font(scheme.getEditorFontName(), Font.PLAIN, size);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:EditorUtil.java

示例5: CellRenderer

import com.intellij.openapi.editor.colors.EditorColorsScheme; //导入方法依赖的package包/类
public CellRenderer(String name) {
  myName = name;
  EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
  FONT = new Font(scheme.getEditorFontName(), Font.PLAIN, scheme.getEditorFontSize());
  setOpaque(true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ImportFromExistingAction.java


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