IntelliJ IDEA 2016.2 Help

Properties Files

On this page:

Basics

The properties files are text files with the .properties extension, containing pairs of keys and values, that can be accessed and rendered in the UI.

These files are marked with the icon propertiesFile.

IntelliJ IDEA also recognizes properties files in XML format. They are marked with the icon xml_properties_icon.

Properties file features

IntelliJ IDEA supports the following features for the properties files:

  • Action for creating new resource bundles.
  • Ability to work with XML-based properties files.
  • Actions for combining and dissociating properties files.
  • Syntax key - delimiter - value. IntelliJ IDEA uses = (equal sign) or : (colon) as a delimiter.

    For example, if you want a field label to read "Your name:", you might create a pair in a properties file like this:

    nameLabel=Your name:

    nameLabel: "Your name:"

  • Error highlighting for errors like missing locale records, or duplicate property keys and invalid escape sequences :
    ij_propertyError
    propErrors
  • Inspection and quick fix for detecting and removing duplicate keys in properties files:
    propIntention
  • Referencing properties from Java files and Ant build files.
    • Code completion for property keys:
      i18nCodeCompletion
    • Inspection and quick fix for detecting and creating the missing property keys and values:
      i18nPropertyIntention.png
    • Goto Declaration Ctrl+B to navigate from a reference to a key to its declaration:
      propGotoDeclaration.png
    • Finding usages of the currently selected property.
    • Refactoring for properties includes Rename, Move, Copy, Safe Delete, and Migrate.
  • Structure view for properties files:
    structure_view_i18n
  • Quick Definition Lookup for properties files: if an action calls a property, you can view the property definition by pressingCtrl+Shift+I:
    propertiesLookUpInfo.png

See Also

Last modified: 23 November 2016