Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » View menuContribution always disabled
View menuContribution always disabled [message #62789] Sat, 23 May 2009 09:39 Go to next message
Alain Sahli is currently offline Alain SahliFriend
Messages: 19
Registered: July 2009
Junior Member
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 #62807 is a reply to message #62789] Sat, 23 May 2009 12:34 Go to previous messageGo to next message
Alain Sahli is currently offline Alain SahliFriend
Messages: 19
Registered: July 2009
Junior Member
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 #62839 is a reply to message #62807] Sun, 24 May 2009 18:23 Go to previous messageGo to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

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 #62855 is a reply to message #62839] Mon, 25 May 2009 07:01 Go to previous messageGo to next message
Alain Sahli is currently offline Alain SahliFriend
Messages: 19
Registered: July 2009
Junior Member
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 #63117 is a reply to message #62855] Mon, 25 May 2009 08:30 Go to previous message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

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 12:34 Go to previous message
Alain Sahli is currently offline Alain SahliFriend
Messages: 19
Registered: July 2009
Junior Member
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 18:23 Go to previous message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

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 07:01 Go to previous message
Alain Sahli is currently offline Alain SahliFriend
Messages: 19
Registered: July 2009
Junior Member
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 08:30 Go to previous message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

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.
>
Previous Topic:How to detect if launching from eclipse
Next Topic:Saving values modified from property sheet
Goto Forum:
  


Current Time: Fri Mar 29 15:16:43 GMT 2024

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

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

Back to the top