Search in sources :

Example 1 with GlobalResults

use of com.intellij.struts2.dom.struts.strutspackage.GlobalResults in project intellij-plugins by JetBrains.

the class ExceptionMappingResultResolveConverter method getVariants.

@NotNull
public Collection<? extends HasResultType> getVariants(final ConvertContext context) {
    final DomElement invocationElement = context.getInvocationElement();
    final Action action = invocationElement.getParentOfType(Action.class, true);
    if (action == null) {
        return Collections.emptySet();
    }
    final List<HasResultType> variants = new ArrayList<>();
    // Action-local first
    variants.addAll(action.getResults());
    final StrutsPackage strutsPackage = action.getStrutsPackage();
    final GlobalResults globalResults = strutsPackage.getGlobalResults();
    variants.addAll(globalResults.getResults());
    return variants;
}
Also used : DomElement(com.intellij.util.xml.DomElement) HasResultType(com.intellij.struts2.dom.struts.HasResultType) GlobalResults(com.intellij.struts2.dom.struts.strutspackage.GlobalResults) ArrayList(java.util.ArrayList) StrutsPackage(com.intellij.struts2.dom.struts.strutspackage.StrutsPackage) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

HasResultType (com.intellij.struts2.dom.struts.HasResultType)1 GlobalResults (com.intellij.struts2.dom.struts.strutspackage.GlobalResults)1 StrutsPackage (com.intellij.struts2.dom.struts.strutspackage.StrutsPackage)1 DomElement (com.intellij.util.xml.DomElement)1 ArrayList (java.util.ArrayList)1 NotNull (org.jetbrains.annotations.NotNull)1