Hi everyone,
I’m opening this proposal in order to implement a solution for allowing to define a specific order in macro parameters (see Loading...). This proposal is directly linked to the 2 other proposals we already opened related to Macro Config UI:
- the proposal about a stable order in macro parameters: Stable order for macro parameters
- the proposal for redefining the Macro Config UI: Macro config UI
So what I propose here is to introduce a new annotation @PropertyOrder(100)
where the value would work the same way our various priority order works (lowest value means displayed first basically).
Now that order would be used also based on the various other parameters, so let’s take an example.
Assume we have the following definition:
@PropertyMandatory
@PropertyOrder(1)
String parameter1;
@PropertyOrder(2)
String parameter2;
@PropertyDeprecated
@PropertyOrder(3)
String parameter3;
@PropertyFeature(value = "myFeature", mandatory = true)
@PropertyOrder(4)
String parameter4;
@PropertyMandatory
@PropertyOrder(5)
String parameter5;
@PropertyFeature(value = "myFeature", mandatory = true)
@PropertyOrder(6)
String parameter6;
String parameter7;
@PropertyMandatory
String parameter8;
@PropertyGroup("someGroup")
String parameter9;
@PropertyGroup("someGroup")
@PropertyOrder(8)
String parameter10;
@PropertyDisplayHidden
@PropertyOrder(9)
String parameter11;
@PropertyAdvanced
@PropertyOrder(10)
String parameter12;
@PropertyGroup("someGroup")
@PropertyOrder(11)
String parameter13;
@PropertyAdvanced
String parameter14;
String parameter15;
@PropertyOrder(12)
String parameter16;
So in such case, based on the proposed new UI in other proposal, and on the proposal for having a stable order, the UI would look like that:
The algorithm would work that way:
- first we put the mandatory fields that have a priority order, and for placing the mandatory feature and groups we use the best order of their fields: that explains why we see “My feature” before Parameter 5 since Parameter 4 has a best order
- then we put the mandatory fields that don’t have a priority order, using alphabetical order of their id to have stable order: that’s why Parameter 8 appears last in mandatory fields
- then we put the tabs for optional fields: this has to be discussed but IMO we should always put the “Others” tab first and then the tabs for the groups / features, ordered following same mechanism than for mandatory fields (i.e. we use best order of their inner fields): the rationale is that we generally have more optional fields outside of a group than inside of a group so better put emphasize of them since the tab name of group emphasized on those already
- inside the tabs the algorithm is same for mandatory: first we order fields with an explicit order, and then the other ones
- it’s not related to the order, but if a deprecated field has a value it would be displayed in the UI, and we use its order to place that’s why we see Parameter 3 in my screenshot
- also when a field doesn’t have a specific order set I apply following ordering before using alphabetical order: fields without any annotation > advanced fields > deprecated fields. It explains why we see Parameter 15 displayed before Parameter 14 since that one is advanced. This order is used for both mandatory and optional fields when no specific order is defined.