use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor in project mdw-designer by CenturyLinkCloud.
the class OsgiAdapterDesignSection method drawWidgets.
public void drawWidgets(Composite composite, WorkflowElement selection) {
activity = (Activity) selection;
interfaceSelector = new WorkflowAssetEditor(activity, WorkAttributeConstant.SERVICE_INTERFACE, getAssetTypes());
interfaceSelector.setLabel("Service Interface");
interfaceSelector.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
activity.setAttribute(WorkAttributeConstant.SERVICE_INTERFACE, (String) newValue);
methodDropdown.setValueOptions(getServiceMethodOptions());
}
});
interfaceSelector.render(composite);
methodDropdown = new PropertyEditor(activity, PropertyEditor.TYPE_COMBO);
methodDropdown.setLabel("Method");
methodDropdown.setWidth(277);
methodDropdown.setValueOptions(getServiceMethodOptions());
methodDropdown.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
activity.setAttribute(WorkAttributeConstant.SERVICE_METHOD, (String) newValue);
paramsTable.setValue(getParamsTableValue());
}
});
methodDropdown.render(composite);
resultDropdown = new PropertyEditor(activity, PropertyEditor.TYPE_COMBO);
resultDropdown.setLabel("Result Variable");
resultDropdown.setWidth(277);
resultDropdown.setValueOptions(getResultVariableOptions());
resultDropdown.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
activity.setAttribute(WorkAttributeConstant.SERVICE_RESULT, (String) newValue);
}
});
resultDropdown.render(composite);
paramsTable = new TableEditor(activity, TableEditor.TYPE_TABLE);
paramsTable.setColumnSpecs(getInputTableColumns());
paramsTable.setColumnDelimiter('=');
paramsTable.setLabel("Parameters");
paramsTable.setAttributeName(WorkAttributeConstant.SERVICE_PARAMETERS);
paramsTable.setHorizontalSpan(3);
paramsTable.render(composite, false);
helpLink = new PropertyEditor(activity, PropertyEditor.TYPE_LINK);
helpLink.setLabel("OSGi Service Adapter Help");
helpLink.render(composite);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor in project mdw-designer by CenturyLinkCloud.
the class PageletSection method setSelection.
public void setSelection(WorkflowElement selection) {
element = (WorkflowElement) selection;
if (propertyEditors != null) {
for (PropertyEditor propertyEditor : propertyEditors) {
propertyEditor.dispose();
}
}
if (savePropertyEditor != null)
savePropertyEditor.dispose();
if (offlinePropertyEditor != null)
offlinePropertyEditor.dispose();
if (helpPropertyEditor != null)
helpPropertyEditor.dispose();
final PageletTab tab = element.getProject().getPageletTab(tabId);
if (tab != null) {
if (element.overrideAttributesApplied()) {
attributeNames = new ArrayList<String>();
propertyEditors = new PropertyEditorList(element, tab.getXml());
for (PropertyEditor propertyEditor : propertyEditors) {
attributeNames.add(propertyEditor.getName());
propertyEditor.setFireDirtyStateChange(false);
propertyEditor.render(composite);
propertyEditor.setValue(element.getAttribute(propertyEditor.getName()));
if (!propertyEditor.getType().equals(PropertyEditor.TYPE_LINK)) {
// pagelet-driven attributes are always considered
// override attributes
boolean editable = element.isUserAuthorized(UserRoleVO.PROCESS_EXECUTION) && !propertyEditor.isReadOnly();
propertyEditor.setEditable(editable);
propertyEditor.setFireDirtyStateChange(false);
}
if (!propertyEditor.isReadOnly()) {
propertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
setDirty(true);
}
});
}
}
// help link
helpPropertyEditor = new PropertyEditor(element, PropertyEditor.TYPE_LINK);
helpPropertyEditor.setLabel("Override Attributes Help");
helpPropertyEditor.render(composite);
helpPropertyEditor.setValue("/MDWHub/doc/override-attributes.html");
// save button
savePropertyEditor = createSaveButton();
} else {
// offline message
offlinePropertyEditor = new PropertyEditor(element, PropertyEditor.TYPE_INFO);
offlinePropertyEditor.render(composite);
offlinePropertyEditor.setValue("Attributes unavailable. Reload process with server online.");
// help link
helpPropertyEditor = new PropertyEditor(element, PropertyEditor.TYPE_LINK);
helpPropertyEditor.setLabel("Override Attributes Help");
helpPropertyEditor.render(composite);
helpPropertyEditor.setValue("/MDWHub/doc/todo.html");
}
}
composite.layout(true);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor in project mdw-designer by CenturyLinkCloud.
the class PrePostScriptSection method drawWidgets.
public void drawWidgets(Composite composite, WorkflowElement selection) {
activity = (Activity) selection;
activity.setScriptLanguages(null);
// artifact editor
preScriptArtifactEditor = new ArtifactEditor(activity, getNewScriptValueProvider(true), "PreScript Language");
preScriptArtifactEditor.render(composite);
postScriptArtifactEditor = new ArtifactEditor(activity, getNewScriptValueProvider(false), "PostScript Language");
postScriptArtifactEditor.render(composite);
// output docs
outputDocsPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_PICKLIST);
outputDocsPropertyEditor.setLabel("Documents:Read-Only~Writable");
outputDocsPropertyEditor.setValueOptions(activity.getProcess().getDocRefVariableNames());
outputDocsPropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
activity.setAttribute("Output Documents", (String) newValue);
}
});
outputDocsPropertyEditor.render(composite);
outputDocsPropertyEditor.setVisible(activity.canWriteOutputDocs());
// help link
helpPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_LINK);
helpPropertyEditor.setLabel("Script Activity Help");
helpPropertyEditor.render(composite);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor in project mdw-designer by CenturyLinkCloud.
the class ProcessDesignSection method drawWidgets.
@Override
public void drawWidgets(Composite composite, WorkflowElement selection) {
process = (WorkflowProcess) selection;
// sla timer field
slaPropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_TIMER);
slaPropertyEditor.setLabel("SLA");
slaPropertyEditor.setAcceptedUnits(new Units[] { Units.Minutes, Units.Hours, Units.Days });
slaPropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
TimeInterval.TimerValue timerValue = (TimeInterval.TimerValue) newValue;
process.setAttribute(WorkAttributeConstant.SLA, timerValue.getInterval());
process.setAttribute(WorkAttributeConstant.SLA_UNIT, timerValue.getUnits().toString());
}
});
slaPropertyEditor.render(composite);
// synchronous checkbox
syncPropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_CHECKBOX);
syncPropertyEditor.setLabel("Service Process");
syncPropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
Boolean value = (Boolean) newValue;
process.setSynchronous(value.booleanValue());
}
});
syncPropertyEditor.render(composite);
// performance level dropdown
performancePropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_COMBO);
performancePropertyEditor.setLabel("Performance Level");
performancePropertyEditor.setValueOptions(getPerformanceLevelOptions());
performancePropertyEditor.setWidth(400);
performancePropertyEditor.setReadOnly(true);
performancePropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
String sel = (String) newValue;
process.setPerformanceLevel(Integer.parseInt(sel.substring(0, sel.indexOf('-') - 1).trim()));
}
});
performancePropertyEditor.render(composite);
// transition outcome radio
transitionOutcomePropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_RADIO);
transitionOutcomePropertyEditor.setLabel("Empty Transition Outcome");
transitionOutcomePropertyEditor.setValueOptions(getTransitionOutcomeOptions());
transitionOutcomePropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
process.setEmptyTransitionOutcome(((String) newValue).trim());
}
});
transitionOutcomePropertyEditor.render(composite);
// transition retry
transitionRetryPropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_RADIO);
transitionRetryPropertyEditor.setLabel("Transition Retry Default Limit");
transitionRetryPropertyEditor.setValueOptions(getTransitionRetryOptions());
transitionRetryPropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
String sel = (String) newValue;
process.setDefaultTransitionRetryLimit(Integer.parseInt(sel.substring(sel.indexOf('(') + 1, sel.indexOf(')'))));
}
});
transitionRetryPropertyEditor.render(composite);
// process config help link
processConfigHelpLinkEditor = new PropertyEditor(process, PropertyEditor.TYPE_LINK);
processConfigHelpLinkEditor.setLabel("Process Configuration Help");
processConfigHelpLinkEditor.render(composite);
// start page asset field
startPagePropertyEditor = new WorkflowAssetEditor(process, WorkAttributeConstant.PROCESS_START_PAGE, Arrays.asList(new String[] { RuleSetVO.HTML, RuleSetVO.FACELET, RuleSetVO.JSX }));
startPagePropertyEditor.setLabel("Custom Start Page");
startPagePropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
process.setStartPage((String) newValue);
}
});
startPagePropertyEditor.render(composite);
// custom page config help link
customPageHelpLinkEditor = new PropertyEditor(process, PropertyEditor.TYPE_LINK);
customPageHelpLinkEditor.setLabel("Custom Page Help");
customPageHelpLinkEditor.render(composite);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor in project mdw-designer by CenturyLinkCloud.
the class ProcessLockSection method drawWidgets.
public void drawWidgets(Composite composite, WorkflowElement selection) {
process = (WorkflowProcess) selection;
// lock user read-only text field
lockUserPropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_TEXT);
lockUserPropertyEditor.setLabel("Locked By");
lockUserPropertyEditor.setWidth(150);
lockUserPropertyEditor.setReadOnly(true);
lockUserPropertyEditor.render(composite);
// lock date read-only text field
lockDatePropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_TEXT);
lockDatePropertyEditor.setLabel("Lock Date");
lockDatePropertyEditor.setWidth(150);
lockDatePropertyEditor.setValueConverter(new DateConverter());
lockDatePropertyEditor.setReadOnly(true);
lockDatePropertyEditor.render(composite);
// lock button
lockButtonPropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_BUTTON);
lockButtonPropertyEditor.setLabel("");
lockButtonPropertyEditor.setWidth(65);
lockButtonPropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
toggleProcessLock();
}
});
lockButtonPropertyEditor.render(composite);
}
Aggregations