org.eclipse.emf.ecp.view.internal.rule
Class RuleRegistry<T extends Rule>

java.lang.Object
  extended by org.eclipse.emf.ecp.view.internal.rule.RuleRegistry<T>
Type Parameters:
T - the actual Rule type

public class RuleRegistry<T extends Rule>
extends Object

Rule registry that maintains which VElements are affected if a setting is changed.

Author:
emueller

Constructor Summary
RuleRegistry()
          Default constructor.
 
Method Summary
 Map<T,VElement> getAffectedRenderables(org.eclipse.emf.ecore.EStructuralFeature feature)
          Returns all rules that would be affected if the value of given feature is changed.
 Set<org.eclipse.emf.ecore.EStructuralFeature> getAttributes()
          Returns the settings of this registry.
 Set<org.eclipse.emf.ecore.EStructuralFeature> register(VElement renderable, T rule, Condition condition, org.eclipse.emf.ecore.EObject domainModel)
          Creates a setting from the given EObject and the LeafCondition and register it with the VElement.
 VElement removeCondition(Condition condition)
          Removes the given condition from the registry.
 VElement removeEFeature(org.eclipse.emf.ecore.EStructuralFeature esf, Condition condition)
          Removes a EStructuralFeature from the mapping.
 void removeRenderable(VElement renderable)
          Removes the given VElement from the registry.
 VElement removeRule(T rule)
          Removes the given rule from the registry.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleRegistry

public RuleRegistry()
Default constructor.

Method Detail

register

public Set<org.eclipse.emf.ecore.EStructuralFeature> register(VElement renderable,
                                                              T rule,
                                                              Condition condition,
                                                              org.eclipse.emf.ecore.EObject domainModel)
Creates a setting from the given EObject and the LeafCondition and register it with the VElement.

Parameters:
renderable - the VElement to be updated in case the condition changes
rule - the parent rule holding the LeafCondition
condition - contains the attribute that the condition is depending on
domainModel - the domain object that owns the attribute possibly being changed
Returns:
the registered EStructuralFeatures

removeRule

public VElement removeRule(T rule)
Removes the given rule from the registry.

Parameters:
rule - the rule to be removed
Returns:
the VElement that belonged to the removed rule

removeRenderable

public void removeRenderable(VElement renderable)
Removes the given VElement from the registry.

Parameters:
renderable - the renderable to be removed

removeCondition

public VElement removeCondition(Condition condition)
Removes the given condition from the registry.

Parameters:
condition - the condition to be removed
Returns:
the VElement that belonged to the removed condition

getAttributes

public Set<org.eclipse.emf.ecore.EStructuralFeature> getAttributes()
Returns the settings of this registry.

Returns:
the settings of this registry.

getAffectedRenderables

public Map<T,VElement> getAffectedRenderables(org.eclipse.emf.ecore.EStructuralFeature feature)
Returns all rules that would be affected if the value of given feature is changed.

Parameters:
feature - the feature
Returns:
a list of VElements that are affected of the feature change

removeEFeature

public VElement removeEFeature(org.eclipse.emf.ecore.EStructuralFeature esf,
                               Condition condition)
Removes a EStructuralFeature from the mapping.

Parameters:
esf - the EStructuralFeature to remove
condition - the container Condition
Returns:
the VElement being cleaned


Copyright © 2014. All Rights Reserved.