public class WidgetTypeDefinitionRegistry extends SimpleContributionRegistry<WidgetTypeDefinition>
ContributionFragmentRegistry.Fragment<T>, ContributionFragmentRegistry.FragmentList<T>
Modifier and Type | Field and Description |
---|---|
protected String |
category |
currentContribs
contribs
Constructor and Description |
---|
WidgetTypeDefinitionRegistry(String category) |
Modifier and Type | Method and Description |
---|---|
void |
addContribution(WidgetTypeDefinition contrib)
Add a new contribution.
|
String |
getCategory() |
String |
getContributionId(WidgetTypeDefinition contrib)
Returns the contribution ID given the contribution object
|
WidgetTypeDefinition |
getDefinition(String id) |
List<WidgetTypeDefinition> |
getDefinitions() |
void |
removeContribution(WidgetTypeDefinition contrib)
Overridden to use equals method when removing elements.
|
void |
removeContribution(WidgetTypeDefinition contrib,
boolean useEqualsMethod)
Remove a contribution.
|
clone, contributionRemoved, contributionUpdated, getCurrentContribution, isSupportingMerge, merge
addFragment, getContribution, getFragments, removeFragment
public WidgetTypeDefinitionRegistry(String category)
public String getCategory()
public String getContributionId(WidgetTypeDefinition contrib)
ContributionFragmentRegistry
getContributionId
in class ContributionFragmentRegistry<WidgetTypeDefinition>
public List<WidgetTypeDefinition> getDefinitions()
public WidgetTypeDefinition getDefinition(String id)
public void addContribution(WidgetTypeDefinition contrib)
ContributionFragmentRegistry
addContribution
in class ContributionFragmentRegistry<WidgetTypeDefinition>
public void removeContribution(WidgetTypeDefinition contrib)
removeContribution
in class ContributionFragmentRegistry<WidgetTypeDefinition>
ContributionFragmentRegistry.removeContribution(Object, boolean)
public void removeContribution(WidgetTypeDefinition contrib, boolean useEqualsMethod)
ContributionFragmentRegistry
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.
removeContribution
in class ContributionFragmentRegistry<WidgetTypeDefinition>
contrib
- the contrib to removeuseEqualsMethod
- a boolean stating that old contributions should be checked using the equals method instead
ofCopyright © 2015 Nuxeo SA. All rights reserved.