/** Initializes this dialog's controls. */ private void initializeDialog() { selectionGroup.addSelectionChangedListener( new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { getButton(IDialogConstants.OK_ID) .setEnabled(!selectionGroup.getListTableSelection().isEmpty()); } }); selectionGroup.addDoubleClickListener( new IDoubleClickListener() { public void doubleClick(DoubleClickEvent event) { buttonPressed(IDialogConstants.OK_ID); } }); getButton(IDialogConstants.OK_ID).setEnabled(false); }
protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.OK_ID) { result = selectionGroup.getListTableSelection(); } super.buttonPressed(buttonId); }