|findViewReference returning null [message #554068]
||Thu, 19 August 2010 22:28
| Janusz Dalecki
Registered: January 2010
I need to call getSite().getPage().findViewReference inside a createPartControl() method of my editor to get the view itself. The problem is that the call returns me a null pointer. I guess it is because the view has not been instantiated yet.|
How can I get a hold of my view inside editor?
|Re: findViewReference returning null [message #556385 is a reply to message #554220]
||Wed, 01 September 2010 02:29
| Daniel KrÃ¼gler
Registered: July 2009
On 20.08.2010 16:52, Janusz Dalecki wrote:|
> Hi Daniel,
> You seem to know the area I am having problem with so much better then
It would be nice, if I would, but it turned out, I did not ;-)
> So first of all, sorry for the confusion about my explanation of the
> view and editor (I read my explanation again) it does sound like I am
> implying that they are the same but that is not what I meant - sorry.
> I am using CommonNavigator as a view and some home grown file editor.
> Inside editor's createPartControl I am trying to get hold of
> CommonViewer instance (I want to check that some property of the viewer
> is set to true).
> Now the problem is that even before I try to get hold of the viewer
> there seems to be a problem because if I call:
> IViewReference ref =
> getSite().getPage().findViewReference("CNTest.NavigatorView ");
I assume the space at the end of the ID is a typo, right?
> the 'ref' is null so I can't even call ref.getPart(false) function to
> get the viewer instance.
I was wrong, you need to check the IViewDescriptor *not* the IViewReference:
IViewDescriptor descr =
HTH & Greetings from Bremen,
Powered by FUDForum
. Page generated in 0.03364 seconds