Class WidgetDefinitionRegistry
- java.lang.Object
-
- org.nuxeo.runtime.model.ContributionFragmentRegistry<T>
-
- org.nuxeo.runtime.model.SimpleContributionRegistry<WidgetDefinition>
-
- org.nuxeo.ecm.platform.forms.layout.core.registries.WidgetDefinitionRegistry
-
public class WidgetDefinitionRegistry extends SimpleContributionRegistry<WidgetDefinition>
Registry holding widget definitions (global widgets) for a given category- Since:
- 5.5
-
-
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 WidgetDefinitionRegistry(String category)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContribution(WidgetDefinition contrib)
Add a new contribution.String
getCategory()
String
getContributionId(WidgetDefinition contrib)
Returns the contribution ID given the contribution objectWidgetDefinition
getWidgetDefinition(String id)
void
removeContribution(WidgetDefinition contrib)
Overridden to use equals method when removing elements.void
removeContribution(WidgetDefinition 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
-
WidgetDefinitionRegistry
public WidgetDefinitionRegistry(String category)
-
-
Method Detail
-
getCategory
public String getCategory()
-
getContributionId
public String getContributionId(WidgetDefinition contrib)
Description copied from class:ContributionFragmentRegistry
Returns the contribution ID given the contribution object- Specified by:
getContributionId
in classContributionFragmentRegistry<WidgetDefinition>
-
getWidgetDefinition
public WidgetDefinition getWidgetDefinition(String id)
-
addContribution
public void addContribution(WidgetDefinition 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<WidgetDefinition>
-
removeContribution
public void removeContribution(WidgetDefinition contrib)
Overridden to use equals method when removing elements.- Overrides:
removeContribution
in classContributionFragmentRegistry<WidgetDefinition>
- Since:
- 7.2
- See Also:
ContributionFragmentRegistry.removeContribution(Object, boolean)
-
removeContribution
public void removeContribution(WidgetDefinition 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<WidgetDefinition>
- Parameters:
contrib
- the contrib to removeuseEqualsMethod
- a boolean stating that old contributions should be checked using the equals method instead of
-
-