String buttonLabel = "Variables...";
Button pgrmArgVariableButton = createPushButton(group, buttonLabel, null);
pgrmArgVariableButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
pgrmArgVariableButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
dialog.open();
String variable = dialog.getVariableExpression();
if (variable != null) {
fPrgmArgumentsText.insert(variable);
}
}
});
Group groupNode = new Group(comp, SWT.NONE);
groupNode.setFont(font);
groupNode.setLayout(new GridLayout());
groupNode.setLayoutData(new GridData(GridData.FILL_BOTH));
groupNode.setText("Node Arguments");
fNodeArgumentsText = new Text(groupNode, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
fNodeArgumentsText.addTraverseListener(new TraverseListener() {
public void keyTraversed(TraverseEvent e) {
switch (e.detail) {
case SWT.TRAVERSE_ESCAPE:
case SWT.TRAVERSE_PAGE_NEXT:
case SWT.TRAVERSE_PAGE_PREVIOUS:
e.doit = true;
break;
case SWT.TRAVERSE_RETURN:
case SWT.TRAVERSE_TAB_NEXT:
case SWT.TRAVERSE_TAB_PREVIOUS:
if ((fPrgmArgumentsText.getStyle() & SWT.SINGLE) != 0) {
e.doit = true;
} else {
if (!fPrgmArgumentsText.isEnabled() || (e.stateMask & SWT.MODIFIER_MASK) != 0) {
e.doit = true;
}
}
break;
}
}
});
GridData gd2 = new GridData(GridData.FILL_BOTH);
gd2.heightHint = 40;
gd2.widthHint = 100;
fNodeArgumentsText.setLayoutData(gd2);
fNodeArgumentsText.setFont(font);
fNodeArgumentsText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent evt) {
scheduleUpdateJob();
}
});
//ControlAccessibleListener.addListener(fPrgmArgumentsText, group.getText());
String buttonLabel2 = "Variables...";
Button pgrmArgVariableButton2 = createPushButton(groupNode, buttonLabel2, null);
pgrmArgVariableButton2.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
pgrmArgVariableButton2.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
dialog.open();
String variable = dialog.getVariableExpression();
if (variable != null) {
fNodeArgumentsText.insert(variable);
}
}
});