Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ice-dev] Remote File Browsing with PTP

Alex,

Did you try this while using the Luna branch?

My workspace is still configured for the Kepler target. I had to change "org.eclipse.remote.JSch" to "org.eclipse.ptp.remote.RemoteTools" for it to work.

This is pretty cool, though. It looks like for the viz service stuff, we can hook into the PTP connections so that we don't have to keep track of server IPs, usernames, or passwords. The extra stuff that is specific to the viz services will still have to be managed, but that's pretty much already done.

Jordan

Jordan Deyton
Oak Ridge National Laboratory
Telephone: (865) 574-1091
Email: deytonjh@xxxxxxxx

On 1/12/2015 4:19 PM, McCaskey, Alex wrote:
Everyone,

It turns out that remote file browsers are super easy through Eclipse PTP. The following 5 line code snippet will display the remote browser and return the absolute path of the selected file.

IRemoteServices services = RemoteServices.getRemoteServices("org.eclipse.remote.JSch");
IRemoteUIServices uiServices = RemoteUIServices.getRemoteUIServices(services);
IRemoteUIFileManager manager = uiServices.getUIFileManager();
manager.showConnections(true);
String file = manager.browseFile(shell, "Select the remote files you would like to view in VisIt", ".", SWT.MULTI);

The API wraps a set of services that you can query through the RemoteServices class. The default (basic) remote interface realization is based on JSch. From those services you can create an IRemoteUIServices object which gives you an IRemoteUIFileManager, which provides browse file(s) and directory methods.

The remote UI services also provide a remote connection manager object that gives detailed information about the connection such as host, port, username, and password, as well as a ‘Create New Connection Wizard’.

IRemoteUIConnectionManager connMan = uiServices.getUIConnectionManager();
IRemoteUIConnectionWizard wizard = connMan.getConnectionWizard(shell);
IRemoteConnectionWorkingCopy workingCopy = wizard.open();
IRemoteConnection connection = workingCopy.save();

Plus, these IRemoteConnections are cached for future use, and can be viewed in Window > Preferences > Remote Development > Connections.

This stuff will be big for use going forward, specifically in our org.eclipse.ice.viz plugin and in the job launch action. So I just wanted to get these code snippets archived.

Best,

Alex
_______________________________________________
ice-dev mailing list
ice-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ice-dev



Back to the top