Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Albireo » For Starters...
For Starters... [message #1339] Tue, 14 August 2007 20:52 Go to next message
Gordon Hirsch is currently offline Gordon HirschFriend
Messages: 100
Registered: July 2009
Senior Member
First, a couple of pointers:

Albireo proposal: http://www.eclipse.org/proposals/albireo/
Wiki page: http://wiki.eclipse.org/Albireo_Project

The wiki page has very little content today, but it will grow over time.
Add it to your watchlist if you are interested in this proposed project.

The existing proposal lists a some specific features for Albireo, but
it's not meant to be exhaustive.

We'd love to hear about what you are doing with Swing/SWT integration.
What are the problems you have faced? Were you able to solve them? If
so, how? In general, what would you like to see a project like Albireo
provide?

In any case we'd like to know if you support this project, either here
or via e-mail. (Better still, how about participating? :-))

This information will help us validate and improve the proposal, and
hopefully help make the project something that is useful to a wide
audience.
Re: For Starters... [message #1345 is a reply to message #1339] Wed, 15 August 2007 15:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: steve_northover.ca.ibm.com

I support the project.

From the article you wrote and the code it contained, there were many
interesting problems, some of them on the SWT side and others on the Swing
side. From memory, Swing menus would not disappear and required special
code to make them go away. Embedding Swing in SWT is similar to embedding
Swing in a browser. I wonder how many of the problems we face are solved
there?

"Gordon Hirsch" <gordon.hirsch@sas.com> wrote in message
news:f9t4li$qvk$1@build.eclipse.org...
> First, a couple of pointers:
>
> Albireo proposal: http://www.eclipse.org/proposals/albireo/
> Wiki page: http://wiki.eclipse.org/Albireo_Project
>
> The wiki page has very little content today, but it will grow over time.
> Add it to your watchlist if you are interested in this proposed project.
>
> The existing proposal lists a some specific features for Albireo, but it's
> not meant to be exhaustive.
>
> We'd love to hear about what you are doing with Swing/SWT integration.
> What are the problems you have faced? Were you able to solve them? If so,
> how? In general, what would you like to see a project like Albireo
> provide?
>
> In any case we'd like to know if you support this project, either here or
> via e-mail. (Better still, how about participating? :-))
>
> This information will help us validate and improve the proposal, and
> hopefully help make the project something that is useful to a wide
> audience.
Re: For Starters... [message #1358 is a reply to message #1345] Wed, 15 August 2007 17:15 Go to previous messageGo to next message
Bruno Haible is currently offline Bruno HaibleFriend
Messages: 8
Registered: July 2009
Junior Member
Steve Northover wrote:
> I support the project.

Thank you!

> From the article you wrote and the code it contained, there were many
> interesting problems, some of them on the SWT side and others on the Swing
> side. From memory, Swing menus would not disappear and required special
> code to make them go away.

This is just one of the problems; there are indeed many problems, and often
platform-specific ones.

> Embedding Swing in SWT is similar to embedding Swing in a browser. I
> wonder how many of the problems we face are solved there?

Applets in a browser generally work fine. Sure some applet focus problems
(e.g. Sun bug id #6588892, #6538154) look similar to those found with
SWT/AWT. But in general, the bug types are quite different. In particular,
there are many applet bugs relating to the strange initialization / reload
protocol, to the multithreading environment provided by the browser, and
to the applet jar caching.

Bruno
Re: For Starters... [message #1363 is a reply to message #1358] Wed, 15 August 2007 17:51 Go to previous messageGo to next message
Gordon Hirsch is currently offline Gordon HirschFriend
Messages: 100
Registered: July 2009
Senior Member
Bruno Haible wrote:
> Steve Northover wrote:
....
>> Embedding Swing in SWT is similar to embedding Swing in a browser. I
>> wonder how many of the problems we face are solved there?
>
> Applets in a browser generally work fine. Sure some applet focus problems
> (e.g. Sun bug id #6588892, #6538154) look similar to those found with
> SWT/AWT. But in general, the bug types are quite different. In particular,
> there are many applet bugs relating to the strange initialization / reload
> protocol, to the multithreading environment provided by the browser, and
> to the applet jar caching.

I agree with Steve's browser analogy. Clearly, the Java Browser Plug-in
has had to deal with similar issues. If a problem we are seeing doesn't
appear in an applet, chances are that the plug-in has some workaround
for it.

I also agree that applets work acceptably in a browser. This gives me
more confidence that some of the problems we face are solvable. On the
other hand, I don't think you could say that browser/applet integration
is seamless, so it is likely that Albireo will also not be completely
seamless for Swing/SWT integration. The question will be: how seamless
can we make it?
Re: For Starters... [message #3471 is a reply to message #1339] Wed, 10 October 2007 18:21 Go to previous messageGo to next message
Chris Kwon Lewis is currently offline Chris Kwon LewisFriend
Messages: 24
Registered: July 2009
Junior Member
I just wanted to drop my thoughts and say I think this will be a great
and very useful project. I'm glad there's always people out there trying
to make things easier for the rest of us, in this case the SWT/Swing
integration.

As far as what i'm doing with Swing/SWT integration, I'm basically
adding more features to a program someone already made in swing. A vague
description of the program is to basically visualize communications from
previous simulations. The visualization is done using *piccolo. They
want me to add other features to the program, and I felt more
comfortable writing in SWT because I'm not a fan swing.

However, there is some support for piccolo in SWT, but it remains
incomplete and I'm not sure if it will ever get finished. Since the
program already has thorough code done for piccolo in swing, I'd rather
just use the SWT/Swing bridge to display the piccolo swing stuff.

I've read your article Mr. Hirsch, but besides yours its been hard for
me to find examples on Swing/SWT integration. In situations like this,
diverse examples are very important and helpful for me.

I downloaded the examples, but none of them are runnable when I tried
them. It would have been helpful to actually have code for a runnable
program that embedded a swing component in it, even if it was a small
snippet.

I have yet to code any of the integration part as I'm still trying to
figure it out just based on your examples. My main worries as of right
now are unexpected behavior and I'm worried about managing each thread
as I don't really have experience doing this.

Hope my comments and thoughts were somewhat useful.

*piccolo: http://www.cs.umd.edu/hcil/jazz/download/open-source.shtml

Gordon Hirsch wrote:
> First, a couple of pointers:
>
> Albireo proposal: http://www.eclipse.org/proposals/albireo/
> Wiki page: http://wiki.eclipse.org/Albireo_Project
>
> The wiki page has very little content today, but it will grow over time.
> Add it to your watchlist if you are interested in this proposed project.
>
> The existing proposal lists a some specific features for Albireo, but
> it's not meant to be exhaustive.
>
> We'd love to hear about what you are doing with Swing/SWT integration.
> What are the problems you have faced? Were you able to solve them? If
> so, how? In general, what would you like to see a project like Albireo
> provide?
>
> In any case we'd like to know if you support this project, either here
> or via e-mail. (Better still, how about participating? :-))
>
> This information will help us validate and improve the proposal, and
> hopefully help make the project something that is useful to a wide
> audience.
Re: For Starters... [message #3504 is a reply to message #3471] Wed, 10 October 2007 19:55 Go to previous messageGo to next message
Gordon Hirsch is currently offline Gordon HirschFriend
Messages: 100
Registered: July 2009
Senior Member
Cklewis wrote:
> I just wanted to drop my thoughts and say I think this will be a great
> and very useful project. I'm glad there's always people out there trying
> to make things easier for the rest of us, in this case the SWT/Swing
> integration.

It's really helpful to know of your interest and what you are working
on, so thanks for that.

....
>
> I downloaded the examples, but none of them are runnable when I tried
> them. It would have been helpful to actually have code for a runnable
> program that embedded a swing component in it, even if it was a small
> snippet.

Sorry about that. You didn't mention if you are writing an Eclipse RCP
application or just a standalone SWT application. Below is a snippet
that implements an RCP view with a simple embedded Swing JTable, using
the code included with the article. If you're writing a standalone SWT
application, you should be able to take just the code from
createPartControl() and added it to a shell or some other composite.
Once you get it running, you should also be able to replace the JTable
with another component of your choice. Make sure you take a look at the
javadoc as well. The sample code still has some issues, as you can see
from some of the other posts in this newsgroup.

public class JTableView extends ViewPart {

private EmbeddedSwingComposite embeddedComposite;

public void createPartControl(Composite parent) {
embeddedComposite = new EmbeddedSwingComposite(parent, SWT.NONE) {
protected JComponent createSwingComponent() {
/* Creating components */
int nrows = 1000, ncolumns = 10;
Vector rows = new Vector();
for (int i = 0; i < nrows; i++) {
Vector row = new Vector();
for (int j = 0; j < ncolumns; j++) {
row.addElement("Item " + i + "-" + j);
}
rows.addElement(row);
}
Vector columns = new Vector();
for (int i = 0; i < ncolumns; i++) {
columns.addElement("Column " + i);
}
JTable table = new JTable(rows, columns);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
table.createDefaultColumnsFromModel();

JScrollPane scrollPane = new JScrollPane(table);

return scrollPane;
}
};
embeddedComposite.populate();
}

public void setFocus() {
embeddedComposite.setFocus();
}

}
Re: For Starters... [message #3537 is a reply to message #3504] Wed, 10 October 2007 20:44 Go to previous messageGo to next message
Chris Kwon Lewis is currently offline Chris Kwon LewisFriend
Messages: 24
Registered: July 2009
Junior Member
Sorry I forgot to mention I was doing a standalone SWT application. In
fact I don't even know what an RCP application is, but i'll be sure to
look it up and find out :)

Thanks for the tips also. Is this forum strictly for the project or are
am I allowed to ask questions relating to implementing SWT/Swing bridge
for my program as well. Perhaps there is a better group to ask those
questions in?

Another thing I wanted to mention is I hope the word gets around more
that there is indeed a SWT/Swing bridge. In the SWT book I have, there
was no mention of it (it covered version 3.0 I believe). The only reason
I was aware of it was when I came across your article browsing the
eclipse corner articles. Next I searched on google trying to find more
examples or information on the bridge, then I eventually came across the
page for this project.

Perhaps when I figure out how to use this bridge more and get my program
working with it, I can submit a basic program example that uses the
swing version of piccolo inside of SWT. Like I said, the SWT version of
piccolo is incomplete with missing features and there's a different way
of doing certain things..so I'm sure there are other SWT users who might
want to use the swing piccolo as well and get benefit from further work
on the SWT/Swing bridge.

By the way, will this project be included in a future version of SWT?

Gordon Hirsch wrote:
> It's really helpful to know of your interest and what you are working
> on, so thanks for that.
>

> Sorry about that. You didn't mention if you are writing an Eclipse RCP
> application or just a standalone SWT application. Below is a snippet
> that implements an RCP view with a simple embedded Swing JTable, using
> the code included with the article. If you're writing a standalone SWT
> application, you should be able to take just the code from
> createPartControl() and added it to a shell or some other composite.
> Once you get it running, you should also be able to replace the JTable
> with another component of your choice. Make sure you take a look at the
> javadoc as well. The sample code still has some issues, as you can see
> from some of the other posts in this newsgroup.
>
> public class JTableView extends ViewPart {
>
> private EmbeddedSwingComposite embeddedComposite;
>
> public void createPartControl(Composite parent) {
> embeddedComposite = new EmbeddedSwingComposite(parent, SWT.NONE) {
> protected JComponent createSwingComponent() {
> /* Creating components */
> int nrows = 1000, ncolumns = 10;
> Vector rows = new Vector();
> for (int i = 0; i < nrows; i++) {
> Vector row = new Vector();
> for (int j = 0; j < ncolumns; j++) {
> row.addElement("Item " + i + "-" + j);
> }
> rows.addElement(row);
> }
> Vector columns = new Vector();
> for (int i = 0; i < ncolumns; i++) {
> columns.addElement("Column " + i);
> }
> JTable table = new JTable(rows, columns);
> table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
> table.createDefaultColumnsFromModel();
>
> JScrollPane scrollPane = new JScrollPane(table);
>
> return scrollPane;
> }
> };
> embeddedComposite.populate();
> }
>
> public void setFocus() {
> embeddedComposite.setFocus();
> }
>
> }
>
Re: For Starters... [message #3571 is a reply to message #3537] Thu, 11 October 2007 15:15 Go to previous messageGo to next message
Gordon Hirsch is currently offline Gordon HirschFriend
Messages: 100
Registered: July 2009
Senior Member
Cklewis wrote:
>
> Thanks for the tips also. Is this forum strictly for the project or are
> am I allowed to ask questions relating to implementing SWT/Swing bridge
> for my program as well. Perhaps there is a better group to ask those
> questions in?

I don't think there's a problem asking general SWT/Swing questions here.
If you are encountering an issue, chances are that we will encounter it
or have encountered it. Certainly, if you have any questions about the
sample code in the article, this is a good place to ask, since it will
be part of the initial code contribution for the project.

Your other newsgroup alternative would be eclipse.platform.swt

>
> By the way, will this project be included in a future version of SWT?

We are proposing Albireo as an Eclipse Technology project, so it will be
separate from anything in the Eclipse platform for now. As for the
future, it really depends on the technical success of the project and
the number of users.
Re: For Starters... [message #3603 is a reply to message #1339] Fri, 12 October 2007 18:48 Go to previous messageGo to next message
Chris Kwon Lewis is currently offline Chris Kwon LewisFriend
Messages: 24
Registered: July 2009
Junior Member
I was just wondering, what did your company like or need from swing
tables that wasn't available from SWT tables + JFace table controls?

Gordon Hirsch wrote:
> First, a couple of pointers:
>
> Albireo proposal: http://www.eclipse.org/proposals/albireo/
> Wiki page: http://wiki.eclipse.org/Albireo_Project
>
> The wiki page has very little content today, but it will grow over time.
> Add it to your watchlist if you are interested in this proposed project.
>
> The existing proposal lists a some specific features for Albireo, but
> it's not meant to be exhaustive.
>
> We'd love to hear about what you are doing with Swing/SWT integration.
> What are the problems you have faced? Were you able to solve them? If
> so, how? In general, what would you like to see a project like Albireo
> provide?
>
> In any case we'd like to know if you support this project, either here
> or via e-mail. (Better still, how about participating? :-))
>
> This information will help us validate and improve the proposal, and
> hopefully help make the project something that is useful to a wide
> audience.
Re: For Starters... [message #3672 is a reply to message #3603] Mon, 15 October 2007 15:58 Go to previous message
Gordon Hirsch is currently offline Gordon HirschFriend
Messages: 100
Registered: July 2009
Senior Member
We subclassed the Swing JTable class and added a lot of functionality.
I'm not sure if there are features in the plain old JTable that don't
map to SWT/JFace (but I suspect there are). In any case, it's not just a
question of Swing vs SWT; it's a question of reusing a specialized Swing
component.

Cklewis wrote:
> I was just wondering, what did your company like or need from swing
> tables that wasn't available from SWT tables + JFace table controls?
>
> Gordon Hirsch wrote:
>> First, a couple of pointers:
>>
>> Albireo proposal: http://www.eclipse.org/proposals/albireo/
>> Wiki page: http://wiki.eclipse.org/Albireo_Project
>>
>> The wiki page has very little content today, but it will grow over
>> time. Add it to your watchlist if you are interested in this proposed
>> project.
>>
>> The existing proposal lists a some specific features for Albireo, but
>> it's not meant to be exhaustive.
>>
>> We'd love to hear about what you are doing with Swing/SWT integration.
>> What are the problems you have faced? Were you able to solve them? If
>> so, how? In general, what would you like to see a project like Albireo
>> provide?
>>
>> In any case we'd like to know if you support this project, either here
>> or via e-mail. (Better still, how about participating? :-))
>>
>> This information will help us validate and improve the proposal, and
>> hopefully help make the project something that is useful to a wide
>> audience.
Re: For Starters... [message #572001 is a reply to message #1339] Wed, 15 August 2007 15:45 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
I support the project.

From the article you wrote and the code it contained, there were many
interesting problems, some of them on the SWT side and others on the Swing
side. From memory, Swing menus would not disappear and required special
code to make them go away. Embedding Swing in SWT is similar to embedding
Swing in a browser. I wonder how many of the problems we face are solved
there?

"Gordon Hirsch" <gordon.hirsch@sas.com> wrote in message
news:f9t4li$qvk$1@build.eclipse.org...
> First, a couple of pointers:
>
> Albireo proposal: http://www.eclipse.org/proposals/albireo/
> Wiki page: http://wiki.eclipse.org/Albireo_Project
>
> The wiki page has very little content today, but it will grow over time.
> Add it to your watchlist if you are interested in this proposed project.
>
> The existing proposal lists a some specific features for Albireo, but it's
> not meant to be exhaustive.
>
> We'd love to hear about what you are doing with Swing/SWT integration.
> What are the problems you have faced? Were you able to solve them? If so,
> how? In general, what would you like to see a project like Albireo
> provide?
>
> In any case we'd like to know if you support this project, either here or
> via e-mail. (Better still, how about participating? :-))
>
> This information will help us validate and improve the proposal, and
> hopefully help make the project something that is useful to a wide
> audience.
Re: For Starters... [message #572066 is a reply to message #1345] Wed, 15 August 2007 17:15 Go to previous message
Bruno Haible is currently offline Bruno HaibleFriend
Messages: 8
Registered: July 2009
Junior Member
Steve Northover wrote:
> I support the project.

Thank you!

> From the article you wrote and the code it contained, there were many
> interesting problems, some of them on the SWT side and others on the Swing
> side. From memory, Swing menus would not disappear and required special
> code to make them go away.

This is just one of the problems; there are indeed many problems, and often
platform-specific ones.

> Embedding Swing in SWT is similar to embedding Swing in a browser. I
> wonder how many of the problems we face are solved there?

Applets in a browser generally work fine. Sure some applet focus problems
(e.g. Sun bug id #6588892, #6538154) look similar to those found with
SWT/AWT. But in general, the bug types are quite different. In particular,
there are many applet bugs relating to the strange initialization / reload
protocol, to the multithreading environment provided by the browser, and
to the applet jar caching.

Bruno
Re: For Starters... [message #572089 is a reply to message #1358] Wed, 15 August 2007 17:51 Go to previous message
Gordon Hirsch is currently offline Gordon HirschFriend
Messages: 100
Registered: July 2009
Senior Member
Bruno Haible wrote:
> Steve Northover wrote:
....
>> Embedding Swing in SWT is similar to embedding Swing in a browser. I
>> wonder how many of the problems we face are solved there?
>
> Applets in a browser generally work fine. Sure some applet focus problems
> (e.g. Sun bug id #6588892, #6538154) look similar to those found with
> SWT/AWT. But in general, the bug types are quite different. In particular,
> there are many applet bugs relating to the strange initialization / reload
> protocol, to the multithreading environment provided by the browser, and
> to the applet jar caching.

I agree with Steve's browser analogy. Clearly, the Java Browser Plug-in
has had to deal with similar issues. If a problem we are seeing doesn't
appear in an applet, chances are that the plug-in has some workaround
for it.

I also agree that applets work acceptably in a browser. This gives me
more confidence that some of the problems we face are solvable. On the
other hand, I don't think you could say that browser/applet integration
is seamless, so it is likely that Albireo will also not be completely
seamless for Swing/SWT integration. The question will be: how seamless
can we make it?
Re: For Starters... [message #572985 is a reply to message #1339] Wed, 10 October 2007 18:21 Go to previous message
Chris Kwon Lewis is currently offline Chris Kwon LewisFriend
Messages: 24
Registered: July 2009
Junior Member
I just wanted to drop my thoughts and say I think this will be a great
and very useful project. I'm glad there's always people out there trying
to make things easier for the rest of us, in this case the SWT/Swing
integration.

As far as what i'm doing with Swing/SWT integration, I'm basically
adding more features to a program someone already made in swing. A vague
description of the program is to basically visualize communications from
previous simulations. The visualization is done using *piccolo. They
want me to add other features to the program, and I felt more
comfortable writing in SWT because I'm not a fan swing.

However, there is some support for piccolo in SWT, but it remains
incomplete and I'm not sure if it will ever get finished. Since the
program already has thorough code done for piccolo in swing, I'd rather
just use the SWT/Swing bridge to display the piccolo swing stuff.

I've read your article Mr. Hirsch, but besides yours its been hard for
me to find examples on Swing/SWT integration. In situations like this,
diverse examples are very important and helpful for me.

I downloaded the examples, but none of them are runnable when I tried
them. It would have been helpful to actually have code for a runnable
program that embedded a swing component in it, even if it was a small
snippet.

I have yet to code any of the integration part as I'm still trying to
figure it out just based on your examples. My main worries as of right
now are unexpected behavior and I'm worried about managing each thread
as I don't really have experience doing this.

Hope my comments and thoughts were somewhat useful.

*piccolo: http://www.cs.umd.edu/hcil/jazz/download/open-source.shtml

Gordon Hirsch wrote:
> First, a couple of pointers:
>
> Albireo proposal: http://www.eclipse.org/proposals/albireo/
> Wiki page: http://wiki.eclipse.org/Albireo_Project
>
> The wiki page has very little content today, but it will grow over time.
> Add it to your watchlist if you are interested in this proposed project.
>
> The existing proposal lists a some specific features for Albireo, but
> it's not meant to be exhaustive.
>
> We'd love to hear about what you are doing with Swing/SWT integration.
> What are the problems you have faced? Were you able to solve them? If
> so, how? In general, what would you like to see a project like Albireo
> provide?
>
> In any case we'd like to know if you support this project, either here
> or via e-mail. (Better still, how about participating? :-))
>
> This information will help us validate and improve the proposal, and
> hopefully help make the project something that is useful to a wide
> audience.
Re: For Starters... [message #573014 is a reply to message #3471] Wed, 10 October 2007 19:55 Go to previous message
Gordon Hirsch is currently offline Gordon HirschFriend
Messages: 100
Registered: July 2009
Senior Member
Cklewis wrote:
> I just wanted to drop my thoughts and say I think this will be a great
> and very useful project. I'm glad there's always people out there trying
> to make things easier for the rest of us, in this case the SWT/Swing
> integration.

It's really helpful to know of your interest and what you are working
on, so thanks for that.

....
>
> I downloaded the examples, but none of them are runnable when I tried
> them. It would have been helpful to actually have code for a runnable
> program that embedded a swing component in it, even if it was a small
> snippet.

Sorry about that. You didn't mention if you are writing an Eclipse RCP
application or just a standalone SWT application. Below is a snippet
that implements an RCP view with a simple embedded Swing JTable, using
the code included with the article. If you're writing a standalone SWT
application, you should be able to take just the code from
createPartControl() and added it to a shell or some other composite.
Once you get it running, you should also be able to replace the JTable
with another component of your choice. Make sure you take a look at the
javadoc as well. The sample code still has some issues, as you can see
from some of the other posts in this newsgroup.

public class JTableView extends ViewPart {

private EmbeddedSwingComposite embeddedComposite;

public void createPartControl(Composite parent) {
embeddedComposite = new EmbeddedSwingComposite(parent, SWT.NONE) {
protected JComponent createSwingComponent() {
/* Creating components */
int nrows = 1000, ncolumns = 10;
Vector rows = new Vector();
for (int i = 0; i < nrows; i++) {
Vector row = new Vector();
for (int j = 0; j < ncolumns; j++) {
row.addElement("Item " + i + "-" + j);
}
rows.addElement(row);
}
Vector columns = new Vector();
for (int i = 0; i < ncolumns; i++) {
columns.addElement("Column " + i);
}
JTable table = new JTable(rows, columns);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
table.createDefaultColumnsFromModel();

JScrollPane scrollPane = new JScrollPane(table);

return scrollPane;
}
};
embeddedComposite.populate();
}

public void setFocus() {
embeddedComposite.setFocus();
}

}
Re: For Starters... [message #573047 is a reply to message #3504] Wed, 10 October 2007 20:44 Go to previous message
Chris Kwon Lewis is currently offline Chris Kwon LewisFriend
Messages: 24
Registered: July 2009
Junior Member
Sorry I forgot to mention I was doing a standalone SWT application. In
fact I don't even know what an RCP application is, but i'll be sure to
look it up and find out :)

Thanks for the tips also. Is this forum strictly for the project or are
am I allowed to ask questions relating to implementing SWT/Swing bridge
for my program as well. Perhaps there is a better group to ask those
questions in?

Another thing I wanted to mention is I hope the word gets around more
that there is indeed a SWT/Swing bridge. In the SWT book I have, there
was no mention of it (it covered version 3.0 I believe). The only reason
I was aware of it was when I came across your article browsing the
eclipse corner articles. Next I searched on google trying to find more
examples or information on the bridge, then I eventually came across the
page for this project.

Perhaps when I figure out how to use this bridge more and get my program
working with it, I can submit a basic program example that uses the
swing version of piccolo inside of SWT. Like I said, the SWT version of
piccolo is incomplete with missing features and there's a different way
of doing certain things..so I'm sure there are other SWT users who might
want to use the swing piccolo as well and get benefit from further work
on the SWT/Swing bridge.

By the way, will this project be included in a future version of SWT?

Gordon Hirsch wrote:
> It's really helpful to know of your interest and what you are working
> on, so thanks for that.
>

> Sorry about that. You didn't mention if you are writing an Eclipse RCP
> application or just a standalone SWT application. Below is a snippet
> that implements an RCP view with a simple embedded Swing JTable, using
> the code included with the article. If you're writing a standalone SWT
> application, you should be able to take just the code from
> createPartControl() and added it to a shell or some other composite.
> Once you get it running, you should also be able to replace the JTable
> with another component of your choice. Make sure you take a look at the
> javadoc as well. The sample code still has some issues, as you can see
> from some of the other posts in this newsgroup.
>
> public class JTableView extends ViewPart {
>
> private EmbeddedSwingComposite embeddedComposite;
>
> public void createPartControl(Composite parent) {
> embeddedComposite = new EmbeddedSwingComposite(parent, SWT.NONE) {
> protected JComponent createSwingComponent() {
> /* Creating components */
> int nrows = 1000, ncolumns = 10;
> Vector rows = new Vector();
> for (int i = 0; i < nrows; i++) {
> Vector row = new Vector();
> for (int j = 0; j < ncolumns; j++) {
> row.addElement("Item " + i + "-" + j);
> }
> rows.addElement(row);
> }
> Vector columns = new Vector();
> for (int i = 0; i < ncolumns; i++) {
> columns.addElement("Column " + i);
> }
> JTable table = new JTable(rows, columns);
> table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
> table.createDefaultColumnsFromModel();
>
> JScrollPane scrollPane = new JScrollPane(table);
>
> return scrollPane;
> }
> };
> embeddedComposite.populate();
> }
>
> public void setFocus() {
> embeddedComposite.setFocus();
> }
>
> }
>
Re: For Starters... [message #573069 is a reply to message #3537] Thu, 11 October 2007 15:15 Go to previous message
Gordon Hirsch is currently offline Gordon HirschFriend
Messages: 100
Registered: July 2009
Senior Member
Cklewis wrote:
>
> Thanks for the tips also. Is this forum strictly for the project or are
> am I allowed to ask questions relating to implementing SWT/Swing bridge
> for my program as well. Perhaps there is a better group to ask those
> questions in?

I don't think there's a problem asking general SWT/Swing questions here.
If you are encountering an issue, chances are that we will encounter it
or have encountered it. Certainly, if you have any questions about the
sample code in the article, this is a good place to ask, since it will
be part of the initial code contribution for the project.

Your other newsgroup alternative would be eclipse.platform.swt

>
> By the way, will this project be included in a future version of SWT?

We are proposing Albireo as an Eclipse Technology project, so it will be
separate from anything in the Eclipse platform for now. As for the
future, it really depends on the technical success of the project and
the number of users.
Re: For Starters... [message #573088 is a reply to message #1339] Fri, 12 October 2007 18:48 Go to previous message
Chris Kwon Lewis is currently offline Chris Kwon LewisFriend
Messages: 24
Registered: July 2009
Junior Member
I was just wondering, what did your company like or need from swing
tables that wasn't available from SWT tables + JFace table controls?

Gordon Hirsch wrote:
> First, a couple of pointers:
>
> Albireo proposal: http://www.eclipse.org/proposals/albireo/
> Wiki page: http://wiki.eclipse.org/Albireo_Project
>
> The wiki page has very little content today, but it will grow over time.
> Add it to your watchlist if you are interested in this proposed project.
>
> The existing proposal lists a some specific features for Albireo, but
> it's not meant to be exhaustive.
>
> We'd love to hear about what you are doing with Swing/SWT integration.
> What are the problems you have faced? Were you able to solve them? If
> so, how? In general, what would you like to see a project like Albireo
> provide?
>
> In any case we'd like to know if you support this project, either here
> or via e-mail. (Better still, how about participating? :-))
>
> This information will help us validate and improve the proposal, and
> hopefully help make the project something that is useful to a wide
> audience.
Re: For Starters... [message #573129 is a reply to message #3603] Mon, 15 October 2007 15:58 Go to previous message
Gordon Hirsch is currently offline Gordon HirschFriend
Messages: 100
Registered: July 2009
Senior Member
We subclassed the Swing JTable class and added a lot of functionality.
I'm not sure if there are features in the plain old JTable that don't
map to SWT/JFace (but I suspect there are). In any case, it's not just a
question of Swing vs SWT; it's a question of reusing a specialized Swing
component.

Cklewis wrote:
> I was just wondering, what did your company like or need from swing
> tables that wasn't available from SWT tables + JFace table controls?
>
> Gordon Hirsch wrote:
>> First, a couple of pointers:
>>
>> Albireo proposal: http://www.eclipse.org/proposals/albireo/
>> Wiki page: http://wiki.eclipse.org/Albireo_Project
>>
>> The wiki page has very little content today, but it will grow over
>> time. Add it to your watchlist if you are interested in this proposed
>> project.
>>
>> The existing proposal lists a some specific features for Albireo, but
>> it's not meant to be exhaustive.
>>
>> We'd love to hear about what you are doing with Swing/SWT integration.
>> What are the problems you have faced? Were you able to solve them? If
>> so, how? In general, what would you like to see a project like Albireo
>> provide?
>>
>> In any case we'd like to know if you support this project, either here
>> or via e-mail. (Better still, how about participating? :-))
>>
>> This information will help us validate and improve the proposal, and
>> hopefully help make the project something that is useful to a wide
>> audience.
Previous Topic:Advice on getting started?
Next Topic:Advice on getting started?
Goto Forum:
  


Current Time: Sat Sep 22 20:42:50 GMT 2018

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

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

Back to the top