Class LayoutTypeDefinitionRegistry
- java.lang.Object
-
- org.nuxeo.runtime.model.ContributionFragmentRegistry<T>
-
- org.nuxeo.runtime.model.SimpleContributionRegistry<LayoutTypeDefinition>
-
- org.nuxeo.ecm.platform.forms.layout.core.registries.LayoutTypeDefinitionRegistry
-
public class LayoutTypeDefinitionRegistry extends SimpleContributionRegistry<LayoutTypeDefinition>
Regiustry for layoyut type definitions.- Since:
- 6.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nuxeo.runtime.model.ContributionFragmentRegistry
ContributionFragmentRegistry.Fragment<T>, ContributionFragmentRegistry.FragmentList<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected String
category
-
Fields inherited from class org.nuxeo.runtime.model.SimpleContributionRegistry
currentContribs
-
Fields inherited from class org.nuxeo.runtime.model.ContributionFragmentRegistry
contribs
-
-
Constructor Summary
Constructors Constructor Description LayoutTypeDefinitionRegistry(String category)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContribution(LayoutTypeDefinition contrib)
Add a new contribution.String
getCategory()
String
getContributionId(LayoutTypeDefinition contrib)
Returns the contribution ID given the contribution objectLayoutTypeDefinition
getDefinition(String id)
List<LayoutTypeDefinition>
getDefinitions()
void
removeContribution(LayoutTypeDefinition contrib)
Overridden to use equals method when removing elements.void
removeContribution(LayoutTypeDefinition contrib, boolean useEqualsMethod)
Remove a contribution.-
Methods inherited from class org.nuxeo.runtime.model.SimpleContributionRegistry
clone, contributionRemoved, contributionUpdated, getCurrentContribution, isSupportingMerge, merge
-
Methods inherited from class org.nuxeo.runtime.model.ContributionFragmentRegistry
addFragment, getContribution, getFragments, removeFragment, toMap
-
-
-
-
Field Detail
-
category
protected final String category
-
-
Constructor Detail
-
LayoutTypeDefinitionRegistry
public LayoutTypeDefinitionRegistry(String category)
-
-
Method Detail
-
getCategory
public String getCategory()
-
getContributionId
public String getContributionId(LayoutTypeDefinition contrib)
Description copied from class:ContributionFragmentRegistry
Returns the contribution ID given the contribution object- Specified by:
getContributionId
in classContributionFragmentRegistry<LayoutTypeDefinition>
-
getDefinitions
public List<LayoutTypeDefinition> getDefinitions()
-
getDefinition
public LayoutTypeDefinition getDefinition(String id)
-
addContribution
public void addContribution(LayoutTypeDefinition contrib)
Description copied from class:ContributionFragmentRegistry
Add a new contribution. This will start install the new contribution and will notify the implementation about the value to add. (the final value to add may not be the same object as the one added - but a merge between multiple contributions)- Overrides:
addContribution
in classContributionFragmentRegistry<LayoutTypeDefinition>
-
removeContribution
public void removeContribution(LayoutTypeDefinition contrib)
Overridden to use equals method when removing elements.- Overrides:
removeContribution
in classContributionFragmentRegistry<LayoutTypeDefinition>
- Since:
- 7.2
- See Also:
ContributionFragmentRegistry.removeContribution(Object, boolean)
-
removeContribution
public void removeContribution(LayoutTypeDefinition contrib, boolean useEqualsMethod)
Description copied from class:ContributionFragmentRegistry
Remove a contribution. This will uninstall the contribution and notify the implementation about the new value it should store (after re-merging contribution fragments).Equality can be controlled from here.
Contributions come from the runtime that keeps exact instances, so using equality usually makes it possible to remove the exact instance that was contributed by this component (without needing to reference the component name for instance). But when unit-testing, or when registrating contributions that do not come directly from the runtime, regirties need to use the equals method defined on each contribution.
- Overrides:
removeContribution
in classContributionFragmentRegistry<LayoutTypeDefinition>
- Parameters:
contrib
- the contrib to removeuseEqualsMethod
- a boolean stating that old contributions should be checked using the equals method instead of
-
-