Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Launch an external application in a shell
Launch an external application in a shell [message #532377] Sun, 09 May 2010 06:02 Go to next message
Eclipse UserFriend
Hello everybody,
I think my problem is quite common but I cannot find any interesting answer on the Internet.

I have developped an eclipse RCP application, and I would like to launch an external application (it's a Java Swing app, but it could also be any win32 application) to display it inside an editor.

I know it's possible, because under the Eclipse IDE, when I click on an image to display it, it launches a "mspaint.exe" process and display it inside the editor (without the menu bar).
But I cannot found how to do it.

I've found a small article showing an SWT shell hosting a win32 application (winrar) and saying that it uses org.eclipse.swt.internal.win32.OS, but it does not say precisely how that was done, and moreover it's an internal and non portable API.

Any idea how to do this ?

Thank you for your answers.
Re: Launch an external application in a shell [message #532467 is a reply to message #532377] Mon, 10 May 2010 03:38 Go to previous messageGo to next message
Eclipse UserFriend
You should use 'Program' APIs of SWT framework for launching external
(may be default) application for any file associated with the platform.
For more info on the Program APIs, please refer to snippets (under
'Program' section) available at - http://eclipse.org/swt/snippets/
Re: Launch an external application in a shell [message #532485 is a reply to message #532467] Mon, 10 May 2010 04:52 Go to previous messageGo to next message
Eclipse UserFriend
Paint is opened inside editor or view by using OLE api..

I think that not be used for u r purpose since its your own swing application.....

Although there are SWT AWT bridges awailable where u can put swing components inside swt components,,,,
May be this can be used...
Re: Launch an external application in a shell [message #532656 is a reply to message #532377] Mon, 10 May 2010 13:34 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for your answers.

What is the purpose of the "Program" API compared to the classical Java ProcessBuilder ?

I don't think I can use the SWT_AWT bridge, because I do not want to reuse components but launch a whole application (which could also be a native application), but I want it to be displayed inside a window of my RCP application.
Re: Launch an external application in a shell [message #532806 is a reply to message #532656] Tue, 11 May 2010 05:41 Go to previous messageGo to next message
Eclipse UserFriend
Zlika wrote:
> What is the purpose of the "Program" API compared to the classical Java
> ProcessBuilder ?
Program is a utility class that provides support to launch any kind of
application for any kind of file type. It provides transparency from the
user to launch the default application, or a custom application for any
file type.
I think ProcessBuilder is more for managing/creating/instantiating
processes itself, nothing to determine the application for a filetype,
determining the available apps/extensions installed on the machine.
Re: Launch an external application in a shell [message #533525 is a reply to message #532806] Fri, 14 May 2010 08:46 Go to previous message
Eclipse UserFriend
Refer this post
http://www.eclipse.org/forums/index.php?t=msg&goto=51550 5&#msg_515505
Previous Topic:Dotted line missing on focused Radio button and List
Next Topic:How can I make the WebBrowser to scroll up when new content is inserted
Goto Forum:
  


Current Time: Fri Jul 11 20:38:47 EDT 2025

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

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

Back to the top