Search code examples
eclipseeclipse-pluginosgiequinox

Share data between views (ViewPart) Equinox


got a little question here to Eclipse Plugins.

I have a java class which contains some data, e.g. a linkedlist and some other stuff. I need this data in 2 views. In one view I want to display some of them, and the other view should show a list with the data. (this is my special case, but I ask the question generally).

So, how can I use this one class in both views? In "normal" java I'd would give a reference when I create the views, but as far as I know this is not possible in eclipse plugins.

My solution is, that the data-class is a singleton. But I don't like this solution, I think this only works in my case.

Hope you got the point :) Do anyone of you know a better solution?

(i'm new in eclipse plugins, there aren't good books or tutorials, aren't there?)


Solution

  • To answer the second question in your post... try this site out for basic tutorials about Eclipse plug-ins and RCP applications.

    www.vogella.com/eclipse.html

    This answer should help with the first question in your post.