Button lookupButton = new Button(container, SWT.NONE);
lookupButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Shell shell = Display.getDefault().getActiveShell();
DirectoryDialog dlg = new DirectoryDialog(shell);
dlg.setFilterPath(project.getLocation().toOSString());
// Change the title bar text
dlg.setText("Source Folder");
// Customizable message displayed in the dialog
dlg.setMessage("Select a folder");
// Calling open() will open and run the dialog.
// It will return the selected directory, or
// null if user cancels
String dir = dlg.open();
if (dir != null) {
// Set the text box to the new selection
folderNameText.setText(dir);
}
}