In Intellij IDEA 11.1.2, when using the refactor shortcut to Introduce a Constant, it always makes public static final constant, whereas I generally prefer to default to private. In older versions of Intellij, I'm pretty sure that I had the option of setting private as the default. Does anyone know if there still exists an option to default to private for the Introduce Constant refactor option rather than having to afterwards go to the declaration and edit the public to private? Thanks
Press Shift+F6 or from the main menu, select Refactor | Rename. next to the highlighted element. You can press Tab to open the context menu and select the additional rename options. If you want to see the Rename dialog with more options, click the More options link or press Shift+F6 .
Press Ctrl+Alt+V or from the main menu, select Refactor | Extract/Introduce | Variable. Select a name suggested in the popup or type your own and press Enter . that you can use to configure more options.
Open your class in the editor, place a caret at the static method you want to move and press F6 . In the Move Members dialog specify the following options: In the Members to be moved to another class (static only) field, select the checkboxes next to the methods that you want to move to another class.
ah, never mind, I see. You have to press command-alt-C again to get the old dialog. Grrr. The short cut is getting longer....
I had the same problem and solved it (idea 12).
To introduce private constants by default do the following:
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