Package ch.tocco.nice2.model.form.spi
Class PositionBasedSorter
java.lang.Object
ch.tocco.nice2.model.form.spi.PositionBasedSorter
Deprecated.
Sorts all components based on the
Component.Position.
So the first priority are the categories like
Component.Position.TOP,
Component.Position.MIDDLE,
Component.Position.BOTTOM.
So the components are sorted in those three zones.
After this the 'relative'-positions like
Component.Position.BEFORE,
Component.Position.AFTER,
are applied.
This sorting always is applied to all components of the same level on the component-tree.
The sorting is done after all configration-files are read. The sorting is important
to set the position of components when extending a form.
Example: - DetailForm -- name: Top -- address: Middel -- firstname: Top -- city: After:address -- email: After:name -- phone: Bottom will be sorted to: - DetailForm -- name -- email -- firstname -- address -- City -- Phone
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.This interface contains all needed to use thePositionBasedSorter. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidsort(Optional<EntityModel> backedModel, Component parent, boolean isUserAdjustmentSort) Deprecated.static <T extends PositionBasedSorter.PositionItem>
Iterable<T> sortSequence(Iterable<T> items, boolean isUserAdjustmentSort) Deprecated.static <V> List<V> unwrap(Iterable<PositionBasedSorter.PositionItem<V>> input, Function<Tuple2<V, List<V>>, V> parentChild) Deprecated.Unwraps a list ofPositionBasedSorter.PositionItems and returns a list of its containing values.
-
Method Details
-
sortSequence
public static <T extends PositionBasedSorter.PositionItem> Iterable<T> sortSequence(Iterable<T> items, boolean isUserAdjustmentSort) Deprecated. -
sort
public static void sort(Optional<EntityModel> backedModel, Component parent, boolean isUserAdjustmentSort) Deprecated. -
unwrap
public static <V> List<V> unwrap(Iterable<PositionBasedSorter.PositionItem<V>> input, Function<Tuple2<V, List<V>>, V> parentChild) Deprecated.Unwraps a list ofPositionBasedSorter.PositionItems and returns a list of its containing values. If it is a nested structure (`getChildren()` returns a non-empty list), it is unwrappsd recursively and the provided function `parentChild` is called with a tuple of the unwrapped value and its children and is exspected to set the children list for the value returning the updated value.
-