You need to send a message to the user and/or get a little feedback from the user .
Use the SWT MessageBox class to create a message box, and check the return value from its open method to determine which button the user clicked.
Here are the MessageBox class's methods :
String getMessage( )
Returns the dialog's message
int open( )
Makes the dialog visible
void setMessage(String string)
Sets the dialog's message
You create a message box by passing the current shell to the MessageBox constructor, as well as the style you want to use: MessageBox(Shell parent, int style) . Here are some common styles to use:
SWT.YES SWT.NO SWT.CANCEL
SWT.ABORT SWT.RETRY SWT.IGNORE .
You use the message box's open method to display it; when the message box is closed, compare this method's int return value to one of the preceding styles such as SWT.YES , SWT.NO , or SWT.CANCEL to determine which button was clicked.