use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class HighlightingSessionImpl method queueHighlightInfo.
void queueHighlightInfo(@NotNull HighlightInfo info, @NotNull TextRange restrictedRange, int groupId) {
myEDTQueue.offer(() -> {
final EditorColorsScheme colorsScheme = getColorsScheme();
UpdateHighlightersUtil.addHighlighterToEditorIncrementally(myProject, getDocument(), getPsiFile(), restrictedRange.getStartOffset(), restrictedRange.getEndOffset(), info, colorsScheme, groupId, myRanges2markersCache);
});
}
use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class ColorSchemeActions method importScheme.
@Override
protected void importScheme(@NotNull String importerName) {
if (tryImportWithImportHandler(importerName)) {
return;
}
final SchemeImporter<EditorColorsScheme> importer = SchemeImporterEP.getImporter(importerName, EditorColorsScheme.class);
if (importer != null) {
VirtualFile importSource = SchemeImportUtil.selectImportSource(importer.getSourceExtensions(), getSchemesPanel(), null, "Choose " + importerName);
if (importSource != null) {
try {
EditorColorsScheme imported = importer.importScheme(DefaultProjectFactory.getInstance().getDefaultProject(), importSource, getOptions().getSelectedScheme(), name -> {
String newName = SchemeNameGenerator.getUniqueName(name != null ? name : "Unnamed", candidate -> getSchemesPanel().getModel().containsScheme(candidate, false));
AbstractColorsScheme newScheme = new EditorColorsSchemeImpl(EmptyColorScheme.INSTANCE);
newScheme.setName(newName);
newScheme.setDefaultMetaInfo(EmptyColorScheme.INSTANCE);
return newScheme;
});
if (imported != null) {
getOptions().addImportedScheme(imported);
}
} catch (SchemeImportException e) {
getSchemesPanel().showStatus("Import failed: " + e.getMessage(), MessageType.ERROR);
}
}
}
}
use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class ColorSchemeActions method exportScheme.
@Override
protected void exportScheme(@NotNull EditorColorsScheme scheme, @NotNull String exporterName) {
EditorColorsScheme schemeToExport = scheme;
if (scheme instanceof AbstractColorsScheme) {
EditorColorsScheme parent = ((AbstractColorsScheme) scheme).getParentScheme();
if (!(parent instanceof DefaultColorsScheme)) {
schemeToExport = parent;
}
}
if (schemeToExport.getName().startsWith(SchemeManager.EDITABLE_COPY_PREFIX)) {
schemeToExport = (EditorColorsScheme) schemeToExport.clone();
schemeToExport.setName(SchemeManager.getDisplayName(schemeToExport));
}
super.exportScheme(schemeToExport, exporterName);
}
use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class ColorSchemeImporter method importScheme.
@Nullable
@Override
public EditorColorsScheme importScheme(@NotNull Project project, @NotNull VirtualFile selectedFile, @NotNull EditorColorsScheme currentScheme, @NotNull SchemeFactory<EditorColorsScheme> schemeFactory) throws SchemeImportException {
Element root = SchemeImportUtil.loadSchemeDom(selectedFile);
String name = getSchemeName(root);
EditorColorsScheme scheme = schemeFactory.createNewScheme(name);
String preferredName = scheme.getName();
scheme.readExternal(root);
scheme.setName(preferredName);
return scheme;
}
use of com.intellij.openapi.editor.colors.EditorColorsScheme in project intellij-community by JetBrains.
the class EditorOptionsPanel method reset.
@Override
public void reset() {
EditorSettingsExternalizable editorSettings = EditorSettingsExternalizable.getInstance();
CodeInsightSettings codeInsightSettings = CodeInsightSettings.getInstance();
UISettings uiSettings = UISettings.getInstance();
VcsApplicationSettings vcsSettings = VcsApplicationSettings.getInstance();
// Display
myCbSmoothScrolling.setSelected(editorSettings.isSmoothScrolling());
// Brace highlighting
myCbHighlightBraces.setSelected(codeInsightSettings.HIGHLIGHT_BRACES);
myCbHighlightScope.setSelected(codeInsightSettings.HIGHLIGHT_SCOPE);
myCbHighlightIdentifierUnderCaret.setSelected(codeInsightSettings.HIGHLIGHT_IDENTIFIER_UNDER_CARET);
// Virtual space
myCbUseSoftWrapsAtEditor.setSelected(editorSettings.isUseSoftWraps(SoftWrapAppliancePlaces.MAIN_EDITOR));
myCbUseCustomSoftWrapIndent.setSelected(editorSettings.isUseCustomSoftWrapIndent());
myCustomSoftWrapIndent.setText(Integer.toString(editorSettings.getCustomSoftWrapIndent()));
myCbShowSoftWrapsOnlyOnCaretLine.setSelected(!editorSettings.isAllSoftWrapsShown());
updateSoftWrapSettingsRepresentation();
myCbVirtualSpace.setSelected(editorSettings.isVirtualSpace());
myCbCaretInsideTabs.setSelected(editorSettings.isCaretInsideTabs());
myCbVirtualPageAtBottom.setSelected(editorSettings.isAdditionalPageAtBottom());
// Limits
myClipboardContentLimitTextField.setText(Integer.toString(uiSettings.getMaxClipboardContents()));
// Strip trailing spaces on save
String stripTrailingSpaces = editorSettings.getStripTrailingSpaces();
if (EditorSettingsExternalizable.STRIP_TRAILING_SPACES_NONE.equals(stripTrailingSpaces)) {
myStripTrailingSpacesCombo.setSelectedItem(STRIP_NONE);
} else if (EditorSettingsExternalizable.STRIP_TRAILING_SPACES_CHANGED.equals(stripTrailingSpaces)) {
myStripTrailingSpacesCombo.setSelectedItem(STRIP_CHANGED);
} else if (EditorSettingsExternalizable.STRIP_TRAILING_SPACES_WHOLE.equals(stripTrailingSpaces)) {
myStripTrailingSpacesCombo.setSelectedItem(STRIP_ALL);
}
myCbKeepTrailingSpacesOnCaretLine.setSelected(editorSettings.isKeepTrailingSpacesOnCaretLine());
myCbEnsureBlankLineBeforeCheckBox.setSelected(editorSettings.isEnsureNewLineAtEOF());
myCbShowQuickDocOnMouseMove.setSelected(editorSettings.isShowQuickDocOnMouseOverElement());
myQuickDocDelayTextField.setText(Long.toString(editorSettings.getQuickDocOnMouseOverElementDelayMillis()));
myQuickDocDelayTextField.setEnabled(editorSettings.isShowQuickDocOnMouseOverElement());
myQuickDocDelayLabel.setEnabled(editorSettings.isShowQuickDocOnMouseOverElement());
// Advanced mouse
myCbEnableDnD.setSelected(editorSettings.isDndEnabled());
myCbEnableWheelFontChange.setSelected(editorSettings.isWheelFontChangeEnabled());
myCbHonorCamelHumpsWhenSelectingByClicking.setSelected(editorSettings.isMouseClickSelectionHonorsCamelWords());
myRbPreferMovingCaret.setSelected(editorSettings.isRefrainFromScrolling());
myRbPreferScrolling.setSelected(!editorSettings.isRefrainFromScrolling());
myRecentFilesLimitField.setText(Integer.toString(uiSettings.getRecentFilesLimit()));
myCbRenameLocalVariablesInplace.setSelected(editorSettings.isVariableInplaceRenameEnabled());
myPreselectCheckBox.setSelected(editorSettings.isPreselectRename());
myShowInlineDialogForCheckBox.setSelected(editorSettings.isShowInlineLocalDialog());
myShowNotificationAfterReformatCodeCheckBox.setSelected(editorSettings.getOptions().SHOW_NOTIFICATION_AFTER_REFORMAT_CODE_ACTION);
myShowNotificationAfterOptimizeImportsCheckBox.setSelected(editorSettings.getOptions().SHOW_NOTIFICATION_AFTER_OPTIMIZE_IMPORTS_ACTION);
myShowLSTInGutterCheckBox.setSelected(vcsSettings.SHOW_LST_GUTTER_MARKERS);
myShowWhitespacesModificationsInLSTGutterCheckBox.setSelected(vcsSettings.SHOW_WHITESPACES_IN_LST);
myShowWhitespacesModificationsInLSTGutterCheckBox.setEnabled(myShowLSTInGutterCheckBox.isSelected());
myErrorHighlightingPanel.reset();
RichCopySettings settings = RichCopySettings.getInstance();
myCbEnableRichCopyByDefault.setSelected(settings.isEnabled());
myRichCopyColorSchemeComboBox.removeAllItems();
EditorColorsScheme[] schemes = EditorColorsManager.getInstance().getAllSchemes();
myRichCopyColorSchemeComboBox.addItem(RichCopySettings.ACTIVE_GLOBAL_SCHEME_MARKER);
for (EditorColorsScheme scheme : schemes) {
myRichCopyColorSchemeComboBox.addItem(scheme.getName());
}
String toSelect = settings.getSchemeName();
if (!StringUtil.isEmpty(toSelect)) {
myRichCopyColorSchemeComboBox.setSelectedItem(toSelect);
}
}
Aggregations