Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Target Management » Problem using SystemRemoteFolderDialog
Problem using SystemRemoteFolderDialog [message #482122] Tue, 25 August 2009 12:44 Go to next message
David Wootton is currently offline David WoottonFriend
Messages: 11
Registered: July 2009
Junior Member
I have RSE 3.1 runtime installed and have some code which uses the
SystemRemoteFolderDialog class to get the pathname of a directory on the
remote system. If the user clicks a directory name, then getOutputObject
returns an instance of SftpRemoteFile and everything is fine. If the user
selects either the 'My Home' or 'Root' labels, then getRemoteObject
returns an instance of SystemFilterReference and I can't get a remote path
from that since it's the wrong class.

How should I handle this? Should my code issue an error message indicating
that 'My Home' or 'Root' are not valid selections and that the user should
retry with a selection of a directory instead of one of these two objects?

Is there something else my code should be doing? Is this a RSE problem?

Thanks

Dave
Re: Problem using SystemRemoteFolderDialog [message #482484 is a reply to message #482122] Wed, 26 August 2009 18:22 Go to previous messageGo to next message
David McKnight is currently offline David McKnightFriend
Messages: 244
Registered: July 2009
Senior Member
Hi Dave,

Here's something you may want to try:
// could have selected a filter reference

Object value = selectFolderAction.getValue();

if (value instanceof ISystemFilterReference){

ISystemFilterReference fref = (ISystemFilterReference)value;


ISubSystem ss = fref.getSubSystem();


// target for filter should give the most relevant folder

Object target = ss.getTargetForFilter(fref);


if (target instanceof IRemoteFile){

remoteFile = (IRemoteFile)target;

}

Dave


"David Wootton" <dwootton@us.ibm.com> wrote in message
news:54e7b9a3beb626ff7b00a3ad164665ee$1@www.eclipse.org...
>I have RSE 3.1 runtime installed and have some code which uses the
>SystemRemoteFolderDialog class to get the pathname of a directory on the
>remote system. If the user clicks a directory name, then getOutputObject
>returns an instance of SftpRemoteFile and everything is fine. If the user
>selects either the 'My Home' or 'Root' labels, then getRemoteObject returns
>an instance of SystemFilterReference and I can't get a remote path from
>that since it's the wrong class.
>
> How should I handle this? Should my code issue an error message indicating
> that 'My Home' or 'Root' are not valid selections and that the user should
> retry with a selection of a directory instead of one of these two objects?
>
> Is there something else my code should be doing? Is this a RSE problem?
>
> Thanks
>
> Dave
>
Re: Problem using SystemRemoteFolderDialog [message #482531 is a reply to message #482484] Wed, 26 August 2009 22:39 Go to previous message
David Wootton is currently offline David WoottonFriend
Messages: 11
Registered: July 2009
Junior Member
I tried what you suggested and it works for both the 'My Home' and 'Root'
cases.

Thanks

David McKnight wrote:

> Hi Dave,

> Here's something you may want to try:
> // could have selected a filter reference

> Object value = selectFolderAction.getValue();
> if (value instanceof ISystemFilterReference){
> ISystemFilterReference fref = (ISystemFilterReference)value;
> ISubSystem ss = fref.getSubSystem();
> // target for filter should give the most relevant folder
> Object target = ss.getTargetForFilter(fref);
> if (target instanceof IRemoteFile){
> remoteFile = (IRemoteFile)target;
> }

> Dave
Re: Problem using SystemRemoteFolderDialog [message #582290 is a reply to message #482122] Wed, 26 August 2009 18:22 Go to previous message
David McKnight is currently offline David McKnightFriend
Messages: 244
Registered: July 2009
Senior Member
Hi Dave,

Here's something you may want to try:
// could have selected a filter reference

Object value = selectFolderAction.getValue();

if (value instanceof ISystemFilterReference){

ISystemFilterReference fref = (ISystemFilterReference)value;


ISubSystem ss = fref.getSubSystem();


// target for filter should give the most relevant folder

Object target = ss.getTargetForFilter(fref);


if (target instanceof IRemoteFile){

remoteFile = (IRemoteFile)target;

}

Dave


"David Wootton" <dwootton@us.ibm.com> wrote in message
news:54e7b9a3beb626ff7b00a3ad164665ee$1@www.eclipse.org...
>I have RSE 3.1 runtime installed and have some code which uses the
>SystemRemoteFolderDialog class to get the pathname of a directory on the
>remote system. If the user clicks a directory name, then getOutputObject
>returns an instance of SftpRemoteFile and everything is fine. If the user
>selects either the 'My Home' or 'Root' labels, then getRemoteObject returns
>an instance of SystemFilterReference and I can't get a remote path from
>that since it's the wrong class.
>
> How should I handle this? Should my code issue an error message indicating
> that 'My Home' or 'Root' are not valid selections and that the user should
> retry with a selection of a directory instead of one of these two objects?
>
> Is there something else my code should be doing? Is this a RSE problem?
>
> Thanks
>
> Dave
>
Re: Problem using SystemRemoteFolderDialog [message #582316 is a reply to message #482484] Wed, 26 August 2009 22:39 Go to previous message
David Wootton is currently offline David WoottonFriend
Messages: 11
Registered: July 2009
Junior Member
I tried what you suggested and it works for both the 'My Home' and 'Root'
cases.

Thanks

David McKnight wrote:

> Hi Dave,

> Here's something you may want to try:
> // could have selected a filter reference

> Object value = selectFolderAction.getValue();
> if (value instanceof ISystemFilterReference){
> ISystemFilterReference fref = (ISystemFilterReference)value;
> ISubSystem ss = fref.getSubSystem();
> // target for filter should give the most relevant folder
> Object target = ss.getTargetForFilter(fref);
> if (target instanceof IRemoteFile){
> remoteFile = (IRemoteFile)target;
> }

> Dave
Previous Topic:Problem using SystemRemoteFolderDialog
Next Topic:persistence of IHost custom properties
Goto Forum:
  


Current Time: Sat Dec 20 01:38:11 GMT 2014

Powered by FUDForum. Page generated in 0.01657 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software