This is probably wishful thinking, but I figured I'd ask and hope to get lucky:
I have an Eclipse RCP app with some complicated layouts. Is there some way to manually layout the views/editors in the perspective and export that layout back into the the plugins, so I don't have to twiddle every plugin.xml file?
Thanks!
You should use Window Builder Pro it can even layout Eclipse perspectives.
Related
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.
Upon startup I only have the Open Perspective button and the default perspective that I set in method getInitialWindowPerspectiveId on its right. I want to show all my other perspectives on that coolbar.
Until now i tried:
config.ini file with org.eclipse.ui/PERSPECTIVE_BAR_EXTRAS=id1,id2,id3
plugin_customization.ini with org.eclipse.ui/PERSPECTIVE_BAR_EXTRAS=id1,id2,id3
in class ApplicationWorkbenchAdvisor in the initialize method someone said to do this:
PlatformUI.getPreferenceStore().setDefault(IWorkbenchPreferenceConstants.PERSPECTIVE_BAR_EXTRAS,"id1,id2,id3");
PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.PERSPECTIVE_BAR_EXTRAS,"id1,id2,id3");
Nothing worked.
However i found a workaround:
in class ApplicationWorkbenchWindowAdvisor in the postWindowOpen i manually show all my perspectives. This leaves them opened in the coolbar. However this is not the optimum way and maybe someone knows the proper way to show all my perspective shortcuts on the coolbar.
PlatformUI.getWorkbench().showPerspective("id1", getWindowConfigurer().getWindow());
PlatformUI.getWorkbench().showPerspective("id2", getWindowConfigurer().getWindow());
PlatformUI.getWorkbench().showPerspective("id3", getWindowConfigurer().getWindow());
Thanks
The 'plugin_customization.ini' method should work
The 'plugin_customization.ini' file must be in your RCP plugin
The 'plugin_customization.ini' must be included in the build in the 'build.properties' file.
What is the difference between 'Java Perspective', 'J2EE Perspective' and 'JPA Perspective' in Eclipse ?
Will it hamper anything to the code if i switch between perspectives?
Thanks,
Sudhansu.
"A perspective is a visual container for a set of views and editors (parts)" eclipse.org/.../PerspectiveArticle.html
As an example, in the "J2EE Perspective" is the "Server"-view already added. This view does not make any sense at "Java Perspective".
So perspecitves (and views, editors) are only about the User-Interface. The perspectives do not have any effect on the code.
No changes in code result if you switch between perspectives which are layouts in Eclipse
Check out these links
Eclipse - Perspectives(http://www.tutorialspoint.com/eclipse/eclipse_perspectives.htm),
Java Perspectives(http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Fconcepts%2Fconcept-java-perspective.htm)
A perspective in Eclipse is the way it will show you code and tools. Every perspective is made for an individual workflow. "Java" e.g. is for simple coding in Java and focusses on the Code in the middle. "Debug" e.g. perspective does not focus on the code but instead shows you tools which help you to analyze you actual problem (Thread Monitor, Variable Monitor etc.)
In Flash Builder 4.6's code assist, there is this extra box on the right of the classes, outlined in red, (image: http://oi42.tinypic.com/rqyuqq.jpg) that pops up when using the default Flex SDK. What is it called?
I find this feature very useful and wondering where I can get more information to implement a similar one in another Eclipsed-based IDE that I'm using.
this window is called JavaDoc View
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fviews%2Fref-view-javadoc.htm
any developer that uses the eclipse IDE knows this windows, it's shown the javadoc content of selected element,
it's part of Eclipse Java development tools (JDT)
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.