Search in sources :

Example 1 with DomCollectionProblemDescriptor

use of com.intellij.util.xml.highlighting.DomCollectionProblemDescriptor in project intellij-community by JetBrains.

the class DomCollectionControl method validate.

private void validate() {
    DomElement domElement = getDomElement();
    final List<DomElementProblemDescriptor> list = DomElementAnnotationsManager.getInstance(getProject()).getCachedProblemHolder(domElement).getProblems(domElement);
    final List<String> messages = new ArrayList<>();
    for (final DomElementProblemDescriptor descriptor : list) {
        if (descriptor instanceof DomCollectionProblemDescriptor && myChildDescription.equals(((DomCollectionProblemDescriptor) descriptor).getChildDescription())) {
            messages.add(descriptor.getDescriptionTemplate());
        }
    }
    myCollectionPanel.setErrorMessages(ArrayUtil.toStringArray(messages));
    myCollectionPanel.repaint();
}
Also used : DomElement(com.intellij.util.xml.DomElement) DomCollectionProblemDescriptor(com.intellij.util.xml.highlighting.DomCollectionProblemDescriptor) DomElementProblemDescriptor(com.intellij.util.xml.highlighting.DomElementProblemDescriptor) ArrayList(java.util.ArrayList)

Aggregations

DomElement (com.intellij.util.xml.DomElement)1 DomCollectionProblemDescriptor (com.intellij.util.xml.highlighting.DomCollectionProblemDescriptor)1 DomElementProblemDescriptor (com.intellij.util.xml.highlighting.DomElementProblemDescriptor)1 ArrayList (java.util.ArrayList)1