Package com.intellij.struts2.dom.struts.model

Examples of com.intellij.struts2.dom.struts.model.StrutsModel


    });
  }

  @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


  protected boolean acceptModule(final Module module) {
    return StrutsFacet.getInstance(module) != null;
  }

  protected void addNames(@NotNull final Module module, final Set<String> result) {
    final StrutsModel strutsModel = StrutsManager.getInstance(module.getProject()).getCombinedModel(module);
    if (strutsModel == null) {
      return;
    }

    strutsModel.processActions(new Processor<Action>() {
      public boolean process(final Action action) {
        result.add(action.getName().getStringValue());
        return true;
      }
    });
View Full Code Here

      }
    });
  }

  protected void addItems(@NotNull final Module module, final String name, final List<NavigationItem> result) {
    final StrutsModel strutsModel = StrutsManager.getInstance(module.getProject()).getCombinedModel(module);
    if (strutsModel == null) {
      return;
    }

    final List<Action> actions = strutsModel.findActionsByName(name, null);
    for (final Action action : actions) {
      final NavigationItem item = createNavigationItem(action.getXmlTag(),
                                                       action.getName().getStringValue() +
                                                       " [" + action.getNamespace() + "]",
                                                       Struts2Icons.Action);
View Full Code Here

  protected ResultType convertString(@Nullable final String s, final ConvertContext convertContext) {
    if (StringUtil.isEmpty(s)) {
      return null;
    }

    final StrutsModel strutsModel = ConverterUtil.getStrutsModelOrCombined(convertContext);
    if (strutsModel == null) {
      return null;
    }

    final List<ResultType> resultTypes = ContainerUtil.concat(strutsModel.getStrutsPackages(),
                                                              RESULT_TYPE_GETTER);

    return ContainerUtil.find(resultTypes, new Condition<ResultType>() {
      public boolean value(final ResultType resultType) {
        return Comparing.strEqual(s, resultType.getName().getStringValue());
View Full Code Here

  }

  @Override
  protected Object[] getReferenceVariants(final ConvertContext convertContext,
                                          final GenericDomValue<List<ResultType>> listGenericDomValue) {
    final StrutsModel strutsModel = ConverterUtil.getStrutsModelOrCombined(convertContext);
    if (strutsModel == null) {
      return ArrayUtil.EMPTY_OBJECT_ARRAY;
    }

    return ElementPresentationManager.getInstance()
        .createVariants(ContainerUtil.concat(strutsModel.getStrutsPackages(), RESULT_TYPE_GETTER));
  }
View Full Code Here

    if (actionName == null || TaglibUtil.isDynamicExpression(actionName)) {
      return PsiReference.EMPTY_ARRAY;
    }

    final StrutsManager strutsManager = StrutsManager.getInstance(psiElement.getProject());
    final StrutsModel strutsModel = strutsManager.getCombinedModel(psiElement);
    if (strutsModel == null) {
      return PsiReference.EMPTY_ARRAY;
    }

    final List<Action> actions = strutsModel.findActionsByName(actionName, actionTag.getAttributeValue("namespace"));
    if (actions.size() != 1) {
      return PsiReference.EMPTY_ARRAY;
    }

    final Action action = actions.get(0);
View Full Code Here

    if (!SUPPORTED_EXTENSIONS.contains(extension)) {
      return Collections.emptyList();
    }

    final StrutsManager strutsManager = StrutsManager.getInstance(psiElement.getProject());
    final StrutsModel strutsModel = strutsManager.getCombinedModel(psiElement);
    if (strutsModel == null) {
      return Collections.emptyList();
    }

    final List<PsiFile> allFiles = containingFile.getViewProvider().getAllFiles();

    final Set<Action> actions = new HashSet<Action>();
    final List<GotoRelatedItem> items = new ArrayList<GotoRelatedItem>();
    strutsModel.processActions(new Processor<Action>() {
      @Override
      public boolean process(final Action action) {
        for (final Result result : action.getResults()) {

          final PathReference pathReference = result.getValue();
View Full Code Here

  protected boolean acceptModule(final Module module) {
    return StrutsFacet.getInstance(module) != null;
  }

  protected void addNames(@NotNull final Module module, final Set<String> result) {
    final StrutsModel strutsModel = StrutsManager.getInstance(module.getProject()).getCombinedModel(module);
    if (strutsModel == null) {
      return;
    }

    final Set<String> packageNames = ContainerUtil.map2Set(strutsModel.getStrutsPackages(),
                                                           STRUTS_PACKAGE_NAME_FUNCTION);
    result.addAll(packageNames);
  }
View Full Code Here

  protected PsiReference[] createReferences(@NotNull final PsiElement psiElement,
                                            final int offset,
                                            final String text,
                                            @Nullable final ServletMappingInfo info,
                                            final boolean soft) {
    final StrutsModel strutsModel = StrutsManager.getInstance(psiElement.getProject()).getCombinedModel(psiElement);

    if (strutsModel == null) {
      return PsiReference.EMPTY_ARRAY;
    }
View Full Code Here

                                                           STRUTS_PACKAGE_NAME_FUNCTION);
    result.addAll(packageNames);
  }

  protected void addItems(@NotNull final Module module, final String name, final List<NavigationItem> result) {
    final StrutsModel strutsModel = StrutsManager.getInstance(module.getProject()).getCombinedModel(module);
    if (strutsModel == null) {
      return;
    }

    final List<StrutsPackage> strutsPackageList = strutsModel.getStrutsPackages();

    for (final StrutsPackage strutsPackage : strutsPackageList) {
      if (Comparing.strEqual(name, strutsPackage.getName().getStringValue())) {
        final NavigationItem item = createNavigationItem(strutsPackage.getXmlTag(),
                                                         name,
View Full Code Here

TOP

Related Classes of com.intellij.struts2.dom.struts.model.StrutsModel

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.