this.browseButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (WebRootsList.this.table.getSelection() == null || WebRootsList.this.table.getSelection().length == 0) return;
ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new ProjectContentProvider());
final TableItem item = WebRootsList.this.table.getSelection()[0];
dialog.setTitle(Messages.ProjectPropertyPage_SelectHtdocsFolderTitle);
dialog.setMessage(Messages.ProjectPropertyPage_SelectHtdocsFolderDescription);
dialog.setInput(project.getEclipseProject().getWorkspace());
dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
dialog.setInitialSelection(((WebRootItem)item.getData()).getFolder());
dialog.setAllowMultiple(false);
if (dialog.open() == IDialogConstants.OK_ID) {
IResource resource = (IResource) dialog.getFirstResult();
if (resource != null) {
((WebRootItem)item.getData()).setFolder((IContainer) resource);
item.setText(1, resource.getProjectRelativePath().toString());
validate();
}
}
}
});
this.addButton = SWTUtil.createButton(composite, Messages.ProjectPropertyPage_Add);
this.addButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new ProjectContentProvider());
dialog.setTitle(Messages.ProjectPropertyPage_SelectHtdocsFolderTitle);
dialog.setMessage(Messages.ProjectPropertyPage_SelectHtdocsFolderDescription);
dialog.setInput(project.getEclipseProject().getWorkspace());
dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
dialog.setAllowMultiple(false);