Examples of StrutsModel


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

      }
    });
  }

  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

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

  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

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

  }

  @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

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

    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

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

    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

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

  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

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

  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

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

                                                           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

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

    // recursive self-inclusion
    if (context.getFile().equals(psiFile)) {
      return null;
    }

    final StrutsModel model = ConverterUtil.getStrutsModel(context);
    if (model == null) {
      return null;
    }

    return isFileAccepted(model, psiFile) ? super.resolve(psiFile, context) : null;
View Full Code Here

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

    final String s = genericDomValue.getStringValue();
    if (s == null) {
      return PsiReference.EMPTY_ARRAY;
    }

    final StrutsModel model = ConverterUtil.getStrutsModel(context);
    if (model == null) {
      return PsiReference.EMPTY_ARRAY;
    }

    final int offset = ElementManipulators.getOffsetInElement(element);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.