eclipselabs / passerelle

Passerelle, an actor-based process engine based on Ptolemy II
5 stars 3 forks source link

Directory selection in RCP Workbench doesn't work #77

Closed pkeller closed 9 years ago

pkeller commented 9 years ago

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.

erwindl0 commented 9 years ago

Peter,

Good find! I added some logic to pick the right File/DirectoryDialog based on the FileParameter settings. See https://github.com/eclipselabs/passerelle/commit/b2b1339a88a361fecba6f726d33eb52c06f0fe11

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

pkeller commented 9 years ago

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.