return cellElement.getAttribute(m_attribute);
}
@Override
public void setExpression(XmlObjectInfo object, String expression) throws Exception {
DocumentElement objectElement = object.getCreationSupport().getElement();
DocumentElement cellElement = getExistingCellElement(object);
// wrap into "Cell" element
if (cellElement == null) {
DocumentElement parentElement = objectElement.getParent();
int index = parentElement.indexOf(objectElement);
// prepare "Cell" element
{
cellElement = new DocumentElement();
cellElement.setTag(m_namespace + "Cell");
parentElement.addChild(cellElement, index);
}
// move "widget" into "Cell"
cellElement.moveChild(objectElement, 0);
}
// set attribute
cellElement.setAttribute(m_attribute, expression);
// remove "Cell" if no attributes
if (cellElement.getDocumentAttributes().isEmpty()) {
DocumentElement parentElement = cellElement.getParent();
int index = parentElement.indexOf(cellElement);
// move "widget" at place of "Cell"
parentElement.moveChild(objectElement, index);
// remove "Cell"
cellElement.remove();
}
// finish edit operation
ExecutionUtils.refresh(object);