Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Enable print command(Added print in the menu, created handler but it's still not enabled)
Enable print command [message #638702] Fri, 12 November 2010 09:34 Go to next message
Ivan Larionov is currently offline Ivan LarionovFriend
Messages: 37
Registered: July 2009
Member
Hi everyone,

I didn't manage to enable print menu item in the main menu. I would be grateful if someone could help me and point out the reason of it.

Here what I did:
- created a handler and associated it with the org.eclipse.ui.file.print command (I didn't specify any enablement rules. Though, sampleCommand works in such configuration. Why does not the print command work like that?)
- using the org.eclipse.ui.menu extension point, put the org.eclipse.ui.file.print command in the main menu
- registered ActionFactory.PRINT in the application's ActionBarAdvisor.

Thanks in advance
Re: Enable print command [message #638707 is a reply to message #638702] Fri, 12 November 2010 10:10 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3801
Registered: July 2009
Senior Member
Ivan Larionov wrote:
> Hi everyone,
>
> I didn't manage to enable print menu item in the main menu. I would be
> grateful if someone could help me and point out the reason of it.
This only works along with an open textual editor.

Dani
>
> Here what I did:
> - created a handler and associated it with the
> org.eclipse.ui.file.print command (I didn't specify any enablement
> rules. Though, sampleCommand works in such configuration. Why does not
> the print command work like that?)
> - using the org.eclipse.ui.menu extension point, put the
> org.eclipse.ui.file.print command in the main menu
> - registered ActionFactory.PRINT in the application's ActionBarAdvisor.
>
> Thanks in advance
Re: Enable print command [message #638711 is a reply to message #638707] Fri, 12 November 2010 10:19 Go to previous message
Ivan Larionov is currently offline Ivan LarionovFriend
Messages: 37
Registered: July 2009
Member
Yes, it probably does. I've found out today that calling site.getActionBars().setGlobalActionHandler() in, for instance, an editor with print action as an argument will probably enable the menu item. But it's still unclear to me how it should be deregisterd after the editor is closed.
Thanks for the hint.
Previous Topic:How can I make configurable my RCP App?
Next Topic:Implement dynamic splash screen
Goto Forum:
  


Current Time: Fri Dec 19 17:36:24 GMT 2014

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

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