[
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?
|
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.
____________________________________
David McKnight
Phone: 905-413-3902 , T/L: 969-3902
Internet: dmcknigh@xxxxxxxxxx
Mail: D1/YFY/8200/TOR
____________________________________
Samuel Lampa ---14/06/2011 05:15:20 PM---On 05/30/2011 04:34 PM, Samuel Lampa wrote: > 1. I want to programmatically open up a file selection
![]()
From: | ![]()
Samuel Lampa <samuel.lampa@xxxxxxxxxxxxxxxx> |
![]()
To: | ![]()
TM project developer discussions <tm-dev@xxxxxxxxxxx> |
![]()
Date: | ![]()
14/06/2011 05:15 PM |
![]()
Subject: | ![]()
Re: [tm-dev] Opening remote file selection dialog? + Rec. way of fetching host? |
![]()
Sent by: | ![]()
tm-dev-bounces@xxxxxxxxxxx |
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
_______________________________________________
tm-dev mailing list
tm-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/tm-dev

