oracle.adf.view.rich.model

## Class RegionModel

- java.lang.Object
- - oracle.adf.view.rich.model.RegionModel

- Direct Known Subclasses:
    RemoteRegionModel

      public abstract class RegionModel
      extends Object

  Model for the Region component.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `RegionModel.RegionAction` Metadata constants for available actions

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `REMOTE_REGION_ATTRIB` A constant represening an Attribute on the view root which contains a Set of RemoteRegion client ids

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RegionModel()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addRegionClientId(String clientId, boolean isNew)` Called whenever a clientId is added to the RegionComponentClientId set.
    `List<? extends RegionModel.RegionAction>` | `getActions()` Returns the unmodifiable List of valid RegionActions for the current state of the Region, in display order.
    `Set<String>` | `getCapabilities()` Returns the unmodifiable Set of outcomes for the current state of the RegionModel The list of available capabilities is implementation specific.
    `Set<String>` | `getRegionComponentClientIds()` Retrieves the Set of component client IDs of region components that are associated with this RegionModel.
    `protected RegionModelListener` | `getRegionModelListener()` Provides RegionModelListener listener used by this model
    `DirtyPageHandler.UncommittedDataWarning` | `getUncommittedDataWarning()` Returns a default value for the Uncommitted Data Warning configuration option
    `Serializable` | `getViewHandle(javax.faces.context.FacesContext context)` Returns a unique identifier for the RegionModel's current component tree.
    `abstract String` | `getViewId(javax.faces.context.FacesContext context)` Gets the viewId of the region's content.
    `protected boolean` | `isComponentPresent(javax.faces.context.FacesContext context, String clientId)` Returns true if the component is part of a view tree or will be created during render.
    `boolean` | `isDataDirty()` Called during the RenderResponse phase to determine whether the region model contains uncommitted data.
    `boolean` | `isRemoteConsumerModel()` Test if the model is bound to a remote region (consumer)
    `boolean` | `isRemoteProducerModel()` Test if the model is bound to a remote region (producer)
    `void` | `markRegionDirty()` If a region component client ID gets associated with this RegionModel instance then this method will mark that component as needing to be redrawn.
    `void` | `processBeginRegion(javax.faces.context.FacesContext context)` Deprecated.
    `void` | `processBeginRegion(javax.faces.context.FacesContext context, RegionSite regionSite)` Called just before rendering the region's content.
    `void` | `processEndRegion(javax.faces.context.FacesContext context)` Deprecated.
    `void` | `processEndRegion(javax.faces.context.FacesContext context, RegionSite regionSite)` Called just after rendering the region's content.
    `void` | `refresh(javax.faces.context.FacesContext context)` Clears out any cached content held by this model.
    `void` | `release(javax.faces.context.FacesContext context)` Called to notify the RegionModel that it will no longer be used and that it may release any resources it is holding.
    `protected void` | `removeRegionClientId(String clientId)` Called whenever a clientId is removed from the RegionComponentClientId set.
    `void` | `setRegionModelListener(RegionModelListener listener)` Sets RegionModelListener instance for this model

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### REMOTE_REGION_ATTRIB

          public static final String REMOTE_REGION_ATTRIB

      A constant represening an Attribute on the view root which contains a Set of RemoteRegion client ids
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RegionModel

          public RegionModel()

  - ### Method Detail

    - #### isDataDirty

          public boolean isDataDirty()

      Called during the RenderResponse phase to determine whether the region model contains uncommitted data. If there is uncommitted data then calling release() on the RegionModel will result in a loss of data. By default this method returns false.
      Returns:
        `true` if the current RegionModel contains uncommitted data.

    - #### getUncommittedDataWarning

          public DirtyPageHandler.UncommittedDataWarning getUncommittedDataWarning()

      Returns a default value for the Uncommitted Data Warning configuration option
      Returns:
        configuration option

    - #### setRegionModelListener

          public void setRegionModelListener(RegionModelListener listener)

      Sets RegionModelListener instance for this model
      Parameters:
        `listener` - - RegionModelListener instance, which may be null

    - #### getRegionModelListener

          protected RegionModelListener getRegionModelListener()

      Provides RegionModelListener listener used by this model
      Returns:
        RegionModelListener instance, whcih may be null

    - #### isRemoteConsumerModel

          public boolean isRemoteConsumerModel()

      Test if the model is bound to a remote region (consumer)
      Returns:
        true is the model is bound to remote region consumer

    - #### isRemoteProducerModel

          public boolean isRemoteProducerModel()

      Test if the model is bound to a remote region (producer)
      Returns:
        true is the model is bound to remote region producer

    - #### processBeginRegion

          @Deprecated
          public void processBeginRegion(javax.faces.context.FacesContext context)

      Deprecated.
      Called just before rendering the region's content. This method has been deprecated and the default implementation now throws a UnsupportedOperationException. Implementors should override processBeginRegion(FacesContext, RegionSite) instead.
      Parameters:
        `context` - the FacesContext
      Throws:
        `IllegalStateException` - if the RegionModel currently has processBeginRegion called on it.
      See Also:
        `processBeginRegion(FacesContext, RegionSite)`

    - #### processBeginRegion

          public void processBeginRegion(javax.faces.context.FacesContext context,
                                         RegionSite regionSite)

      Called just before rendering the region's content. For backwards compatibility the default implementation calls the deprecated method (of the same name). It's recommended that model implementors override this method.
      Parameters:
        `context` - the FacesContext
        `regionSite` - the RegionSite, providing access to site-specific information and services. The RegionSite is only valid between processBeginRegion and processEndRegion.
      Throws:
        `IllegalStateException` - if the RegionModel currently has processBeginRegion called on it.

    - #### processEndRegion

          @Deprecated
          public void processEndRegion(javax.faces.context.FacesContext context)

      Deprecated.
      Called just after rendering the region's content. This method has been deprecated and the default implementation now throws a UnsupportedOperationException. Implementors should override processEndRegion(FacesContext, RegionSite) instead.
      Parameters:
        `context` - the FacesContext
      Throws:
        `IllegalStateException` - if the RegionModel does not currently has processBeginRegion called on it.
      See Also:
        `processEndRegion(FacesContext, RegionSite)`

    - #### processEndRegion

          public void processEndRegion(javax.faces.context.FacesContext context,
                                       RegionSite regionSite)

      Called just after rendering the region's content. For backwards compatibility the default implementation calls the deprecated method (of the same name). It's recommended that model implementors override this method.
      Parameters:
        `context` - the FacesContext
        `regionSite` - the RegionSite, providing access to site-specific information and services. The RegionSite is only valid between processBeginRegion and processEndRegion. This instance is identical to the instance passed to `RegionModel.processBeginRegion` and is passed here as a convenience to the RegionModel.
      Throws:
        `IllegalStateException` - if the RegionModel does not currently have processBeginRegion called on it.
      See Also:
        `processBeginRegion(FacesContext, RegionSite)`

    - #### refresh

          public void refresh(javax.faces.context.FacesContext context)

      Clears out any cached content held by this model. The next time the region component renders, this model will recompute everything and possibly return new viewIds.

      This method should not be called directly. Instead `UIXRegion.refresh(javax.faces.context.FacesContext)` may be called.

      Parameters:
        `context` - the faces context

    - #### release

          public void release(javax.faces.context.FacesContext context)

      Called to notify the RegionModel that it will no longer be used and that it may release any resources it is holding. Note: Calling this method does not necessarily indicate the end of the RegionModel's lifespan. Subsequent calls to processBeginRegion() should result in the RegionModel reinitializing itself into its initial state.
      Parameters:
        `context` - the FacesContext.

    - #### getCapabilities

          public Set<String> getCapabilities()

      Returns the unmodifiable Set of outcomes for the current state of the RegionModel The list of available capabilities is implementation specific. Each capability is a String. Examples of capabilities include: "edit" - if the region is capable of allowing the user to edit it, "help" - if the region provides a help page to the user. "print" - if the region is capable of providing a printable-page of itself.

      Capabilities are typically used by a region's container component, which paints the chrome around the region; depending on the region's capabilities, the container may show different icons.

      This implementation returns an empty Set.

      Returns:
        the set of capabilities for this RegionModel
      See Also:
        `getActions()`

    - #### getActions

          public List<? extends RegionModel.RegionAction> getActions()

      Returns the unmodifiable List of valid RegionActions for the current state of the Region, in display order. There should be a corresponding RegionAction outcome for every outcome returned by `getCapabilities`.
      Returns:
        The List of valid RegionActions or an empty List if no RegionActiosn are available for the current Region state.
      See Also:
        `getCapabilities()`

    - #### getViewHandle

          public Serializable getViewHandle(javax.faces.context.FacesContext context)

      Returns a unique identifier for the RegionModel's current component tree. This is more specific than the viewId, which identifies the current fragment, as in some cases the application may need to navigate between two different component trees sharing the same viewId. The viewHandle must be both Serializable and immutable with respect to `equals` and `hashCode`. For backwards compatibility, the default implementation returns the viewId, however RegionModel implementations that support the same viewId creating different component trees, must override this method to return an identifier per component tree.
      Parameters:
        `context` - the faces context
      Returns:
        a Serializable object representing the viewHandle.
      See Also:
        `getViewId(javax.faces.context.FacesContext)`

    - #### getViewId

          public abstract String getViewId(javax.faces.context.FacesContext context)

      Gets the viewId of the region's content. `processBeginRegion(javax.faces.context.FacesContext)` must be called before this method is called.
      Parameters:
        `context` - the FacesContext
      Returns:
        the viewId of the region's content

    - #### markRegionDirty

          public void markRegionDirty()

      If a region component client ID gets associated with this RegionModel instance then this method will mark that component as needing to be redrawn.

      If the the client ID does not match with any component reachable from the view root of the FacesContext, then it will not be markd for redraw and may be disassociated with this model.

    - #### getRegionComponentClientIds

          public Set<String> getRegionComponentClientIds()

      Retrieves the Set of component client IDs of region components that are associated with this RegionModel.

      These client IDs will be used to help mark components as needing to be redrawn if this RegionModel instance is marked as dirty.

      Returns:
        the set of component client IDs that are associated with this model

    - #### isComponentPresent

          protected boolean isComponentPresent(javax.faces.context.FacesContext context,
                                               String clientId)

      Returns true if the component is part of a view tree or will be created during render. This API can be used in scenarios where controller/model wants to check the component before refreshing or initializing the binding cotainer hierarchy. In usecases like childCreation attribute defers creation of child components and the model and controller need not initialize itself. By going through the region component's hierarchy we will check all toggle components for usecases where the component may get created duinrg render response This method should be called only after INVOKE_APPLICATION JSF phase.
      Parameters:
        `context` - - Current FacesContext instance.
        `clientId` - - clientId of the component that needs to be checked
      Returns:
        true if the component exists or will be created during renderResponse.

    - #### addRegionClientId

          protected void addRegionClientId(String clientId,
                                           boolean isNew)

      Called whenever a clientId is added to the RegionComponentClientId set. This method is called regardless of whether the item is new or not. This is because sometimes the cache on the model may be out of date, and "add" logic might need to be performed regardless of whether the cache is up to date or not. The isNew parameter will allow the implementation to decide which logic to run and when.

      By default this method ensures that the client ID does NOT appear in the list of RemoteRegions. For RemoteRegion functionality, ADFFaces needs to maintain a set of clientId's that are remote. This version of the method ensures the region DOES NOT appear in this list.

      Parameters:
        `clientId` - the Client Id
        `isNew` - if this is a new component. This is not used.

    - #### removeRegionClientId

          protected void removeRegionClientId(String clientId)

      Called whenever a clientId is removed from the RegionComponentClientId set. This method will only be run if a clientId was actually removed .
      Parameters:
        `clientId` - the client id.

Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.