Eclipse 4: Default commands - eclipse-rcp

I apologise for the very amateur question about E4 but I am a bit confused about a couple of things about RCP development using the new Eclipse 4 framework. I read in this tutorial that one can no longer use any default commands the way we could in 3.x especially for common things like Save, Save As... in the File menu. It says that in E4 we have to write our own commands. The reason I am confused is because the thing I liked about Eclipse previously is that a lot of things are already implemented and we can just extend that to our own needs. But it feels like now everything must be written from scratch.
That led me to considering reusing the command code already written for Eclipse Juno. I had the Live Editor open so I could see the list of commands etc but I don't really see any Handlers implemented for any of them. Then I used the Spy on Eclipse Juno and checked out some of the menu items and they all seem to point to Actions. That really confused me as I thought Juno was based on E4.
I could be completely wrong so I am sorry for asking such a silly question. I only just started using E4 and need to decide whether one of fairly young Eclipse 3.x projects should be migrated to 4.x.

AfaIk, in Juno the compatibility layer translates the 3.x based implementation of the IDE into E4 concepts. This is also the reason why the reusable commands are not yet available.
If you have an 3.x based RCP it should also run using the compatibility layer (and you can reuse the commands mentioned in your question) if no incompatible APIs have been used.
Here is more information (also a tutorial from Lars Vogel): http://www.vogella.com/articles/Eclipse4CompatibilityLayer/article.html

Related

Eclipse RCP opinions

