Search in sources :

Example 21 with ValueChangeListener

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

the class PackagePermissionsSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    workflowPackage = (WorkflowPackage) selection;
    // user text field
    userEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_TEXT);
    userEditor.setLabel("Current User");
    userEditor.setWidth(150);
    userEditor.setReadOnly(true);
    userEditor.render(composite);
    // edit processes checkbox
    editProcessesEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_CHECKBOX);
    editProcessesEditor.setLabel("Create/Edit Assets");
    editProcessesEditor.setReadOnly(true);
    editProcessesEditor.render(composite);
    // run processes checkbox
    runProcessesEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_CHECKBOX);
    runProcessesEditor.setLabel("Execute Processes");
    runProcessesEditor.setReadOnly(true);
    runProcessesEditor.render(composite);
    // admin checkbox
    adminPermissionsEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_CHECKBOX);
    adminPermissionsEditor.setLabel("Administrator Privileges");
    adminPermissionsEditor.setReadOnly(true);
    adminPermissionsEditor.render(composite);
    // sys admin checkbox
    sysAdminPermissionsEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_CHECKBOX);
    sysAdminPermissionsEditor.setLabel("System Admin Privileges");
    sysAdminPermissionsEditor.setReadOnly(true);
    sysAdminPermissionsEditor.render(composite);
    // MDW Hub link
    mdwHubLinkEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_LINK);
    mdwHubLinkEditor.setLabel("Launch MDW Hub to Change Role Assignments");
    mdwHubLinkEditor.setIndent(-100);
    mdwHubLinkEditor.setWidth(500);
    mdwHubLinkEditor.setHeight(20);
    mdwHubLinkEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            launchMdwHub();
        }
    });
    mdwHubLinkEditor.render(composite);
    // reload button
    reloadButtonEditor = new PropertyEditor(workflowPackage, PropertyEditor.TYPE_BUTTON);
    reloadButtonEditor.setLabel("Reload");
    reloadButtonEditor.setIndent(-100);
    reloadButtonEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            reloadPermissions();
        }
    });
    reloadButtonEditor.render(composite);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 22 with ValueChangeListener

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

the class VariableInstancesSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    process = (WorkflowProcess) selection;
    tableEditor = new TableEditor(process, TableEditor.TYPE_TABLE);
    tableEditor.setReadOnly(true);
    tableEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            openDialog((VariableInstanceInfo) newValue);
        }
    });
    if (columnSpecs == null)
        columnSpecs = createColumnSpecs();
    tableEditor.setColumnSpecs(columnSpecs);
    if (contentProvider == null)
        contentProvider = new VariableInstanceContentProvider();
    tableEditor.setContentProvider(contentProvider);
    if (labelProvider == null)
        labelProvider = new VariableInstanceLabelProvider();
    tableEditor.setLabelProvider(labelProvider);
    tableEditor.render(composite);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) VariableInstanceInfo(com.centurylink.mdw.model.value.variable.VariableInstanceInfo) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)

Example 23 with ValueChangeListener

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

the class WorkflowAssetAttributesSection method setSelection.

public void setSelection(WorkflowElement selection) {
    if (workflowAsset != null)
        workflowAsset.removeElementChangeListener(this);
    workflowAsset = (WorkflowAsset) selection;
    workflowAsset.addElementChangeListener(this);
    if (propertyEditors != null) {
        for (PropertyEditor propertyEditor : propertyEditors) propertyEditor.dispose();
    }
    if (warningLabel != null)
        warningLabel.dispose();
    if (savePropertyEditor != null)
        savePropertyEditor.dispose();
    if (workflowAsset.getCustomAttribute().getDefinition() == null) {
        warningLabel = new Label(composite, SWT.NONE);
        warningLabel.setText("Please define the custom attributes.");
    } else {
        propertyEditors = new PropertyEditorList(workflowAsset, workflowAsset.getCustomAttribute().getDefinition());
        for (PropertyEditor propertyEditor : propertyEditors) {
            propertyEditor.render(composite);
            propertyEditor.setValue(workflowAsset);
        }
        // save button
        savePropertyEditor = new PropertyEditor(workflowAsset, PropertyEditor.TYPE_BUTTON);
        savePropertyEditor.setLabel("Save");
        savePropertyEditor.setComment("Save Attributes:");
        savePropertyEditor.setWidth(65);
        savePropertyEditor.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                saveAttributes();
            }
        });
        savePropertyEditor.render(composite);
        savePropertyEditor.setElement(workflowAsset);
    }
    composite.layout(true);
}
Also used : PropertyEditorList(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) Label(org.eclipse.swt.widgets.Label) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 24 with ValueChangeListener

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

