Eclipse Plug-in / View Question -


I have a plug-in that has class A that brings the defined view through the following line of code in class B :

 (VideoLogView) PlatformUI.getWorkbench (). GetActiveWorkbenchWindow () GetActivePage () ShowView ("Videolog.VideoLogView"); 

In the createPartControl () method of the view (class B object), I have to use a method in class A object.

How can this be?

Thanks

It looks like you are facing" how do I pass arguments in my thoughts "














The questions asked about the RCP project were strange about the fact that There was no way to pass an argument as seen model.

Why? Because (emphasis my):

You are on a opened, pluggable platform . You contribute for the current development, others should be able to contribute to you.

So you will not give a view "pass" logic, it will lock the whole thing in a non, instead, to determine that your view will ask (or listen to the platform) that platform Which information is to manage.
Manage the same information on other events (other plugins that are not yet in existence) also want the same event.

What you need to do is ask the workspace for the current selection. I think your view is open on double click action or simple selection, so the object you want to manage in your view will be currently selected.
This way you can retrieve workspace selection from your view:

  select = this.get site (). GetWorkbenchWindow () GetSelectionService () GetSelection ();  

Where "this" is a view paint.

Then you will have to create your initial view (starting with the creation of a scene from a given event like DoubleClick ) is a selection provider. A JFace viewer is a select provider, so if you are using jface, you can use it, or when you are using custom then you The ISelectionProvider can implement the interface SWT control (this was my case).


The article can also give you some hints.

alt text

< / Html>

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -