eclipselabs/passerelle

Directory selection in RCP Workbench doesn't work

Closed this issue · 2 comments

The following MOML:

    <property name="Working Directory" class="com.isencia.passerelle.util.ptolemy.DirectoryParameter" value="">
        <property name="allowFiles" class="ptolemy.data.expr.Parameter" value="false">
        </property>
        <property name="allowDirectories" class="ptolemy.data.expr.Parameter" value="true">
        </property>
    </property>

should give a file chooser in the workbench that allows the selection of a directory, according to the javadoc for FileParameter. In my hands, it doesn't: double clicking on a directory or selecting a directory then clicking "OK" just enters the directory.

See also DirectoryParameter which is what I used to create the above MOML in practice.

Peter,

Good find! I added some logic to pick the right File/DirectoryDialog based on the FileParameter settings. See b2b1339

Remark that, contrary to the world-of-Swing with its option JFileChooser.FILES_AND_DIRECTORIES, it seems that in SWT you can not support mixed selection of a File or a Directory in a common dialog.

Can you try it out?

regards
erwin

Hi Erwin,

Yes, that's fixed it for me. Many thanks.

I guess that that the SWT distinction also partly explains having two distinct launch configuration variables "file_prompt" and "folder_prompt".

Regards,
Peter.