Class RuleRegistry<T extends Rule>
- java.lang.Object
-
- org.eclipse.emf.ecp.view.internal.rule.RuleRegistry<T>
-
-
Constructor Summary
Constructors Constructor Description RuleRegistry(ViewModelContext context)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Disposes thisRuleRegistry.java.util.Map<T,VElement>getAffectedRenderables(UniqueSetting setting)Returns all rules that would be affected if the value of given setting is changed.java.util.Set<UniqueSetting>getSettings()Returns the settings of this registry.java.util.Set<UniqueSetting>register(VElement renderable, T rule, Condition condition, org.eclipse.emf.ecore.EObject domainModel)VElementremoveCondition(Condition condition)Removes the given condition from the registry.voidremoveRenderable(VElement renderable)Removes the givenVElementfrom the registry.VElementremoveRule(T rule)Removes the given rule from the registry.
-
-
-
Constructor Detail
-
RuleRegistry
public RuleRegistry(ViewModelContext context)
Default constructor.- Parameters:
context- the view model context of theRuleServiceusing this registry
-
-
Method Detail
-
register
public java.util.Set<UniqueSetting> register(VElement renderable, T rule, Condition condition, org.eclipse.emf.ecore.EObject domainModel)
- Parameters:
renderable- theVElementto be updated in case the condition changesrule- the parent rule holding theConditioncondition- contains the attribute that the condition is depending ondomainModel- the domain object that owns the attribute possibly being changed- Returns:
- the registered
UniqueSettings
-
removeRule
public VElement removeRule(T rule)
Removes the given rule from the registry.- Parameters:
rule- the rule to be removed- Returns:
- the
VElementthat belonged to the removed rule
-
removeRenderable
public void removeRenderable(VElement renderable)
Removes the givenVElementfrom 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
VElementthat belonged to the removed condition
-
getSettings
public java.util.Set<UniqueSetting> getSettings()
Returns the settings of this registry.- Returns:
- the settings of this registry.
-
getAffectedRenderables
public java.util.Map<T,VElement> getAffectedRenderables(UniqueSetting setting)
Returns all rules that would be affected if the value of given setting is changed.- Parameters:
setting- the setting- Returns:
- a list of
VElements that are affected of the setting change
-
dispose
public void dispose()
Disposes thisRuleRegistry.
-
-