Package com.orchestranetworks.ui.form.widget

# Interface WidgetDisplayContext

public interface WidgetDisplayContext
Context of a custom widget, containing values and information about the context in which the widget is called.

This context is provided by the user interface container.

Since:
  5.8.0
See Also:
  - `UICustomWidget`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `displayOccurrence(Object aValue, boolean useLabels)`
  Returns a string to display the specified value according to the current locale of this context.
  `Perspective`
  `getCurrentPerspective()`
  Returns the current perspective.
  `UICustomViewContext`
  `getCustomViewContext()`
  Returns the view context.
  `com.orchestranetworks.hierarchy.Member`
  `getHierarchyMember()`
  Returns the current hierarchy member if the current `UIBeanEditor` is instantiated in the context of a hierarchy.
  `HierarchyNode`
  `getHierarchyNode()`
  Deprecated.
  Replaced by `getHierarchyMember()`.
  `SchemaNode`
  `getNode()`
  Returns the node to which the component is attached, as specified in the data model.
  `String`
  `getOptionalRequestParameterValue(String aParameterName)`
  Returns the HTTP parameter value in the incoming request.
  `String[]`
  `getOptionalRequestParameterValues(String aParameterName)`
  Returns the HTTP parameter values in the incoming request.
  `AccessPermission`
  `getPermission()`
  Returns the current user's access rights on the current node.
  `AccessPermission`
  `getPermission(Path aPath)`
  Returns the current user's access rights on the node specified by a path.
  `ValueContext`
  `getValueContext()`
  Returns the value context of the current element.
  `ValueContext`
  `getValueContext(Path aPath)`
  Returns the value context of the target element.
  `boolean`
  `isCreatingRecord()`
  Returns `true` if this component is displayed in the context of a new record creation.
  `boolean`
  `isDisplayedInForm()`
  Returns true if this widget is currently displayed in a form.
  `boolean`
  `isDisplayedInTable()`
  Returns true if this widget is currently displayed in a table grid cell.
  `boolean`
  `isDuplicatingRecord()`
  Returns `true` if this component is displayed in the context of the duplication of an existing record.
  `boolean`
  `isInherited()`
  Returns true if the displayed value is inherited.

- ## Method Details

  - ### getNode

    SchemaNode getNode()
    Returns the node to which the component is attached, as specified in the data model.
    See Also:
      - `ValueContext.getNode()`

  - ### getValueContext

    ValueContext getValueContext()
    Returns the value context of the current element.

  - ### getValueContext

    ValueContext getValueContext(Path aPath)
    Returns the value context of the target element.

  - ### displayOccurrence

    String displayOccurrence(Object aValue, boolean useLabels)
    Returns a string to display the specified value according to the current locale of this context.

    The specified value must be related to the current node.

    See Also:
      - `SchemaNode.displayOccurrence(Object, boolean, ValueContext, Locale)`

  - ### getOptionalRequestParameterValue

    String getOptionalRequestParameterValue(String aParameterName)
    Returns the HTTP parameter value in the incoming request.

  - ### getOptionalRequestParameterValues

    String[] getOptionalRequestParameterValues(String aParameterName)
    Returns the HTTP parameter values in the incoming request.

  - ### isDisplayedInForm

    boolean isDisplayedInForm()
    Returns true if this widget is currently displayed in a form.

  - ### isDisplayedInTable

    boolean isDisplayedInTable()
    Returns true if this widget is currently displayed in a table grid cell.

  - ### getPermission

    AccessPermission getPermission()
    Returns the current user's access rights on the current node.

  - ### getPermission

    AccessPermission getPermission(Path aPath)
    Returns the current user's access rights on the node specified by a path.
    Parameters:
      `aPath` - the path of the node. The path must be relative to the path of the current widget.
    Throws:
      `PathAccessException` - to report that the path is invalid.
    See Also:
      - `SessionPermissions.getNodeAccessPermissionForForm(SchemaNode, Adaptation)`

  - ### isCreatingRecord

    boolean isCreatingRecord()
    Returns `true` if this component is displayed in the context of a new record creation. In this case, the persistent record does not yet exist.

  - ### isDuplicatingRecord

    boolean isDuplicatingRecord()
    Returns `true` if this component is displayed in the context of the duplication of an existing record. In this case, the target persistent record does not yet exist.

  - ### getHierarchyMember

    com.orchestranetworks.hierarchy.Member getHierarchyMember()
    Returns the current hierarchy member if the current `UIBeanEditor` is instantiated in the context of a hierarchy. Returns `null` otherwise.

    This method allows specializing the look and feel of the user interface for hierarchy contexts.

  - ### getHierarchyNode

    @Deprecated HierarchyNode getHierarchyNode()
    Deprecated.
    Replaced by `getHierarchyMember()`.

  - ### getCurrentPerspective

    Perspective getCurrentPerspective()
    Returns the current perspective.
    Since:
      6.0.0

  - ### getCustomViewContext

    UICustomViewContext getCustomViewContext()
    Returns the view context.
    Since:
      6.1.0

  - ### isInherited

    boolean isInherited()
    Returns true if the displayed value is inherited.
    Since:
      6.2.1