Class LocaleProperty

All Implemented Interfaces:
PropertyVisitorAcceptor, Cloneable

@OpenApiAll public class LocaleProperty extends ChoiceProperty
The property for storing and editing some java.util.Locale value.
See Also:
  • Constructor Details

    • LocaleProperty

      public LocaleProperty()
      Default constructor. Value of the property will be null. ID will be empty string.
    • LocaleProperty

      public LocaleProperty(String id, Object value, List choice)
      The constructor.
      Parameters:
      id - the ID of property.
      value - the value of the property.
      choice - the list of possible values.
    • LocaleProperty

      public LocaleProperty(String id, int index, List choice)
      The constructor.
      Parameters:
      id - the ID of property.
      index - the index in choice of selected value.
      choice - the list of possible values.
  • Method Details

    • getLocale

      public Locale getLocale()
      Return the locale.
      Returns:
      a locale from property.
    • setLocale

      public void setLocale(Locale locale)
      Sets a new locale for property.
      Parameters:
      locale - a new locale.
    • updateLocaleByValue

      public void updateLocaleByValue()
      Updates locale by current value. Also updates available language list for this property from ResourceManager languages.
    • updateLocaleByString

      public void updateLocaleByString(String locale)
      Update Locale By String
      Parameters:
      locale - Locale String.
    • getClassType

      public String getClassType()
      Returns property class type.
      Specified by:
      getClassType in interface PropertyVisitorAcceptor
      Overrides:
      getClassType in class ChoiceProperty
      Returns:
      PropertyID.LOCALE_PROPERTY
      See Also:
    • accept

      public void accept(PropertyVisitor v) throws Exception
      Accepts the given visitor.
      Specified by:
      accept in interface PropertyVisitorAcceptor
      Overrides:
      accept in class ChoiceProperty
      Parameters:
      v - the PropertyVisitor.
      Throws:
      Exception
    • clone

      public LocaleProperty clone()
      Description copied from class: Property
      Clones the property. Clone is not deep, the clone will have the same instance of value. The clone will not have registered PropertyChangeListeners.
      Overrides:
      clone in class ChoiceProperty
      Returns:
      the cloned property.