View menuContribution always disabled [message #62789] |
Sat, 23 May 2009 05:39  |
Eclipse User |
|
|
|
Hello,
I did a view and I want to add a context menu to this view. First I tried
to do this :
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:ch.wess.ezclipse.varbrowser.view">
<command
commandId="ch.wess.ezclipse.varbrowser.refreshcommand"
id="ch.wess.ezclipse.varbrowser.refresh"
label="Refresh"
style="push"
tooltip="Refresh the subtree">
</command>
</menuContribution>
</extension>
But the context menu never appeared in my view. After that I tried to
change the locationURI to :
locationURI="toolbar:ch.wess.ezclipse.varbrowser.view">
Now I see the "refresh" button in the view's toolbar but it's always
disabled. I tried to add :
<visibleWhen
checkEnabled="true">
</visibleWhen>
But my button is still disabled.
I think I don't see my context menu because it's always disabled, how can
I enable my command ?
Thanks for help,
Alain
|
|
|
|
|
|
Re: View menuContribution always disabled [message #63117 is a reply to message #62855] |
Mon, 25 May 2009 04:30  |
Eclipse User |
|
|
|
Hi Alain,
happy to hear this.
Best regards, Lars
Alain Sahli wrote:
> Hi Lars,
>
> Thanks a lot ! Your article helped me and it works now ;-)
>
> My handler implemented IHandler and the execute method was never called.
> I change this and extended the AbstractHandler class, the execute method
> is now called.
>
|
|
|
Re: View menuContribution always disabled [message #597812 is a reply to message #62789] |
Sat, 23 May 2009 08:34  |
Eclipse User |
|
|
|
I found how to enable my button in the toolbar. The class (RefreshHandler)
which implements IHandler has a method called isEnabled(). I return true
and my button is enabled.
But my problem still exist. I changed the locactionURI in my plugin.xml :
locationURI="popup:ch.wess.ezclipse.varbrowser.view"
But I don't see a context menu in my view :-(
|
|
|
Re: View menuContribution always disabled [message #597822 is a reply to message #62807] |
Sun, 24 May 2009 14:23  |
Eclipse User |
|
|
|
Hi,
The following tutorial gives a example how to add a command to the view
toolbar.
http://www.vogella.de/articles/EclipseCommands/article.html
I hope this helps.
Best regards, Lars
Alain Sahli wrote:
> I found how to enable my button in the toolbar. The class
> (RefreshHandler) which implements IHandler has a method called
> isEnabled(). I return true and my button is enabled.
>
> But my problem still exist. I changed the locactionURI in my plugin.xml :
>
> locationURI="popup:ch.wess.ezclipse.varbrowser.view"
>
> But I don't see a context menu in my view :-(
>
>
>
|
|
|
Re: View menuContribution always disabled [message #597827 is a reply to message #62839] |
Mon, 25 May 2009 03:01  |
Eclipse User |
|
|
|
Hi Lars,
Thanks a lot ! Your article helped me and it works now ;-)
My handler implemented IHandler and the execute method was never called. I
change this and extended the AbstractHandler class, the execute method is
now called.
|
|
|
Re: View menuContribution always disabled [message #597831 is a reply to message #62855] |
Mon, 25 May 2009 04:30  |
Eclipse User |
|
|
|
Hi Alain,
happy to hear this.
Best regards, Lars
Alain Sahli wrote:
> Hi Lars,
>
> Thanks a lot ! Your article helped me and it works now ;-)
>
> My handler implemented IHandler and the execute method was never called.
> I change this and extended the AbstractHandler class, the execute method
> is now called.
>
|
|
|
Powered by
FUDForum. Page generated in 0.04217 seconds