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); boolean isDefault = isDefaultScheme != null && Boolean.parseBoolean(isDefaultScheme); if (!isDefault) { myParentScheme = DefaultColorSchemesManager.getInstance() .getScheme(node.getAttributeValue(PARENT_SCHEME_ATTR, DEFAULT_SCHEME_NAME)); } for (final Object o : node.getChildren()) { Element childNode = (Element) o; String childName = childNode.getName(); if (OPTION_ELEMENT.equals(childName)) { readSettings(childNode, isDefault); } else if (EDITOR_FONT.equals(childName)) { readFontSettings(childNode, myFontPreferences, isDefault); } else if (CONSOLE_FONT.equals(childName)) { readFontSettings(childNode, myConsoleFontPreferences, isDefault); } 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(); }
private static boolean calcNeedUpdateOnTyping( @Nullable Boolean needsUpdateOnTyping, HighlightInfoType type) { if (needsUpdateOnTyping != null) return needsUpdateOnTyping.booleanValue(); if (type == HighlightInfoType.TODO) return false; if (type == HighlightInfoType.LOCAL_VARIABLE) return false; if (type == HighlightInfoType.INSTANCE_FIELD) return false; if (type == HighlightInfoType.STATIC_FIELD) return false; if (type == HighlightInfoType.STATIC_FINAL_FIELD) return false; if (type == HighlightInfoType.PARAMETER) return false; if (type == HighlightInfoType.METHOD_CALL) return false; if (type == HighlightInfoType.METHOD_DECLARATION) return false; if (type == HighlightInfoType.STATIC_METHOD) return false; if (type == HighlightInfoType.ABSTRACT_METHOD) return false; if (type == HighlightInfoType.INHERITED_METHOD) return false; if (type == HighlightInfoType.CONSTRUCTOR_CALL) return false; if (type == HighlightInfoType.CONSTRUCTOR_DECLARATION) return false; if (type == HighlightInfoType.INTERFACE_NAME) return false; if (type == HighlightInfoType.ABSTRACT_CLASS_NAME) return false; if (type == HighlightInfoType.ENUM_NAME) return false; if (type == HighlightInfoType.CLASS_NAME) return false; if (type == HighlightInfoType.ANONYMOUS_CLASS_NAME) return false; return true; }