Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Open a View(Open a View which is not defined in the extensions.)
Open a View [message #501644] Thu, 03 December 2009 04:06 Go to next message
Eclipse UserFriend
Hi all,
I need to open a view from another previous view.

Currently I'm using the next code:

ViewPart myView = (ViewPart) PlatformUI
.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().showView(
MyView.ID);

which is working but only when I've defined the target view in the extensions section in plugin.xml.

I need the target view doesn't appear in any category. I need the target view be only accesible fron the first view.

When I remove the target view in section extensions I get the next exception:


es.myproject.cliente.rc.ui.views.menu.MyView
org.eclipse.ui.PartInitException: Could not create view: es.myproject.cliente.rc.ui.views.menu.MyView
at org.eclipse.ui.internal.ViewFactory.createView(ViewFactory.j ava:157)
at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:2227)
at org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:1067)
at org.eclipse.ui.internal.WorkbenchPage$20.run(WorkbenchPage.j ava:3816)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3813)

How I could to do it?.

Thank you in advance.
Re: Open a View [message #501648 is a reply to message #501644] Thu, 03 December 2009 04:17 Go to previous messageGo to next message
Eclipse UserFriend
You have to declare the extension for the view, but you don't need to specify the category, it's optional.
Re: Open a View [message #501651 is a reply to message #501648] Thu, 03 December 2009 04:24 Go to previous messageGo to next message
Eclipse UserFriend
Hi Francis,
thanks for your reply.

I also removed the category in the extensions section but then the target view appears in the "Others" category.

I suppose that "Others" is the default category and if you don't specify the category your view goes there directly.

Do you know how to avoid that behaviour?

Re: Open a View [message #501656 is a reply to message #501651] Thu, 03 December 2009 04:40 Go to previous messageGo to next message
Eclipse UserFriend
David Crecente wrote on Thu, 03 December 2009 01:24
Hi Francis,
Do you know how to avoid that behaviour?


No, sorry, but it might be OK because realistically people rarely look there to open a view, so it might be that that's the best you can do. I could be wrong though.
Re: Open a View [message #501657 is a reply to message #501651] Thu, 03 December 2009 04:40 Go to previous messageGo to next message
Eclipse UserFriend
you can use activities to hide the menu entry completely

See http://www.vogella.de/blog/2009/07/13/eclipse-activities/

Greetz
Thomas
Re: Open a View [message #501665 is a reply to message #501657] Thu, 03 December 2009 05:54 Go to previous messageGo to next message
Eclipse UserFriend
Hi Thomas,
it worked for me.

Thank you.
Re: Open a View [message #501799 is a reply to message #501644] Thu, 03 December 2009 14:50 Go to previous message
Eclipse UserFriend
When creating an RCP application you can remove the workbench's "Show
View" contribution from your Application's ActionBarAdvisor.

You can always create your own "Show View" menu manager and only show
the views you want to expose to the user.

MenuManager myViewsMenu = new MenuManager("Show View");
myViewsMenu.add(myFirstViewAction);
myViewsMenu.add(mySecondViewAction);

Shawn
Previous Topic:Perspective in editor
Next Topic:Memory consumption
Goto Forum:
  


Current Time: Fri Jul 11 21:45:24 EDT 2025

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

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

Back to the top