Search in sources :

Example 6 with CMNode

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

the class HedFORM method getExclusion.

/**
 * Exclusion.
 * <code>FORM</code> has the exclusion.
 * It is <code>FORM</code> itself.
 */
public CMContent getExclusion() {
    if (exclusion != null)
        // already created.
        return exclusion;
    if (elementCollection == null)
        // fatal
        return null;
    exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
    CMNode form = elementCollection.getNamedItem(CHTMLNamespace.ElementName.FORM);
    if (form != null)
        exclusion.appendChild(form);
    return exclusion;
}
Also used : CMNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)

Example 7 with CMNode

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

the class CtdOptionContainer method createContent.

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

Example 8 with CMNode

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

the class DeclCollection method getDeclarations.

public void getDeclarations(CMGroupImpl group, Iterator names) {
    while (names.hasNext()) {
        String entityName = (String) names.next();
        CMNode dec = getNamedItem(entityName);
        if (dec != null)
            group.appendChild(dec);
    }
}
Also used : CMNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)

Example 9 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)

Example 10 with CMNode

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

the class HedPROGRESS method getExclusion.

public CMContent getExclusion() {
    if (exclusion != null)
        return exclusion;
    if (elementCollection == null)
        return null;
    exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
    CMNode progress = elementCollection.getNamedItem(HTML50Namespace.ElementName.PROGRESS);
    if (progress != null) {
        exclusion.appendChild(progress);
    }
    return exclusion;
}
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