Search in sources :

Example 41 with CMNode

use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.

the class CtdRuby method createContent.

/**
 * (RT)+.
 */
protected void createContent() {
    if (content != null)
        // already created.
        return;
    if (collection == null)
        return;
    content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
    CMGroupImpl phraseGroup = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
    if (phraseGroup == null)
        return;
    content.appendChild(phraseGroup);
    collection.getPhrase(phraseGroup);
    CMGroupImpl rtrpgroup = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
    if (rtrpgroup == null)
        return;
    content.appendChild(rtrpgroup);
    // RT
    CMNode dec = collection.getNamedItem(HTML50Namespace.ElementName.RT);
    if (dec != null)
        rtrpgroup.appendChild(dec);
    CMGroupImpl rpgroup = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
    if (rpgroup == null)
        return;
    rtrpgroup.appendChild(rpgroup);
    // RP
    dec = collection.getNamedItem(HTML50Namespace.ElementName.RP);
    if (dec != null)
        rpgroup.appendChild(dec);
    // RT
    dec = collection.getNamedItem(HTML50Namespace.ElementName.RT);
    if (dec != null)
        rpgroup.appendChild(dec);
    dec = collection.getNamedItem(HTML50Namespace.ElementName.RP);
    if (dec != null)
        rpgroup.appendChild(dec);
}
Also used : CMNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)

Example 42 with CMNode

use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.

the class CtdFigure method createContent.

/**
 * (FIGCAPTION)+.
 */
protected void createContent() {
    if (content != null)
        // already created.
        return;
    if (collection == null)
        return;
    // ( | )+
    content = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
    CMGroupImpl group1 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
    if (group1 != null) {
        content.appendChild(group1);
    }
    // FIGCAPTION, FLOW
    CMNode dec = collection.getNamedItem(HTML50Namespace.ElementName.FIGCAPTION);
    if (dec != null)
        group1.appendChild(dec);
    CMGroupImpl flowgroup = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
    group1.appendChild(flowgroup);
    collection.getFlow(flowgroup);
    CMGroupImpl group2 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
    if (group2 != null) {
        content.appendChild(group2);
    }
    // FLOW , FIGCAPTION
    CMGroupImpl flowgroup2 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
    group2.appendChild(flowgroup2);
    collection.getFlow(flowgroup2);
    CMNode dec1 = collection.getNamedItem(HTML50Namespace.ElementName.FIGCAPTION);
    if (dec1 != null)
        group2.appendChild(dec1);
    // FLOW
    CMGroupImpl group3 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
    if (group3 != null) {
        content.appendChild(group3);
    }
    collection.getFlow(group3);
}
Also used : CMNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)

Example 43 with CMNode

use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.

the class CtdMap method createContent.

/**
 * ((%block;) | AREA)+.
 */
protected void createContent() {
    if (content != null)
        // already created.
        return;
    if (collection == null)
        return;
    // ( | )+
    content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
    // (%block;)
    CMGroupImpl blocks = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
    if (blocks == null)
        return;
    collection.getBlock(blocks);
    content.appendChild(blocks);
    // AREA
    CMNode area = collection.getNamedItem(HTML40Namespace.ElementName.AREA);
    if (area != null)
        content.appendChild(area);
}
Also used : CMNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)

Example 44 with CMNode

use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.

the class CtdNoframesContent method createContent.

/**
 * (BODY).
 */
protected void createContent() {
    if (content != null)
        // already created.
        return;
    if (collection == null)
        return;
    // ( )
    content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
    // BODY
    CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.BODY);
    if (dec != null)
        content.appendChild(dec);
}
Also used : CMNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)

Example 45 with CMNode

use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.

the class HedDETAILS method createAttributeDeclarations.

protected void createAttributeDeclarations() {
    if (attributes != null)
        // already created.
        return;
    if (attributeCollection == null)
        // fatal
        return;
    attributes = new CMNamedNodeMapImpl();
    // %attrs;
    attributeCollection.getAttrs(attributes);
    CMNode node = attributeCollection.getDeclaration(HTML50Namespace.ATTR_NAME_OPEN);
    if (node != null)
        attributes.putNamedItem(HTML50Namespace.ATTR_NAME_OPEN, node);
}
Also used : CMNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)

Aggregations

CMNode (org.eclipse.wst.xml.core.internal.contentmodel.CMNode)133 CMElementDeclaration (org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration)37 List (java.util.List)36 CMNamedNodeMap (org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap)35 ArrayList (java.util.ArrayList)28 Iterator (java.util.Iterator)23 ITextRegionList (org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList)20 CMNodeList (org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList)19 CMAttributeDeclaration (org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration)17 CMDocument (org.eclipse.wst.xml.core.internal.contentmodel.CMDocument)17 Element (org.w3c.dom.Element)16 NodeList (org.w3c.dom.NodeList)15 CMNamedNodeMapImpl (org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl)14 ModelQuery (org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery)13 Node (org.w3c.dom.Node)13 NamedNodeMap (org.w3c.dom.NamedNodeMap)10 ModelQueryAction (org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction)9 IDOMNode (org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode)9 Image (org.eclipse.swt.graphics.Image)8 CustomCompletionProposal (org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal)8