Search in sources :

Example 51 with PropertyEditor

use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor in project mdw-designer by CenturyLinkCloud.

the class ActivitySection method drawWidgets.

@Override
public void drawWidgets(Composite composite, WorkflowElement selection) {
    activity = (Activity) selection;
    // id text field
    idPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_TEXT);
    idPropertyEditor.setLabel("ID");
    idPropertyEditor.setWidth(150);
    idPropertyEditor.setReadOnly(true);
    idPropertyEditor.render(composite);
    // logical id text field
    logicalIdPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_TEXT);
    logicalIdPropertyEditor.setLabel("Logical ID");
    logicalIdPropertyEditor.setWidth(150);
    logicalIdPropertyEditor.setReadOnly(true);
    logicalIdPropertyEditor.render(composite);
    // name text field
    namePropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_TEXT);
    namePropertyEditor.setLabel("Label");
    namePropertyEditor.setMultiLine(true);
    namePropertyEditor.setWidth(475);
    namePropertyEditor.setHeight(30);
    namePropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setName((String) newValue);
        }
    });
    namePropertyEditor.render(composite);
    // implementor combo
    implementorPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_COMBO);
    implementorPropertyEditor.setLabel("Implementor");
    implementorPropertyEditor.setWidth(475);
    List<String> implementorNames = new ArrayList<>();
    for (ActivityImplementorVO implVo : getDataAccess().getActivityImplementors(false)) implementorNames.add(implVo.getImplementorClassName());
    implementorPropertyEditor.setValueOptions(implementorNames);
    implementorPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setActivityImpl(activity.getProject().getActivityImpl((String) newValue));
        }
    });
    implementorPropertyEditor.render(composite);
    ((Combo) implementorPropertyEditor.getWidget()).setVisibleItemCount(10);
    // implementor link
    linkPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_LINK);
    linkPropertyEditor.setLabel("Open Implementor Source Code");
    linkPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.getProject().viewSource(activity.getActivityImpl().getImplClassName());
        }
    });
    linkPropertyEditor.render(composite);
    // description text area
    descriptionPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_TEXT);
    descriptionPropertyEditor.setLabel("Description");
    descriptionPropertyEditor.setWidth(475);
    descriptionPropertyEditor.setHeight(70);
    descriptionPropertyEditor.setMultiLine(true);
    descriptionPropertyEditor.setTextLimit(1000);
    descriptionPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setDescription((String) newValue);
        }
    });
    descriptionPropertyEditor.render(composite);
}
Also used : ActivityImplementorVO(com.centurylink.mdw.model.value.activity.ActivityImplementorVO) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) ArrayList(java.util.ArrayList) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor) Combo(org.eclipse.swt.widgets.Combo)

Aggregations

PropertyEditor (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)51 ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)36 PropertyEditorList (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList)11 Activity (com.centurylink.mdw.plugin.designer.model.Activity)7 ArrayList (java.util.ArrayList)6 Label (org.eclipse.swt.widgets.Label)6 ArtifactEditor (com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor)5 TableEditor (com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)5 DateConverter (com.centurylink.mdw.plugin.designer.properties.convert.DateConverter)4 WorkflowAssetEditor (com.centurylink.mdw.plugin.designer.properties.editor.WorkflowAssetEditor)4 CustomAttributeVO (com.centurylink.mdw.model.value.attribute.CustomAttributeVO)3 FontData (org.eclipse.swt.graphics.FontData)3 TimeInterval (com.centurylink.mdw.plugin.designer.properties.editor.TimeInterval)2 GridData (org.eclipse.swt.layout.GridData)2 Button (org.eclipse.swt.widgets.Button)2 Composite (org.eclipse.swt.widgets.Composite)2 MarkdownRenderer (com.centurylink.mdw.designer.utils.MarkdownRenderer)1 ActivityImplementorVO (com.centurylink.mdw.model.value.activity.ActivityImplementorVO)1 BamMessageDefinition (com.centurylink.mdw.model.value.event.BamMessageDefinition)1 VariableVO (com.centurylink.mdw.model.value.variable.VariableVO)1