|
|
|
Re: Is there a JFace directory dialog that presents a list of files found [message #295013 is a reply to message #294392] |
Mon, 21 November 2005 19:38  |
Eclipse User |
|
|
|
Thank you very much!
venkataramana wrote:
> Cooked up one fastly with org.eclipse.ui.dialogs.ElementListSelectionDialog. Try this ...
>
>
> private void openFileList(String dirPath)
> {
> ElementListSelectionDialog dlg = new ElementListSelectionDialog(window.getShell(), new FileLblProvider());
> dlg.setMultipleSelection(true);
> File directory = new File(dirPath);
> dlg.setElements(directory.listFiles());/* filter just files if you need to */
> dlg.open();
> }
>
> class FileLblProvider extends LabelProvider
> {
> public String getText(Object element) {
> return ((File)element).getName();
> }
>
> public Image getImage(Object element) {
> return null; /* TODO: Show file/folder image */
> }
> }
>
>
> Hope that helps.
>
> Thanks
> Venkat
|
|
|
Powered by
FUDForum. Page generated in 0.02752 seconds