Search in sources :

Example 1 with AttributeDialog

use of com.centurylink.mdw.plugin.designer.dialogs.AttributeDialog 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 2 with AttributeDialog

use of com.centurylink.mdw.plugin.designer.dialogs.AttributeDialog 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)

Aggregations

AttributeVO (com.centurylink.mdw.model.value.attribute.AttributeVO)2 AttributeDialog (com.centurylink.mdw.plugin.designer.dialogs.AttributeDialog)2 ColumnSpec (com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec)1 TableEditor (com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)1 ArrayList (java.util.ArrayList)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1