Usage notes

Attributes fieldSetId and fieldSetName are used to associate members together. These are available for ActionLayout and PropertyLayout (but not for CollectionLayout as collections don’t support annotation based grouping).

Dependent on the type of object member the sequence attribute orders those members that have been grouped together. It is available with ActionLayout, PropertyLayout and CollectionLayout

Properties

For properties, the fieldSetId and/or fieldSetName attribute is used to group properties together, and sequence orders the properties within that group. It corresponds to a <fieldset> if using layout files.

For example:

import lombok.Getter;
import lombok.Setter;

public class Customer {

    @PropertyLayout(fieldSetName = "Personal Details", sequence = "1.0")
    private String firstName;

    @PropertyLayout(fieldSetName = "Personal Details", sequence = "2.0")
    private String lastName;

    @PropertyLayout(fieldSetName = "Address", sequence = "1.0")
    private String addressLine1;

    @PropertyLayout(fieldSetName = "Address", sequence = "2.0")
    private String addressLine2;

    @PropertyLayout(fieldSetName = "Address", sequence = "3.0")
    private String city;

    @PropertyLayout(fieldSetName = "Address", sequence = "4.0")
    private String zipCode;

    // ...
}
It’s possible to combine @PropertyLayout with layout file. Use the layout file to define the positioning of the fieldsets, and use @PropertyLayout to organise the properties within the fieldset.

Actions

For actions, the fieldSetId and/or fieldSetName attribute indicates the name of a property to associate the action with, and sequence orders all the actions associated with the same property or collection (on the panel of the property’s fieldset, or collection’s title bar).

For example:

import lombok.Getter;
import lombok.Setter;

public class Customer {

    @ActionLayout(fieldSetName = "Personal Details")
    public Customer updateName(String firstName, String lastName) {
        // ...
    }

    @ActionLayout(fieldSetName = "Address")
    public Customer changeAddress(String firstName, String lastName) {
        // ...
    }

    // ...
}
For actions @ActionLayout#associateWith() is an alternative that indicates, that the action should be rendered close to its associated peer.
For actions associated with properties, the @ActionLayout#position() element indicates whether the action should be rendered beneath the property’s field, or instead on the property’s fieldset panel’s header.

Collections

The fieldSetId and fieldSetName attributes have no counterpart within @CollectionLayout.