the class WorkflowAssetLockSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    workflowAsset = (WorkflowAsset) selection;
    // lock user read-only text field
    lockUserPropertyEditor = new PropertyEditor(workflowAsset, PropertyEditor.TYPE_TEXT);
    lockUserPropertyEditor.setLabel("Locked By");
    lockUserPropertyEditor.setWidth(150);
    lockUserPropertyEditor.setReadOnly(true);
    lockUserPropertyEditor.render(composite);
    // lock date read-only text field
    modDatePropertyEditor = new PropertyEditor(workflowAsset, PropertyEditor.TYPE_TEXT);
    modDatePropertyEditor.setLabel("Lock Date");
    modDatePropertyEditor.setWidth(150);
    modDatePropertyEditor.setValueConverter(new DateConverter());
    modDatePropertyEditor.setReadOnly(true);
    modDatePropertyEditor.render(composite);
    // lock button
    lockButtonPropertyEditor = new PropertyEditor(workflowAsset, PropertyEditor.TYPE_BUTTON);
    lockButtonPropertyEditor.setLabel("");
    lockButtonPropertyEditor.setWidth(65);
    lockButtonPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            toggleLock();
        }
    });
    lockButtonPropertyEditor.render(composite);
}
Also used : DateConverter(com.centurylink.mdw.plugin.designer.properties.convert.DateConverter) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 25 with ValueChangeListener

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

the class WorkflowAssetVersionsSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    workflowAsset = (WorkflowAsset) selection;
    tableEditor = new TableEditor(workflowAsset, TableEditor.TYPE_TABLE);
    List<ColumnSpec> columnSpecs = new ArrayList<ColumnSpec>();
    ColumnSpec packageColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Package", "package");
    packageColSpec.width = 160;
    columnSpecs.add(packageColSpec);
    ColumnSpec versionColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Version", "version");
    versionColSpec.width = 60;
    columnSpecs.add(versionColSpec);
    ColumnSpec idColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "ID", "id");
    idColSpec.width = 65;
    columnSpecs.add(idColSpec);
    ColumnSpec createDateColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Created", "createDate");
    createDateColSpec.width = 110;
    columnSpecs.add(createDateColSpec);
    ColumnSpec userColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "User", "user");
    userColSpec.width = 75;
    columnSpecs.add(userColSpec);
    ColumnSpec commentsColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Comments", "comments");
    commentsColSpec.width = 200;
    columnSpecs.add(commentsColSpec);
    ColumnSpec lockedToColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Locked To", "lockedTo");
    lockedToColSpec.width = 75;
    columnSpecs.add(lockedToColSpec);
    ColumnSpec modDateColSpec = new ColumnSpec(PropertyEditor.TYPE_TEXT, "Last Modified", "modDate");
    modDateColSpec.width = 110;
    columnSpecs.add(modDateColSpec);
    tableEditor.setColumnSpecs(columnSpecs);
    // tableEditor.setFillWidth(true);
    tableEditor.setReadOnly(true);
    tableEditor.setContentProvider(new AssetVersionContentProvider());
    tableEditor.setLabelProvider(new AssetVersionLabelProvider());
    tableEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            openAsset((WorkflowAsset) newValue);
        }
    });
    tableEditor.render(composite);
    // right-click menu
    tableEditor.getTable().addListener(SWT.MenuDetect, new Listener() {

        public void handleEvent(Event event) {
            tableEditor.getTable().setMenu(createContextMenu(tableEditor.getTable().getShell()));
        }
    });
}
Also used : ColumnSpec(com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) Listener(org.eclipse.swt.widgets.Listener) ElementChangeListener(com.centurylink.mdw.plugin.designer.model.ElementChangeListener) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) ArrayList(java.util.ArrayList) WorkflowAsset(com.centurylink.mdw.plugin.designer.model.WorkflowAsset) Event(org.eclipse.swt.widgets.Event) ElementChangeEvent(com.centurylink.mdw.plugin.designer.model.ElementChangeEvent) SelectionEvent(org.eclipse.swt.events.SelectionEvent) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)

Aggregations

ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)44 PropertyEditor (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)36 TableEditor (com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)9 ArrayList (java.util.ArrayList)8 SelectionEvent (org.eclipse.swt.events.SelectionEvent)6 ArtifactEditor (com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor)5 Event (org.eclipse.swt.widgets.Event)5 Label (org.eclipse.swt.widgets.Label)5 Listener (org.eclipse.swt.widgets.Listener)5 DateConverter (com.centurylink.mdw.plugin.designer.properties.convert.DateConverter)4 ColumnSpec (com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec)3 PropertyEditorList (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList)3 FontData (org.eclipse.swt.graphics.FontData)3 CustomAttributeVO (com.centurylink.mdw.model.value.attribute.CustomAttributeVO)2 ElementChangeEvent (com.centurylink.mdw.plugin.designer.model.ElementChangeEvent)2 ElementChangeListener (com.centurylink.mdw.plugin.designer.model.ElementChangeListener)2 EmbeddedSubProcess (com.centurylink.mdw.plugin.designer.model.EmbeddedSubProcess)2 TimeInterval (com.centurylink.mdw.plugin.designer.properties.editor.TimeInterval)2 WorkflowAssetEditor (com.centurylink.mdw.plugin.designer.properties.editor.WorkflowAssetEditor)2 MarkdownRenderer (com.centurylink.mdw.designer.utils.MarkdownRenderer)1