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


Java EffectType.BOXED属性代码示例

本文整理汇总了Java中com.intellij.openapi.editor.markup.EffectType.BOXED属性的典型用法代码示例。如果您正苦于以下问题:Java EffectType.BOXED属性的具体用法?Java EffectType.BOXED怎么用?Java EffectType.BOXED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.intellij.openapi.editor.markup.EffectType的用法示例。


在下文中一共展示了EffectType.BOXED属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testScopeBased

public void testScopeBased() throws Exception {
  NamedScope xScope = new NamedScope("xxx", new PatternPackageSet("x..*", PatternPackageSet.SCOPE_SOURCE, null));
  NamedScope utilScope = new NamedScope("util", new PatternPackageSet("java.util.*", PatternPackageSet.SCOPE_LIBRARY, null));
  NamedScopeManager scopeManager = NamedScopeManager.getInstance(getProject());
  scopeManager.addScope(xScope);
  scopeManager.addScope(utilScope);

  EditorColorsManager manager = EditorColorsManager.getInstance();
  EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
  manager.addColorsScheme(scheme);
  EditorColorsManager.getInstance().setGlobalScheme(scheme);
  TextAttributesKey xKey = ScopeAttributesUtil.getScopeTextAttributeKey(xScope.getName());
  TextAttributes xAttributes = new TextAttributes(Color.cyan, Color.darkGray, Color.blue, EffectType.BOXED, Font.ITALIC);
  scheme.setAttributes(xKey, xAttributes);

  TextAttributesKey utilKey = ScopeAttributesUtil.getScopeTextAttributeKey(utilScope.getName());
  TextAttributes utilAttributes = new TextAttributes(Color.gray, Color.magenta, Color.orange, EffectType.STRIKEOUT, Font.BOLD);
  scheme.setAttributes(utilKey, utilAttributes);

  try {
    testFile(BASE_PATH + "/scopeBased/x/X.java").projectRoot(BASE_PATH + "/scopeBased").checkSymbolNames().test();
  }
  finally {
    scopeManager.removeAllSets();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:AdvHighlightingTest.java

示例2: testScopeBased

public void testScopeBased() throws Exception {
  NamedScope xScope = new NamedScope("xxx", new PatternPackageSet("x..*", PatternPackageSet.SCOPE_SOURCE, null));
  NamedScope utilScope = new NamedScope("util", new PatternPackageSet("java.util.*", PatternPackageSet.SCOPE_LIBRARY, null));
  NamedScopeManager scopeManager = NamedScopeManager.getInstance(getProject());
  scopeManager.addScope(xScope);
  scopeManager.addScope(utilScope);

  EditorColorsManager manager = EditorColorsManager.getInstance();
  EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
  manager.addColorsScheme(scheme);
  EditorColorsManager.getInstance().setGlobalScheme(scheme);
  TextAttributesKey xKey = ColorAndFontOptions.getScopeTextAttributeKey(xScope.getName());
  TextAttributes xAttributes = new TextAttributes(Color.cyan, Color.darkGray, Color.blue, EffectType.BOXED, Font.ITALIC);
  scheme.setAttributes(xKey, xAttributes);

  TextAttributesKey utilKey = ColorAndFontOptions.getScopeTextAttributeKey(utilScope.getName());
  TextAttributes utilAttributes = new TextAttributes(Color.gray, Color.magenta, Color.orange, EffectType.STRIKEOUT, Font.BOLD);
  scheme.setAttributes(utilKey, utilAttributes);

  try {
    testFile(BASE_PATH + "/scopeBased/x/X.java").projectRoot(BASE_PATH + "/scopeBased").checkSymbolNames().test();
  }
  finally {
    scopeManager.removeAllSets();
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:AdvHighlightingTest.java

示例3: testSharedScopeBased

public void testSharedScopeBased() throws Exception {
  NamedScope xScope = new NamedScope("xxx", new PatternPackageSet("x..*", PatternPackageSet.SCOPE_ANY, null));
  NamedScope utilScope = new NamedScope("util", new PatternPackageSet("java.util.*", PatternPackageSet.SCOPE_LIBRARY, null));
  NamedScopesHolder scopeManager = DependencyValidationManager.getInstance(getProject());
  scopeManager.addScope(xScope);
  scopeManager.addScope(utilScope);

  EditorColorsManager manager = EditorColorsManager.getInstance();
  EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
  manager.addColorsScheme(scheme);
  EditorColorsManager.getInstance().setGlobalScheme(scheme);
  TextAttributesKey xKey = ScopeAttributesUtil.getScopeTextAttributeKey(xScope.getName());
  TextAttributes xAttributes = new TextAttributes(Color.cyan, Color.darkGray, Color.blue, null, Font.ITALIC);
  scheme.setAttributes(xKey, xAttributes);

  TextAttributesKey utilKey = ScopeAttributesUtil.getScopeTextAttributeKey(utilScope.getName());
  TextAttributes utilAttributes = new TextAttributes(Color.gray, Color.magenta, Color.orange, EffectType.STRIKEOUT, Font.BOLD);
  scheme.setAttributes(utilKey, utilAttributes);

  NamedScope projectScope = PackagesScopesProvider.getInstance(myProject).getProjectProductionScope();
  TextAttributesKey projectKey = ScopeAttributesUtil.getScopeTextAttributeKey(projectScope.getName());
  TextAttributes projectAttributes = new TextAttributes(null, null, Color.blue, EffectType.BOXED, Font.ITALIC);
  scheme.setAttributes(projectKey, projectAttributes);

  try {
    testFile(BASE_PATH + "/scopeBased/x/Shared.java").projectRoot(BASE_PATH + "/scopeBased").checkSymbolNames().test();
  }
  finally {
    scopeManager.removeAllSets();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:AdvHighlightingTest.java

示例4: equals

@Override
public boolean equals(final TextAttributes attributes1, final TextAttributes attributes2) {
  Color effectColor = attributes1.getEffectColor();
  EffectType effectType = attributes1.getEffectType();
  return effectColor != null
         && effectColor.equals(attributes2.getEffectColor())
         && (EffectType.BOXED == effectType || EffectType.ROUNDED_BOX == effectType) &&
         effectType == attributes2.getEffectType();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:BorderEffect.java

示例5: paintFoldedEffect

public static void paintFoldedEffect(Graphics g, int foldingXStart,
                                     int y, int foldingXEnd, int lineHeight, Color effectColor,
                                     EffectType effectType) {
  if (effectColor == null || effectType != EffectType.BOXED) return;
  g.setColor(effectColor);
  g.drawRect(foldingXStart, y, foldingXEnd - foldingXStart, lineHeight - 1);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:BorderEffect.java

示例6: apply

@Override
public void apply(EditorColorsScheme scheme) {
  TextAttributesKey key = myDiffType.getAttributesKey();
  TextAttributes attrs = new TextAttributes(null, myBackgroundColor, null, EffectType.BOXED, Font.PLAIN);
  attrs.setErrorStripeColor(myStripebarColor);
  scheme.setAttributes(key, attrs);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:DiffOptionsPanel.java

示例7: testYieldInNestedFunction

public void testYieldInNestedFunction() {
  // highlight func declaration first, lest we get an "Extra fragment highlighted" error.
  EditorColorsManager manager = EditorColorsManager.getInstance();
  EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
  manager.addColorsScheme(scheme);
  EditorColorsManager.getInstance().setGlobalScheme(scheme);

  TextAttributesKey xKey = TextAttributesKey.find("PY.FUNC_DEFINITION");
  TextAttributes xAttributes = new TextAttributes(Color.red, Color.black, Color.white, EffectType.BOXED, Font.BOLD);
  scheme.setAttributes(xKey, xAttributes);

  doTest();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:PythonHighlightingTest.java

示例8: testSharedScopeBased

public void testSharedScopeBased() throws Exception {
  NamedScope xScope = new NamedScope("xxx", new PatternPackageSet("x..*", PatternPackageSet.SCOPE_ANY, null));
  NamedScope utilScope = new NamedScope("util", new PatternPackageSet("java.util.*", PatternPackageSet.SCOPE_LIBRARY, null));
  NamedScopesHolder scopeManager = DependencyValidationManager.getInstance(getProject());
  scopeManager.addScope(xScope);
  scopeManager.addScope(utilScope);

  EditorColorsManager manager = EditorColorsManager.getInstance();
  EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
  manager.addColorsScheme(scheme);
  EditorColorsManager.getInstance().setGlobalScheme(scheme);
  TextAttributesKey xKey = ColorAndFontOptions.getScopeTextAttributeKey(xScope.getName());
  TextAttributes xAttributes = new TextAttributes(Color.cyan, Color.darkGray, Color.blue, null, Font.ITALIC);
  scheme.setAttributes(xKey, xAttributes);

  TextAttributesKey utilKey = ColorAndFontOptions.getScopeTextAttributeKey(utilScope.getName());
  TextAttributes utilAttributes = new TextAttributes(Color.gray, Color.magenta, Color.orange, EffectType.STRIKEOUT, Font.BOLD);
  scheme.setAttributes(utilKey, utilAttributes);

  NamedScope projectScope = PackagesScopesProvider.getInstance(myProject).getProjectProductionScope();
  TextAttributesKey projectKey = ColorAndFontOptions.getScopeTextAttributeKey(projectScope.getName());
  TextAttributes projectAttributes = new TextAttributes(null, null, Color.blue, EffectType.BOXED, Font.ITALIC);
  scheme.setAttributes(projectKey, projectAttributes);

  try {
    testFile(BASE_PATH + "/scopeBased/x/Shared.java").projectRoot(BASE_PATH + "/scopeBased").checkSymbolNames().test();
  }
  finally {
    scopeManager.removeAllSets();
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:AdvHighlightingTest.java

示例9: read

static EffectType read(TextAttributesReader reader, Element element) {
  Effect effect = reader.readChild(Effect.class, element, EFFECT_TYPE);
  return effect != null ? effect.myType : EffectType.BOXED;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:TextAttributesReader.java

示例10: isBorder

private static boolean isBorder(TextAttributes textAttributes) {
  return textAttributes != null &&
         textAttributes.getEffectColor() != null &&
         (EffectType.BOXED == textAttributes.getEffectType() || EffectType.ROUNDED_BOX == textAttributes.getEffectType());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:BorderEffect.java

示例11: readScheme

private void readScheme(Element node) throws InvalidDataException {
  myDeprecatedBackgroundColor = null;
  if (SCHEME_ELEMENT.equals(node.getName())) {
    setName(node.getAttributeValue(NAME_ATTR));
    int readVersion = Integer.parseInt(node.getAttributeValue(VERSION_ATTR, "0"));
    if (readVersion > CURR_VERSION) throw new InvalidDataException("Unsupported color scheme version: " + readVersion);
    myVersion = readVersion;
    String isDefaultScheme = node.getAttributeValue(DEFAULT_SCHEME_ATTR);
    if (isDefaultScheme == null || !Boolean.parseBoolean(isDefaultScheme)) {
      String parentSchemeName = node.getAttributeValue(PARENT_SCHEME_ATTR);
      if (parentSchemeName == null) parentSchemeName = DEFAULT_SCHEME_NAME;
      myParentScheme = myDefaultColorSchemesManager.getScheme(parentSchemeName);
    }

    for (final Object o : node.getChildren()) {
      Element childNode = (Element)o;
      String childName = childNode.getName();
      if (OPTION_ELEMENT.equals(childName)) {
        readSettings(childNode);
      }
      else if (EDITOR_FONT.equals(childName)) {
        readFontSettings(childNode, myFontPreferences);
      }
      else if (CONSOLE_FONT.equals(childName)) {
        readFontSettings(childNode, myConsoleFontPreferences);
      }
      else if (COLORS_ELEMENT.equals(childName)) {
        readColors(childNode);
      }
      else if (ATTRIBUTES_ELEMENT.equals(childName)) {
        readAttributes(childNode);
      }
    }

    if (myDeprecatedBackgroundColor != null) {
      TextAttributes textAttributes = myAttributesMap.get(HighlighterColors.TEXT);
      if (textAttributes == null) {
        textAttributes = new TextAttributes(Color.black, myDeprecatedBackgroundColor, null, EffectType.BOXED, Font.PLAIN);
        myAttributesMap.put(HighlighterColors.TEXT, textAttributes);
      }
      else {
        textAttributes.setBackgroundColor(myDeprecatedBackgroundColor);
      }
    }

    if (myConsoleFontPreferences.getEffectiveFontFamilies().isEmpty()) {
      myFontPreferences.copyTo(myConsoleFontPreferences);
    }
    
    initFonts();
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:52,代码来源:AbstractColorsScheme.java

示例12: getAttributesFor

static TextAttributes getAttributesFor(final Range range) {
  final Color stripeColor = getDiffColor(range, false);
  final TextAttributes textAttributes = new TextAttributes(null, stripeColor, null, EffectType.BOXED, Font.PLAIN);
  textAttributes.setErrorStripeColor(stripeColor);
  return textAttributes;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:LineStatusTrackerDrawing.java

示例13: reset

public void reset(ColorAndFontDescription description) {
  if (description.isFontEnabled()) {
    myLabelFont.setEnabled(true);
    myCbBold.setEnabled(true);
    myCbItalic.setEnabled(true);
    int fontType = description.getFontType();
    myCbBold.setSelected((fontType & Font.BOLD) != 0);
    myCbItalic.setSelected((fontType & Font.ITALIC) != 0);
  }
  else {
    myLabelFont.setEnabled(false);
    myCbBold.setSelected(false);
    myCbBold.setEnabled(false);
    myCbItalic.setSelected(false);
    myCbItalic.setEnabled(false);
  }

  updateColorChooser(myCbForeground, myForegroundChooser, description.isForegroundEnabled(),
                     description.isForegroundChecked(), description.getForegroundColor());

  updateColorChooser(myCbBackground, myBackgroundChooser, description.isBackgroundEnabled(),
                     description.isBackgroundChecked(), description.getBackgroundColor());

  updateColorChooser(myCbErrorStripe, myErrorStripeColorChooser, description.isErrorStripeEnabled(),
                     description.isErrorStripeChecked(), description.getErrorStripeColor());

  EffectType effectType = description.getEffectType();
  updateColorChooser(myCbEffects, myEffectsColorChooser, description.isEffectsColorEnabled(),
                     description.isEffectsColorChecked(), description.getEffectColor());

  if (description.isEffectsColorEnabled() && description.isEffectsColorChecked()) {
    myEffectsCombo.setEnabled(true);
    updatingEffects = true;
    if (effectType == EffectType.BOXED) {
      myEffectsCombo.setSelectedItem(BORDERED_EFFECT);
    }
    else if (effectType == EffectType.LINE_UNDERSCORE) {
      myEffectsCombo.setSelectedItem(UNDERSCORED_EFFECT);
    }
    else if (effectType == EffectType.WAVE_UNDERSCORE) {
      myEffectsCombo.setSelectedItem(UNDERWAVED_EFFECT);
    }
    else if (effectType == EffectType.BOLD_LINE_UNDERSCORE) {
      myEffectsCombo.setSelectedItem(BOLD_UNDERSCORED_EFFECT);
    }
    else if (effectType == EffectType.STRIKEOUT) {
      myEffectsCombo.setSelectedItem(STRIKEOUT_EFFECT);
    }
    else if (effectType == EffectType.BOLD_DOTTED_LINE) {
      myEffectsCombo.setSelectedItem(BOLD_DOTTED_LINE_EFFECT);
    }
    else {
      myEffectsCombo.setSelectedItem(null);
    }
    updatingEffects = false;
  }
  else {
    myEffectsCombo.setEnabled(false);
  }
  setInheritanceLabel(description);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:61,代码来源:ColorAndFontDescriptionPanel.java

示例14: readScheme

private void readScheme(Element node) {
  myDeprecatedBackgroundColor = null;
  if (!SCHEME_ELEMENT.equals(node.getName())) {
    return;
  }

  setName(node.getAttributeValue(NAME_ATTR));
  int readVersion = Integer.parseInt(node.getAttributeValue(VERSION_ATTR, "0"));
  if (readVersion > CURR_VERSION) {
    throw new IllegalStateException("Unsupported color scheme version: " + readVersion);
  }

  myVersion = readVersion;
  String isDefaultScheme = node.getAttributeValue(DEFAULT_SCHEME_ATTR);
  if (isDefaultScheme == null || !Boolean.parseBoolean(isDefaultScheme)) {
    String defaultAttributeValue = node.getAttributeValue(PARENT_SCHEME_ATTR, DEFAULT_SCHEME_NAME);
    myParentScheme = myEditorColorsManager.getBundledSchemes().get(defaultAttributeValue);
  }

  for (final Element childNode : node.getChildren()) {
    String childName = childNode.getName();
    if (OPTION_ELEMENT.equals(childName)) {
      readSettings(childNode);
    }
    else if (EDITOR_FONT.equals(childName)) {
      readFontSettings(childNode, myFontPreferences);
    }
    else if (CONSOLE_FONT.equals(childName)) {
      readFontSettings(childNode, myConsoleFontPreferences);
    }
    else if (COLORS_ELEMENT.equals(childName)) {
      readColors(childNode);
    }
    else if (ATTRIBUTES_ELEMENT.equals(childName)) {
      readAttributes(childNode);
    }
  }

  if (myDeprecatedBackgroundColor != null) {
    TextAttributes textAttributes = myAttributesMap.get(HighlighterColors.TEXT);
    if (textAttributes == null) {
      textAttributes = new TextAttributes(Color.black, myDeprecatedBackgroundColor, null, EffectType.BOXED, Font.PLAIN);
      myAttributesMap.put(HighlighterColors.TEXT, textAttributes);
    }
    else {
      textAttributes.setBackgroundColor(myDeprecatedBackgroundColor);
    }
  }

  if (myConsoleFontPreferences.getEffectiveFontFamilies().isEmpty()) {
    myFontPreferences.copyTo(myConsoleFontPreferences);
  }

  initFonts();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:55,代码来源:AbstractColorsScheme.java

示例15: canRender

private static boolean canRender(final TextAttributes attributes) {
  return attributes.getEffectType() != EffectType.BOXED || attributes.getEffectColor() == null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:3,代码来源:ImmediatePainter.java


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