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
Author:
Dirk Lemmermann
See Also:
AbstractGanttChart.getPolicyProvider(), LayerContainer.getPolicyProvider(), TreeTable.getPolicyProvider(), Dateline.getPolicyProvider()

Method Summary
 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(java.lang.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(java.lang.Class<T> policyType, T policyImpl)
          Registers a policy implementation for the given policy type (policy interface).
 

Method Detail

setPolicy

<T extends IPolicy> void setPolicy(java.lang.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(java.lang.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