use of com.intellij.util.xml.DomElement in project intellij-community by JetBrains.
the class DomElementPattern method getChildren.
@Override
protected DomElement[] getChildren(@NotNull final DomElement domElement) {
final List<DomElement> children = new ArrayList<>();
domElement.acceptChildren(new DomElementVisitor() {
@Override
public void visitDomElement(final DomElement element) {
children.add(element);
}
});
return children.toArray(new DomElement[children.size()]);
}
use of com.intellij.util.xml.DomElement in project intellij-community by JetBrains.
the class GenerateDomElementProvider method navigate.
public void navigate(final DomElement element) {
if (element != null && element.isValid()) {
final DomElement copy = element.createStableCopy();
final Project project = element.getManager().getProject();
final DomElementNavigationProvider navigateProvider = getNavigationProviderName(project);
if (navigateProvider != null && navigateProvider.canNavigate(copy)) {
ApplicationManager.getApplication().invokeLater(() -> {
if (!project.isDisposed()) {
doNavigate(navigateProvider, copy);
}
});
}
}
}
use of com.intellij.util.xml.DomElement in project intellij-community by JetBrains.
the class DomCollectionControl method navigate.
@Override
public void navigate(DomElement element) {
final Class<DomElement> aClass = (Class<DomElement>) ReflectionUtil.getRawType(myChildDescription.getType());
final DomElement domElement = element.getParentOfType(aClass, false);
int index = myCollectionElements.indexOf(domElement);
if (index < 0)
index = 0;
myCollectionPanel.getTable().setRowSelectionInterval(index, index);
}
use of com.intellij.util.xml.DomElement in project intellij-community by JetBrains.
the class DomCollectionControl method canNavigate.
@Override
public boolean canNavigate(DomElement element) {
final Class<DomElement> aClass = (Class<DomElement>) ReflectionUtil.getRawType(myChildDescription.getType());
final DomElement domElement = element.getParentOfType(aClass, false);
return domElement != null && myCollectionElements.contains(domElement);
}
use of com.intellij.util.xml.DomElement in project intellij-community by JetBrains.
the class DomCollectionWrapper method setValue.
@Override
public void setValue(final T value) throws IllegalAccessException, InvocationTargetException {
final List<? extends DomElement> list = myChildDescription.getValues(myDomElement);
final DomElement domElement;
if (list.isEmpty()) {
domElement = myChildDescription.addValue(myDomElement);
} else {
domElement = list.get(0);
}
mySetter.invoke(domElement, value);
}
Aggregations