Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tm-dev] Opening remote file selection dialog? + Rec. way of fetching host?

On 05/30/2011 04:34 PM, Samuel Lampa wrote:
1. I want to programmatically open up a file selection dialog through RSE, and get the selected resource in return. Any code examples on this, or just some pointers on how to get started?

I managed to do this now, with the following code:

SystemRemoteFileDialog dialog = new SystemRemoteFileDialog(SystemBasePlugin.getActiveWorkbenchShell());
dialog.open();
Object o = dialog.getSelectedObject();
if (o instanceof IRemoteFile) {
    IRemoteFile file = (IRemoteFile)
    System.out.println("Selected file's abs path: " + file.getAbsolutePath());
} else {
    System.out.println("No valid file selected!");
}

But, I still wonder how I can programmatically show only the files for a specific remote connection (hiding the drop-down menu to choose connection, at the top of the dialog)?

Also, I'd like the file tree to show by default only the files under a specific directory (Same as manually right-clicking a folder in the main RSE view and selecting "Go Into", but programmatically). Any hints how this could be done?

Big thanks in advance,
// Samuel



--
System Expert / Bioinformatician
SNIC-UPPMAX / SciLifeLab Uppsala
Uppsala University, Sweden
--------------------------------------
E-mail: samuel.lampa@xxxxxxxxxxxxxxxx
Phone: +46 (0)18 - 471 1060
WWW: http://www.uppmax.uu.se
Uppnex: https://www.uppnex.uu.se



Back to the top