I am working on a standalone Eclipse RCP product. My team replaced another team that wrote the infrastructure of the product.
I and my team leader aren't very happy with the Eclipse RCP framework because we feel that it is just very hard to get it to work correctly.
This is because:
The GUI building tools are annoying. XWT is buggy (bindings don't
always work, can't add scrollbars, and this is only the half of it).
SWT also isn't very exciting. I don't like the API and it doesn't
have too many exciting widgets.
Eclipse IDE itself is buggy (we
have to restart it every few hours). We are using eclipse juno. When
we tried to upgrade to luna we ran into some unsolvable issues:
Eclipse Luna: Handlers' #CanExecute methods not called due to wrong context
We have lots of weird bugs (e.g. eclipse looks at wrong selection
service and much more).
Even though there is support and
documentation, we find that it is kind of poor compared to other
solutions out there.
Due to the above, developement of simple
things seem to take too long. We have another .NET product which is
much easier to write.
However, google didn't seem to badmouth eclipse rcp... So I wanted to ask, what do you guys think about it? Do you find it easy to use? Do you find it flexible?
Just want to hear some opinions.
Thanks!!!

What exactly is e4 and what is its meaning if I want to write a new eclipse plugin?

I am interested in writing an eclipse plugin.
After reading various tutorials around the internet and working through some simple plugin examples, I am quite confused as to how you are supposed to use the new dependency injection/services style of programming I have read about in various places as one of the primary features of eclipse 4.
http://wiki.eclipse.org/Eclipse4/FAQ#For_Adopters_.28Plug-In_Developers.29
The tutorials I've seen, and the eclipse wizard-generated plugins themselves, all use the "old" style of programming using extension points and referencing things using the singleton pattern. Apparently, this style is supported using a compatibility layer.
The information on 3.x style plugin development seems perfectly reasonable and workable to me, but it sounds bad that it is only supported using a "compatibility layer." Is this a style of programming that is going to be phased out/deprecated for Eclipse development?
Where can I find a guide on writing a plugin that uses the new, preferred style? And why do the eclipse plugin wizards themselves not even use this style, if it has been the preferred development model since eclipse 4 was originally released?! Everything I have found about writing eclipse 4 style programs focuses on standalone rcp "applications", not actual plugins to eclipse IDE.
Here are some tutorials I found which use what I understand to be the old style of plugin:
http://www.eclipsepluginsite.com/
http://www.ibm.com/developerworks/opensource/library/os-ecplug/
http://www.vogella.com/tutorials/EclipsePlugIn/article.html
Can someone explain to me clearly what the current status of the eclipse 4 programming model for plugin development is? And if you could point me to some documentation of it that would be great as well.
Thanks!
It will be very long time before the compatibility layer goes as a huge amount of code depends on it.
You can only really use e4 if you are developing a new RCP and don't need any of the existing 3.x style plugins. e4 development is perfectly practical for new apps that don't use compatibility layer plugins - I have several such apps.
An e4 app can use extension points from core plugins which are not part of the compatibility layer. e4 applications make more use of direct injection and the application model which replace some of the old extension points.
For a plugin to an existing RCP (such as Eclipse itself) the 3.x style is required, although
Eclipse Luna provides some support for using e4 style views in a 3.x application.

Migrating eclipse 3.x application application to eclipse 4.x

I'm working on a product which is an RCP application based on Eclipse 3.x api. Now we are trying to move it to Eclipse 4.x. We are using some internal classes in our code. I've already read the tutorial provided by Vogella about migrating to Eclipse 4.x from 3.x, but I'm still not getting how to start.
We want to take advantage of the new Eclipse features, my main question is that we have good number of views, layouts in our old code, so what should be the approach I should follow. Also is there a way to create an application model from my older application using 3.x API.
I'm stuck and not getting how to proceed.
this really depends what you are trying to do. Do you just want to update your IDE? Or should the project be based on the e4 platform.
I recently updated a project from 3.x to the new IDE. This works very good, the compatibility layer does a good job and you are able to run the application with minimal changes. However if you do this, you cannot use the benefits of the e4 platform.
If you want to move your application to e4, thats more work to do. Mostly you will not want to touch all the old code, so there is a possiblity to have 3.x and e4 plugins run together in your application. Thats done with the e4 bridge and wrapper classes for old code. Most of the IDE views and editor are also still based on 3.x, so if you use them, the e4 bridge is also a good way to incorporate them.
Some information can be found here:
http://tomsondev.bestsolution.at/2011/06/10/how-to-apply-the-e4-programming-model-to-3-x/
http://eclipsesource.com/blogs/2012/06/18/migrating-from-eclipse-3-x-to-eclipse-4-e4/
Andy
I've read both the tutorial.But I am stucked and got too much confused as to where to start from. Basically 3 features are there
1. css styling of widgets(which i understood and did a bit of it)
2. to introduce dependency injection in my code
3. to put the application model
What approach I should follow?
This document helped me in deciding which strategy to adopt. http://www.eclipse.org/forums/index.php/fa/17403/ for migration.Indicates clearly which strategy you should adopt based on your existing code structure.Hope it helps

Eclipse 4 RCP (aka E4) documentation

Is there at least anything other than Vogella's tutorials and his book, which is completely based on those tuts? Examples from his repo are often either incomplete/unfinished/won't run and those examples even don't match the book actually..
I'd like to find at least some javadoc for this, because any step to a side and I'm completely lost on how to accomplish different tasks and what functionality is available.
Lars Vogel's Tutorials are the most complete and up-to-date documentation on Eclipse 4 development. Second to this is asking questions in Eclipse 4 Community Forum. Last option is to google for specific technical problems, which will in most cases lead you to blog posts from the same people that are active on the forums. (Mainly single supporters like Lars, some Eclipse devs and the guys from www.eclipsesource.com)
I discourage using the wiki, since much of the information may be outdated and may be more confusing than an actual help. Documentation for JFace and SWT can be reused from Eclipse 3.x since there are few to none changes in Eclipse E4.
E4 is alive and many of its components are now encapsulated in the standard Eclipse Platform. So most of Eclipse 3 docs and books are still relevant, as well as the Eclipse 4 ones.
If you want to understand the theory, you should start searching Eclipse conference slides explaining the Eclipse Platform and plug-ins. Trust me, it might sound old-style, but most of the times I find an EclipseCon Powerpoint or PDF, it is a great presentation, concentrating in 30 minutes the great work of some of the best Eclipse developers. If I had to re-start learning Eclipse, I would start again from some EclipseCon slides talking about Eclipse Plugins and Eclipse E4 Model.
For Eclipse4 or E4, we mean the Eclipse4 Model, which is now part of the Eclipse Platform. The Eclipse IDE itself supports both 3.x and Eclipse4 programming.
If you want to start Eclipse4, you should take a good book or a tutorial and follow it step by step. As an example you have these books:
Eclipse RCP (Rich Client Platform) 2nd edition
Contributing to the Eclipse IDE Project (free ebook)
Eclipse 4 Plug-in Development by Example: Beginner's Guide
Instant Eclipse 4 RCP Development How-to
However, there are a lot of sources of information, as many books, web tutorials and blogs. You can find most of them here:
https://wiki.eclipse.org/Eclipse_Articles,_Tutorials,_Demos,_Books,_and_More
https://wiki.eclipse.org/Eclipse4/Tutorials
http://planeteclipse.org/planet/
In my personal list of who to follow, I could include: Vogella RCP, EclipseSource, Tom Schindl, OpCoach, RCPVision, Kai Toedter, AllBlue, Wim Yongman, and all the E4 Contributors who are writing articles. But it is unfair not to mention all of them.
If you're not satisfied by docs and tutorials, please file a bug to the Eclipse Platform; mention "missing documents to use E4" and specify what you need. The Platform UI team will take care of this, either by linking the existing documentation to the above wiki page or by creating the missing docs.
Note: Several of the developers of the Eclipse E4 and Platform team contributed to the success of the technology by fixing bugs, writing code, documents, tutorials, and opening businesses based on this.
Eclipse committers are writing most of the existing documents, and they usually go to conferences. So, usually, you get their very best at the Eclipse Conferences. If you get their slides, you can get the best of some Eclipse and Java Champions, condensed in 30 slides, or in a video of 30 minutes.
You can start contributing to open source, by following tutorials, like those written by Eclipse Committers, and then you can give back by writing documents to capture your achievements ;)
But, keep in mind that a tutorial is not a book. There is a different process behind. Thankfully those great developers found the time to write code and documentation at the same time.
i was in the same position for my sparetime RCP-Project and was about to give up
since Neon the situation has been improved a lot
my approach
take the tycho-Example from vogella for headless-build
add your custom parts with 'hello world' and play around to learn
for database-access use a declarative Service using jpa
an example will be
http://relations-rcp.sourceforge.net/
for logging and error-view
https://github.com/buchen/portfolio
this project eye-opening!
in general:
search Application.e4xmi in Github by date descending and you will find excelent examples and full working products
Forget about e3 and stick to plain e4. Take Advantage of the latest api's
make a i18n plugin and use
#Inject
#Translation
Messages messages;
use ISideEffect as Binding
for me it becomes fun to code with e4
After almost 2 years there has been no decent response to this question. So i'm considering the Eclipse E4 platform efectively dead, as there are still people voting for this question and can't find an answer.
The only answer I have is - move to the NetBeans Platform. There are similar problems there, but at least people do answer in the mailing list and there are books which are quite more recent and are actually providing working source code! Enve the NetBeans website provides free tutorial on a lot of stuff for free!
I mean it's really hard to believe, but you should try NetBeans platform - it's the only choice.
For anyone who stumbles here looking for an e4 example, here's a simple basic example on using eclipse 4 rcpeclipse 4: rcp getting started
Standard Eclipse documentation for version 4.3 (Kepler) contains javadoc for the most part of e4 project:
http://help.eclipse.org/kepler/topic/org.eclipse.platform.doc.isv/reference/api/overview-summary.html?cp=2_1_0

