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

项目: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());
}
项目:intellij-ce-playground    文件:DefaultColorSchemesManager.java   
@Nullable
public EditorColorsScheme getScheme(String name) {
  for (DefaultColorsScheme scheme : mySchemes) {
    if (name.equals(scheme.getName())) return scheme;
  }
  return null;
}
项目:tools-idea    文件:DefaultColorSchemesManager.java   
@Override
public void readExternal(Element element) throws InvalidDataException {
  List schemes = element.getChildren(SCHEME_ELEMENT);
  for (Object scheme : schemes) {
    Element schemeElement = (Element)scheme;
    DefaultColorsScheme newScheme = new DefaultColorsScheme(this);
    newScheme.readExternal(schemeElement);
    mySchemes.add(newScheme);
  }
}
项目:tools-idea    文件:DefaultColorSchemesManager.java   
@Nullable
public EditorColorsScheme getScheme(String name) {
  for (DefaultColorsScheme scheme : mySchemes) {
    if (name.equals(scheme.getName())) return scheme;
  }

  return null;
}
项目:intellij-ce-playground    文件:DefaultColorSchemesManager.java   
public DefaultColorSchemesManager() {
  mySchemes = new ArrayList<DefaultColorsScheme>();
}
项目:intellij-ce-playground    文件:DefaultColorSchemesManager.java   
@NotNull
public DefaultColorsScheme[] getAllSchemes() {
  return mySchemes.toArray(new DefaultColorsScheme[mySchemes.size()]);
}
项目:intellij-ce-playground    文件:DefaultColorSchemesManager.java   
@NotNull
public DefaultColorsScheme getFirstScheme() {
  return mySchemes.get(0);
}
项目:tools-idea    文件:DefaultColorSchemesManager.java   
public DefaultColorSchemesManager() {
  mySchemes = new ArrayList<DefaultColorsScheme>();
}
项目:tools-idea    文件:DefaultColorSchemesManager.java   
public DefaultColorsScheme[] getAllSchemes() {
  return mySchemes.toArray(new DefaultColorsScheme[mySchemes.size()]);
}
项目:tools-idea    文件:ColorAndFontOptions.java   
public boolean isDefault() {
  return myParentScheme instanceof DefaultColorsScheme;
}
项目:consulo    文件:ColorAndFontOptions.java   
public boolean isDefault() {
  return myParentScheme instanceof DefaultColorsScheme;
}