Package com.intellij.psi.xml

Examples of com.intellij.psi.xml.XmlFile


    }

    public FileEditor createEditor(final Project pProject, final VirtualFile pPomFile) {
        final FileDocumentManager filedocMgr = FileDocumentManager.getInstance();
        final Document document = filedocMgr.getDocument(pPomFile);
        final XmlFile xmlFile = PsiUtils.findXmlFile(pProject, document);

        return new PomFileEditor(new DefaultPsiProject(xmlFile));
    }
View Full Code Here


                id = plugin.getArtifactId();
            else
                id = plugin.getId();
            final String regGoalName = id + ":register";

            final XmlFile xmlFile = PsiUtils.findXmlFile(project, script);
            if (xmlFile == null)
                continue;

            final XmlTagPath regGoalPath = new XmlTagPath(xmlFile, "project/goal");
            final XmlTag[] goals = regGoalPath.getAllTags();
View Full Code Here

    private final PsiResources psiResources;

    public ResourcesPanel(final PsiResources pPsiResources) {
        psiResources = pPsiResources;

        final XmlFile xmlFile = psiResources.getXmlFile();

        final ResourcesTableModel resourcesModel = new ResourcesTableModel(psiResources);
        resources = new CRUDTablePanel<ResourcesTableModel>(xmlFile, resourcesModel);

        final PsiResourcePatterns psiIncl = psiResources.getIncludes(-1);
View Full Code Here

    public PsiProject getPsiProject(final String pPomUrl) {
        boolean recreate = true;
        PsiProject psi = get(KEY, pPomUrl);

        if (psi != null) {
            final XmlFile xmlFile = psi.getXmlFile();
            final VirtualFile psiFile = xmlFile.getVirtualFile();
            if (psiFile != null) {
                final String psiUrl = psiFile.getUrl();
                recreate = !pPomUrl.equals(psiUrl);
            }
        }

        if (recreate) {
            final VirtualFile file = getFile(pPomUrl);
            if (file == null)
                return null;

            final XmlFile xmlFile = PsiUtils.findXmlFile(project, file);
            if (xmlFile == null)
                return null;

            psi = new DefaultPsiProject(xmlFile);
        }
View Full Code Here

        if (pluginPom != null && pluginPom.isValid() && FileUtils.exists(pluginPom))
            plugin.setPomFile(pluginPom);
        else
            return null;

        final XmlFile pomPsi = PsiUtils.findXmlFile(project, pluginPom);
        if (pomPsi == null)
            return null;

        plugin.setId(new XmlTagPath(pomPsi, POM_ID_XPATH).getStringValue());
        plugin.setGroupId(new XmlTagPath(pomPsi, POM_GROUP_ID_XPATH).getStringValue());
        plugin.setArtifactId(new XmlTagPath(pomPsi, POM_ARTIFACT_ID_XPATH).getStringValue());
        plugin.setVersion(new XmlTagPath(pomPsi, POM_VERSION_XPATH).getStringValue());
        plugin.setName(new XmlTagPath(pomPsi, POM_NAME_XPATH).getStringValue());
        plugin.setDescription(new XmlTagPath(pomPsi, POM_DESC_XPATH).getStringValue());

        //
        //parse plugin Jelly script
        //
        final VirtualFile jellyFile = pPluginDir.findChild("plugin.jelly");
        if (jellyFile != null && jellyFile.isValid() && FileUtils.exists(jellyFile))
            plugin.setScriptFile(jellyFile);
        else
            return null;

        final XmlFile jellyPsi = PsiUtils.findXmlFile(project, jellyFile);
        final XmlTagPath goalsPath = new XmlTagPath(jellyPsi, "project/goal");
        final XmlTag[] goalTags = goalsPath.getAllTags();
        final PluginGoal[] goals = new PluginGoal[goalTags.length];
        for (int i = 0; i < goalTags.length; i++) {
            XmlTag tag = goalTags[i];
View Full Code Here

                final Document document = editor.getDocument();
                final PsiFile psiFile = psiMgr.getPsiFile(document);
                if (!(psiFile instanceof XmlFile))
                    return;

                final XmlFile xmlFile = (XmlFile) psiFile;
                final XmlDocument xmlDoc = xmlFile.getDocument();
                if (xmlDoc == null)
                    return;

                final XmlTag projectTag = xmlDoc.getRootTag();
                if (projectTag == null)
View Full Code Here

    if (!(psiFile instanceof XmlFile))
    {
      return;
    }

    XmlFile xmlFile = (XmlFile) psiFile;
    IXMappingSet xMappingSet =
      XStructurePlugin.getInstance().getXMappingSetRegistry().getSelectedXMappingSet(xmlFile);
    if (xMappingSet == null)
    {
      return;
View Full Code Here

    DefaultActionGroup actionGroup = new DefaultActionGroup();

    XMappingSetRegistry mappingSetRegistry =
      XStructurePlugin.getInstance().getXMappingSetRegistry();

    XmlFile xmlFile = retrieveXmlFile();
    if (xmlFile == null)
    {
      return actionGroup;
    }
View Full Code Here

  }

  @NotNull
  @Override
  public StructureViewTreeElement getRoot() {
    final XmlFile xmlFile = (XmlFile)getPsiFile();
    final DomFileElement<DomElement> fileElement = DomManager.getDomManager(xmlFile.getProject()).getFileElement(xmlFile, DomElement.class);
    if (fileElement == null) {
      return new XmlFileTreeElement(xmlFile);
    }

    return new com.intellij.struts2.structure.StructureViewTreeElement(fileElement.getRootElement().createStableCopy());
View Full Code Here

   * @param context Invoking context.
   * @return <code>null</code> if no StrutsModel found by current file (e.g. not in any fileset).
   */
  @Nullable
  public static StrutsModel getStrutsModel(final ConvertContext context) {
    final XmlFile xmlFile = context.getFile();
    return StrutsManager.getInstance(xmlFile.getProject()).getModelByFile(xmlFile);
  }
View Full Code Here

TOP

Related Classes of com.intellij.psi.xml.XmlFile

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.