Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Adding accelerator keys (how?)
Adding accelerator keys (how?) [message #871468] Mon, 14 May 2012 00:28 Go to next message
John Lussmyer is currently offline John LussmyerFriend
Messages: 97
Registered: December 2010
Now, I'm pretty sure that the way I'm doing some view-specific actions isn't the currently accepted practice. This is what happens when the example apps are out of date, and most of the examples I found via searches were apparently old as well.
So, taking that into account...
How do I add accelerator keys to my actions?
I've tried setAccelerator() and that doesn't work.

I have several Views that extend ViewPart.
These add toolbar buttons like this:
        IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager();
        mAction1 = new MessageSPAMAction("DoStuff");
        ActionContributionItem aci = new ActionContributionItem(mAction1);

The action class is an internal class, like this:
    private class DoStuffAction extends Action {

        publicDoStuffAction( String text) {

        public void run() {
            // Do things using member variables of the enclosing view
Re: Adding accelerator keys (how?) [message #878171 is a reply to message #871468] Mon, 28 May 2012 18:39 Go to previous message
Simon Scholz is currently offline Simon ScholzFriend
Messages: 73
Registered: April 2012
Location: Germany

I would recommend to take a look at the Eclipse Commands.
Commands are newer than the Actions and they are loosely coupled from the UI.
See the following tutorial for further information:

Best regards,

Previous Topic:Problem when running a RCP product
Next Topic:Stack view with editor in eclipse 3.5.
Goto Forum:

Current Time: Sat May 26 21:47:35 GMT 2018

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

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

Back to the top