Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Handler Enablement
Handler Enablement [message #488476] Mon, 28 September 2009 20:27 Go to next message
Eclipse UserFriend
Originally posted by: runzhou.li.gmail.com

Hi,

I've contributed a toolbar button to a specific perspective and the command
of this button is handled by a handler extension point defined in
plugin.xml.

What this button does is to open up a web page using an IWebBrowser.

Now I'm trying to implement an enablement mechanism so the button is grayed
out when this web page is opened.

How should I do this properly?

Thank you in advance.

--
Runzhou Li
Re: Handler Enablement [message #488534 is a reply to message #488476] Tue, 29 September 2009 07:43 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
Runzhou Li wrote:
> I've contributed a toolbar button to a specific perspective and the
> command of this button is handled by a handler extension point defined
> in plugin.xml.
>
> What this button does is to open up a web page using an IWebBrowser.
>
> Now I'm trying to implement an enablement mechanism so the button is
> grayed out when this web page is opened.

You can either create a property tester or a source provider and
maintain that state. Use that information in the enableWhen in your handler

- Prakash

Platform UI Team, IBM
http://blog.eclipse-tips.com
Re: Handler Enablement [message #488635 is a reply to message #488534] Tue, 29 September 2009 14:31 Go to previous message
Eclipse UserFriend
Originally posted by: runzhou.li.gmail.com

Thank you Prakash.

Actually I just found a solution, which is that by restrict the select in
the handler class.

:)

"Prakash G.R." <grprakash@gmail.com> 写入消息
news:h9sdq5$ah7$1@build.eclipse.org...
> Runzhou Li wrote:
>> I've contributed a toolbar button to a specific perspective and the
>> command of this button is handled by a handler extension point defined
>> in plugin.xml.
>>
>> What this button does is to open up a web page using an IWebBrowser.
>>
>> Now I'm trying to implement an enablement mechanism so the button is
>> grayed out when this web page is opened.
>
> You can either create a property tester or a source provider and
> maintain that state. Use that information in the enableWhen in your
> handler
>
> - Prakash
>
> Platform UI Team, IBM
> http://blog.eclipse-tips.com
Previous Topic:Compare Dialog for you own data structure
Next Topic:How to get one command to affect the visibility of another command?
Goto Forum:
  


Current Time: Tue Mar 19 05:20:19 GMT 2024

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

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

Back to the top