java.lang.Object
de.funfried.netbeans.plugins.external.formatter.ui.options.Settings

public class Settings extends Object
Settings utility class.
Author:
markiewb, bahlef
  • Field Details

    • ENABLED_FORMATTER_PREFIX

      public static final String ENABLED_FORMATTER_PREFIX
      Property key prefix for the enabled formatter per mime type.
      Since:
      1.14
      See Also:
    • ENABLED_FORMATTER

      @Deprecated public static final String ENABLED_FORMATTER
      Deprecated.
      Property key which defines the enabled formatter.
      Since:
      1.13
      See Also:
    • DEFAULT_FORMATTER

      public static final String DEFAULT_FORMATTER
      Property value of the default formatter to use (NetBeans internal formatter).
      Since:
      1.13
      See Also:
    • ENABLE_USE_OF_INDENTATION_SETTINGS

      public static final String ENABLE_USE_OF_INDENTATION_SETTINGS
      Property key which defines whether or not to use the settings of the external formatter in the NetBeans editor.
      See Also:
    • ENABLE_USE_OF_EDITOR_CONFIG

      public static final String ENABLE_USE_OF_EDITOR_CONFIG
      Property key which defines whether or not to use editorconfig in NetBeans if present.
      See Also:
    • OVERRIDE_TAB_SIZE

      public static final String OVERRIDE_TAB_SIZE
      Property key which defines whether or not to use the OVERRIDE_TAB_SIZE_VALUE instead of the one inside the external formatter configuration.
      See Also:
    • OVERRIDE_TAB_SIZE_VALUE

      public static final String OVERRIDE_TAB_SIZE_VALUE
      Property key which defines the tab size which is used when OVERRIDE_TAB_SIZE is actived.
      See Also:
    • SHOW_NOTIFICATIONS

      public static final String SHOW_NOTIFICATIONS
      Property key which defines whether or not to show notifications after each formatting.
      See Also:
    • USE_PROJECT_SETTINGS

      public static final String USE_PROJECT_SETTINGS
      Property key which defines whether or not to use project specific settings instead of global formatter settings.
      See Also:
  • Method Details

    • getActivePreferences

      public static Preferences getActivePreferences(Document document)
      Returns the active Preferences object for the given Document, either the global preferences are returned or if the Project has a separate configuration it will return the project specific Preferences.
      Parameters:
      document - the document to get the Preferences for
      Returns:
      the active Preferences object for the given Document, either the global preferences are returned or if the Project has a separate configuration it will return the project specific Preferences
    • getLineFeed

      public static String getLineFeed(String lineFeedSetting, String fallback)
      Returns the real line feed characters for the given escaped line feed characters.
      Parameters:
      lineFeedSetting - escaped line feed characters, e.g. \\n
      fallback - if the escaped line feed characters could not be matched to a real line feed setting
      Returns:
      the real line feed characters for the given escaped line feed characters, or the given fallback if the escaped characters could not be matched to a real line feed setting