Annotation Interface P


@Retention(RUNTIME) @Target(FIELD) public @interface P
Annotate a field as a property. A control and port will be automatically created so that values of the field can be queried or set from the UI or other components. Field values will also be stored in the project, and available when copying or exporting, unless the field is read-only or transient.

The @P annotation may be used on fields of type Property, or any field type that can be backed by a Property, such as String, double, float, int, boolean, any Value type, any enum, etc.

The @P annotation can also be used on fields that represent a represent loadable resource, in which case the port / control will accept a URL and the field type will be the loaded resource. See specific custom code types for what resources they support loading.

Use the various Type annotations to set default values, allowed values, ranges, etc. Use @Config.Port(false) to suppress automatic creation of a port. Use @Transient to stop the field value being saved as part of the project. Use @ReadOnly to stop the field being settable externally (it can still be set in code).

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
    Relative weight compared to other @P elements.
  • Element Details

    • value

      int value
      Relative weight compared to other @P elements. Elements will be sorted by weight, and then alphabetically. Higher weight elements will sort after lower weight elements.
      Returns:
      weight
      Default:
      0