GridData data1 = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
attributeAddButton.setLayoutData(data1);
attributeAddButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
OutputAttribute attr = new OutputAttribute();
attr.createNew(state);
if (DialogUtils.openPropertiesDialog(state, attr, true) == Dialog.OK) {
outputAttributes.add(attr);
attributeViewer.refresh();
}
}
});
attributeEditButton = new Button(buttonArea, SWT.PUSH);
attributeEditButton.setText("Edit");
data1 = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
attributeEditButton.setLayoutData(data1);
attributeEditButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IStructuredSelection selection = (IStructuredSelection) attributeViewer
.getSelection();
if (selection.getFirstElement() != null) {
if (selection.getFirstElement() instanceof IOutputAttribute) {
if (DialogUtils.openPropertiesDialog(state, (IOutputAttribute) selection
.getFirstElement(), true) == Dialog.OK) {
attributeViewer.refresh(true);
}
}
}
}
});
attributeRemoveButton = new Button(buttonArea, SWT.PUSH);
attributeRemoveButton.setText("Delete");
GridData data2 = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
attributeRemoveButton.setLayoutData(data2);
attributeRemoveButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IStructuredSelection selection = (IStructuredSelection) attributeViewer
.getSelection();
if (selection.getFirstElement() != null) {
if (selection.getFirstElement() instanceof IOutputAttribute) {
outputAttributes.remove(selection.getFirstElement());
attributeViewer.refresh(true);
}
}
}
});
attributeRemoveButton.setEnabled(false);
attributeEditButton.setEnabled(false);
if (WebflowModelXmlUtils.isVersion1Flow(state)) {
Group groupPropertyType2 = new Group(parent, SWT.NULL);
layoutPropMap = new GridLayout();
layoutPropMap.marginWidth = 3;
layoutPropMap.marginHeight = 3;
groupPropertyType2.setLayout(layoutPropMap);
groupPropertyType2.setText(" Mapping ");
groupPropertyType2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Composite tableAndButtons2 = new Composite(groupPropertyType2, SWT.NONE);
tableAndButtons2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
layout2 = new GridLayout();
layout2.marginHeight = 0;
layout2.marginWidth = 0;
layout2.numColumns = 2;
tableAndButtons2.setLayout(layout2);
Table mappingConfigsTable = new Table(tableAndButtons2, SWT.MULTI | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
data = new GridData(GridData.FILL_BOTH);
// data.widthHint = 250;
data.heightHint = 75;
mappingConfigsTable.setLayoutData(data);
TableColumn mcolumnName = new TableColumn(mappingConfigsTable, SWT.NONE);
mcolumnName.setText("Source");
mcolumnName.setWidth(250);
mappingConfigsTable.setHeaderVisible(true);
mappingViewer = new TableViewer(mappingConfigsTable);
String[] mcolumnNames = new String[] { "Source" };
mappingViewer.setColumnProperties(mcolumnNames);
mappingViewer.setContentProvider(new MappingContentProvider(this.mappings));
mappingViewer.setCellEditors(new org.eclipse.jface.viewers.CellEditor[0]);
mappingViewer.setLabelProvider(new ModelTableLabelProvider());
mappingViewer.setCellModifier(new TableCellModifier());
mappingViewer.setInput(this.state);
mappingConfigsTable.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleMappingTableSelectionChanged();
}
});
Composite buttonArea2 = new Composite(tableAndButtons2, SWT.NONE);
layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
buttonArea2.setLayout(layout);
buttonArea2.setLayoutData(new GridData(GridData.FILL_VERTICAL));
mappingAddButton = new Button(buttonArea2, SWT.PUSH);
mappingAddButton.setText("Add");
data1 = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
mappingAddButton.setLayoutData(data1);
mappingAddButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
Mapping attr = new Mapping();
attr.createNew(state);
if (DialogUtils.openPropertiesDialog(state, attr, true) == Dialog.OK) {
mappings.add(attr);
mappingViewer.refresh(true);
}
}