Search in sources :

Example 1 with CDATA

use of org.jdom.CDATA in project intellij-community by JetBrains.

the class BaseInjection method getState.

public final Element getState() {
    final Element e = new Element("injection");
    e.setAttribute("language", myInjectedLanguageId);
    e.setAttribute("injector-id", mySupportId);
    e.addContent(new Element("display-name").setText(getDisplayName()));
    if (StringUtil.isNotEmpty(myPrefix)) {
        e.addContent(new Element("prefix").setText(myPrefix));
    }
    if (StringUtil.isNotEmpty(mySuffix)) {
        e.addContent(new Element("suffix").setText(mySuffix));
    }
    if (StringUtil.isNotEmpty(myValuePattern)) {
        e.addContent(new Element("value-pattern").setText(myValuePattern));
    }
    if (mySingleFile) {
        e.addContent(new Element("single-file"));
    }
    Arrays.sort(myPlaces, (o1, o2) -> Comparing.compare(o1.getText(), o2.getText()));
    for (InjectionPlace place : myPlaces) {
        final Element child = new Element("place").setContent(new CDATA(place.getText()));
        if (!place.isEnabled())
            child.setAttribute("disabled", "true");
        e.addContent(child);
    }
    writeExternalImpl(e);
    return e;
}
Also used : PsiElement(com.intellij.psi.PsiElement) Element(org.jdom.Element) CDATA(org.jdom.CDATA)

Aggregations

PsiElement (com.intellij.psi.PsiElement)1 CDATA (org.jdom.CDATA)1 Element (org.jdom.Element)1