use of com.centurylink.mdw.model.value.attribute.AttributeVO in project mdw-designer by CenturyLinkCloud.
the class Activity method setAttribute.
/**
* Sets the value of the specified attribute.
*
* @param attrName
* @param attrValue
*/
public void setAttribute(String attrName, String attrValue) {
for (AttributeVO attribute : node.getAttributes()) {
if (attribute.getAttributeName().equals(attrName)) {
attribute.setAttributeValue(attrValue);
fireAttributeValueChanged(attrName, attrValue);
return;
}
}
// not found, so add
AttributeVO attrVO = new AttributeVO(attrName, attrValue);
node.getAttributes().add(attrVO);
fireAttributeValueChanged(attrName, attrValue);
}
use of com.centurylink.mdw.model.value.attribute.AttributeVO in project mdw-designer by CenturyLinkCloud.
the class WorkflowAssetVersionsSection method openViewCommentsDialog.
private void openViewCommentsDialog(WorkflowAsset asset) {
// just use the attribute dialog
String comment = asset.getRevisionComment();
if (comment == null)
comment = asset.getComment();
AttributeVO attr = new AttributeVO(asset.getLabel(), comment);
AttributeDialog dialog = new AttributeDialog(getShell(), attr);
dialog.open();
}
use of com.centurylink.mdw.model.value.attribute.AttributeVO in project mdw-designer by CenturyLinkCloud.
the class AttributesSection method drawWidgets.
@Override
public void drawWidgets(Composite composite, WorkflowElement selection) {
this.element = selection;
tableEditor = new TableEditor(element, TableEditor.TYPE_TABLE);
List<ColumnSpec> columnSpecs = new ArrayList<>();
columnSpecs.add(new ColumnSpec(PropertyEditor.TYPE_TEXT, "Attribute Name", "name"));
columnSpecs.add(new ColumnSpec(PropertyEditor.TYPE_TEXT, "Value", "value"));
tableEditor.setColumnSpecs(columnSpecs);
tableEditor.setReadOnly(true);
tableEditor.setContentProvider(new AttributeContentProvider());
tableEditor.setLabelProvider(new AttributeLabelProvider());
tableEditor.render(composite);
tableEditor.getTable().addSelectionListener(new SelectionAdapter() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
AttributeVO attributeVO = (AttributeVO) e.item.getData();
AttributeDialog dialog = new AttributeDialog(getShell(), attributeVO);
dialog.open();
}
});
}
use of com.centurylink.mdw.model.value.attribute.AttributeVO in project mdw-designer by CenturyLinkCloud.
the class Activity method removeAttribute.
/**
* Removes the specified attribute.
*
* @param attrName
* @param attrValue
*/
public boolean removeAttribute(String attrName) {
boolean success = false;
for (AttributeVO attribute : node.getAttributes()) {
if (attribute.getAttributeName().equals(attrName)) {
success = node.getAttributes().remove(attribute);
fireAttributeValueChanged(attrName, null);
return success;
}
}
fireAttributeValueChanged(attrName, null);
return success;
}
use of com.centurylink.mdw.model.value.attribute.AttributeVO in project mdw-designer by CenturyLinkCloud.
the class ExportHelper method printAttributesPdf.
private void printAttributesPdf(Section section, List<AttributeVO> attrs, int parentLevel) {
Paragraph sTitle = new Paragraph("Activity Attributes", subSectionFont);
Section subsection = section.addSection(sTitle, parentLevel == 0 ? 0 : (parentLevel + 1));
com.lowagie.text.List list = new com.lowagie.text.List(false, false, 20.0f);
for (AttributeVO attr : attrs) {
if (excludeAttribute(attr.getAttributeName(), attr.getAttributeValue()))
continue;
Phrase phrase = new Phrase();
phrase.add(new Chunk(attr.getAttributeName(), fixedWidthFont));
String v = attr.getAttributeValue();
if (v == null)
v = "";
phrase.add(new Chunk(": " + v, normalFont));
list.add(new ListItem(phrase));
}
subsection.add(list);
}
Aggregations