for (String s : I18N.instance().getUserDesignationKeys(true)) {
designationComboBox.add(I18N.instance().getUserDesignation(s));
}
designationComboBox.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
final BugCollectionAndInstance bug = theBug;
if (bug == null) {
return;
}
final BugInstance bugInstance = bug.getBugInstance();
if (bugInstance == null) {
return;
}
final int selectionIndex = designationComboBox.getSelectionIndex();
executor.submit(new Runnable() {
public void run() {
bugInstance.setUserDesignationKeyIndex(selectionIndex, bug.getBugCollection());
}
});
}
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
});
// designationComboBox.setSize(designationComboBox.computeSize(
// SWT.DEFAULT, SWT.DEFAULT));
designationComboBox.setEnabled(false);
signinStatusBox = new SigninStatusBox(main, SWT.NONE);
signinStatusBox.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
firstVersionLabel = new Label(main, SWT.LEFT);
firstVersionLabel.setToolTipText("The earliest version in which the bug was present");
firstVersionLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
userAnnotationTextField = new Text(main, SWT.LEFT | SWT.WRAP | SWT.BORDER);
userAnnotationTextField.setToolTipText("My bug comments");
userAnnotationTextField.setEnabled(false);
GridData uatfData = new GridData(GridData.FILL_BOTH);
uatfData.horizontalSpan = 2;
userAnnotationTextField.setLayoutData(uatfData);
userAnnotationTextField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
final BugCollectionAndInstance bug = theBug;
if (bug != null && bug.getBugInstance() != null) {
final String txt = userAnnotationTextField.getText();
executor.submit(new Runnable() {
public void run() {
bug.getBugInstance().setAnnotationText(txt, bug.getBugCollection());
}
});
}
}
});