Package com.intellij.struts2.dom.struts.strutspackage

Examples of com.intellij.struts2.dom.struts.strutspackage.InterceptorOrStackBase


    });
  }

  @Override
  protected Object[] getReferenceVariants(ConvertContext context, GenericDomValue<List<StrutsPackage>> genericDomValue) {
    final StrutsModel strutsModel = ConverterUtil.getStrutsModel(context);
    if (strutsModel == null) {
      return ArrayUtil.EMPTY_OBJECT_ARRAY;
    }

    final Collection<StrutsPackage> variants = removeCurrentElementFromVariants(context, strutsModel.getStrutsPackages());
    return ElementPresentationManager.getInstance().createVariants(variants);
  }
View Full Code Here


    if (DomUtil.hasXml(actionClassAttribute)) {
      return actionClassAttribute.getValue();
    }

    // resolve parent package <default-class-ref> (walk upwards)
    final DefaultClassRef ref = getStrutsPackage().searchDefaultClassRef();
    if (ref != null) {
      return ref.getDefaultClass().getValue();
    }

    // nothing found in parents --> error highlighting
    return null;
  }
View Full Code Here

    final List<HasResultType> variants = new ArrayList<HasResultType>();
    variants.addAll(action.getResults()); // Action-local first

    final StrutsPackage strutsPackage = action.getStrutsPackage();
    final GlobalResults globalResults = strutsPackage.getGlobalResults();
    variants.addAll(globalResults.getResults());

    return variants;
  }
View Full Code Here

    if (!(paramsElement instanceof InterceptorRef)) {
      return PsiReference.EMPTY_ARRAY;
    }

    InterceptorRef interceptorRef = (InterceptorRef) paramsElement;
    final InterceptorOrStackBase value = interceptorRef.getName().getValue();
    if (!(value instanceof InterceptorStack)) {
      return PsiReference.EMPTY_ARRAY;
    }

    final String text = nameAttributeValue.getValue();
View Full Code Here

    public PsiElement resolve() {
      if (resolvedInterceptorRef == null) {
        return null;
      }

      final InterceptorOrStackBase interceptorDeclaration = resolvedInterceptorRef.getName().getValue();
      if (interceptorDeclaration == null) {
        return null;
      }

      final DomTarget domTarget = DomTarget.getTarget(interceptorDeclaration);
View Full Code Here

    @Override
    public Object[] getVariants() {
      final List<InterceptorRef> allInterceptorRefs = interceptorStack.getInterceptorRefs();
      List<LookupElement> names = new ArrayList<LookupElement>(allInterceptorRefs.size());
      for (InterceptorRef interceptorRef : allInterceptorRefs) {
        final InterceptorOrStackBase resolvedInterceptor = interceptorRef.getName().getValue();
        if (resolvedInterceptor == null) {
          continue;
        }

        final String interceptorName = StringUtil.notNullize(resolvedInterceptor.getName().getStringValue());
        names.add(LookupElementBuilder.create(resolvedInterceptor, interceptorName)
                                      .withIcon(ElementPresentationManager.getIcon(resolvedInterceptor)));
      }
      return ArrayUtil.toObjectArray(names, LookupElement.class);
    }
View Full Code Here

*/
public abstract class InterceptorRefImpl implements InterceptorRef {

  @Nullable
  public PsiClass getParamsClass() {
    final InterceptorOrStackBase interceptorOrStack = getName().getValue();
    if (interceptorOrStack instanceof Interceptor) {
      return ((Interceptor) interceptorOrStack).getInterceptorClass().getValue();
    }
    return null;
  }
View Full Code Here

    final Ref<InterceptorOrStackBase> resolveResult = new Ref<InterceptorOrStackBase>();
    final Processor<StrutsPackage> processor = new Processor<StrutsPackage>() {
      @Override
      public boolean process(final StrutsPackage strutsPackage) {
        final InterceptorOrStackBase result = ContainerUtil.find(getAllInterceptors(strutsPackage), nameCondition);
        if (result != null) {
          resolveResult.set(result);
          return false;
        }
View Full Code Here

  }


  private static void checkResolve(@NotNull final JamDefaultInterceptorRef jamDefaultInterceptorRef,
                                   @NotNull final String interceptorName) {
    final InterceptorOrStackBase interceptorOrStackBase = jamDefaultInterceptorRef.getValue().getValue();
    assertNotNull(interceptorOrStackBase);
    assertEquals(interceptorName, interceptorOrStackBase.getName().getStringValue());
  }
View Full Code Here

    checkResolve(jamInterceptorRef, "myCustomInterceptor");
  }

  private static void checkResolve(@NotNull final JamInterceptorRef jamInterceptorRef,
                                   @NotNull final String interceptorName) {
    final InterceptorOrStackBase interceptorOrStackBase = jamInterceptorRef.getValue().getValue();
    assertNotNull(interceptorOrStackBase);
    assertEquals(interceptorName, interceptorOrStackBase.getName().getStringValue());
  }
View Full Code Here

TOP

Related Classes of com.intellij.struts2.dom.struts.strutspackage.InterceptorOrStackBase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.