use of com.centurylink.mdw.plugin.designer.dialogs.ValueDisplayDialog in project mdw-designer by CenturyLinkCloud.
the class SimulationSection method drawWidgets.
public void drawWidgets(Composite composite, WorkflowElement selection) {
activity = (Activity) selection;
if (responseListTableEditor == null)
responseListTableEditor = new TableEditor(activity, TableEditor.TYPE_TABLE);
if (columnSpecs == null)
columnSpecs = createColumnSpecs();
responseListTableEditor.setColumnSpecs(columnSpecs);
if (contentProvider == null)
contentProvider = new SimulationContentProvider();
if (labelProvider == null)
labelProvider = new SimulationLabelProvider();
if (cellModifier == null)
cellModifier = new SimulationCellModifier();
if (modelUpdater == null)
modelUpdater = new SimulationModelUpdater();
// simulation radio button
simPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_RADIO);
simPropertyEditor.setLabel("Simulation Mode");
simPropertyEditor.setWidth(85);
ArrayList<String> simOpts = new ArrayList<String>();
simOpts.add("On");
simOpts.add("Off");
simPropertyEditor.setValueOptions(simOpts);
simPropertyEditor.setDefaultValue("Off");
simPropertyEditor.setFireDirtyStateChange(false);
simPropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
activity.setAttribute(WorkAttributeConstant.SIMULATION_STUB_MODE, (String) newValue);
setDirty(true);
}
});
simPropertyEditor.render(composite);
// response table
responseListTableEditor.setWidth(500);
responseListTableEditor.setHeight(100);
responseListTableEditor.setFillWidth(true);
responseListTableEditor.setReadOnly(false);
responseListTableEditor.setFireDirtyStateChange(false);
responseListTableEditor.setContentProvider(contentProvider);
responseListTableEditor.setLabelProvider(labelProvider);
responseListTableEditor.setModelUpdater(modelUpdater);
responseListTableEditor.setCellModifier(cellModifier);
responseListTableEditor.setLabel("Responses");
responseListTableEditor.render(composite);
responseListTableEditor.getTable().addSelectionListener(new SelectionAdapter() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
SimulationResponseVO response = (SimulationResponseVO) e.item.getData();
String responseString = response == null ? null : response.getResponse();
ValueDisplayDialog dlg = new ValueDisplayDialog(getShell(), responseString);
dlg.open();
}
});
// save button
createSaveButton();
// help link
// spacer
new Label(composite, SWT.NONE);
helpPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_LINK);
helpPropertyEditor.setLabel("Simulation Mode Help");
helpPropertyEditor.render(composite);
helpPropertyEditor.setValue("/MDWHub/doc/todo.html");
}
Aggregations