plugin written in Swing ? [message #189841] |
Thu, 05 February 2004 01:59  |
Eclipse User |
|
|
|
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 #190913 is a reply to message #189841] |
Fri, 06 February 2004 23:45   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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%!).
|
|
|
Powered by
FUDForum. Page generated in 0.03261 seconds