Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Possible bug with findView
Possible bug with findView [message #337096] Mon, 27 July 2009 17:06 Go to next message
Dilton McGowan II is currently offline Dilton McGowan IIFriend
Messages: 110
Registered: July 2009
Senior Member
Eclipse 3.4.1

For views created with secondaryid's, I can call on the active page:

findView(viewID);
findViewReference(viewID);
findViewReference(viewID, secondaryID);

It seems like an inconsistency in the API to not be able to call
something like findView(viewID, secondaryID)?

Additionally, in the part listener events an IWorkbenchPart is passed
in but it is not clear that it's possible to get a view from this when it
was created with a secondaryID?
Re: Possible bug with findView [message #452926 is a reply to message #337096] Sat, 01 August 2009 14:29 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

findView only supports primary IDs. You have to use findViewReference("id", "secondaryId").

You then use ref.getPart(false) if you don't necessarily want the part instantiated, and ref.getPart(true) if you want to force instantiation.

re:listener ... If you have an IWorkbenchPart that's a view, you can ask it for the IViewSite which will return the secondary ID.

PW


Re: Possible bug with findView [message #468059 is a reply to message #452926] Mon, 03 August 2009 19:58 Go to previous message
Dilton McGowan II is currently offline Dilton McGowan IIFriend
Messages: 110
Registered: July 2009
Senior Member
On Sat, 01 Aug 2009 10:29:04 -0400, Paul Webster wrote:

> findView only supports primary IDs. You have to use
> findViewReference("id", "secondaryId").
>
> You then use ref.getPart(false) if you don't necessarily want the part
> instantiated, and ref.getPart(true) if you want to force instantiation.
>
> re:listener ... If you have an IWorkbenchPart that's a view, you can ask
> it for the IViewSite which will return the secondary ID.
>
> PW

If findView can't handle sedcondaryid's I guess that's ok.

Thanks for the tip, it's cleaner than what I'd come up with.
Previous Topic:Text editor synchronization problem
Next Topic:Custom text editor not showing the enable/disable breakpoint menu items in the context menu...
Goto Forum:
  


Current Time: Thu Mar 28 12:19:14 GMT 2024

Powered by FUDForum. Page generated in 0.02896 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top