Examples of XmlTag


Examples of com.intellij.psi.xml.XmlTag

            return null;
        }
    }

    private void handleChildAddition(final PsiElement pChild) {
        final XmlTag containerTag = containerPath.getTag();
        if (containerTag == null)
            return;

        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, pChild, false)) {
                if (pChild.equals(rowTag))
                    fireRowAddedEvent(i);
                else {
                    final String property = mapper.findPropertyForElement(pChild);
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

            }
        }
    }

    private void handleChildRemoval(final PsiElement pParent, final PsiElement pChild) {
        final XmlTag parent = PsiTreeUtil.getParentOfType(pParent,
                                                          XmlTag.class,
                                                          false);
        if (parent == null)
            return;

        //
        //if the removed tag was the container tag, fire global change event
        //
        final XmlTag containerTag = containerPath.getTag();
        if (containerTag == null) {
            if (pChild instanceof XmlTag) {
                final XmlTag tag = (XmlTag) pChild;
                final String[] path = PsiUtils.getPathAndConcat(parent, tag.getName());
                if (path.equals(containerPath.getPathTokens()))
                    fireRowsChangedEvent();
            }
            return;
        }

        //
        //if the removed child was a text node, simply find which property it belonged to
        //
        if (pChild instanceof XmlText) {
            final XmlTag[] rowTags = containerTag.findSubTags(rowTagName);
            for (int i = 0; i < rowTags.length; i++) {
                rowPath.setRow(i);
                if (PsiTreeUtil.isAncestor(rowPath.getTag(), pChild, false)) {
                    final String property = mapper.findPropertyForElement(pChild);
                    if (property != null)
                        fireRowChangedEvent(i, property);
                }
            }
        }

        //
        //if the removed child is a tag, check if it is a row tag or a property tag
        //
        else if (pChild instanceof XmlTag) {
            rowPath.setRow(null);
            final XmlTag tag = (XmlTag) pChild;
            final String[] path = PsiUtils.getPathAndConcat(parent, tag.getName());

            //if the removed tag is a registered property tag
            final String propertyName = mapper.findPropertyByPath(path);
            if (propertyName != null) {
                final int row = findRowForElement(parent);
                fireRowChangedEvent(row, propertyName);
            }

            //if the removed tag is a row tag
            else if (rowTagName.equals(tag.getName())) {
                //TODO: inspect event's offset to determine row number
                //fireRowRemovedEvent(rowByOffset);

                fireRowsChangedEvent();
            }
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

        private int result = -1;

        public void run() {
            result = -1;
            try {
                final XmlTag containerTag = containerPath.ensureTag();
                final String namespace = containerTag.getNamespace();
                final XmlTag rowTag = (XmlTag) containerTag.add(
                        containerTag.createChildTag(rowTagName,
                                                    namespace,
                                                    null,
                                                    false));

                final XmlTag[] childTags = containerTag.findSubTags(rowTagName);
                for (int i = 0; i < childTags.length; i++) {
                    XmlTag tag = childTags[i];
                    if (tag.equals(rowTag)) {
                        result = i;
                        break;
                    }
                }
            }
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

    }

    public final void renameProperty(final String pPropertyName,
                                     final String pNewPropertyName) {
        final XmlTagPath tagPath = getPropertyTagPath(pPropertyName, false);
        XmlTag tag = tagPath == null ? null : tagPath.getTag();
        if (tag == null)
            return;

        //
        //rename the tag
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

        notifyAddition(pNewPropertyName);
    }

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

        return containerTag.getSubTags();
    }
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

            listenerList.remove(BeanRowsListener.class, pListener);
        }
    }

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

        return containerTag.getSubTags().length;
    }
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

        private int result = -1;

        public void run() {
            result = -1;
            try {
                final XmlTag containerTag = containerPath.ensureTag();
                final String namespace = containerTag.getNamespace();
                final XmlTag rowTag = (XmlTag) containerTag.add(
                        containerTag.createChildTag(unknownPropertyName,
                                                    namespace,
                                                    null,
                                                    false));

                final XmlTag[] childTags = containerTag.getSubTags();
                for (int i = 0; i < childTags.length; i++) {
                    XmlTag tag = childTags[i];
                    if (tag.equals(rowTag)) {
                        result = i;
                        break;
                    }
                }
            }
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

            rowIndices = pRowIndices;
        }

        public void run() {
            try {
                final XmlTag containerTag = containerPath.getTag();
                if (containerTag == null)
                    return;

                final XmlTag[] childTags = containerTag.getSubTags();
                final Set<XmlTag> tags = new HashSet<XmlTag>(rowIndices.length);
                for (int rowIndice : rowIndices)
                    tags.add(childTags[rowIndice]);

                for (XmlTag xmlTag : tags)
View Full Code Here

Examples of com.mycila.xmltool.XMLTag

* @author Mathieu Carbou (mathieu.carbou@gmail.com)
*/
public final class AdditionalHeaderDefinitionTest {
    @Test
    public void test_load_definitions() throws Exception {
        XMLTag def = XMLDoc.newDocument(true).addRoot("additionalHeaders")
                .addTag("xquery")
                .addTag("firstLine").addText("(:")
                .addTag("beforeEachLine").addText(" : ")
                .addTag("endLine").addText(" :)")
                .addTag("firstLineDetectionPattern").addText("\\(\\:")
                .addTag("lastLineDetectionPattern").addText("\\:\\)")
                .addTag("allowBlankLines").addText("false")
                .addTag("isMultiline").addText("false");

        System.out.println(def.toString());

        AdditionalHeaderDefinition loader = new AdditionalHeaderDefinition(def);

        assertEquals(loader.getDefinitions().size(), 1);
        assertEquals(loader.getDefinitions().get("xquery").getType(), "xquery");
View Full Code Here

Examples of net.sourceforge.javautil.common.xml.annotation.XmlTag

    this.propertyName = parent == null ? clazz.getSimpleName() : parent.propertyName;
    this.propertyType = clazz;
    this.classRegistry = tagDef != null && tagDef.classRegistry().length > 0 ? tagDef.classRegistry()[0] : null;
   
    if (tagDef == null || (tagDef != null && "".equals(tagDef.name()))) {
      XmlTag tag = null;
      Class<?> c = clazz.getSuperclass();
      while (tag == null && c != null) {
        tag = c.getAnnotation(XmlTag.class);
        if (tag != null && !"".equals(tag.name())) {
          if (tagDef == null) tagDef = tag;
          tagName = tag.name(); break;
        }
        c = c.getSuperclass();
      }
    }
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.