Say I have:
public class A extends B {
/* autocompletion doesn't suggests protected methods from B to
override with Ctrl+SPACE
*/
}
I'm currently using Intellij IDEA 11.0.2.
On the Code menu, click Override methods Ctrl+O . Alternatively, you can right-click anywhere in the class file, then click Generate Alt+Insert , and select Override methods. Select the methods to override (hold the Shift or Ctrl key to perform a multiple select).
I have tried the following according to this thread (Intellij IDEA CE 12 Android XML Code Completion not working): Go to File->Power Save Mode and disable it - it is off. Go to Preferences->Editor->Code Completion and check Autopopup code completion - this has been checked.
By default, IntelliJ IDEA displays the code completion popup automatically as you type. If automatic completion is disabled, press Ctrl+Shift+Space or choose Code | Code Completion | Type-Matching from the main menu. If necessary, press Ctrl+Shift+Space once again.
When overriding a method, you might want to use the @Override annotation that instructs the compiler that you intend to override a method in the superclass. If, for some reason, the compiler detects that the method does not exist in one of the superclasses, then it will generate an error.
Right click in your editor pane for class A
, go to 'Generate...' -> 'Override Methods...'.
You'll then be presented with a list of all methods that can be overridden.
'Generate...' can also be called up via keyboard shortcuts, I'm on a Mac currently and it's ^N
. IIRC the shortcut on Windows/Linux is Alt-Insert.
Tried to add this as a comment but the keyboard shortcuts are clear when added as a reply ;)
Once in your subclass do CTRL + O (Windows) this will list the methods that you can override, which includes the standard ones as well as the methods from your superclass.
Additional Info (Not related to question): Also posted a link that contains some other very useful intelliJ shorcuts if they are of use to you. IntelliJ shortcuts that I can't find
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With