org.eclipse.graphiti.pattern

## Class AbstractBasePattern

- java.lang.Object
- - org.eclipse.graphiti.pattern.AbstractBasePattern

All Implemented Interfaces:
  IFeatureProviderHolder

Direct Known Subclasses:
  AbstractConnectionPattern, AbstractPattern

    public abstract class AbstractBasePattern
    extends Object
    implements IFeatureProviderHolder

This is the abstract base class for patterns. Clients implementing own patterns should not subclass this class, but use `AbstractPattern` or `AbstractConnectionPattern` instead.

### Constructor Summary

Constructors
Constructor and Description
`AbstractBasePattern()`

### Method Summary

All Methods Instance Methods Concrete Methods
`PictogramElement` `add(IAddContext context)` Clients must override this method to provide the functionality to add an existing domain object to a diagram.
`boolean` `canAdd(IAddContext context)` Clients must override this method to indicate the framework that this pattern can add a domain object to the diagram.
`IFeatureProvider` `getFeatureProvider()` Returns the feature provider for this pattern.
`void` `setFeatureProvider(IFeatureProvider featureProvider)` Sets the feature provider for this pattern.

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

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

### Constructor Detail

#### AbstractBasePattern

    public AbstractBasePattern()

### Method Detail

#### add

    public PictogramElement add(IAddContext context)

Clients must override this method to provide the functionality to add an existing domain object to a diagram. Corresponds to the `IAdd.add(IAddContext)` method. The default implementation simply does nothing and returns `null`.

Parameters:
  `context` - The add context holding information about the added domain object.
Returns:
  The root shape of the created pictogram tree.

#### canAdd

    public boolean canAdd(IAddContext context)

Clients must override this method to indicate the framework that this pattern can add a domain object to the diagram. Corresponds to the `IAdd.canAdd(IAddContext)` method. The default implementation simply returns `false`.

Parameters:
  `context` - The add context holding information about the added domain object.
Returns:
  `true`, if the domain object can be added, `false` otherwise.

#### getFeatureProvider

    public IFeatureProvider getFeatureProvider()

Returns the feature provider for this pattern.

Specified by:
  `getFeatureProvider` in interface `IFeatureProviderHolder`
Returns:
  Returns the featureProvider.

#### setFeatureProvider

    public void setFeatureProvider(IFeatureProvider featureProvider)

Sets the feature provider for this pattern. Note that once a feature provider has been set, it should not be changed again.

Parameters:
  `featureProvider` - The new featureProvider