Button button = new Button(parent, SWT.PUSH);
button.setText("Create macro");
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
MacroDialog dialog = MacroDialog.createDialog(getShell());
if (dialog.open() == Window.OK) {
macrosTableViewer.refresh();
macrosTableViewer.setSelection(new StructuredSelection(dialog.getMacro()), true);
}
}
});
return button;
}