use of com.tobszarny.intellij.plugin.activetabhighlighter.config.HighlighterSettingsConfig in project ActiveTabHighlighterPlugin by tobszarny.
the class CustomEditorTabColorProvider method getEditorTabColor.
@Nullable
@Override
public Color getEditorTabColor(@NotNull Project project, @NotNull VirtualFile virtualFile) {
final FileEditorManagerEx fileEditorManagerEx = FileEditorManagerEx.getInstanceEx(project);
FileColorManager fileColorManager = FileColorManager.getInstance(project);
HighlighterSettingsConfig highlighterSettingsConfig = HighlighterSettingsConfig.getSettings(project);
if (highlighterSettingsConfig.isBackgroundColorUsed()) {
EditorWindow activeWindow = fileEditorManagerEx.getCurrentWindow();
if (activeWindow != null) {
final EditorWithProviderComposite selectedEditor = activeWindow.getSelectedEditor();
if (selectedEditor != null && virtualFile.equals(selectedEditor.getFile())) {
return highlighterSettingsConfig.getBackgroundColor();
}
}
}
return fileColorManager.getFileColor(virtualFile);
}
Aggregations