Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Enable-disable command on click of a tab
Enable-disable command on click of a tab [message #499849] Tue, 24 November 2009 11:29 Go to next message
Neha is currently offline NehaFriend
Messages: 52
Registered: July 2009
Member
Hi,
In my application i need a particular button (command) on editor toolbar be
enabled only when a particular tab is opened on the editor, it should be
disabled for rest of the tab.Is there a way to do so ?
please do let me know

Thanks in advance ,
Neha.
Re: Enable-disable command on click of a tab [message #499921 is a reply to message #499849] Tue, 24 November 2009 14:26 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

If your handler was activated by the part itself then you could know when pages changed ... MultiPageEditorPart is a org.eclipse.jface.dialogs.IPageChangeProvider

If your handler is coming from plugin.xml, then you would:
1) write a property tester
2) set up a page change listener or your editor itself to request a property refresh on page change events, org.eclipse.ui.services.IEvaluationService.requestEvaluation (String)

PW


Re: Enable-disable command on click of a tab [message #500175 is a reply to message #499921] Wed, 25 November 2009 09:04 Go to previous messageGo to next message
Neha is currently offline NehaFriend
Messages: 52
Registered: July 2009
Member
Hi Paul,
Thanks for your reply.
Can you please tell me what handler or class is activated when i click a
tab.if i need to write some function on click event of the tab.

"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:hegqfk$9tc$1@build.eclipse.org...
> If your handler was activated by the part itself then you could know when
> pages changed ... MultiPageEditorPart is a
> org.eclipse.jface.dialogs.IPageChangeProvider
>
> If your handler is coming from plugin.xml, then you would:
> 1) write a property tester
> 2) set up a page change listener or your editor itself to request a
> property refresh on page change events,
> org.eclipse.ui.services.IEvaluationService.requestEvaluation (String)
>
> PW
>
> --
> Paul Webster
> http://wiki.eclipse.org/Platform_Command_Framework
> http://wiki.eclipse.org/Command_Core_Expressions
> http://wiki.eclipse.org/Menu_Contributions
Re: Enable-disable command on click of a tab [message #500544 is a reply to message #500175] Thu, 26 November 2009 15:37 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Are you using a MultiPageEditorPart?

PW


Previous Topic:How to locate and load an XML configuration file?
Next Topic:64-bit Eclipse RCP development environment on 64-bit Windows 7
Goto Forum:
  


Current Time: Tue Mar 19 06:28:56 GMT 2024

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

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

Back to the top