Swing/Prefuse or SWT for eclipse plugin development - java

I have existing java application where GUI had mainly built using Swing and prefuse API (http://prefuse.org/).
I want to develop eclipse plugin for this application. I have read in vogella tutorial that SWT is prefer to use for plugin development.
My problem is that if I should use SWT, then how can I convert each swing and prefuse API component to SWT?
PS: If I use existing GUI in my eclipse plugin project, then when I run the plugin as "Eclipse Application", it display GUI outside eclipse which I am not sure is correct behaviour for plugin development.

The http://wiki.eclipse.org/Albireo_Project might help:
"The Albireo project builds on the SWT_AWT bridge to provide more complete Swing/SWT integration, resulting in a better "out-of-the-box" experience and more credibility for the entire notion of Swing/SWT integration."
Extend the SwingControl and implement createSwingComponent() and getLayoutAncestor().
http://eclipsesrc.appspot.com/jsrcs/org.eclipse.albireo/org.eclipse.albireo.core/src/org/eclipse/albireo/core/SwingControl.java.html

Related

how do I get a preview of a java swing application without actually running it?

Is it possible to get a good preview of the java swing application without running it repeatedly in IntelliJ? Whenever I modify code I have to run it again and again so that it looks good.
It also generates a bunch of classes that I don't really need since I'm committing to a GitHub repository How do I do this?
I don't know about IntelliJ, but Eclipse has WindowBuilder, a visual designer and development tool that supports Swing. You can install it into a variety of Eclipse releases, I don't think it comes pre-installed in any of the Eclipse packages.
eclipse and NetBeans does have some WindowBuilder future
if you are using eclipse download this
and if you are using Netbeans it does provide a WindowBuilder itself so read this article

Use Eclipse RCP GUI in other applications

We are redesigning a few of our applications to a new custom framework. Now we want a stage to reuse the Eclipse RCP application GUI and redesign the backend (without using Eclipse RCP framework). So we can easily switch the GUI part to JavaFX. Is it possible to only use the GUI parts of the Eclipse RCP framework without using the Eclipse RCP framework?
We don't want all the Eclipse RCP configuration crap in our new projects and we only need the full GUI layer.
Everything in an Eclipse RCP is an Eclipse/OSGi plug-in and depends on the OSGi plug-in system to work.
If you depend on existing 3.x compatibility mode plug-ins then you are stuck using the 3.x style RCP.
If you don't depend on 3.x mode plug-ins you may be able to use the e4 style RCP which can set up to look any way you like and can be written using JavaFX instead of SWT using the e(fx)clipse code.
No, you cannot use the Eclipse RCP framework without using the Eclipse RCP framework. You might want to look at e(fx)clipse which allows you to sue the Eclipse RCP framework with a Java FX layer

Swing designer plugin for Eclipse

I am looking for best swing editor rite now I was looking for eclipse plugin that is Swing Plugin. Are there any other plugins for designing Swing apps. that can be installed in Eclipse, and will also generate the code?
Not Eclipse, but quite powerful is the swing designer of Netbeans.
It generates the code you need, and has got a lot of features.

How content assist works in Eclipse and how to mimic that functionality for my application

Can somebody help me on how content assist works in eclipse and how I mimic that functionality for my desktop java application?
Thanks!
Eclipse is built on SWT and JFace, in other words, it's part of the UI toolkit Eclipse interface is based on. Since you have a average desktop application I assume your program's GUI is Swing and I don't know about content proposals in the Swing toolkit.
Some links on the Eclipse Platform (<- overall name for technologies like SWT, JFace, more general plugin development):
Eclipse Wiki: JFace
Eclipse Wiki: JFace UI Framework -> Field Assist

SWT or Swing for Plugin Project

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?
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 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.
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.
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.
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.

Categories