本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}