use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector in project webtools.sourceediting by eclipse.
the class CSSSelectorListImpl method parseSelectorText.
/**
*/
private void parseSelectorText() {
fSelectors = new ArrayList();
if (fText == null) {
return;
}
CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_STYLESHEET, fText);
CSSTextToken[] tokens = parser.getTokens();
if (tokens.length <= 0) {
return;
}
List tokenGroup = new ArrayList();
for (int i = 0; i < tokens.length; i++) {
CSSTextToken token = tokens[i];
if (token.kind == CSSRegionContexts.CSS_SELECTOR_SEPARATOR && 0 < tokenGroup.size()) {
ICSSSelector selector = new CSSSelector(tokenGroup);
if (selector != null) {
fSelectors.add(selector);
}
tokenGroup.clear();
} else {
tokenGroup.add(tokens[i]);
}
}
if (0 < tokenGroup.size()) {
ICSSSelector selector = new CSSSelector(tokenGroup);
if (selector != null) {
fSelectors.add(selector);
}
}
}
use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector in project webtools.sourceediting by eclipse.
the class CSSSelectorListImpl method getErrors.
/**
*/
public Iterator getErrors() {
List errors = new ArrayList();
Iterator iSelector = getSelectors().iterator();
while (iSelector.hasNext()) {
Iterator iError = ((ICSSSelector) iSelector.next()).getErrors();
while (iError.hasNext()) {
errors.add(iError.next());
}
}
return errors.iterator();
}
Aggregations