Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Target Management » Possible to use SystemRemoteFileDialog/SystemRemoteFolderDialog without RSE open
Possible to use SystemRemoteFileDialog/SystemRemoteFolderDialog without RSE open [message #24037] Wed, 18 June 2008 19:32 Go to next message
Eclipse User
Originally posted by: zengland.us.ibm.com

Is it possible to make use of the
SystemRemoteFileDialog/SystemRemoteFolderDialog classes without being in
or possibly even activating the Remote systems view or Remote Systems
Explorer perspective?

I have another perspective and view from which I need to browse a remote
system for which I already have the host name/address and a
userid/password.

I started out trying some code like below but ran into a number of issues
with the bundle not being loaded and values not being initialized.


new RSECorePlugin();
IRSESystemType[] systemTypes =
RSECorePlugin.getTheCoreRegistry().getSystemTypes();
if(systemTypes != null)
{
System.out.println(systemTypes);
}

Host host = null;
SystemProfile prof = null;
prof = new SystemProfile(hostAddress, true);
host = new Host(prof);

IRSESystemType type =
RSECoreRegistry.getInstance().getSystemTypeById(IRSESystemTy pe.SYSTEMTYPE_SSH_ONLY_ID);
ISubSystemConfigurator sub[] = null;
SystemRegistry reg = SystemRegistry.getInstance();
try {
reg.createHost("builtIn", type , hostName, hostName, id, remoteHost, 0,
sub );
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
diag = new SystemRemoteFileDialog(l_Form.getShell(), "browse remote file
system", host);
diag.open();
Object o = diag.getSelectedObject();


Is this type of usage even possible?
Re: Possible to use SystemRemoteFileDialog/SystemRemoteFolderDialog without RSE open [message #24344 is a reply to message #24037] Tue, 01 July 2008 16:54 Go to previous message
Martin Oberhuber is currently offline Martin Oberhuber
Messages: 985
Registered: July 2009
Senior Member
Hello Zackery,

sure, the dialog classes work without activating the RSE perspective;
just for example, if you create an empty project in the Resource
perspective and then do File > New > Folder > Advanced > Link to folder
in file system > (Disabled default, select File System : RSE) > Browse
you'll see the dialog but without the Perspective.

What you're trying to do in your code, though, looks totally odd. You
cannot instanciate a plugin class yourself, the Eclipse Framework would
do that for you.

Please look at the EclipseCon 2008 tutorial slides for some example of
programmatically creating a connection and opening a browse dialog --
I'm quite sure that this should work from any control outside the RSE
Perspective.

Links to the EclipseCon 2008 tutorial slides as well as the example
code are available from the first item in the "Events" box on the
TM Homepage:
http://www.eclipse.org/dsdp/tm/
Note that parts of the example might not compile because they were
written against RSE 3.0M6 but some APIs have changed since. The
concepts, though, are still valid.

Cheers,
--
Martin Oberhuber, Senior Member of Technical Staff, Wind River
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm




Zackery England wrote:
> Is it possible to make use of the
> SystemRemoteFileDialog/SystemRemoteFolderDialog classes without being in
> or possibly even activating the Remote systems view or Remote Systems
> Explorer perspective?
>
> I have another perspective and view from which I need to browse a remote
> system for which I already have the host name/address and a
> userid/password.
>
> I started out trying some code like below but ran into a number of
> issues with the bundle not being loaded and values not being initialized.
>
>
> new RSECorePlugin();
> IRSESystemType[] systemTypes =
> RSECorePlugin.getTheCoreRegistry().getSystemTypes();
> if(systemTypes != null)
> {
> System.out.println(systemTypes);
> }
>
> Host host = null;
> SystemProfile prof = null;
> prof = new SystemProfile(hostAddress, true);
> host = new Host(prof);
>
> IRSESystemType type =
> RSECoreRegistry.getInstance().getSystemTypeById(IRSESystemTy pe.SYSTEMTYPE_SSH_ONLY_ID);
>
> ISubSystemConfigurator sub[] = null;
> SystemRegistry reg = SystemRegistry.getInstance();
> try {
> reg.createHost("builtIn", type , hostName, hostName, id, remoteHost,
> 0, sub );
> } catch (Exception e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> }
> diag = new SystemRemoteFileDialog(l_Form.getShell(), "browse remote file
> system", host);
> diag.open();
> Object o = diag.getSelectedObject();
>
>
> Is this type of usage even possible?
>
Re: Possible to use SystemRemoteFileDialog/SystemRemoteFolderDialog without RSE open [message #575595 is a reply to message #24037] Tue, 01 July 2008 16:54 Go to previous message
Martin Oberhuber is currently offline Martin Oberhuber
Messages: 985
Registered: July 2009
Senior Member
Hello Zackery,

sure, the dialog classes work without activating the RSE perspective;
just for example, if you create an empty project in the Resource
perspective and then do File > New > Folder > Advanced > Link to folder
in file system > (Disabled default, select File System : RSE) > Browse
you'll see the dialog but without the Perspective.

What you're trying to do in your code, though, looks totally odd. You
cannot instanciate a plugin class yourself, the Eclipse Framework would
do that for you.

Please look at the EclipseCon 2008 tutorial slides for some example of
programmatically creating a connection and opening a browse dialog --
I'm quite sure that this should work from any control outside the RSE
Perspective.

Links to the EclipseCon 2008 tutorial slides as well as the example
code are available from the first item in the "Events" box on the
TM Homepage:
http://www.eclipse.org/dsdp/tm/
Note that parts of the example might not compile because they were
written against RSE 3.0M6 but some APIs have changed since. The
concepts, though, are still valid.

Cheers,
--
Martin Oberhuber, Senior Member of Technical Staff, Wind River
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm




Zackery England wrote:
> Is it possible to make use of the
> SystemRemoteFileDialog/SystemRemoteFolderDialog classes without being in
> or possibly even activating the Remote systems view or Remote Systems
> Explorer perspective?
>
> I have another perspective and view from which I need to browse a remote
> system for which I already have the host name/address and a
> userid/password.
>
> I started out trying some code like below but ran into a number of
> issues with the bundle not being loaded and values not being initialized.
>
>
> new RSECorePlugin();
> IRSESystemType[] systemTypes =
> RSECorePlugin.getTheCoreRegistry().getSystemTypes();
> if(systemTypes != null)
> {
> System.out.println(systemTypes);
> }
>
> Host host = null;
> SystemProfile prof = null;
> prof = new SystemProfile(hostAddress, true);
> host = new Host(prof);
>
> IRSESystemType type =
> RSECoreRegistry.getInstance().getSystemTypeById(IRSESystemTy pe.SYSTEMTYPE_SSH_ONLY_ID);
>
> ISubSystemConfigurator sub[] = null;
> SystemRegistry reg = SystemRegistry.getInstance();
> try {
> reg.createHost("builtIn", type , hostName, hostName, id, remoteHost,
> 0, sub );
> } catch (Exception e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> }
> diag = new SystemRemoteFileDialog(l_Form.getShell(), "browse remote file
> system", host);
> diag.open();
> Object o = diag.getSelectedObject();
>
>
> Is this type of usage even possible?
>
Previous Topic:Adding sudo command
Next Topic:FTP Only not working for IIS
Goto Forum:
  


Current Time: Fri Oct 31 17:23:34 GMT 2014

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

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