use of gnu.trove.TObjectIntProcedure in project intellij-community by JetBrains.
the class SeverityRegistrar method writeExternal.
public void writeExternal(Element element) {
List<HighlightSeverity> list = getOrderAsList(getOrderMap());
for (HighlightSeverity severity : list) {
Element info = new Element(INFO_TAG);
String severityName = severity.getName();
final SeverityBasedTextAttributes infoType = getAttributesBySeverity(severity);
if (infoType != null) {
infoType.writeExternal(info);
final Color color = myRendererColors.get(severityName);
if (color != null) {
info.setAttribute(COLOR_ATTRIBUTE, Integer.toString(color.getRGB() & 0xFFFFFF, 16));
}
element.addContent(info);
}
}
if (myReadOrder != null && !myReadOrder.isEmpty()) {
myReadOrder.writeExternal(element);
} else if (!getDefaultOrder().equals(list)) {
final JDOMExternalizableStringList ext = new JDOMExternalizableStringList(Collections.nCopies(getOrderMap().size(), ""));
getOrderMap().forEachEntry(new TObjectIntProcedure<HighlightSeverity>() {
@Override
public boolean execute(HighlightSeverity orderSeverity, int oIdx) {
ext.set(oIdx, orderSeverity.getName());
return true;
}
});
ext.writeExternal(element);
}
}
Aggregations