Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » plugin written in Swing ?
plugin written in Swing ? [message #189841] Thu, 05 February 2004 01:59 Go to next message
Eclipse UserFriend
Originally posted by: georgetryfon.freemail.gr

Hello
I am not sure if this is the right place for my question, but I couldn't
find a more suitable one.

I am a plugin developer for NetBeans, I am using Swing, I am happy with
it, and I wouldn't like to change into SWT

Could I do the same thing for Eclipse?
Could I plug my Swing based tools in Eclipse?
or where could I find documentation for this?

Thank you in advance for your help
George
Re: plugin written in Swing ? [message #189900 is a reply to message #189841] Thu, 05 February 2004 05:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lard.tardis.ed.ac.molar.uk

George wrote:

> Hello
> I am not sure if this is the right place for my question, but I couldn't
> find a more suitable one.
>
> I am a plugin developer for NetBeans, I am using Swing, I am happy with
> it, and I wouldn't like to change into SWT
>
> Could I do the same thing for Eclipse?
> Could I plug my Swing based tools in Eclipse?
> or where could I find documentation for this?
>
> Thank you in advance for your help
> George
>

From what I can tell (and I'm no pluin expert, I've read into it and
written a 'test' one), to write a plugin you can't get away from having
to interface with at least *some* SWT. Maybe there's a way to work with
Swing under SWT, but I wouldn't hold your breath! SWT was written to
address performance issues IBM had with Swing/Eclipse AFAIK.

alex
Re: plugin written in Swing ? [message #189915 is a reply to message #189841] Thu, 05 February 2004 06:51 Go to previous messageGo to next message
Eclipse UserFriend
> Hello

> I am a plugin developer for NetBeans, I am using Swing, I am happy with
> it, and I wouldn't like to change into SWT
>
> Could I do the same thing for Eclipse?
> Could I plug my Swing based tools in Eclipse?
> or where could I find documentation for this?
Plugging some views and editors in eclipse you need
to match some requirements. A requirement is extending the appropriated
classes like ViewPart. Therefore you need at least one SWT component
on top. But you can use Swing for sure (at least for Dialogs and additional
windows). - I saw some examples.

here are some links to start with:
http://www-106.ibm.com/developerworks/opensource/library/os- swing/
http://www.eclipse.org/eclipse/faq/eclipse-faq.html

Guess this will help you:)


Martin (Kersten)
Re: plugin written in Swing ? [message #190183 is a reply to message #189841] Thu, 05 February 2004 15:54 Go to previous messageGo to next message
Eclipse UserFriend
George wrote in:


> Could I plug my Swing based tools in Eclipse?
> or where could I find documentation for this?
>
In their letter to the Eclipse community Sun promised that Swing would be
compatible (more or less?) with SWT. So if it isn't today, it will be
tomorrow...

For now, just try with a single Panel and a button, it's not that hard.
There are complete GUI builders for Eclipse, so I guess it is at least
possible. Check out an open source one and see how they do it.

Maarten
Re: plugin written in Swing ? [message #190913 is a reply to message #189841] Fri, 06 February 2004 23:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: usefirstinitiallastname.cs.ucsd.edu

George wrote:

> Hello
> I am not sure if this is the right place for my question, but I couldn't
> find a more suitable one.

> I am a plugin developer for NetBeans, I am using Swing, I am happy with
> it, and I wouldn't like to change into SWT

> Could I do the same thing for Eclipse?
> Could I plug my Swing based tools in Eclipse?
> or where could I find documentation for this?

> Thank you in advance for your help
> George

You can use the class org.eclipse.swt.awt.SWT_AWT to embed your Swing
JPanels:

// This is a callback that will allow us to create the viewer and
// initialize it.
public void createPartControl(Composite parent) {
Panel panel = new_Panel(parent);
panel.add(<JPanel>); /* ... */
}

There are some bugs. First, you need to change you M6 manifest file to
include the path to the SWT_AWT class. Next, you need to put the Swing
panel in a panel of it's own:

public static Panel new_Panel(Composite parent) {
Frame frame;
Panel panel;

frame = SWT_AWT.new_Frame(parent);
hackForM6(parent, frame);
panel = new Panel();
panel.setLayout(new BorderLayout());
frame.add(panel);
return panel;
}

Then, you need the hackForM6 code, which is in a bug filed by Dan Small:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=50522 .
Re: plugin written in Swing ? [message #190921 is a reply to message #189841] Fri, 06 February 2004 23:47 Go to previous message
Eclipse UserFriend
Originally posted by: usefirstinitiallastname.cs.ucsd.edu

George wrote:

> Hello
> I am not sure if this is the right place for my question, but I couldn't
> find a more suitable one.

> I am a plugin developer for NetBeans, I am using Swing, I am happy with
> it, and I wouldn't like to change into SWT

> Could I do the same thing for Eclipse?
> Could I plug my Swing based tools in Eclipse?
> or where could I find documentation for this?

> Thank you in advance for your help
> George

You might also want to look into the SwingWT library. It's not 100%
complete, but may serve the subset of Swing that you use (and, if not,
maybe you could finish that last 10%!).
Previous Topic:JDK 1.4.2_03 - Error message popping up
Next Topic:setting classpath using Eclipse 3.0 on MAC OS X (Panther)
Goto Forum:
  


Current Time: Sat May 10 18:33:29 EDT 2025

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

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

Back to the top