Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Get workbench part instance.
Get workbench part instance. [message #482564] Thu, 27 August 2009 04:59 Go to next message
Matthias Treitler is currently offline Matthias Treitler
Messages: 117
Registered: July 2009
Senior Member
Hi!
How can I programmatically access a view part instance? I have only found
this API:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().getActivePart();

Unfortunately I use this method in a Handler an get only the view part
where the command has been executed. I need to get the instance of an
other view part, specified by its id. (of course only if it has been
already opened).

Is this basically possible?
Cheers,
Matthias
Re: Get workbench part instance. [message #482586 is a reply to message #482564] Thu, 27 August 2009 07:57 Go to previous messageGo to next message
Eclipse User
Originally posted by: msp.informatik.uni-kiel.de

Matthias Treitler wrote:
> Hi!
> How can I programmatically access a view part instance? I have only
> found this API:
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().getActivePart();
>
> Unfortunately I use this method in a Handler an get only the view part
> where the command has been executed. I need to get the instance of an
> other view part, specified by its id. (of course only if it has been
> already opened).
>
> Is this basically possible?
> Cheers,
> Matthias

IWorkbenchPage has a method

IViewPart findView(String viewId)


Miro
Re: Get workbench part instance. [message #482713 is a reply to message #482586] Thu, 27 August 2009 16:32 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Use findViewReference(*) and then ref.getPart(false) to avoid unnecessarily instantiating/activating parts.

PW


Previous Topic:TimeZone.getDefault() returns GMT
Next Topic:Selection provider that is not a workbench part
Goto Forum:
  


Current Time: Thu Oct 02 10:35:12 GMT 2014

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

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