当前位置: 首页>>代码示例>>Java>>正文


Java FileColorManager.getInstance方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:tobszarny,项目名称:ActiveTabHighlighterPlugin,代码行数:17,代码来源:TabHighlighterFileEditorListener.java

示例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);
}
 
开发者ID:tobszarny,项目名称:ActiveTabHighlighterPlugin,代码行数:19,代码来源:CustomEditorTabColorProvider.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:FileColorsOptionsTopHitProvider.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:NavigationItemListCellRenderer.java

示例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);
                }
              });
}
 
开发者ID:ChrisRM,项目名称:material-theme-jetbrains,代码行数:21,代码来源:MTAddFileColorsAction.java

示例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();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:NavigationItemListCellRenderer.java

示例7: createComponent

import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
@Override
public JComponent createComponent() {
  if (myPanel == null) {
    myPanel = new FileColorsConfigurablePanel((FileColorManagerImpl) FileColorManager.getInstance(myProject));
  }

  return myPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:FileColorsConfigurable.java

示例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();
}
 
开发者ID:ChrisRM,项目名称:material-theme-jetbrains,代码行数:10,代码来源:MTEditorTabColor.java

示例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);
}
 
开发者ID:ChrisRM,项目名称:material-theme-jetbrains,代码行数:12,代码来源:MTScopeComponent.java

示例11: XDebuggerFrameListRenderer

import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
public XDebuggerFrameListRenderer(Project project) {
  myColorsManager = FileColorManager.getInstance(project);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:XDebuggerFramesList.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:EditorTabColorProviderImpl.java

示例13: XDebuggerFrameListRenderer

import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
public XDebuggerFrameListRenderer(Project project) {
  myPsiManager = PsiManager.getInstance(project);
  myColorsManager = FileColorManager.getInstance(project);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:XDebuggerFramesList.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:7,代码来源:EditorTabColorProviderImpl.java

示例15: XDebuggerFrameListRenderer

import com.intellij.ui.FileColorManager; //导入方法依赖的package包/类
public XDebuggerFrameListRenderer(@Nonnull Project project) {
  myColorsManager = FileColorManager.getInstance(project);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:XDebuggerFramesList.java


注:本文中的com.intellij.ui.FileColorManager.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。