@Override public void readSettings(@NotNull Element element) throws InvalidDataException { super.readSettings(element); parseString(loggerClassName, loggerFactoryClassNames); parseString(loggerFactoryMethodName, loggerFactoryMethodNames); if (loggerFactoryClassNames.size() != loggerFactoryMethodNames.size()) { parseString(DEFAULT_LOGGER_CLASS_NAMES, loggerFactoryClassNames); parseString(DEFAULT_FACTORY_METHOD_NAMES, loggerFactoryMethodNames); } }
@Override public void readSettings(@NotNull Element node) throws InvalidDataException { super.readSettings(node); onlyReportWhenAnnotated = false; for (Element option : node.getChildren("option")) { if ("onlyReportWhenAnnotated".equals(option.getAttributeValue("name"))) { onlyReportWhenAnnotated = Boolean.parseBoolean(option.getAttributeValue("value")); } else if ("annotations".equals(option.getAttributeValue("name"))) { final Element value = option.getChild("value"); if (value != null) { annotations.readExternal(value); } } } }
@Override public void writeSettings(@NotNull Element node) throws WriteExternalException { super.writeSettings(node); if (onlyReportWhenAnnotated) { node.addContent( new Element("option") .setAttribute("name", "onlyReportWhenAnnotated") .setAttribute("value", String.valueOf(onlyReportWhenAnnotated))); } if (!annotations.hasDefaultValues()) { final Element element = new Element("option").setAttribute("name", "annotations"); final Element valueElement = new Element("value"); annotations.writeExternal(valueElement); node.addContent(element.addContent(valueElement)); } }
private void addRemoveTestsScope(Project project, boolean add) { final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project); final InspectionProfileImpl profile = (InspectionProfileImpl) profileManager.getCurrentProfile(); final String shortName = myInspection.getShortName(); final InspectionToolWrapper tool = profile.getInspectionTool(shortName, project); if (tool == null) { return; } if (add) { final NamedScope namedScope = NamedScopesHolder.getScope(project, "Tests"); final HighlightDisplayKey key = HighlightDisplayKey.find(shortName); final HighlightDisplayLevel level = profile.getErrorLevel(key, namedScope, project); profile.addScope(tool, namedScope, level, false, project); } else { profile.removeScope(shortName, "Tests", project); } profile.scopesChanged(); }
@Override public void writeSettings(Element element) throws WriteExternalException { annotationNamesString = formatString(annotationNames); super.writeSettings(element); }
@Override public void readSettings(Element element) throws InvalidDataException { super.readSettings(element); parseString(annotationNamesString, annotationNames); }
@Override public void writeSettings(@NotNull Element element) throws WriteExternalException { loggerClassName = formatString(loggerFactoryClassNames); loggerFactoryMethodName = formatString(loggerFactoryMethodNames); super.writeSettings(element); }
@Override public void writeSettings(@NotNull Element element) throws WriteExternalException { callCheckString = formatString(classNames, methodNamePatterns); super.writeSettings(element); }
@Override public void readSettings(@NotNull Element element) throws InvalidDataException { super.readSettings(element); parseString(callCheckString, classNames, methodNamePatterns); }