Package org.eclipse.emf.compare.rcp.ui.internal.structuremergeviewer.groups.impl

# Class DifferenceGroupRegistryImpl

java.lang.Object
org.eclipse.emf.compare.rcp.ui.internal.structuremergeviewer.groups.impl.DifferenceGroupRegistryImpl

All Implemented Interfaces:
  `IDifferenceGroupProvider.Descriptor.Registry`

public class DifferenceGroupRegistryImpl extends Object implements IDifferenceGroupProvider.Descriptor.Registry
Implementation of the `IDifferenceGroupProvider.Descriptor.Registry`. This implementation allow user to override ranking of each group using preferences.

Since:
  4.0

## Constructor Summary

Constructors
Constructor
Description
`DifferenceGroupRegistryImpl(DifferenceGroupManager groupManager, IItemRegistry<IDifferenceGroupProvider.Descriptor> registry)`
Constructs the registry.

## Method Summary

Modifier and Type
Method
Description
`IDifferenceGroupProvider.Descriptor`
`add(IDifferenceGroupProvider.Descriptor providerDescriptor, String className)`
Add to the registry the given `IDifferenceGroupProvider`.
`void`
`clear()`
Clear the registry.
`IDifferenceGroupProvider.Descriptor`
`getDefaultGroupProvider(IComparisonScope scope, Comparison comparison)`
Returns the default group provider.
`List<IDifferenceGroupProvider.Descriptor>`
`getGroupProviders(IComparisonScope scope, Comparison comparison)`
Returns the list of `IDifferenceGroupProvider` contained in the registry.
`IDifferenceGroupProvider.Descriptor`
`remove(String className)`
Remove from the registry the `IDifferenceGroupProvider` designated by the given `String` .

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DifferenceGroupRegistryImpl

public DifferenceGroupRegistryImpl(DifferenceGroupManager groupManager, IItemRegistry<IDifferenceGroupProvider.Descriptor> registry)
Constructs the registry.

Parameters:
  `groupManager` - `DifferenceGroupManager` use to handle groups.
  `registry` - Item registry where are stored all registered group.

## Method Details

### getGroupProviders

public List<IDifferenceGroupProvider.Descriptor> getGroupProviders(IComparisonScope scope, Comparison comparison)
Returns the list of `IDifferenceGroupProvider` contained in the registry.

Specified by:
  `getGroupProviders` in interface `IDifferenceGroupProvider.Descriptor.Registry`
Parameters:
  `scope` - The scope on which the group providers will be applied.
  `comparison` - The comparison which is to be displayed in the structural view.
Returns:
  The list of `IDifferenceGroupProvider` contained in the registry.
See Also:
  - `IDifferenceGroupProvider.Descriptor.Registry.getGroupProviders(IComparisonScope, Comparison)`

### getDefaultGroupProvider

public IDifferenceGroupProvider.Descriptor getDefaultGroupProvider(IComparisonScope scope, Comparison comparison)
Returns the default group provider.

Specified by:
  `getDefaultGroupProvider` in interface `IDifferenceGroupProvider.Descriptor.Registry`
Parameters:
  `scope` - The scope on which the group providers will be applied.
  `comparison` - The comparison which is to be displayed in the structural view.
Returns:
  the default group provider or null if none.
See Also:
  - `IDifferenceGroupProvider.Descriptor.Registry.getDefaultGroupProvider(org.eclipse.emf.compare.scope.IComparisonScope, org.eclipse.emf.compare.Comparison)`

### add

public IDifferenceGroupProvider.Descriptor add(IDifferenceGroupProvider.Descriptor providerDescriptor, String className)
Add to the registry the given `IDifferenceGroupProvider`.

Specified by:
  `add` in interface `IDifferenceGroupProvider.Descriptor.Registry`
Parameters:
  `providerDescriptor` - The given `IDifferenceGroupProvider`.
  `className` - The class name of the given provider.
Returns:
  The previous value associated with the class name of the given `IDifferenceGroupProvider`, or null if there was no entry in the registry for the class name.
See Also:
  - `(org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider.Descriptor)`

### remove

public IDifferenceGroupProvider.Descriptor remove(String className)
Remove from the registry the `IDifferenceGroupProvider` designated by the given `String` .

Specified by:
  `remove` in interface `IDifferenceGroupProvider.Descriptor.Registry`
Parameters:
  `className` - The given `String` representing a `IDifferenceGroupProvider`.
Returns:
  The `IDifferenceGroupProvider` designated by the given `String`.
See Also:
  - `IDifferenceGroupProvider.Descriptor.Registry.remove(java.lang.String)`

### clear

public void clear()
Clear the registry.

Specified by:
  `clear` in interface `IDifferenceGroupProvider.Descriptor.Registry`
See Also:
  - `IDifferenceGroupProvider.Descriptor.Registry.clear()`