本文整理汇总了Java中com.intellij.ui.FileColorManager.getFileColor方法的典型用法代码示例。如果您正苦于以下问题:Java FileColorManager.getFileColor方法的具体用法?Java FileColorManager.getFileColor怎么用?Java FileColorManager.getFileColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.FileColorManager
的用法示例。
在下文中一共展示了FileColorManager.getFileColor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEditorTabColor
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
@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.getInstance(project);
EditorWindow activeWindow = fileEditorManagerEx.getCurrentWindow();
if (activeWindow != null) {
final EditorWithProviderComposite selectedEditor = activeWindow.getSelectedEditor();
if (selectedEditor != null && selectedEditor.getFile() != null && selectedEditor.getFile().equals(virtualFile)) {
return highlighterSettingsConfig.buildHighlightColor();
}
}
return fileColorManager.getFileColor(virtualFile);
}
示例2: getEditorTabColor
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
@Override
public Color getEditorTabColor(@NotNull final Project project, @NotNull final VirtualFile virtualFile) {
final FileColorManager colorManager = FileColorManager.getInstance(project);
if (colorManager.isEnabledForTabs()) {
final Color fileColor = colorManager.getFileColor(virtualFile);
return fileColor != null ? fileColor : getDefaultTabColor();
}
return getDefaultTabColor();
}
示例3: getEditorTabColor
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
@Override
@Nullable
public Color getEditorTabColor(Project project, VirtualFile file) {
final FileColorManager colorManager = FileColorManagerImpl.getInstance(project);
final PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
return psiFile != null && colorManager.isEnabledForTabs() ? colorManager.getFileColor(psiFile) : null;
}
示例4: getEditorTabColor
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
@Override
@Nullable
public Color getEditorTabColor(@NotNull Project project, @NotNull VirtualFile file) {
FileColorManager colorManager = FileColorManager.getInstance(project);
return colorManager.isEnabledForTabs() ? colorManager.getFileColor(file) : null;
}
示例5: getEditorTabColor
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
@Override
@Nullable
public Color getEditorTabColor(Project project, VirtualFile file) {
FileColorManager colorManager = FileColorManager.getInstance(project);
return colorManager.isEnabledForTabs() ? colorManager.getFileColor(file) : null;
}