{
Composite composite = (Composite) super.createDialogArea(parent);
new Label(composite, SWT.NONE).setText("Select bundle form file from workspace:");
Tree tree = new Tree(composite, SWT.SINGLE);
TreeViewer viewer = new TreeViewer(tree);
viewer.setContentProvider(new BaseWorkbenchContentProvider());
viewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
viewer.addSelectionChangedListener(new ISelectionChangedListener()
{
public void selectionChanged(SelectionChangedEvent evt)
{
if (evt.getSelection().isEmpty())
{
updateFile(null);
}
else
{
StructuredSelection sel = (StructuredSelection) evt.getSelection();
IResource r = (IResource) sel.getFirstElement();
if (r instanceof IFile)
{
IFile f = (IFile) r;
updateFile(f);
}
else
{
updateFile(null);
}
}
}
});
viewer.setLabelProvider(new WorkbenchLabelProvider());
tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
return composite;
}