@Override
public IAddFeature getAddFeature(IAddContext context) {
IAddFeature ret = super.getAddFeature(context);
Object newObject = context.getNewObject();
if (newObject instanceof Diagram) {
ret = new AddDiagramFeature(this);
} else if (!(context.getTargetContainer() instanceof Diagram) && !(newObject instanceof PictogramElement)) {
// works only container shapes, because drop is only allowed on
// container shapes
ret = new AddLinkFeature(this);
} else {
return new AddAnythingFeature(this);
}
return ret;
}
]]>