1 package net.sourceforge.phpdt.internal.ui.util;
5 import org.eclipse.swt.widgets.Composite;
6 import org.eclipse.swt.widgets.DirectoryDialog;
8 public class DirectorySelector extends ResourceSelector {
10 public DirectorySelector(Composite parent) {
14 protected void handleBrowseSelected() {
15 DirectoryDialog dialog = new DirectoryDialog(getShell());
16 dialog.setMessage(browseDialogMessage);
17 String currentWorkingDir = textField.getText();
18 if (!currentWorkingDir.trim().equals("")) {
19 File path = new File(currentWorkingDir);
21 dialog.setFilterPath(currentWorkingDir);
25 String selectedDirectory = dialog.open();
26 if (selectedDirectory != null) {
27 textField.setText(selectedDirectory);
31 protected String validateResourceSelection() {
32 String directory = textField.getText();
33 File directoryFile = new File(directory);
34 if (directoryFile.exists() && directoryFile.isDirectory())