Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » command "org.eclipse.ui.views.showView" is always disabled
command "org.eclipse.ui.views.showView" is always disabled [message #503694] Tue, 15 December 2009 06:36 Go to next message
Rafael Messias Martins is currently offline Rafael Messias Martins
Messages: 3
Registered: September 2009
Junior Member
Hello everyone, I'm trying to get the "Show View" dialog to appear by using the following code:

<extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="menu:org.eclipse.ui.main.menu">
         <menu
               label="Window">
            <command
                  commandId="org.eclipse.ui.views.showView"
                  style="push">
            </command>
         </menu>
      </menuContribution>
   </extension>


But it's always disabled. The same code with the command "org.eclipse.ui.perspectives.showPerspective" works fine (shows the perspective dialog).

What's wrong?

Thanks in advance!
Re: command "org.eclipse.ui.views.showView" is always disabled [message #503695 is a reply to message #503694] Tue, 15 December 2009 01:43 Go to previous messageGo to next message
T. Wilhelm is currently offline T. Wilhelm
Messages: 129
Registered: July 2009
Senior Member
You have to add a "parameter" to the command with the name of the view which should be shown:

name:
org.eclipse.ui.views.showView.viewId

value:
my.view.id

<command
commandId="org.eclipse.ui.views.showView"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
value="my.view.id">
</parameter>
</command>

Greetz

[Updated on: Tue, 15 December 2009 06:46]

Report message to a moderator

Re: command "org.eclipse.ui.views.showView" is always disabled [message #503701 is a reply to message #503695] Tue, 15 December 2009 07:08 Go to previous messageGo to next message
Rafael Messias Martins is currently offline Rafael Messias Martins
Messages: 3
Registered: September 2009
Junior Member
I figured it out; I was trying to show views without having set a perspective first. The command works just fine without parameters, but it only shows views who are in your current perspective.

Thanks!
Re: command "org.eclipse.ui.views.showView" is always disabled [message #505135 is a reply to message #503694] Sun, 27 December 2009 10:15 Go to previous message
Wim Jongman is currently offline Wim Jongman
Messages: 418
Registered: July 2009
Senior Member
Hi rmmartins,

Try this in your ApplicationAcationBarAdvisor class

showViewAction = ActionFactory.SHOW_VIEW_MENU.create(window);
register(showViewAction);

--

Best Regards,
Wim Jongman
-- I think my eyes are getting better. Instead of a big dark blur, I see a
big light blur.
HAN SOLO, Star Wars Episode VI: Return of the Jedi

> Hello everyone, I'm trying to get the "Show View" dialog to appear by using
the following code:
>
> <extension
> point="org.eclipse.ui.menus">
> <menuContribution
> locationURI="menu:org.eclipse.ui.main.menu">
> <menu
> label="Window">
> <command
> commandId="org.eclipse.ui.views.showView"
> style="push">
> </command>
> </menu>
> </menuContribution>
> </extension>
>
> But it's always disabled. The same code with the command
"org.eclipse.ui.perspectives.showPerspective" works fine (shows the
perspective dialog).
>
> What's wrong?
>
> Thanks in advance!
Previous Topic:RCP and MAC
Next Topic:Always meet bundle missing problem while exporting RCP
Goto Forum:
  


Current Time: Mon Jul 28 02:15:49 EDT 2014

Powered by FUDForum. Page generated in 0.02396 seconds