public void widgetSelected(SelectionEvent e) {
if (e.getSource() == openPreferences) {
PreferenceManager manager = new PreferenceManager();
manager.addToRoot(new PreferenceNode("Hadoop Installation Directory", new MapReducePreferencePage()));
PreferenceDialog dialog = new PreferenceDialog(this.getShell(), manager);
dialog.create();
dialog.setMessage("Select Hadoop Installation Directory");
dialog.setBlockOnOpen(true);
dialog.open();
updateHadoopDirLabelFromPreferences();
} else if (e.getSource() == browse) {
DirectoryDialog dialog = new DirectoryDialog(this.getShell());
dialog.setMessage("Select a hadoop installation, containing hadoop-X-core.jar");
dialog.setText("Select Hadoop Installation Directory");
String directory = dialog.open();
if (directory != null) {
location.setText(directory);
if (!validateHadoopLocation()) {