Custom RSE view - observations & help needed [message #569874] |
Wed, 22 August 2007 12:15 |
Eclipse User |
|
|
|
I'm trying to create a custom remote file explorer on top of RSE. I've
managed to create an sftp connection to a remote host, but now I'm lost
in the UI code. I'm having problems figuring out how to display a list
of remote files for a specified directory from the subsystem. I'm
pretty sure I need to create a filter for each directory I want the
user to navigate, but I'm a bit confused on the API in this area.
Here's what I've done so far:
RSEUIPlugin.getDefault().isSystemRegistryActive();
ISystemRegistry systemRegistry = RSECorePlugin.getTheSystemRegistry();
IRSECoreRegistry coreRegistry = RSECorePlugin.getTheCoreRegistry();
IRSESystemType systemType =
coreRegistry.getSystemTypeById(IRSESystemType.SYSTEMTYPE_SSH _ONLY_ID);
try
{
ISystemProfile profile =
systemRegistry.createSystemProfile("fexplorer", true);
IHost host = profile.createHost(systemType, "explorer", hostName,
"Directory explorer");
ISubSystem[] subsystems = hosts.getSubSystems();
System.out.println("Sybsystems:");
for(ISubSystem subsystem : subsystems)
{
System.out.println("Connecting to: " + subsystem.getName());
subsystem.connect(new NullProgressMonitor(), false);
System.out.println("Has children: " + subsystem.hasChildren());
}
}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
A couple of observations here:
I wasn't expecting to have to load the RSEUIPlugin since I'm not using
any of the RSE UI code, but if you don't load that plugin,
RSECorePlugin.getTheSystemRegistry() returns null.
I wasn't expecting to have to create a profile since the docs seemed to
indicate that a default private profile will be created. If I didn't
create a profile, my code ran fine as long as I was running under the
debugger, but as soon as I ran without the debugger, I got an
ArrayIndexOutOfBoundsException inside RSE.
I'm going to keep looking at the code, but if anyone can offer some
help in getting from a sftp subsystem to my own TreeViewer, it would
certainly save me some time.
Bryan
|
|
|
Powered by
FUDForum. Page generated in 0.06792 seconds