class AbstractWidgetConverter implements PropertyConverter {

    protected UiSchema.Trigger toTrigger(final Collection<SimplePropertyDefinition> properties,
            final SimplePropertyDefinition prop, final ActionReference ref) {
        final UiSchema.Trigger trigger = new UiSchema.Trigger();
        trigger
                .setAction(prop
                        .getMetadata()
                        .entrySet()
                        .stream()
                        .filter(it -> matchAction(it, ref))
                        .findFirst()
                        .map(Map.Entry::getValue)
                        .orElseGet(ref::getName));
        trigger.setFamily(ref.getFamily());
        trigger.setType(ref.getType());
        trigger
                .setParameters(toParams(properties, prop, ref,
                        prop.getMetadata().get("action::" + ref.getType() + "::parameters")));
        return trigger;
    }

}