This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 250815

Summary: Shortcuts are missing for refactoring actions
Product: java Reporter: Ralph Ruijs <ralphbenjamin>
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: RESOLVED FIXED    
Severity: normal CC: lforet, markiewb, mbalin, sdedic, tboudreau
Priority: P2    
Version: 8.0.2   
Hardware: All   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Screenshot of new shortcuts
Patch adding the shortcuts to refactoring.api, refactoring.java and java.hints
Compare Eclipse/Idea/NBProposal

Description Ralph Ruijs 2015-03-02 12:33:48 UTC
The refactoring actions have no shortcut by default.
Comment 1 Ralph Ruijs 2015-03-02 12:41:38 UTC
Created attachment 152317 [details]
Screenshot of new shortcuts

Having a limited number of keyboard keys and no support for nested shortcuts like "CTRL-R, R", attached imaged shows the keyboard shortcuts we can give to the refactoring actions.

ALT-SHIFT+* will introduce something
CTRL-ALT-SHIFT+* will "refactor" something


and then there are some exceptions like CTRL+R or ALT+F7.


Please tell me what you think :)
Comment 2 Ralph Ruijs 2015-03-02 12:59:54 UTC
Created attachment 152319 [details]
Patch adding the shortcuts to refactoring.api, refactoring.java and java.hints
Comment 3 markiewb 2015-03-02 19:14:37 UTC
Created attachment 152331 [details]
Compare Eclipse/Idea/NBProposal

IMHO: NO. Don't do it. No one ever will remember more shortcuts for refactorings you do not use everyday. 

I attached a screenshot, which compares it with Eclipse and Idea.
Comment 4 Geertjan Wielenga 2015-03-02 19:18:09 UTC
Yes, Eclipse sucks, but that doesn't mean we should! We do need to move away from using the mouse and more towards letting people use the keyboard and this excellent proposal is a great step in that direction.
Comment 5 _ tboudreau 2015-03-02 19:20:47 UTC
It's not a question of people remembering *every* shortcut - but everyone finds ones that *they* use regularly, and it's perfectly possible to learn the shortcuts for the tools you use regularly.

So the idea that nobody will memorize *all* of them doesn't mean nobody will memorize *any* of them.

For Idea users, it might be nice if where possible we copied their shortcuts.
Comment 6 Ralph Ruijs 2015-03-02 19:38:42 UTC
(In reply to _ tboudreau from comment #5)
> <snip>
> 
> For Idea users, it might be nice if where possible we copied their shortcuts.

I think where possible we have the same shortcuts as idea. Please tell me if I missed one and I'll update it.
Comment 7 Ralph Ruijs 2015-03-02 19:41:01 UTC
(In reply to markiewb from comment #3)
> Created attachment 152331 [details]
> Compare Eclipse/Idea/NBProposal
> 
> IMHO: NO. Don't do it. No one ever will remember more shortcuts for
> refactorings you do not use everyday. 
> 
> I attached a screenshot, which compares it with Eclipse and Idea.

I agree not many will remember them all and therefor we could argue if it is necessary to add them, but do you see any harm in adding the shortcuts?
Comment 8 markiewb 2015-03-02 19:45:28 UTC
(In reply to Ralph Ruijs from comment #7)
> 
> I agree not many will remember them all and therefor we could argue if it is
> necessary to add them, but do you see any harm in adding the shortcuts?

You can add them as you like. Are there no conflicts with shortcuts from other modules?
Comment 9 Geertjan Wielenga 2015-03-03 07:17:05 UTC
I'm looking forward to making new screencasts about refactoring, where I'll be able to now use keyboard shortcuts only. Really cool.
Comment 10 Ralph Ruijs 2015-03-03 14:25:07 UTC
(In reply to markiewb from comment #8)
>
> You can add them as you like. Are there no conflicts with shortcuts from
> other modules?

There was one conflict with the action Threads History. I moved Extract Superclass and Extract Interface to CTRL-ALT-SHIFT + S and CTRL-ALT-SHIFT + T.

http://hg.netbeans.org/jet-main/rev/3b7d8afe8d16
Comment 11 Quality Engineering 2015-03-04 03:57:50 UTC
Integrated into 'main-silver', will be available in build *201503040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3b7d8afe8d16
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: #250815 - Shortcuts are missing for refactoring actions
Comment 12 markiewb 2015-05-03 17:23:00 UTC
*** Bug 244033 has been marked as a duplicate of this bug. ***
Comment 13 Alexander Simon 2015-05-19 10:54:26 UTC
Probably change:
-------------------8<------------------
@@ -59,7 +60,10 @@
  */
 @ActionID(id = "org.netbeans.modules.refactoring.java.api.ui.ChangeParametersAction", category = "Refactoring")
 @ActionRegistration(displayName = "#LBL_ChangeMethodSignatureAction", lazy = false)
-@ActionReference(path = "Editors/text/x-java/RefactoringActions" , name = "CallHierarchyAction", position = 430)
+@ActionReferences({
+    @ActionReference(path = "Editors/text/x-java/RefactoringActions", name = "CallHierarchyAction", position = 430),
+    @ActionReference(path = "Shortcuts", name = "OCS-C")
+})
 public class ChangeParametersAction extends JavaRefactoringGlobalAction {
-------------------8<------------------
has a typo?
See: name = "CallHierarchyAction"
And according to proposal shortcut should be OCS-M.