Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Adding a view into a perspective without opening the perspective.
Adding a view into a perspective without opening the perspective. [message #331826] Wed, 24 September 2008 07:23 Go to next message
Jan Kohnert is currently offline Jan KohnertFriend
Messages: 196
Registered: July 2009
Senior Member
Hello,

I want to add a view into a perspective. The view has the 'allowMultiple'
flag set and is opened multiple time within different perspectives.

At the moment I open the view using a IWorkbenchPage received by calling
showPerspective().
IWorkbenchPage page =
PlatformUI.getWorkbench().showPerspective(processor.getId(),
PlatformUI.getWorkbench().getActiveWorkbenchWindow());
...
TaskView processorView = (TaskView)page.showView(TaskView.ID, secondaryId,
IWorkbenchPage.VIEW_CREATE);


This approach has the drawback that the perspective into which a view is
placed has to be shown. I would prefer adding a view 'silently' into a
perspective without having to show the perspective at the same time.

Is this possible?

Thanks,
Jan
Re: Adding a view into a perspective without opening the perspective. [message #331858 is a reply to message #331826] Thu, 25 September 2008 13:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Jan Kohnert wrote:
> Hello,
>
> I want to add a view into a perspective. The view has the
> 'allowMultiple' flag set and is opened multiple time within different
> perspectives.
> At the moment I open the view using a IWorkbenchPage received by calling
> showPerspective().
> IWorkbenchPage page =
> PlatformUI.getWorkbench().showPerspective(processor.getId(),
> PlatformUI.getWorkbench().getActiveWorkbenchWindow());
> ..
> TaskView processorView = (TaskView)page.showView(TaskView.ID,
> secondaryId, IWorkbenchPage.VIEW_CREATE);
>
>
> This approach has the drawback that the perspective into which a view is
> placed has to be shown. I would prefer adding a view 'silently' into a
> perspective without having to show the perspective at the same time.
>
> Is this possible?

I suppose you could do it declaratively in plugin.xml instead of via
Java code. Use the org.eclipse.ui.perspectiveExtensions extension point.

Hope this helps,
Eric
Re: Adding a view into a perspective without opening the perspective. [message #331862 is a reply to message #331858] Thu, 25 September 2008 14:42 Go to previous messageGo to next message
Jan Kohnert is currently offline Jan KohnertFriend
Messages: 196
Registered: July 2009
Senior Member
Eric,

I don'nt think that it is possible doing it declaratively. The
perspectives are all cloned perspectives. The cloned perspectives Id's are
all dependant on a processors (a model class )id. A processors id is
unfortunately not predictable. So it us impossible to add such a
perspective id into any extension point. :(

Jan
Re: Adding a view into a perspective without opening the perspective. [message #331867 is a reply to message #331826] Thu, 25 September 2008 18:27 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

No, only the active perspective can be updated with views. There's no
way to address view.X into open.inactive.perspective.Y

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:Override or extend default resource delete action
Next Topic:Eclipse 3.4 on Solaris 10 sparc
Goto Forum:
  


Current Time: Wed Jul 17 17:22:22 GMT 2024

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

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

Back to the top