Source context menu not adapted when called using key bindings
When the Source context menu is opened using right-click -> Source in the editor, the entries are prepared, i.e. the Java-specific actions removed and Scala-specific actions added. This does not happen when it is invoked using the shortcut Shift+Alt+S.
Leave a comment
on 2012-06-06 15:23 *
By Mirco Dotta
Type set to Defect
Assigned to set to Mirco Dotta
Milestone set to 2.0.x
on 2012-06-15 09:00 *
By Mirco Dotta
This happens because ScalaSourceFileEditor.createActions calls super.createActions (i.e., CompilationUnitEditor.createActions ), which instantiate a GenerateActionGroup (line 1133). The GenerateActionGroup's constructors calls installQuickAccessAction (private method), which creates a JDTQuickMenuCreator with a callback to GenerateActionGroup.fillQuickMenu (private method), which is in the end responsible of filling the Source context menu with the Java source generation actions.
To make this work properly we need to replace the existing GenerateActionGroup with our own implementation. The problem is that the field holding the GenerateActionGroup instance is private as well (i.e., GenerateActionGroup.fGenerateActionGroup ), which makes fixing this ticket a lot more difficult (and weaving is an option I don't want to consider).
IMO, the clean solution is to remove the call to super.createActions in ScalaSourceFileEditor.createActions. Though, I believe it is better to postpone this for the next major release, it is to risky for a 2.0 maintenance release. I'll give it some more thinking, but this is where I stand right now.
To make this work properly we need to replace the existing GenerateActionGroup with our own implementation. The problem is that the field holding the GenerateActionGroup instance is private as well (i.e., GenerateActionGroup.fGenerateActionGroup ), which makes fixing this ticket a lot more difficult (and weaving is an option I don't want to consider).
IMO, the clean solution is to remove the call to super.createActions in ScalaSourceFileEditor.createActions. Though, I believe it is better to postpone this for the next major release, it is to risky for a 2.0 maintenance release. I'll give it some more thinking, but this is where I stand right now.
Postponing this to Helium.
on 2012-10-10 13:08 *
By Mirco Dotta
Version changed from 2.0.1-final-29 to 2.0.2-final-29
Eclipse version changed from Helios to All
Milestone changed from Helium to Backlog
Ticket assignment reverted due to inactivity.