|
|
|
|
Re: findViewReference returning null [message #556385 is a reply to message #554220] |
Wed, 01 September 2010 06:29 |
Daniel Krügler Messages: 853 Registered: July 2009 |
Senior Member |
|
|
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
> me.
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 =
getSite().getPage().getWorkbenchWindow().getViewRegistry().
find("CNTest.NavigatorView");
HTH & Greetings from Bremen,
Daniel Krügler
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03884 seconds