use of com.qwest.mbeng.FormatXml in project mdw-designer by CenturyLinkCloud.
the class AttributesTableContainer method createTableEditor.
private void createTableEditor(Composite parent) {
FormatXml fmter = new FormatXml();
MbengDocument mbengDocument = new MbengDocumentClass();
try {
fmter.load(mbengDocument, pageletTable.xmlText());
} catch (Exception ex) {
ex.printStackTrace();
}
tableEditor = new TableEditor(null, mbengDocument.getRootNode());
// label was already rendered
tableEditor.setLabel(null);
tableEditor.setModelUpdater(new TableModelUpdater() {
public Object create() {
int i = 1;
String attrName = "New Field";
while (getAttribute(attrName) != null) attrName = "New Field (" + i++ + ")";
return new AttributeVO(attrName, null);
}
@SuppressWarnings("rawtypes")
public void updateModelValue(List tableValue) {
fireDirtyStateChange(true);
}
});
tableEditor.setCellModifier(new AttributeCellModifier());
tableEditor.setContentProvider(new AttributeContentProvider());
tableEditor.setLabelProvider(new AttributeLabelProvider());
tableEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
// value changed
}
});
tableEditor.render(parent, true);
}
use of com.qwest.mbeng.FormatXml in project mdw-designer by CenturyLinkCloud.
the class BindingsSection method findBindingsNode.
private MbengNode findBindingsNode(Activity activity) {
String attrXml = activity.getActivityImpl().getAttrDescriptionXml();
FormatXml formatter = new FormatXml();
MbengDocumentClass mbengDocument = new MbengDocumentClass();
try {
formatter.load(mbengDocument, attrXml);
for (MbengNode currentNode = mbengDocument.getRootNode().getFirstChild(); currentNode != null; currentNode = currentNode.getNextSibling()) {
if (MappingEditor.TYPE_MAPPING.equals(currentNode.getName()) && PropertyEditor.SECTION_BINDINGS.equals(currentNode.getAttribute("SECTION")))
return currentNode;
}
} catch (MbengException ex) {
PluginMessages.uiError(getShell(), ex, "Parse Attr XML");
}
return null;
}
Aggregations