Interface CopySource

All Known Implementing Classes:
JavaCopySource

public interface CopySource
What copying a component needs to ask of its source file.

Copy is mostly a runtime operation: the properties come from the live element, and the quirks that drop some of them again are reflection. The source is consulted three times, and only these three times — which is what lets one implementation serve any language. #9828's sibling work on the API-selection dialog found the same shape.

  • Method Details

    • setsProperty

      boolean setsProperty(String propertyKey)
      Whether the file actually sets this property.

      A live component reports a value for min and max whether or not anyone set them, so a copy would carry defaults the original never had and paste them as explicit calls.

      Parameters:
      propertyKey - the JavaBean property name
      Returns:
      true if the source sets it
    • localVariableName

      Optional<String> localVariableName()
      Returns:
      the local variable the component is assigned to, if it is one
    • fieldVariableName

      Optional<String> fieldVariableName()
      Returns:
      the field the component is assigned to, if it is one
    • itemType

      Optional<String> itemType()
      The bean type a Grid is typed with, for the paste to rebuild.
      Returns:
      the class name, or empty where the language cannot resolve it