org.openxava.annotations
Annotation Type Tree


@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface Tree

With @Tree you can instruct OpenXava to visualize collections as a tree instead of a list.

Applies to collections. Example:

  @OneToMany(mappedBy="parentContainer", cascade = CascadeType.REMOVE)
  @Editor("TreeView")
  @ListProperties("description")
  @OrderBy("path, treeOrder")
  private Collection treeItems;
 

Author:
Federico Alcantara

Optional Element Summary
 java.lang.String forViews
          List of comma separated view names where this annotation applies.
 java.lang.String idProperties
          Optional.
 java.lang.String idSeparator
          Optional.
 boolean initialExpandedState
          Optional.
 java.lang.String notForViews
          List of comma separated view names where this annotation does not apply.
 int orderIncrement
          Optional.
 java.lang.String pathProperty
          Optional.
 java.lang.String pathSeparator
          Optional.
 

forViews

public abstract 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

public abstract 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:
""

pathProperty

public abstract java.lang.String pathProperty
Optional. Defaults to path. Property used for the path, must be a String type with a size appropriate to the task at hand.

Returns:
property name
Default:
"path"

idProperties

public abstract java.lang.String idProperties
Optional. 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.

Returns:
node property name.
Default:
""

idSeparator

public abstract java.lang.String idSeparator
Optional. String to be used to separate multiple Id elements.

Default:
","

initialExpandedState

public abstract boolean initialExpandedState
Optional. Indicates how to render the tree when the expandedPropertyName is not defined. It's default value is true.

Returns:
expanded state.
Default:
true

orderIncrement

public abstract int orderIncrement
Optional. Defines the increment used for the keys when orderProperty is used The default value is 2. The minimum is 2.

Returns:
order increment.
Default:
2

pathSeparator

public abstract java.lang.String pathSeparator
Optional. Defines the separator for the path elements. Default value is /

Returns:
path separator character.
Default:
"/"