com.dlsc.flexgantt.policy

## Interface IPolicyProvider

- All Known Implementing Classes:
    PolicyProvider

      public interface IPolicyProvider

  A policy provider supplies the component (e.g. a tree table or a timeline) that it is attached to with policy implementations. These implementations can be registered with the provider. They can be looked up based on the policy interface.
  Since:
    1.0
  Version:
    $Revision: 1.12 $
  Author:
    Dirk Lemmermann
  See Also:
    `AbstractGanttChart.getPolicyProvider()`, `LayerContainer.getPolicyProvider()`, `TreeTable.getPolicyProvider()`, `Dateline.getPolicyProvider()`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPolicyProviderListener(IPolicyProviderListener l)` Adds a listener to the policy provider that will be informed about changes to the provider.
    `<T extends IPolicy> T` | `getPolicy(Class<T> policyType)` Returns a policy implementation for the given policy type (policy interface).
    `void` | `removePolicyProviderListener(IPolicyProviderListener l)` Removes a listener from the policy provider.
    `<T extends IPolicy> void` | `setPolicy(Class<T> policyType, T policyImpl)` Registers a policy implementation for the given policy type (policy interface).

- - ### Method Detail

    - #### setPolicy

          <T extends IPolicy> void setPolicy(Class<T> policyType,
                                             T policyImpl)

      Registers a policy implementation for the given policy type (policy interface).
      Type Parameters:
        `T` - the policy type
      Parameters:
        `policyType` - the policy interface class (e.g. `INodeEditPolicy`)
        `policyImpl` - the policy implementation (e.g. `DefaultNodeEditPolicy`)
      Since:
        1.0
      See Also:
        `getPolicy(Class)`

    - #### getPolicy

          <T extends IPolicy> T getPolicy(Class<T> policyType)

      Returns a policy implementation for the given policy type (policy interface).
      Type Parameters:
        `T` - the policy type
      Parameters:
        `policyType` - the policy interface class (e.g. `INodeEditPolicy`)
      Returns:
        a policy implementation (e.g. `DefaultNodeEditPolicy`)
      Since:
        1.0
      See Also:
        `setPolicy(Class, IPolicy)`

    - #### addPolicyProviderListener

          void addPolicyProviderListener(IPolicyProviderListener l)

      Adds a listener to the policy provider that will be informed about changes to the provider.
      Parameters:
        `l` - the added policy provider listener
      Since:
        1.0

    - #### removePolicyProviderListener

          void removePolicyProviderListener(IPolicyProviderListener l)

      Removes a listener from the policy provider.
      Parameters:
        `l` - the removed policy provider listener
      Since:
        1.0

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.