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