Eclipse Swing designer - eclipse

Is there a plugin for Eclipse that can help with designing the Swing GUI like in Netbeans?
The WindowBuilder is too simple and primitive. For example:
it only allows me to place a component in one of the 5 pre-defined regions
The GUI designer in Netbeans is much, much more powerful

There is a port of the Mantisse GUI Editor from NetBeans to Eclipse.
http://marketplace.eclipse.org/content/swing-gui-designer

There actually is several options to how control components are placed in the window. In the Design tab of your class under the Layouts dropdown there are several options. For example there is an Absolute option which allows x and y coordinate precision in placing and moving components.

Related

Eclipse e4 Extending a Perspective

I am starting a new eclipse plug-in project and trying to evaluate what is the best approach.
What is the goal: I want to create a plug-in that adds a View/Editor stacked on the Editor of the C/C++ perspective from the CDT plug-in. Similar to XML editors that have highlighted text editor view and a view that contains a form to be filled and automatically creates xml code.
The best way would probably be to extend the existing C/C++ perspective from the CDT plug-in. How this is done wtih the 3.X API is explained here [1,2]. Basically you use the org.eclipse.ui.perspectiveExtensions extension point to add views realtive to the views in the perspective.
But how can this be done with the e4 API and the model fragment? Is this possible with compatibility layer?
I think another possibility would be to add views contained in the C/C++ perspective through the combability layer to my own perspective like the package explorer. This has the adavantage that already existing 3.X views (like the package explorer) can be used but also have the advantages of the e4 API.
Or would it even be the best to create a pure 3.X plug-in because my plug-in is mainly based on another perspective/plug-in?
Hope somebody can help me here :)
I don't think it is possible to extend a 3.x perspective using e4 model fragments. It is certainly easier to stick to the 3.x style.
You can use e4 style views by using the e4view style view on the org.eclipse.ui.views extension point.

Jfreeshart support on SWT?

Hi I want to develop dynamic time series graph, (i.e time graphe which will updated automatically after few second) in SWT. I am able to do it using jFreechart in swing based application. Now I have shifted whole UI in eclipe RCP SWT. I have research ove web, I found that jfreechart not supported any longer on swt. is it true? SHould I drop jfreechart development on swt and find other altenative? what are other alternative for dynamic time series.
Yes, I wouldn't use JFreeChart in SWT, unless you are willing to either 1) fix bugs in it or 2) embed a Swing frame in your SWT GUI. There are several alternative libraries listed in Libraries for pretty charts in SWT?
Dear #user2670032 there is an option to show jFreeChart in RCP but I am not sure this solution will be efficient in your case because in my case I need to show pie chart in RCP view only once.
Export chart as PNG image.
ChartUtilities.saveChartAsPNG('image-name', chart, 500, 300, info);
Use SWT browser composite to show chart.
Use exported image path in HTML and set this HTML in browser composite.
This solution fulfills my need.
Like any other Java Application coding, JFreechart chart application can be developed in SWT via adding jar in SWT Plugin development and coding
Add Chart in ViewPart in eclipse and that viewpart can be added to perspective.
Eclipse software can be developed

Eclipse look & feel customization

I need to customize the look & feel of my RCP application.
I took a look at Eclipse Presentation API and I suppose it allows to customize everything in workbench except controls.
So is there any solution to customize controls?
I made some research work and implemented some ad-hoc SWT cunstomization using control canvas drawning. May be there are better solutions?
In Swing you can use Synth theme. It would be great if some 'skin' framework exists for SWT.
One way of customizing an RCP app is by using a plugin_customization.ini file. Like this:
Create a new file called "plugin_customization.ini" in the root of your project.
If you have not already done so, create a product configuration and define a Product.
In your plugin's manifest editor, on the "Extensions" tab, locate the "org.eclipse.core.runtime.products" extension, expand the node, right click on your product node and select "New > property" from the context menu.
Enter "preferenceCustomization" in the "name" field and "plugin_customization.ini" in the "value" field.
Select "File > Save" from the main menu.
You can then customize a lot of things simply by editing plugin_customization.ini file. For example, adding the following line
org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
will give you rounded tabs on your views and editors (similar to those that Eclipse IDE has) instead of the default ones.
You can find other constants that you can use in IWorkbenchPreferenceConstants javadoc.
Also, check out the Eclipse skins project, if you haven't already.
There is also the possibility to use CSS to change the look & feel of your app, but that is still in development and can be buggy
As for customizing the SWT controls themselves, the only way to do that (apart from small customizations such as changing the background colour of a control etc.) is by creating your own custom controls by extending Canvas or Composite, but you already know that. Keep in mind that the point of SWT is to use native controls, so if you desire the ability to completely customize your controls, perhaps using Swing would be a better option. However, if you're going to use Swing, it may be better to use another RCP entirely - namely, NetBeans RCP. I haven't tried it out yet, but I know that whereas Eclipse RCP uses SWT as a widget toolkit, NetBeans RCP relies on Swing, so that may save you from some headaches regarding compatibility problems and so on.
The new Eclipse 4 work contains plugins that allow the L&F to be customized using CSS. These plugins can be run in a 3.7 Eclipse environment. See Kai's blog for a presentation on the subject: http://www.toedter.com/blog/?p=477
The Eclipse 4 Styling Tutorial has a slide (p.66) on where to get an 3.7 based RCP example.

netbeans gui panels don't stay where they are supposed to be

I am trying to create a java gui using netbeans but the swing panels that look great in the IDE are all over the place after I compile and run the program. what can be causing this?
NetBeans' Matisse GUI editor is not a WYSIWYG editor, even though it pretends to be one. The fundamental reason is the philosophy of Swing layout managers; there's no way to position the components to absolute positions, because the size of components vary with the platform as well as with the "look and feel".
In practice, it's best to code the layout by hand, using some third-party layout manager. MiGLayout is one of the best and amazingly easy to use.

My subclipse colors don't work

This is probably a simple issue for some subclipse guru. My decorator colors don't work in eclipse. I'm guessing that some plugin I have is interfering with it somehow. I'm on the current public release of ganymede. Going to the fonts and colors option area lets me change the decorator text color, but I get no effect in the project explorer. Any ideas?
Are you using KDE on Linux? There is a known bug if you use the gtk-qt-engine to make GTK programs (like Eclipse) look more like KDE apps. If this gtk theming engine is active the text colors in views don't work. This is a common problem for mylyn users.
This is probably not important any more, but the decorator issue came down to using the correct view. The "project" view and the "file" view look extremely similar, but the decorators work correctly in one and not the other.