IntelliJ IDEA 2017.2 Help

Extract Constant Dialog

Refactor | Extract Constant

Constant of type IntelliJ IDEA automatically determines the field type.
NameSpecify here the name for the new constant.
Introduce to classSelect the class in which the constant will be introduced.
Introduce as enum constantIf you've selected an enum class in the Introduce to class field, you can use this option to select, whether you want to introduce this constant as an enum constant, or as a usual field. Otherwise, this option is naturally disabled and does not affect anything.
VisibilitySelect the visibility scope for the new field.
Replace all occurrencesCheck this option to automatically replace all the occurrences of the selected expression (if the selected expression is found more than once in the class).
Delete variable declarationCheck this option to delete variable declaration.
Annotate field as @NonNlsCheck this option to avoid changes during localization.
Last modified: 30 August 2017

See Also