Developing Eclipse plugins without Java

Is it possible to create Eclipse plugins/program Eclipse RCP apps without Java? (preferably in Jython)
This will be possible in the next Eclipse major release e4:
One of the goals of e4 is to provide support for writing plugins in other languages.
The quote is from http://wiki.eclipse.org/E4/JavaScript which summarizes the current state of using javascript to implement eclipse plug-ins in e4.
This issue in eclipse's bugzilla issue #227058 also has some discussion on that, but I believe it is outdated.
I am currently not aware of activity regarding other languages.
No. An Eclipse plugin is an OSGi bundle, and that requires interacting with a variety of things that can't implemented in Jython as far as I can see.
If you want to avoid Java, you can look at other things that target the JVM, but you will have to figure if you can produce and consume the specific items needed to call the necessary things and be called in the necessary ways.
OSGi bundles may be written in other JVM languages like Scala. Eclipse plug-ins, as of now, does not support any language other than Java. The Eclipse Plug-in Development Environment heavily makes use of JDT which ties it to Java. However there are some plans I heard that plug-ins might be supported in other languages. But I don't see that coming in near future.
You can write your main code in Jython and use Java interfaces to call then from Java. Take a look at this for details. Also, I am writing a utility library (github.com/abhin4v/jywrapper) to do the same. It has very little documentation right now, but you can look at the examples provided.