Search in sources :

Example 36 with CMNode

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

the class CtdDetails method createContent.

protected void createContent() {
    if (content != null)
        // already created.
        return;
    if (collection == null)
        return;
    content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
    // summary
    CMNode dec = collection.getNamedItem(HTML50Namespace.ElementName.SUMMARY);
    if (dec != null)
        content.appendChild(dec);
    CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
    content.appendChild(group);
    collection.getFlow(group);
}
Also used : CMNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)

Example 37 with CMNode

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

the class CtdEmbed method createContent.

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

Example 38 with CMNode

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

the class CtdSelect method createContent.

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

Example 39 with CMNode

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

the class DeclCollection method getDeclarations.

/**
 */
public CMNamedNodeMap getDeclarations(String[] names) {
    CMNamedNodeMapImpl map = new CMNamedNodeMapImpl();
    for (int i = 0; i < names.length; i++) {
        String name = names[i];
        CMNode node = getNamedItem(name);
        if (node == null)
            continue;
        map.putNamedItem(name, node);
    }
    return map;
}
Also used : CMNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)

Example 40 with CMNode

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

the class DeclCollection method item.

/**
 * item method
 * @return CMNode
 * @param index int
 */
public CMNode item(int index) {
    if (!isValidID(index))
        return null;
    CMNode decl = fDecls[index];
    if (decl != null)
        // already exist.
        return decl;
    decl = create(getName(index));
    fDecls[index] = decl;
    return decl;
}
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