Search in sources :

Example 6 with ConvertContext

use of com.intellij.util.xml.ConvertContext in project intellij-plugins by JetBrains.

the class DefaultInterceptorRefResolveConverterImpl method getVariants.

@NotNull
public Collection<? extends InterceptorStack> getVariants(final ConvertContext context) {
    final List<InterceptorStack> results = new SmartList<>();
    final Processor<StrutsPackage> processor = strutsPackage -> {
        results.addAll(strutsPackage.getInterceptorStacks());
        return true;
    };
    final StrutsPackageHierarchyWalker walker = new StrutsPackageHierarchyWalker(getCurrentStrutsPackage(context), processor);
    walker.walkUp();
    return results;
}
Also used : DefaultInterceptorRefResolveConverter(com.intellij.struts2.dom.struts.strutspackage.DefaultInterceptorRefResolveConverter) Collection(java.util.Collection) NonNls(org.jetbrains.annotations.NonNls) ContainerUtil(com.intellij.util.containers.ContainerUtil) StrutsPackageHierarchyWalker(com.intellij.struts2.dom.struts.strutspackage.StrutsPackageHierarchyWalker) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) SmartList(com.intellij.util.SmartList) Processor(com.intellij.util.Processor) StrutsPackage(com.intellij.struts2.dom.struts.strutspackage.StrutsPackage) InterceptorStack(com.intellij.struts2.dom.struts.strutspackage.InterceptorStack) ConvertContext(com.intellij.util.xml.ConvertContext) NotNull(org.jetbrains.annotations.NotNull) Ref(com.intellij.openapi.util.Ref) DomUtil(com.intellij.util.xml.DomUtil) Condition(com.intellij.openapi.util.Condition) StrutsPackageHierarchyWalker(com.intellij.struts2.dom.struts.strutspackage.StrutsPackageHierarchyWalker) InterceptorStack(com.intellij.struts2.dom.struts.strutspackage.InterceptorStack) StrutsPackage(com.intellij.struts2.dom.struts.strutspackage.StrutsPackage) SmartList(com.intellij.util.SmartList) NotNull(org.jetbrains.annotations.NotNull)

Example 7 with ConvertContext

use of com.intellij.util.xml.ConvertContext in project intellij-plugins by JetBrains.

the class InterceptorRefResolveConverterImpl method getVariants.

@NotNull
public Collection<? extends InterceptorOrStackBase> getVariants(final ConvertContext context) {
    final List<InterceptorOrStackBase> results = new SmartList<>();
    final Processor<StrutsPackage> processor = strutsPackage -> {
        final List<InterceptorOrStackBase> allInterceptors = getAllInterceptors(strutsPackage);
        results.addAll(allInterceptors);
        return true;
    };
    final StrutsPackageHierarchyWalker walker = new StrutsPackageHierarchyWalker(ConverterUtil.getCurrentStrutsPackage(context), processor);
    walker.walkUp();
    return results;
}
Also used : Collection(java.util.Collection) NonNls(org.jetbrains.annotations.NonNls) InterceptorOrStackBase(com.intellij.struts2.dom.struts.strutspackage.InterceptorOrStackBase) ContainerUtil(com.intellij.util.containers.ContainerUtil) StrutsPackageHierarchyWalker(com.intellij.struts2.dom.struts.strutspackage.StrutsPackageHierarchyWalker) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) SmartList(com.intellij.util.SmartList) Processor(com.intellij.util.Processor) StrutsPackage(com.intellij.struts2.dom.struts.strutspackage.StrutsPackage) ConverterUtil(com.intellij.struts2.dom.ConverterUtil) InterceptorRefResolveConverter(com.intellij.struts2.dom.struts.strutspackage.InterceptorRefResolveConverter) ConvertContext(com.intellij.util.xml.ConvertContext) NotNull(org.jetbrains.annotations.NotNull) Ref(com.intellij.openapi.util.Ref) Condition(com.intellij.openapi.util.Condition) StrutsPackageHierarchyWalker(com.intellij.struts2.dom.struts.strutspackage.StrutsPackageHierarchyWalker) InterceptorOrStackBase(com.intellij.struts2.dom.struts.strutspackage.InterceptorOrStackBase) List(java.util.List) SmartList(com.intellij.util.SmartList) StrutsPackage(com.intellij.struts2.dom.struts.strutspackage.StrutsPackage) SmartList(com.intellij.util.SmartList) NotNull(org.jetbrains.annotations.NotNull)

