use of org.eclipse.wst.xml.ui.internal.properties.EnumeratedStringPropertyDescriptor in project webtools.sourceediting by eclipse.
the class XMLTableTreePropertyDescriptorFactory method createPropertyDescriptorHelper.
protected IPropertyDescriptor createPropertyDescriptorHelper(String name, Element element, CMNode cmNode) {
IPropertyDescriptor result = null;
ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
String[] valuesArray = null;
if (mq != null) {
valuesArray = mq.getPossibleDataTypeValues(element, cmNode);
}
if ((valuesArray != null) && (valuesArray.length > 0)) {
result = new EnumeratedStringPropertyDescriptor(name, name, valuesArray);
} else {
result = createDefaultPropertyDescriptor(name);
}
return result;
}
use of org.eclipse.wst.xml.ui.internal.properties.EnumeratedStringPropertyDescriptor in project webtools.sourceediting by eclipse.
the class DOMPropertyDescriptorFactory method createAttributePropertyDescriptor.
public IPropertyDescriptor createAttributePropertyDescriptor(Attr attr) {
IPropertyDescriptor result = null;
String attributeName = attr.getName();
ModelQuery mq = ModelQueryUtil.getModelQuery(attr.getOwnerDocument());
if (mq != null) {
CMAttributeDeclaration ad = mq.getCMAttributeDeclaration(attr);
if (ad != null) {
String[] valuesArray = mq.getPossibleDataTypeValues(attr.getOwnerElement(), ad);
if ((valuesArray != null) && (valuesArray.length > 0)) {
result = new EnumeratedStringPropertyDescriptor(attributeName, attributeName, valuesArray);
}
}
}
if (result == null) {
result = createDefaultPropertyDescriptor(attributeName);
}
return result;
}
Aggregations