views:

127

answers:

4

I'm creating a plugin project that will have a menu and toolbar item, that when clicked, will open a dialog for user interaction (input, searching, etc.). Should I create the dialog using SWT or Swing?

+3  A: 

One advantage of doing it in Swing is that you don't have to supply any other libraries, because Swing is part of JRE. With SWT you have to do it and you have to do have separate dlls for specific platforms. UPDATE: Since you mentioned that you have to create Eclipse plugin, I think you have a clear choice here - SWT. It is what Eclipse is based on.

eugener
I definitelly agree with both ideas
Xorty
+1  A: 

Like @eugener, I prefer Swing to SWT, but both are rich, well-maintained frameworks that will serve the purpose. NetBeans and Eclipse are widely used exemplars. SWT binaries for popular platforms aren't too hard to integrate. The SWT FAQ may offer some perspective.

You'll need some other criteria to decide.

trashgod
+1  A: 

Since you're integrating Code Barrel into Eclipse, and SWT is part of the Eclipse project...

Actually, you should be looking at the Eclipse Plug-in Architecture and see how it works.

R. Bemrose
If this is a Eclipse plugin then you better use SWT. As an Eclipse user I absolutely deplore a plugin that uses Swing because it doesn't look like the rest of the app. Also you will want to look at other plugins (especially the ones that are part of the Eclipse platform) because you will find abstract dialog classes that do most of the work for you and will help your plugin look like it belongs in Eclipse. Deep integration is key to make sure your plugin is worth installing.
rancidfishbreath
+2  A: 

SWT.

Debate over the merits of Swing and SWT is irrelevant. Your plug-in will integrate with a platform built on SWT. Using the same user-interface toolkit will simplify your development and testing, and produce better results.

There are cases where it's useful to use Swing within Eclipse, such as when you have an existing codebase that would be impractical to port. There is an SWT/AWT bridge; I have not used it.

Andy Thomas-Cramer