use of com.intellij.util.xml.DomElement in project intellij-plugins by JetBrains.
the class GlobalExceptionMappingResultResolveConverter method getVariants.
@NotNull
public Collection<? extends GlobalResult> getVariants(final ConvertContext context) {
final DomElement invocationElement = context.getInvocationElement();
final StrutsPackage strutsPackage = invocationElement.getParentOfType(StrutsPackage.class, true);
if (strutsPackage != null) {
return strutsPackage.getGlobalResults().getResults();
}
return Collections.emptySet();
}
use of com.intellij.util.xml.DomElement in project intellij-plugins by JetBrains.
the class ActionMethodConverter method getActionElement.
/**
* Gets the enclosing <code>action</code>-element for the current context.
*
* @param context Current context.
* @return Action-element.
*/
@NotNull
private static Action getActionElement(final ConvertContext context) {
final DomElement domElement = context.getInvocationElement();
final Action action = domElement.getParentOfType(Action.class, false);
assert action != null : "not triggered within <action> for " + domElement.getXmlElement();
return action;
}
use of com.intellij.util.xml.DomElement in project intellij-plugins by JetBrains.
the class Struts2GraphComponent method getSelectedDomElements.
public List<DomElement> getSelectedDomElements() {
final List<DomElement> selected = new ArrayList<>();
final Graph2D graph = myBuilder.getGraph();
for (final Node node : graph.getNodeArray()) {
if (graph.isSelected(node)) {
final BasicStrutsNode nodeObject = myBuilder.getNodeObject(node);
if (nodeObject != null) {
ContainerUtil.addIfNotNull(selected, nodeObject.getIdentifyingElement());
}
}
}
return selected;
}
use of com.intellij.util.xml.DomElement in project intellij-plugins by JetBrains.
the class StructureViewTreeElement method getChildren.
@NotNull
public TreeElement[] getChildren() {
final DomElement element = getElement();
if (!element.isValid()) {
return EMPTY_ARRAY;
}
final List<TreeElement> result = new SmartList<>();
DomUtil.acceptAvailableChildren(element, new DomElementVisitor() {
@Override
public void visitDomElement(final DomElement domElement) {
result.add(new StructureViewTreeElement(domElement));
}
});
return ArrayUtil.toObjectArray(result, TreeElement.class);
}
use of com.intellij.util.xml.DomElement in project intellij-plugins by JetBrains.
the class StructureViewTreeModel method getRoot.
@NotNull
@Override
public StructureViewTreeElement getRoot() {
final XmlFile xmlFile = getPsiFile();
final DomFileElement<DomElement> fileElement = DomManager.getDomManager(xmlFile.getProject()).getFileElement(xmlFile, DomElement.class);
if (fileElement == null) {
return new XmlFileTreeElement(xmlFile);
}
return new com.intellij.struts2.structure.StructureViewTreeElement(fileElement.getRootElement().createStableCopy());
}
Aggregations