Java 类com.intellij.openapi.editor.colors.impl.EditorColorsSchemeImpl 实例源码

项目:intellij-ce-playground    文件:DocumentMarkupModelTest.java   
public void testInfoTestAttributes() throws Exception {
  LanguageExtensionPoint<Annotator> extension = new LanguageExtensionPoint<Annotator>();
  extension.language="TEXT";
  extension.implementationClass = TestAnnotator.class.getName();
  PlatformTestUtil.registerExtension(ExtensionPointName.create(LanguageAnnotators.EP_NAME), extension, getTestRootDisposable());
  myFixture.configureByText(PlainTextFileType.INSTANCE, "foo");
  EditorColorsScheme scheme = new EditorColorsSchemeImpl(new DefaultColorsScheme()){{initFonts();}};
  scheme.setAttributes(HighlighterColors.TEXT, new TextAttributes(Color.black, Color.white, null, null, Font.PLAIN));
  ((EditorEx)myFixture.getEditor()).setColorsScheme(scheme);
  myFixture.doHighlighting();
  MarkupModel model = DocumentMarkupModel.forDocument(myFixture.getEditor().getDocument(), getProject(), false);
  RangeHighlighter[] highlighters = model.getAllHighlighters();
  assertEquals(1, highlighters.length);
  TextAttributes attributes = highlighters[0].getTextAttributes();
  assertNotNull(attributes);
  assertNull(attributes.getBackgroundColor());
  assertNull(attributes.getForegroundColor());
}
项目:tools-idea    文件:QuickChangeColorSchemeAction.java   
protected void fillActions(Project project, @NotNull DefaultActionGroup group, @NotNull DataContext dataContext) {
  final EditorColorsScheme[] schemes = EditorColorsManager.getInstance().getAllSchemes();
  EditorColorsScheme current = EditorColorsManager.getInstance().getGlobalScheme();
  for (final EditorColorsScheme scheme : schemes) {
    addScheme(group, current, scheme, false);
  }


  Collection<SharedScheme<EditorColorsSchemeImpl>> sharedSchemes = ((EditorColorsManagerImpl)EditorColorsManager.getInstance()).getSchemesManager().loadSharedSchemes();

  if (!sharedSchemes.isEmpty()) {
    group.add(Separator.getInstance());

    for (SharedScheme<EditorColorsSchemeImpl> sharedScheme : sharedSchemes) {
      addScheme(group, current, sharedScheme.getScheme(), true);
    }
  }

}