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

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


          final StrutsFileSet fileSet = new StrutsFileSet(StrutsFileSet.getUniqueId(empty),
                                                          StrutsFileSet.getUniqueName("Default File Set", empty),
                                                          strutsFacetConfiguration);
          fileSet.addFile(((XmlFile) psiElement).getVirtualFile());

          final StrutsConfigsSearcher searcher = new StrutsConfigsSearcher(module);
          searcher.search();
          final MultiMap<VirtualFile, PsiFile> jarConfigFiles = searcher.getJars();
          for (final VirtualFile virtualFile : jarConfigFiles.keySet()) {
            final Collection<PsiFile> psiFiles = jarConfigFiles.get(virtualFile);
            for (final PsiFile psiFile : psiFiles) {
              fileSet.addFile(psiFile.getVirtualFile());
            }
View Full Code Here


          final PsiElement psiElement = FileTemplateUtil.createFromTemplate(strutsXmlTemplate,
                                                                            StrutsConstants.STRUTS_XML_DEFAULT_FILENAME,
                                                                            null,
                                                                            directory);
          final Set<StrutsFileSet> empty = Collections.emptySet();
          final StrutsFileSet fileSet = new StrutsFileSet(StrutsFileSet.getUniqueId(empty),
                                                          StrutsFileSet.getUniqueName("Default File Set", empty),
                                                          strutsFacetConfiguration);
          fileSet.addFile(((XmlFile) psiElement).getVirtualFile());

          final StrutsConfigsSearcher searcher = new StrutsConfigsSearcher(module);
          searcher.search();
          final MultiMap<VirtualFile, PsiFile> jarConfigFiles = searcher.getJars();
          for (final VirtualFile virtualFile : jarConfigFiles.keySet()) {
            final Collection<PsiFile> psiFiles = jarConfigFiles.get(virtualFile);
            for (final PsiFile psiFile : psiFiles) {
              fileSet.addFile(psiFile.getVirtualFile());
            }
          }
          strutsFacetConfiguration.getFileSets().add(fileSet);

View Full Code Here

    for (final Object setElement : element.getChildren(FILESET)) {
      final String setName = ((Element) setElement).getAttributeValue(SET_NAME);
      final String setId = ((Element) setElement).getAttributeValue(SET_ID);
      final String removed = ((Element) setElement).getAttributeValue(SET_REMOVED);
      if (setName != null && setId != null) {
        final StrutsFileSet fileSet = new StrutsFileSet(setId, setName, this);
        final List files = ((Element) setElement).getChildren(FILE);
        for (final Object fileElement : files) {
          final String text = ((Element) fileElement).getText();
          fileSet.addFile(text);
        }
        fileSet.setRemoved(Boolean.valueOf(removed));
        myFileSets.add(fileSet);
      }
    }

    // new in X
View Full Code Here

    final Project project = xmlFile.getProject();
    final Graph2D graph = GraphManager.getGraphManager().createGraph2D();
    final Graph2DView view = GraphManager.getGraphManager().createGraph2DView();

    progress.setText("Building model...");
    final StrutsDataModel myDataModel = new StrutsDataModel(xmlFile);
    final StrutsPresentationModel presentationModel = new StrutsPresentationModel(graph);

    progress.setText("Setup graph...");
    myBuilder = GraphBuilderFactory.getInstance(project).createGraphBuilder(graph,
                                                                            view,
View Full Code Here

    final Graph2D graph = GraphManager.getGraphManager().createGraph2D();
    final Graph2DView view = GraphManager.getGraphManager().createGraph2DView();

    progress.setText("Building model...");
    final StrutsDataModel myDataModel = new StrutsDataModel(xmlFile);
    final StrutsPresentationModel presentationModel = new StrutsPresentationModel(graph);

    progress.setText("Setup graph...");
    myBuilder = GraphBuilderFactory.getInstance(project).createGraphBuilder(graph,
                                                                            view,
                                                                            myDataModel,
View Full Code Here

      return;
    }

    for (final StrutsPackage strutsPackage : model.getStrutsPackages()) {
      for (final Action action : strutsPackage.getActions()) {
        final ActionNode actionNode = new ActionNode(action, action.getName().getStringValue());
        addNode(actionNode);

        for (final Result result : action.getResults()) {
          final PathReference pathReference = result.getValue();
          final String path = pathReference != null ? pathReference.getPath() : UNKNOWN;
View Full Code Here

          final ResultNode resultNode = new ResultNode(result, path);
          addNode(resultNode);

          final String resultName = result.getName().getStringValue();
          addEdge(new BasicStrutsEdge(actionNode, resultNode, resultName != null ? resultName : Result.DEFAULT_NAME));
        }

      }
    }
View Full Code Here

  public List<DomElement> getSelectedDomElements() {
    final List<DomElement> selected = new ArrayList<DomElement>();
    final Graph2D graph = myBuilder.getGraph();
    for (final Node node : graph.getNodeArray()) {
      if (graph.isSelected(node)) {
        final BasicStrutsNode nodeObject = myBuilder.getNodeObject(node);
        if (nodeObject != null) {
          ContainerUtil.addIfNotNull(nodeObject.getIdentifyingElement(), selected);
        }
      }
    }
    return selected;
  }
View Full Code Here

        for (final Result result : action.getResults()) {
          final PathReference pathReference = result.getValue();
          final String path = pathReference != null ? pathReference.getPath() : UNKNOWN;

          final ResultNode resultNode = new ResultNode(result, path);
          addNode(resultNode);

          final String resultName = result.getName().getStringValue();
          addEdge(new BasicStrutsEdge(actionNode, resultNode, resultName != null ? resultName : Result.DEFAULT_NAME));
        }
View Full Code Here

  /**
   * Verify all core constants are present.
   */
  public void testCompletionVariantsConstantName() throws Throwable {
    final StrutsCoreConstantContributor coreConstantContributor = new StrutsCoreConstantContributor();
    final List<StrutsConstant> constants = coreConstantContributor.getStrutsConstantDefinitions(myModule);
    final String[] variants = ContainerUtil.map2Array(constants, String.class, new Function<StrutsConstant, String>() {
      @Override
      public String fun(final StrutsConstant strutsConstant) {
        return strutsConstant.getName();
      }
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.