public void checkProperty(css_property property) {
}
@Check
public void checkDeclaration(css_declaration dec) {
css_property property = dec.getProperty();
List<CssTok> tokens = dec.getValueTokens();
URI uri = dec.eResource().getURI();
List<Proposal> properties = ext.getPropertyProposalsForSelector(null);
//extension.getAllProperties(uri);
boolean known = false;
for (Proposal p : properties) {
if (p.getProposal().equals(property.getName())) {
known = true;
break;
}
}
if (!known) {
warning("Unknown property: \""+property.getName()+"\"", CssDslPackage.Literals.CSS_DECLARATION__PROPERTY);
}
else {
ruleset rs = (ruleset) dec.eContainer();
List<selector> selectors = rs.getSelectors();
// Set<CssProperty> selectorProps = new HashSet<>();
// for (selector selector : selectors) {
// selectorProps.addAll(extension.getPropertiesForSelector(uri, selector));
// }
List<Proposal> selectorProps = ext.getPropertyProposalsForSelector(selectors);
if (selectorProps.size() > 0) {
boolean supported = false;
for (Proposal p : selectorProps) {
if (p.getProposal().equals(property.getName())) {
supported = true;
break;
}
}
if (!supported) {
warning("\""+property.getName()+"\" is not supported by the given selectors", CssDslPackage.Literals.CSS_DECLARATION__PROPERTY);
}
}
// List<ValidationResult> result = extension.validateProperty(uri, null, property.getName(), tokens);