use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.
the class CtdTable method createContent.
/**
* (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)
* --> ((CAPTION)?, ((COL)* | (COLGROUP)*), (THEAD)?, (TFOOT)?, (TBODY)+, (TR)+)
*/
protected void createContent() {
if (content != null)
// already created.
return;
if (collection == null)
return;
// ( , , , ,)
content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
// (CAPTION)?
// ( )?
CMGroupImpl wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
if (wrap == null)
return;
content.appendChild(wrap);
// CAPTION
CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.CAPTION);
if (dec != null)
wrap.appendChild(dec);
// ((COL)* | (COLGROUP)*)
// ( | )
CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
if (group == null)
return;
content.appendChild(group);
// (COL)*
wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
if (wrap == null)
return;
group.appendChild(wrap);
dec = collection.getNamedItem(HTML40Namespace.ElementName.COL);
if (dec != null)
wrap.appendChild(dec);
// (COLGROUP)*
wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
if (wrap == null)
return;
group.appendChild(wrap);
dec = collection.getNamedItem(HTML40Namespace.ElementName.COLGROUP);
if (dec != null)
wrap.appendChild(dec);
// (THEAD)?
wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
if (wrap == null)
return;
content.appendChild(wrap);
dec = collection.getNamedItem(HTML40Namespace.ElementName.THEAD);
if (dec != null)
wrap.appendChild(dec);
// (TFOOT)?
wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
if (wrap == null)
return;
content.appendChild(wrap);
dec = collection.getNamedItem(HTML40Namespace.ElementName.TFOOT);
if (dec != null)
wrap.appendChild(dec);
// (TBODY)+
// TBODY has optional start and end tags
wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
if (wrap == null)
return;
content.appendChild(wrap);
dec = collection.getNamedItem(HTML40Namespace.ElementName.TBODY);
if (dec != null)
wrap.appendChild(dec);
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=96101
// TBODY start and end tag are optional, so TR should be allowed here
// (TR)+
wrap = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
if (wrap == null)
return;
content.appendChild(wrap);
dec = collection.getNamedItem(HTML40Namespace.ElementName.TR);
if (dec != null)
wrap.appendChild(dec);
}
use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.
the class AttributeCollection method getDeclaration.
/**
* Get a global attribute declaration.
*
* @param attrName
* java.lang.String
*/
public HTMLAttributeDeclaration getDeclaration(String attrName) {
CMNode cmnode = getNamedItem(attrName);
if (cmnode != null)
// already exists.
return (HTMLAttributeDeclaration) cmnode;
HTMLAttrDeclImpl dec = create(attrName);
if (dec != null)
putNamedItem(attrName, dec);
return dec;
}
use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.
the class CtdTrContainer method createContent.
/**
* (TR)+.
*/
protected void createContent() {
if (content != null)
// already created.
return;
if (collection == null)
return;
// (TR)+
content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
CMNode tr = collection.getNamedItem(HTML40Namespace.ElementName.TR);
if (tr != null)
content.appendChild(tr);
}
use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.
the class CtdFrameset method createContent.
/**
* ((FRAMESET | FRAME)+ & NOFRAMES?).
* --> ((FRAMESET | FRAME)+ & (NOFRAMES)?)
*/
protected void createContent() {
if (content != null)
// already created.
return;
if (collection == null)
return;
// ( & )
content = new CMGroupImpl(CMGroup.ALL, 1, 1);
// ( | )+
CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
if (group == null)
return;
content.appendChild(group);
// FRAMESET
CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.FRAMESET);
if (dec != null)
group.appendChild(dec);
// FRAME
dec = collection.getNamedItem(HTML40Namespace.ElementName.FRAME);
if (dec != null)
group.appendChild(dec);
// ( )?
group = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
if (group == null)
return;
content.appendChild(group);
// NOFRAMES
dec = collection.getNamedItem(HTML40Namespace.ElementName.NOFRAMES);
if (dec != null)
group.appendChild(dec);
}
use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.
the class CtdParamContainer method createContent.
/**
* (PARAM | %flow;)*.
*/
protected void createContent() {
if (content != null)
// already created.
return;
if (collection == null)
return;
// ( | )*
content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
// PARAM
CMNode param = collection.getNamedItem(HTML40Namespace.ElementName.PARAM);
if (param != null)
content.appendChild(param);
// %flow;
CMGroupImpl flows = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
if (flows == null)
return;
collection.getInline(flows);
collection.getBlock(flows);
content.appendChild(flows);
}
Aggregations