collProcessCompleteErrorsViewer.setInput(obj.getCollectionProcessCompleteErrors());
}
}
private void createEditorsForTree(final Tree tree) {
final TreeEditor editor1 = new TreeEditor(tree);
editor1.horizontalAlignment = SWT.CENTER;
editor1.minimumWidth = 60;
final TreeEditor editor2 = new TreeEditor(tree);
editor2.horizontalAlignment = SWT.CENTER;
editor2.grabHorizontal = true;
editor2.minimumWidth = 60;
tree.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
// Clean up any previous editor control
Control oldEditor = editor1.getEditor();
if (oldEditor != null)
oldEditor.dispose();
oldEditor = editor2.getEditor();
if (oldEditor != null)
oldEditor.dispose();
// Identify the selected row
final TreeItem item = (TreeItem) e.item;
// if (!isEditable(item))
// return;
final Spinner spinner = new Spinner(tree, SWT.BORDER);
spinner.setMinimum(0);
String level = item.getText(1);
int defaultLevel = level.length() == 0 || "default".equals(level) ? 0 : Integer.parseInt(level); //$NON-NLS-1$
spinner.setSelection(defaultLevel);
spinner.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (item.getChecked()) {
int selection = spinner.getSelection();
item.setText(1, selection == 0 ? "default" //$NON-NLS-1$
: Integer.toString(selection));
// fTab.updateLaunchConfigurationDialog();
}
}
});
editor1.setEditor(spinner, item, 1);
final CCombo combo = new CCombo(tree, SWT.BORDER | SWT.READ_ONLY);
combo.setItems(new String[] { "default", Boolean.toString(true), Boolean.toString(false) }); //$NON-NLS-1$
combo.setText(item.getText(2));
combo.pack();
combo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (item.getChecked()) {
item.setText(2, combo.getText());
// fTab.updateLaunchConfigurationDialog();
}
}
});
editor2.setEditor(combo, item, 2);
}
});
}