use of com.centurylink.mdw.plugin.designer.DirtyStateListener in project mdw-designer by CenturyLinkCloud.
the class ProcessInstanceFilterDialog method createVariablesTabItem.
private TabItem createVariablesTabItem(TabFolder tabFolder) {
TabItem variablesTabItem = new TabItem(tabFolder, SWT.NULL);
variablesTabItem.setText("Variables");
Composite composite = new Composite(tabFolder, SWT.NONE);
composite.setLayout(new GridLayout());
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
// variables table
tableContainer = new VariableValuesTableContainer();
tableContainer.create(composite);
tableContainer.addDirtyStateListener(new DirtyStateListener() {
public void dirtyStateChanged(boolean dirty) {
filter.getVariableValues().clear();
if (variableValues != null) {
for (VariableValue variableValue : variableValues) filter.getVariableValues().put(variableValue.getName(), variableValue.getValue());
}
}
});
variablesTabItem.setControl(composite);
variableValues = new ArrayList<>();
tableContainer.setInput(variableValues);
return variablesTabItem;
}
use of com.centurylink.mdw.plugin.designer.DirtyStateListener in project mdw-designer by CenturyLinkCloud.
the class BamEventComposer method createBamDataTable.
private void createBamDataTable() {
if (attributesTableContainer != null) {
if (dataTableDirtyStateListener != null)
attributesTableContainer.removeDirtyStateListener(dataTableDirtyStateListener);
attributesTableContainer.dispose();
}
// attributes
TableT bamTable = null;
if (bamPagelet != null) {
try {
bamTable = getBamPageletTable();
} catch (BamPageletValidationException ex) {
PluginMessages.uiError(ex, "BAM Pagelet");
}
}
String label;
if (bamTable != null && (bamTable.getNAME() != null || bamTable.getLABEL() != null)) {
label = bamTable.getLABEL() == null ? bamTable.getNAME() : bamTable.getLABEL();
bamTable.setLABEL(label);
for (DropdownT dropdown : bamTable.getDROPDOWNList()) {
if ("Variables".equalsIgnoreCase(dropdown.getSOURCE())) {
WorkflowProcess processVersion = getProcess();
if (processVersion != null) {
List<String> varNames = processVersion.getNonDocRefVariableNames();
// add process variable values
for (String var : varNames) {
OptionT option = dropdown.addNewOPTION();
option.setVALUE("#{" + var + "}");
option.setStringValue(var);
}
}
}
}
}
attributesTableContainer = createAttributesTable(getWidth(), LAYOUT_COLS, bamTable);
dataTableDirtyStateListener = new DirtyStateListener() {
public void dirtyStateChanged(boolean dirty) {
if (bamMessage != null) {
bamMessage.setAttributes(attributesTableContainer.getAttributes());
Event event = new Event();
event.widget = attributesTableContainer.tableEditor.getTable();
event.data = attributesTableContainer.getAttributes();
fireModify(new ModifyEvent(event));
}
}
};
attributesTableContainer.addDirtyStateListener(dataTableDirtyStateListener);
this.layout(true);
}
use of com.centurylink.mdw.plugin.designer.DirtyStateListener in project mdw-designer by CenturyLinkCloud.
the class ProcessSection method setSelection.
public void setSelection(WorkflowElement selection) {
if (process != null)
process.removeElementChangeListener(this);
process = (WorkflowProcess) selection;
process.addElementChangeListener(this);
idPropertyEditor.setElement(process);
idPropertyEditor.setValue(process.getIdLabel());
namePropertyEditor.setElement(process);
namePropertyEditor.setValue(process.getName());
descriptionPropertyEditor.setElement(process);
descriptionPropertyEditor.setValue(process.getDescription());
descriptionPropertyEditor.setEditable(!process.isReadOnly());
createDatePropertyEditor.setElement(process);
createDatePropertyEditor.setValue(process.getCreateDate());
// avoid triggering dirty state change when reloading combo
List<DirtyStateListener> dsListeners = new ArrayList<DirtyStateListener>();
dsListeners.addAll(process.getDirtyStateListeners());
for (DirtyStateListener dsListener : dsListeners) process.removeDirtyStateListener(dsListener);
List<String> options = new ArrayList<String>();
options.add("");
if (process.isInRuleSet())
options.addAll(getDesignerDataModel().getWorkgroupNames());
// re-enable dirty state firing
for (DirtyStateListener dsListener : dsListeners) process.addDirtyStateListener(dsListener);
definitionLinkEditor.setElement(process);
if (process.hasInstanceInfo())
definitionLinkEditor.setLabel("Open Process Definition");
else if (process.isInRuleSet())
definitionLinkEditor.setLabel("View Definition XML");
definitionLinkEditor.setVisible(process.hasInstanceInfo() || process.isInRuleSet());
}
Aggregations