How to show only remote files in RSE's remote file selection dialog? [message #684007] |
Tue, 14 June 2011 20:54 |
Samuel Lampa Messages: 9 Registered: June 2011 |
Junior Member |
|
|
I'm using the following code to fire up a Remote File Selection Dizard in RSE, and receive the full path of the selected file:
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, the file selection dialog shows both the local files and the remote ones, as well as a drop-down menu at the top, to select connection; local, or one of the remote hosts. (See image at i.stack.imgur.com/jHQkC.png ).
How can I programmatically hide this drop-down menu, and show only the files for a specific remote connection?
Also, I'd like to have the file tree show only files under a specific directory (e.g. the user's home dir). How can I do that? In the main RSE view, it is possible to do this manually by right-clicking a folder, and selecting "Go Into", but I want to do it programmatically.
Best Regards
// Samuel
[Updated on: Tue, 14 June 2011 21:24] Report message to a moderator
|
|
|
(no subject) [message #684050 is a reply to message #684007] |
Tue, 14 June 2011 22:47 |
David McKnight Messages: 244 Registered: July 2009 |
Senior Member |
|
|
I sent this on the mailing list too:
You can restrict the connection types available by calling the
setSystemTypes(IRSESystemType[]) API.
If you want to use a specific connection, then you can call this:
setDefaultSystemConnection(<host>, true)
As for showing only files under a specific directory, you'll probably have
to provide your own class that extends SystemRemoteResourceDialog and with
that provide your own input provider (i.e.
ISystemResourceSelectionInputProvider) returns the appropriate system view
roots.
Dave
"Samuel Lampa" <forums-noreply@eclipse.org> wrote in message
news:it8h87$hrt$1@news.eclipse.org...
> I'm using the following code to fire up a RemoteFileSelectionWizard in
> RSE, and receive the full path of the selected file:
>
>
> 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, the file selection dialog shows both the local files and the remote
> ones (There's a drop-down menu at the top, to select connection; local, or
> one of the remote hosts.).
> How can I programmatically hide this drop-down menu, and show only the
> files for a specific remote connection?
> Also, I'd like to have the file tree show only files under a specific
> directory (e.g. the user's home dir). How can I do that? In the main RSE
> view, it is possible to do this manually by right-clicking a folder, and
> selecting "Go Into", but I want to do it programmatically.
>
> Best Regards
> // Samuel
|
|
|
|
Powered by
FUDForum. Page generated in 0.04455 seconds