Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] IRemoteUIFileManager.browseFile browses local filesystem

Dave,

You need to add a call to remoteUIFileManager.setConnection() before you call browseFile(). Otherwise I think it defaults to the Local connection.

Greg

On Dec 9, 2009, at 8:50 AM, Dave Wootton wrote:


I have a problem that I'm not sure whether it's in my plugin code or in PTP code. I have the latest PTP code from CVS ead, as of this morning, in my workspace. There is a button in my plugin which is intended to open a file selector on a remote system so I can select a file on that system. When I click that button, I expect to see a view of the remote AIX filesystem, but I am seeing a view of the local filesystem (Windows XP)

I ran my code with a debugger and when I look at the RSEConnectionManager object inside the IRemoteUIFileManager object (connMgr) I see multiple connection names including the local system and the target remote system. Is my code supposed to do something to select a specific connection or is there a problem with PTP?

The code in question in my plugin looks like the following

                if (remoteServices != null) {
                        IRemoteUIServices remoteUIServices;
                        IRemoteUIFileManager remoteUIFileManager;
                        IPath path;
                        IFileStore remoteFile;

                        PTPRemoteUIPlugin uiPlugin = new PTPRemoteUIPlugin();
                        remoteUIServices = uiPlugin.getRemoteUIServices(remoteServices);
                        remoteUIFileManager = remoteUIServices.getUIFileManager();
                        path = new Path(remoteUIFileManager.browseFile(shell, msg, null, 0));

The remoteServices variable is set to the IRemoteServices object that is obtained from the selected service configuration (in the service configuration view) using the following code, where newRemoteServices is assigned to remoteServices once I am certain I have a correct service configuration.

                launchServiceProvider = newServiceConfiguration
                                .getServiceProvider(launchService);
                if (launchServiceProvider == null) {
                        MessageDialog.openError(null, Messages.PTPRemoteOperations_0,
                                        Messages.PTPRemoteOperations_40);
                        return;
                }
                if (!(launchServiceProvider instanceof IResourceManagerConfiguration)) {
                        MessageDialog.openError(null, Messages.PTPRemoteOperations_0,
                                        Messages.PTPRemoteOperations_41);
                        return;
                }
                remoteServiceID = ((IResourceManagerConfiguration) launchServiceProvider)
                                .getRemoteServicesId();
                if (remoteServiceID == null) {
                        MessageDialog.openError(null, Messages.PTPRemoteOperations_0,
                                        Messages.PTPRemoteOperations_42);
                        return;
                }
                newRemoteServices = PTPRemoteCorePlugin.getDefault().getRemoteServices(
                                remoteServiceID);
                if (newRemoteServices == null) {
                        MessageDialog.openError(null, Messages.PTPRemoteOperations_0,
                                        Messages.PTPRemoteOperations_43);
                        return;
                }
Dave_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev


Back to the top