use of com.intellij.util.xml.events.DomEvent in project intellij-community by JetBrains.
the class CollectionElementInvocationHandler method undefineInternal.
@Override
public final void undefineInternal() {
final DomElement parent = getParent();
final XmlTag tag = getXmlTag();
if (tag == null)
return;
getManager().cacheHandler(getCacheKey(), tag, null);
setXmlElement(null);
deleteTag(tag);
getManager().fireEvent(new DomEvent(parent, false));
}
use of com.intellij.util.xml.events.DomEvent in project intellij-community by JetBrains.
the class DomInvocationHandler method ensureTagExists.
@Override
public XmlTag ensureTagExists() {
assertValid();
XmlTag tag = getXmlTag();
if (tag != null)
return tag;
tag = setEmptyXmlTag();
setXmlElement(tag);
final DomElement element = getProxy();
myManager.fireEvent(new DomEvent(element, true));
addRequiredChildren();
myManager.cacheHandler(getCacheKey(), tag, this);
return getXmlTag();
}
use of com.intellij.util.xml.events.DomEvent in project intellij-community by JetBrains.
the class DomInvocationHandler method setValue.
protected void setValue(@Nullable final String value) {
final XmlTag tag = ensureTagExists();
myManager.runChange(() -> setTagValue(tag, value));
myManager.fireEvent(new DomEvent(getProxy(), false));
}
use of com.intellij.util.xml.events.DomEvent in project intellij-community by JetBrains.
the class DomInvocationHandler method addCollectionChild.
public final DomElement addCollectionChild(final CollectionChildDescriptionImpl description, final Type type, int index) throws IncorrectOperationException {
final EvaluatedXmlName name = createEvaluatedXmlName(description.getXmlName());
final XmlTag tag = addEmptyTag(name, index);
final CollectionElementInvocationHandler handler = new CollectionElementInvocationHandler(type, tag, description, this, null);
myManager.fireEvent(new DomEvent(getProxy(), false));
getManager().getTypeChooserManager().getTypeChooser(description.getType()).distinguishTag(tag, type);
handler.addRequiredChildren();
return handler.getProxy();
}
use of com.intellij.util.xml.events.DomEvent in project intellij-community by JetBrains.
the class DomSimpleValuesTest method testSetValue.
public void testSetValue() throws Throwable {
final MyElement element = createElement("<a/>");
assertEquals("", element.getValue());
element.setValue(239);
assertEquals("239", element.getValue());
assertEquals("239", element.getXmlTag().getValue().getText());
myCallRegistry.putExpected(new DomEvent(element, false));
myCallRegistry.assertResultsAndClear();
}
Aggregations