Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-ui-dev] RFC: Key Bindings Proposal (end date = Dec 14, 2001)

See my SA2> Comments below

Simon :-)



                                                                                                            
                    "Randy Hudson"                                                                          
                    <hudsonr@xxxxxxxxxx>           To:     platform-ui-dev@xxxxxxxxxxx                      
                    Sent by:                       cc:                                                      
                    platform-ui-dev-admin@e        Subject:     RE: [platform-ui-dev] RFC: Key Bindings     
                    clipse.org                     Proposal (end date = Dec 14, 2001)                       
                                                                                                            
                                                                                                            
                    12/11/2001 11:18 PM                                                                     
                    Please respond to                                                                       
                    platform-ui-dev                                                                         
                                                                                                            
                                                                                                            



So, could I use the pre-defined IDs like this:

claass MygotoEndOfLineAction extends ... {

public MyGotoEndOfLineAction() {
   setText(IWorkbenchActionConstants.END_OF_LINE_LABEL);
   setId(IWorkbenchActionConstants.END_OF_LINE_ID);
   setImageDescriptor(IWorkbenchConstants.END_OF_LINE_IMGDESC);
   setHoverImageDescriptor(IWorkbenchConstants.END_OF_LINE_HOVER_IMGDESC);
   setToolTipText(IWorkbenchConstants.END_OF_LINE_TOOLTIP);
}
...
}

If that is true, am I to also set the Accelerator, or will it happen
automatically for me because my ID happened to be in a binding-set?  Or,
does it happen when I add the ActionContributionItem to the MenuBar?

SA2> Actually, you would still define a unique id for your action. My
current implementation thinking is that the action will have another
attribute to link the action to a common one. You can still provide an
accelerator key for your action. However, if one is defined in the key
binding set, then the one provided by the action is ignored.

SA2> My current implementation thinking is the editor developer providing
an action will not do anything different. The only exception will be to
"link" the action to a common action id (for example, the developer has a
Shift Right action and it represents the Increase Indent Common Action ID,
so the developer would set an attribute on the action for this. The
workbench will be responsible to figure out what the accelerator key should
be (i.e the one from action, or from the key binding set, or user override,
etc)




SA> The workbench will define a list of common action ids (such as the
standard actions for navigation). Each key binding set can then reference
these ids to assign accelerator keys. The editor will then be able to
"register" with the workbench to have its actions invoked when the
accelerator key is pressed.

RANDY> The editor does this by creating an ActionContributionItem with the
action like the one above, and putting it in the
editorSite->actionBars->menuBar, right?  If so, does the act of doing this
set the accelerator for free?  If the users swaps binding sets, I as a
developer don't have to respond, right?

SA2> Yep, the workbench will determine the accelerator key for the action.
If the user changes the key binding set, the workbench will update all the
actions by itself - there is nothing the developer needs to do.

 For example, workbench will define a common
action id "go to start of line". The active key binding (determined by the
user) assigns the Home key to "go to start of line". The editor, when
active, will "register" with the workbench. When the "go to start of line"

RANDY> Again, by "register" you must mean I put an ActionContributionItem
in the MenuBar.

SA2> That will be one way. However, there will be other actions that the
editor may not want in the menu bar. For example, all the navigation
actions in the editor (go to start of line, go to start of document, etc).
There will be an API for the editor to "register" these type of actions so
they get invoked when the accelerator key is pressed. This will be new work
for the editor developer (I think we can abstract this out in the
AbstractTextEditor class so subclasses do not need to do much)

is invoked by the accelerator key, the editor's action is run. Now the
implementation details have not been fully worked out yet - the goal of the
proposal was to make sure we were on the right track to meet user needs.

_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev






Back to the top