Example 8 with ConvertContext

use of com.intellij.util.xml.ConvertContext in project intellij-plugins by JetBrains.

the class ResultTypeResolvingConverterImpl method getVariants.

@NotNull
public Collection<? extends ResultType> getVariants(final ConvertContext context) {
    final List<ResultType> results = new SmartList<>();
    final Processor<StrutsPackage> processor = strutsPackage -> {
        results.addAll(strutsPackage.getResultTypes());
        return true;
    };
    final StrutsPackageHierarchyWalker walker = new StrutsPackageHierarchyWalker(ConverterUtil.getCurrentStrutsPackage(context), processor);
    walker.walkUp();
    return results;
}
Also used : StringUtil(com.intellij.openapi.util.text.StringUtil) Collection(java.util.Collection) NonNls(org.jetbrains.annotations.NonNls) ContainerUtil(com.intellij.util.containers.ContainerUtil) StrutsPackageHierarchyWalker(com.intellij.struts2.dom.struts.strutspackage.StrutsPackageHierarchyWalker) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) Comparing(com.intellij.openapi.util.Comparing) SmartList(com.intellij.util.SmartList) ResultType(com.intellij.struts2.dom.struts.strutspackage.ResultType) Processor(com.intellij.util.Processor) StrutsPackage(com.intellij.struts2.dom.struts.strutspackage.StrutsPackage) ConverterUtil(com.intellij.struts2.dom.ConverterUtil) ResultTypeResolvingConverter(com.intellij.struts2.dom.struts.action.ResultTypeResolvingConverter) ConvertContext(com.intellij.util.xml.ConvertContext) NotNull(org.jetbrains.annotations.NotNull) Ref(com.intellij.openapi.util.Ref) Condition(com.intellij.openapi.util.Condition) StrutsPackageHierarchyWalker(com.intellij.struts2.dom.struts.strutspackage.StrutsPackageHierarchyWalker) StrutsPackage(com.intellij.struts2.dom.struts.strutspackage.StrutsPackage) ResultType(com.intellij.struts2.dom.struts.strutspackage.ResultType) SmartList(com.intellij.util.SmartList) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ConvertContext (com.intellij.util.xml.ConvertContext)8 Nullable (org.jetbrains.annotations.Nullable)7 Condition (com.intellij.openapi.util.Condition)6 Ref (com.intellij.openapi.util.Ref)6 StrutsPackage (com.intellij.struts2.dom.struts.strutspackage.StrutsPackage)6 StrutsPackageHierarchyWalker (com.intellij.struts2.dom.struts.strutspackage.StrutsPackageHierarchyWalker)6 Processor (com.intellij.util.Processor)6 SmartList (com.intellij.util.SmartList)6 ContainerUtil (com.intellij.util.containers.ContainerUtil)6 Collection (java.util.Collection)6 List (java.util.List)6 NonNls (org.jetbrains.annotations.NonNls)6 NotNull (org.jetbrains.annotations.NotNull)6 ConverterUtil (com.intellij.struts2.dom.ConverterUtil)4 Comparing (com.intellij.openapi.util.Comparing)2 StringUtil (com.intellij.openapi.util.text.StringUtil)2 ResultTypeResolvingConverter (com.intellij.struts2.dom.struts.action.ResultTypeResolvingConverter)2 DefaultInterceptorRefResolveConverter (com.intellij.struts2.dom.struts.strutspackage.DefaultInterceptorRefResolveConverter)2 InterceptorOrStackBase (com.intellij.struts2.dom.struts.strutspackage.InterceptorOrStackBase)2 InterceptorRefResolveConverter (com.intellij.struts2.dom.struts.strutspackage.InterceptorRefResolveConverter)2