本文整理汇总了Java中com.intellij.ui.FileColorManager.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java FileColorManager.getInstance方法的具体用法?Java FileColorManager.getInstance怎么用?Java FileColorManager.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.FileColorManager
的用法示例。
在下文中一共展示了FileColorManager.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: selectionChanged
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
@Override
public void selectionChanged(@NotNull FileEditorManagerEvent fileEditorManagerEvent) {
final Project project = fileEditorManagerEvent.getManager().getProject();
final FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(project);
final FileColorManager fileColorManager = FileColorManager.getInstance(project);
final HighlighterSettingsConfig highlighterSettingsConfig = HighlighterSettingsConfig.getInstance(project);
final VirtualFile oldFile = fileEditorManagerEvent.getOldFile();
final VirtualFile newFile = fileEditorManagerEvent.getNewFile();
for (EditorWindow editorWindow : manager.getWindows()) {
setUnfocusedTabWithColorManagerDefaultColor(fileColorManager, oldFile, editorWindow);
setFocusedTabHighlighterColor(highlighterSettingsConfig, newFile, editorWindow);
}
}
示例2: 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);
}
示例3: getOptions
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
@NotNull
@Override
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
if (project != null) {
FileColorManager manager = FileColorManager.getInstance(project);
if (manager != null) {
BooleanOptionDescription enabled = new Option(manager, "File Colors enabled", "isEnabled", "setEnabled");
return !enabled.isOptionEnabled()
? Collections.singletonList(enabled)
: Collections.unmodifiableCollection(Arrays.asList(
enabled,
new Option(manager, "Use File Colors in Editor Tabs", "isEnabledForTabs", "setEnabledForTabs"),
new Option(manager, "Use File Colors in Project View", "isEnabledForProjectView", "setEnabledForProjectView")));
}
}
return Collections.emptyList();
}
示例4: getBackgroundColor
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
protected static Color getBackgroundColor(@Nullable Object value) {
if (value instanceof PsiElement || value instanceof DataProvider) {
final PsiElement psiElement = value instanceof PsiElement
? (PsiElement)value
: CommonDataKeys.PSI_ELEMENT.getData((DataProvider) value);
if (psiElement != null && psiElement.isValid()) {
final FileColorManager fileColorManager = FileColorManager.getInstance(psiElement.getProject());
final Color fileColor = fileColorManager.getRendererBackground(psiElement.getContainingFile());
if (fileColor != null) {
return fileColor;
}
}
}
return UIUtil.getListBackground();
}
示例5: addDisabledFileColors
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
private void addDisabledFileColors(Project project) {
final FileColorManager manager = FileColorManager.getInstance(project);
manager.addScopeColor(NonProjectFilesScope.NAME, MTOceanicTheme.DISABLED, false);
manager.addScopeColor(NonProjectFilesScope.NAME, MTDarkerTheme.DISABLED, false);
manager.addScopeColor(NonProjectFilesScope.NAME, MTLighterTheme.DISABLED, false);
manager.addScopeColor(NonProjectFilesScope.NAME, MTPalenightTheme.DISABLED, false);
Notify.show(project,
"",
MaterialThemeBundle.message("mt.fileColorsInstalled"),
NotificationType.INFORMATION,
new NotificationListener.Adapter() {
@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
ApplicationManager.getApplication().invokeLater(() -> ShowSettingsUtil.getInstance().showSettingsDialog(
project,
"File Colors"), ModalityState.NON_MODAL);
}
});
}
示例6: getBackgroundColor
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
protected static Color getBackgroundColor(@Nullable Object value) {
if (value instanceof PsiElement || value instanceof DataProvider) {
final PsiElement psiElement = value instanceof PsiElement
? (PsiElement)value
: LangDataKeys.PSI_ELEMENT.getData((DataProvider) value);
if (psiElement != null) {
final FileColorManager fileColorManager = FileColorManager.getInstance(psiElement.getProject());
final Color fileColor = fileColorManager.getRendererBackground(psiElement.getContainingFile());
if (fileColor != null) {
return fileColor;
}
}
}
return UIUtil.getListBackground();
}
示例7: createComponent
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
@Override
public JComponent createComponent() {
if (myPanel == null) {
myPanel = new FileColorsConfigurablePanel((FileColorManagerImpl) FileColorManager.getInstance(myProject));
}
return myPanel;
}
示例8: getEditorTabColor
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
@Nullable
@Override
public Color getEditorTabColor(@NotNull Project project, @NotNull VirtualFile file) {
if (JSGraphQLSchemaLanguageProjectService.isProjectSchemaFile(file)) {
FileColorManager colorManager = FileColorManager.getInstance(project);
if (colorManager.isEnabledForTabs()) {
return colorManager.getScopeColor(NonProjectFilesScope.NAME);
}
}
return null;
}
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:12,代码来源:JSGraphQLSchemaEditorTabColorProvider.java
示例9: 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();
}
示例10: addDisabledFileColors
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
/**
* At start, check if Material Theme File Colors are added, otherwise add them
* Note: If the scope has changed somehow (by changing the name or the color), it will add a duplicate.
*/
private void addDisabledFileColors() {
final FileColorManager manager = FileColorManager.getInstance(myProject);
manager.addScopeColor(NonProjectFilesScope.NAME, MTOceanicTheme.DISABLED, false);
manager.addScopeColor(NonProjectFilesScope.NAME, MTDarkerTheme.DISABLED, false);
manager.addScopeColor(NonProjectFilesScope.NAME, MTLighterTheme.DISABLED, false);
manager.addScopeColor(NonProjectFilesScope.NAME, MTPalenightTheme.DISABLED, false);
}
示例11: XDebuggerFrameListRenderer
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
public XDebuggerFrameListRenderer(Project project) {
myColorsManager = FileColorManager.getInstance(project);
}
示例12: 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;
}
示例13: XDebuggerFrameListRenderer
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
public XDebuggerFrameListRenderer(Project project) {
myPsiManager = PsiManager.getInstance(project);
myColorsManager = FileColorManager.getInstance(project);
}
示例14: 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;
}
示例15: XDebuggerFrameListRenderer
import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
public XDebuggerFrameListRenderer(@Nonnull Project project) {
myColorsManager = FileColorManager.getInstance(project);
}