Examples of XmlTag


Examples of com.intellij.psi.xml.XmlTag

        //The getRootTag method used above already makes sure that the root
        //tag name matches the tag name in the tag-path's first token, and
        //returns null if not, therefor we can safely start the iteration
        //at index 1 rather than 0 (where 0 is the root tag's expression).
        //
        XmlTag context = ensureRootTag();
        final String[] pathTokens = getPathTokens();
        for (int i = 1; i < pathTokens.length; i++) {
            final XmlFilterExpression expr =
                    XmlFilterExpression.create(pathTokens[i]);

            XmlTag child = expr.findChildTag(context);
            if (child == null) {
                child = context.createChildTag(
                        expr.getTagName(),
                        context.getNamespace(),
                        null,
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

    }

    public void setValue(final Object pValue) throws IncorrectOperationException {
        final String value = pValue == null ? null : pValue.toString().trim();
        if (value == null || value.length() == 0) {
            XmlTag tag = getTag();
            if (tag != null)
                tag.delete();
        }
        else
            PsiUtils.setTagValue(getProject(), ensureTag(), value);
    }
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

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

                final XmlTag projectTag = xmlDoc.getRootTag();
                if (projectTag == null)
                    return;

                final XmlTag[] goals = projectTag.findSubTags("goal");
                final String goalName = pGoal.getName();
                for (XmlTag goalTag : goals) {
                    if (goalName.equals(goalTag.getAttributeValue("name"))) {
                        final int offset = goalTag.getTextOffset();
                        editor.getCaretModel().moveToOffset(offset);
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

    public static XmlTag[] getPath(final XmlTag pTag, final XmlTag[] pBuffer) {
        if (pTag == null)
            return new XmlTag[0];

        final List<XmlTag> tags = new ArrayList<XmlTag>(5);
        XmlTag context = pTag;
        while (context != null) {
            tags.add(0, context);
            context = context.getParentTag();
        }

        final XmlTag[] buffer;
        if (pBuffer == null || pBuffer.length < tags.size())
            buffer = new XmlTag[tags.size()];
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

    public static String getTagValue(final XmlTag pParentTag,
                                     final String pChildTagName) {
        if (pParentTag == null)
            return null;

        final XmlTag childTag = pParentTag.findFirstSubTag(pChildTagName);
        if (childTag == null)
            return null;

        return getTagValue(childTag);
    }
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

                                   final XmlTag pParentTag,
                                   final String pTagName,
                                   final String pValue) {
        IDEUtils.runCommand(pProject, new Runnable() {
            public void run() {
                final XmlTag child = pParentTag.findFirstSubTag(pTagName);
                if (child != null) {
                    child.getValue().setText(pValue);
                }
                else {
                    final XmlTag newChild = pParentTag.createChildTag(
                            pTagName,
                            pParentTag.getNamespace(),
                            pValue,
                            false);
                    try {
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

            mapper.putTagPath(pPropertyName, tagPath);
        }
    }

    public final String[] getValues() {
        final XmlTag containerTag = containerPath.getTag();
        if (containerTag == null)
            return new String[0];

        final XmlTag[] rowTags = containerTag.findSubTags(rowTagName);
        final String[] values = new String[rowTags.length];
        for (int i = 0; i < rowTags.length; i++)
            values[i] = rowTags[i].getValue().getTrimmedText();

        return values;
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

            }
        }
    }

    public final int getRowCount() {
        final XmlTag containerTag = containerPath.getTag();
        if (containerTag == null)
            return 0;

        final XmlTag[] rowTags = containerTag.findSubTags(rowTagName);
        return rowTags.length;
    }
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

    public void deleteRows(final int... pRowIndices) {
        final Runnable deleteTagsCmd = new Runnable() {
            public void run() {
                try {
                    final XmlTag containerTag = containerPath.getTag();
                    if (containerTag == null)
                        return;

                    final XmlTag[] childTags = containerTag.findSubTags(rowTagName);
                    final Set<XmlTag> tags = new HashSet<XmlTag>(pRowIndices.length);
                    for (int i = 0; i < pRowIndices.length; i++)
                        tags.add(childTags[pRowIndices[i]]);

                    for (XmlTag xmlTag : tags)
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

     *
     * @return the row tag
     */
    private Integer findRowForElement(final PsiElement pElement) {
        synchronized (LOCK) {
            final XmlTag containerTag = containerPath.getTag();
            if (containerTag == null)
                return null;

            final XmlTag[] rowTags = containerTag.findSubTags(rowTagName);
            for (int i = 0; i < rowTags.length; i++) {
                rowPath.setRow(i);
                final XmlTag rowTag = rowPath.getTag();
                if (PsiTreeUtil.isAncestor(rowTag, pElement, false))
                    return i;
            }

            return null;
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.