use of com.intellij.openapi.editor.colors.impl.DelegateColorScheme in project intellij-community by JetBrains.
the class ConsoleViewUtil method setupConsoleEditor.
public static void setupConsoleEditor(@NotNull final EditorEx editor, final boolean foldingOutlineShown, final boolean lineMarkerAreaShown) {
ApplicationManager.getApplication().runReadAction(() -> {
editor.setSoftWrapAppliancePlace(SoftWrapAppliancePlaces.CONSOLE);
final EditorSettings editorSettings = editor.getSettings();
editorSettings.setLineMarkerAreaShown(lineMarkerAreaShown);
editorSettings.setIndentGuidesShown(false);
editorSettings.setLineNumbersShown(false);
editorSettings.setFoldingOutlineShown(foldingOutlineShown);
editorSettings.setAdditionalPageAtBottom(false);
editorSettings.setAdditionalColumnsCount(0);
editorSettings.setAdditionalLinesCount(0);
editorSettings.setRightMarginShown(false);
editorSettings.setCaretRowShown(false);
editor.getGutterComponentEx().setPaintBackground(false);
editor.putUserData(EDITOR_IS_CONSOLE_VIEW, true);
final DelegateColorScheme scheme = updateConsoleColorScheme(editor.getColorsScheme());
if (UISettings.getInstance().getPresentationMode()) {
scheme.setEditorFontSize(UISettings.getInstance().getPresentationModeFontSize());
}
editor.setColorsScheme(scheme);
});
}
use of com.intellij.openapi.editor.colors.impl.DelegateColorScheme in project intellij-community by JetBrains.
the class EventLogConsole method installNotificationsFont.
private void installNotificationsFont(@NotNull final EditorEx editor) {
final DelegateColorScheme globalScheme = new DelegateColorScheme(EditorColorsManager.getInstance().getGlobalScheme()) {
@Override
public String getEditorFontName() {
return getConsoleFontName();
}
@Override
public int getEditorFontSize() {
return getConsoleFontSize();
}
@Override
public String getConsoleFontName() {
return NotificationsUtil.getFontName();
}
@Override
public int getConsoleFontSize() {
Pair<String, Integer> data = NotificationsUtil.getFontData();
return data == null ? super.getConsoleFontSize() : data.second;
}
@Override
public void setEditorFontName(String fontName) {
}
@Override
public void setConsoleFontName(String fontName) {
}
@Override
public void setEditorFontSize(int fontSize) {
}
@Override
public void setConsoleFontSize(int fontSize) {
}
};
ApplicationManager.getApplication().getMessageBus().connect(myProjectModel).subscribe(EditorColorsManager.TOPIC, new EditorColorsListener() {
@Override
public void globalSchemeChange(EditorColorsScheme scheme) {
globalScheme.setDelegate(EditorColorsManager.getInstance().getGlobalScheme());
editor.reinitSettings();
}
});
editor.setColorsScheme(ConsoleViewUtil.updateConsoleColorScheme(editor.createBoundColorSchemeDelegate(globalScheme)));
if (editor instanceof EditorImpl) {
((EditorImpl) editor).setUseEditorAntialiasing(false);
}
}
use of com.intellij.openapi.editor.colors.impl.DelegateColorScheme in project intellij-community by JetBrains.
the class EditorTextFieldCellRenderer method getEditorPanel.
@NotNull
private RendererComponent getEditorPanel(final JTable table) {
RendererComponent panel = UIUtil.getClientProperty(table, MY_PANEL_PROPERTY);
if (panel != null) {
DelegateColorScheme scheme = (DelegateColorScheme) panel.getEditor().getColorsScheme();
scheme.setDelegate(EditorColorsManager.getInstance().getGlobalScheme());
return panel;
}
panel = createRendererComponent(myProject, myFileType, myInheritFontFromLaF);
Disposer.register(this, panel);
Disposer.register(this, new Disposable() {
@Override
public void dispose() {
UIUtil.putClientProperty(table, MY_PANEL_PROPERTY, null);
}
});
table.putClientProperty(MY_PANEL_PROPERTY, panel);
return panel;
}
Aggregations