use of org.eclipse.wst.css.core.internal.metamodel.CSSMMDescriptor in project webtools.sourceediting by eclipse.
the class CSSProposalGeneratorForDeclarationValue method getCandidates.
/**
* getCandidates method comment.
*/
protected Iterator getCandidates() {
List candidates = new ArrayList();
// check should add semi-colon or not
checkSemiColon();
String name = getPropertyName();
if (name != null) {
CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
Iterator i = Collections.EMPTY_LIST.iterator();
if (isFontFaceRule()) {
CSSMMDescriptor desc = util.getDescriptor(name);
if (desc != null) {
i = desc.getValues();
}
} else {
CSSMMProperty prop = util.getProperty(name);
if (prop != null) {
i = prop.getValues();
}
}
while (i.hasNext()) {
CSSMMNode val = (CSSMMNode) i.next();
String valueType = val.getType();
if (valueType == CSSMMNode.TYPE_KEYWORD) {
addString(candidates, val.toString());
} else if (valueType == CSSMMNode.TYPE_NUMBER) {
addNumber(candidates, (CSSMMNumber) val);
} else if (valueType == CSSMMNode.TYPE_FUNCTION) {
addFunction(candidates, (CSSMMFunction) val);
}
}
}
addImportant(candidates);
addSemiColon(candidates);
return candidates.iterator();
}
Aggregations