use of org.eclipse.wst.css.core.internal.metamodel.util.CSSMMTypeCollector in project webtools.sourceediting by eclipse.
the class CSSProposalGeneratorForPseudoSelector method getSelectorTags.
/**
*/
List getSelectorTags() {
List tagList = new ArrayList();
ICSSNode targetNode = fContext.getTargetNode();
String rootType = (targetNode instanceof ICSSPageRule) ? CSSMMNode.TYPE_PAGE_RULE : CSSMMNode.TYPE_STYLE_RULE;
CSSMMTypeCollector collector = new CSSMMTypeCollector();
collector.collectNestedType(false);
collector.apply(fContext.getMetaModel(), rootType);
Iterator i;
i = collector.getNodes();
if (!i.hasNext()) {
return tagList;
}
CSSMMNode node = (CSSMMNode) i.next();
i = node.getChildNodes();
while (i.hasNext()) {
CSSMMNode child = (CSSMMNode) i.next();
if (child.getType() == CSSMMNode.TYPE_SELECTOR) {
String selType = ((CSSMMSelector) child).getSelectorType();
if (selType == CSSMMSelector.TYPE_PSEUDO_CLASS || selType == CSSMMSelector.TYPE_PSEUDO_ELEMENT) {
tagList.add(child);
}
}
}
return tagList;
}
Aggregations