Package org.openxava.annotations
Annotation Type Tree
-
@Repeatable(Trees.class) @Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface Tree
With@Treeyou can instruct OpenXava to visualize collections as a tree instead of a list.Applies to @OneToMany/@ManyToMany collections. Example:
@OneToMany(mappedBy="parentContainer", cascade = CascadeType.REMOVE) @Tree // In versions previous to v7.5 use @Editor("TreeView") too @ListProperties("description") @OrderBy("path, treeOrder") private CollectiontreeItems;
The full syntax for @Tree is @Tree(forViews="", notForViews="", pathProperty="path", idProperties="", idSeparator=",", initialExpandedState=true, orderIncrement=2, pathSeparator="/", allowMoveNodes=true).- forViews. Indicates in which views the tree behavior is going to be applied.
- notForViews. Views which are excluded from the tree renderization.
- pathProperty. Indicates the property to be used as the path, by default points to "path". You can customize this property if the entity path reference is persisted in a property with another name.
- idProperties. The tree implementation needs a unique identification for each of the elements displayed. By default the tree implementation use the properties annotated with @Id, but you can define which properties the tree must use as the unique identifier. The defined properties are comma separated.
- initialExpandedState. If true the tree is rendered with all nodes expanded.
- orderIncrement. If you define a orderBy and the orderBy is an integer type, the Tree implementation uses this field to allow reordering of the tree elements, by default the increment value is 2 and is the minimum allowed. This value allow easy reordering of elements.
- pathSeparator. If you use a separator for your path different than the default "/". Then you can set this property to the value that you are using.
- allowMoveNodes. If false the user cannot move nodes in the tree. By default is true.
- Author:
- Federico Alcantara
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanallowMoveNodesIndicates whether the user can move nodes in the tree.java.lang.StringforViewsList of comma separated view names where this annotation applies.java.lang.StringidPropertiesComma separated list of properties used for identifying the tree node.java.lang.StringidSeparatorString to be used to separate multiple Id elements.booleaninitialExpandedStateIndicates how to render the tree when the expandedPropertyName is not defined.java.lang.StringnotForViewsList of comma separated view names where this annotation does not apply.intorderIncrementDeprecated.since OpenXava 7.2java.lang.StringpathPropertyProperty used for the path, must be a String type with a size appropriate to the task at hand.java.lang.StringpathSeparatorDefines the separator for the path elements.
-
-
-
Element Detail
-
forViews
java.lang.String forViews
List of comma separated view names where this annotation applies.Exclusive with notForViews.
If both forViews and notForViews are omitted then this annotation apply to all views.
You can use the string "DEFAULT" for referencing to the default view (the view with no name).- Default:
- ""
-
-
-
notForViews
java.lang.String notForViews
List of comma separated view names where this annotation does not apply.Exclusive with forViews.
If both forViews and notForViews are omitted then this annotation apply to all views.
You can use the string "DEFAULT" for referencing to the default view (the view with no name).- Default:
- ""
-
-
-
idProperties
java.lang.String idProperties
Comma separated list of properties used for identifying the tree node. By default the id of the entity is used. If more than one property is used, their values will be nodeIdSeparator separated and enclosed in brackets. Optional.- Returns:
- node property name.
- Default:
- ""
-
-