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 void
dispose()
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)
VElement
removeCondition(Condition condition)
Removes the given condition from the registry.void
removeRenderable(VElement renderable)
Removes the givenVElement
from the registry.VElement
removeRule(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 theRuleService
using 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
- theVElement
to be updated in case the condition changesrule
- the parent rule holding theCondition
condition
- 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
VElement
that belonged to the removed rule
-
removeRenderable
public void removeRenderable(VElement renderable)
Removes the givenVElement
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
-
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
VElement
s that are affected of the setting change
-
dispose
public void dispose()
Disposes thisRuleRegistry
.
-
-