Search in sources :

Example 16 with AttributeVO

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);
}
Also used : AttributeVO(com.centurylink.mdw.model.value.attribute.AttributeVO)

Example 17 with AttributeVO

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();
}
Also used : AttributeVO(com.centurylink.mdw.model.value.attribute.AttributeVO) AttributeDialog(com.centurylink.mdw.plugin.designer.dialogs.AttributeDialog)

Example 18 with AttributeVO

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();
        }
    });
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) AttributeVO(com.centurylink.mdw.model.value.attribute.AttributeVO) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ArrayList(java.util.ArrayList) SelectionEvent(org.eclipse.swt.events.SelectionEvent) AttributeDialog(com.centurylink.mdw.plugin.designer.dialogs.AttributeDialog) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)

Example 19 with AttributeVO

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;
}
Also used : AttributeVO(com.centurylink.mdw.model.value.attribute.AttributeVO)

Example 20 with AttributeVO

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);
}
Also used : AttributeVO(com.centurylink.mdw.model.value.attribute.AttributeVO) List(java.util.List) ArrayList(java.util.ArrayList) Phrase(com.lowagie.text.Phrase) ListItem(com.lowagie.text.ListItem) Chunk(com.lowagie.text.Chunk) Section(com.lowagie.text.Section) Paragraph(com.lowagie.text.Paragraph)

Aggregations

AttributeVO (com.centurylink.mdw.model.value.attribute.AttributeVO)24 ArrayList (java.util.ArrayList)15 PackageVO (com.centurylink.mdw.model.value.process.PackageVO)5 ActivityVO (com.centurylink.mdw.model.value.activity.ActivityVO)4 WorkTransitionVO (com.centurylink.mdw.model.value.work.WorkTransitionVO)4 MbengNode (com.qwest.mbeng.MbengNode)4 List (java.util.List)4 PackageDocument (com.centurylink.mdw.bpm.PackageDocument)3 ActivityImplementorVO (com.centurylink.mdw.model.value.activity.ActivityImplementorVO)3 CustomAttributeVO (com.centurylink.mdw.model.value.attribute.CustomAttributeVO)3 ProcessVO (com.centurylink.mdw.model.value.process.ProcessVO)3 ProcessDefinitionDocument (com.centurylink.mdw.bpm.ProcessDefinitionDocument)2 Property (com.centurylink.mdw.bpm.PropertyDocument.Property)2 PropertyGroup (com.centurylink.mdw.bpm.PropertyGroupDocument.PropertyGroup)2 ExternalEventVO (com.centurylink.mdw.model.value.event.ExternalEventVO)2 VariableVO (com.centurylink.mdw.model.value.variable.VariableVO)2 AttributeDialog (com.centurylink.mdw.plugin.designer.dialogs.AttributeDialog)2 LinkedHashMap (java.util.LinkedHashMap)2 Map (java.util.Map)2 XmlOptions (org.apache.xmlbeans.XmlOptions)2