private class CreateVariableSelectionListener extends SelectionAdapter {
@Override
public void widgetSelected(SelectionEvent e) {
CreateVariableDialog dialog = new CreateVariableDialog(getDefinition(), StringFormat.class.getName(), true);
if (dialog.open() == IDialogConstants.OK_ID) {
Variable variable = new Variable(dialog.getName(), dialog.getType(), dialog.isPublicVisibility());
getDefinition().addVariable(variable);
IStructuredSelection selection = new StructuredSelection(variable);
viewer.setSelection(selection);
}