Search in sources :

Example 16 with IPluginPropertiesBuilder

use of org.jowidgets.plugin.api.IPluginPropertiesBuilder in project jo-client-platform by jo-source.

the class BeanFormControl method createModifiedByPluginsAttributes.

@SuppressWarnings({ "unchecked", "rawtypes" })
private List<IAttribute<?>> createModifiedByPluginsAttributes(final Object entityId, final Class<BEAN_TYPE> beanType, final Collection<IAttribute<?>> attributes) {
    List result = new LinkedList(attributes);
    final IPluginPropertiesBuilder propBuilder = PluginToolkit.pluginPropertiesBuilder();
    propBuilder.add(IAttributePlugin.ENTITIY_ID_PROPERTY_KEY, entityId);
    propBuilder.add(IAttributePlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    final IPluginProperties properties = propBuilder.build();
    for (final IAttributePlugin plugin : PluginProvider.getPlugins(IAttributePlugin.ID, properties)) {
        result = plugin.modifyAttributes(properties, result);
    }
    return result;
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IAttributePlugin(org.jowidgets.cap.ui.api.plugin.IAttributePlugin) List(java.util.List) LinkedList(java.util.LinkedList) LinkedList(java.util.LinkedList)

Example 17 with IPluginPropertiesBuilder

use of org.jowidgets.plugin.api.IPluginPropertiesBuilder in project jo-client-platform by jo-source.

the class SingleBeanModelImpl method createModifiedByPluginsAttributes.

private List<IAttribute<Object>> createModifiedByPluginsAttributes(final Object entityId, final Class<BEAN_TYPE> beanType, final List<IAttribute<Object>> attributes) {
    List<IAttribute<Object>> result = attributes;
    final IPluginPropertiesBuilder propBuilder = PluginToolkit.pluginPropertiesBuilder();
    propBuilder.add(IAttributePlugin.ENTITIY_ID_PROPERTY_KEY, entityId);
    propBuilder.add(IAttributePlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    final IPluginProperties properties = propBuilder.build();
    for (final IAttributePlugin plugin : PluginProvider.getPlugins(IAttributePlugin.ID, properties)) {
        result = plugin.modifyAttributes(properties, result);
    }
    return result;
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IAttributePlugin(org.jowidgets.cap.ui.api.plugin.IAttributePlugin) IAttribute(org.jowidgets.cap.ui.api.attribute.IAttribute)

Example 18 with IPluginPropertiesBuilder

use of org.jowidgets.plugin.api.IPluginPropertiesBuilder in project jo-client-platform by jo-source.

the class SingleBeanModelBuilder method modifyFromBeanModelPlugins.

@SuppressWarnings({ "rawtypes", "unchecked" })
private void modifyFromBeanModelPlugins() {
    final IPluginPropertiesBuilder propBuilder = PluginToolkit.pluginPropertiesBuilder();
    propBuilder.add(IBeanModelBuilderPlugin.ENTITIY_ID_PROPERTY_KEY, getEntityId());
    propBuilder.add(IBeanModelBuilderPlugin.BEAN_TYPE_PROPERTY_KEY, getBeanType());
    final IPluginProperties properties = propBuilder.build();
    for (final IBeanModelBuilderPlugin plugin : PluginProvider.getPlugins(IBeanModelBuilderPlugin.ID, properties)) {
        plugin.modify(this);
    }
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IBeanModelBuilderPlugin(org.jowidgets.cap.ui.api.plugin.IBeanModelBuilderPlugin) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder)

Example 19 with IPluginPropertiesBuilder

use of org.jowidgets.plugin.api.IPluginPropertiesBuilder in project jo-client-platform by jo-source.

the class BeanModifierImpl method createPluginProperties.

private IPluginProperties createPluginProperties(final Class<? extends BEAN_TYPE> beanType) {
    final IPluginPropertiesBuilder builder = PluginToolkit.pluginPropertiesBuilder();
    builder.add(IBeanModifierPlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    return builder.build();
}
Also used : IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder)

Example 20 with IPluginPropertiesBuilder

use of org.jowidgets.plugin.api.IPluginPropertiesBuilder in project jo-client-platform by jo-source.

the class BeanServicesProviderBuilderHelper method decorateServiceId.

private static <SERVICE_TYPE> IServiceId<SERVICE_TYPE> decorateServiceId(final IServiceId<SERVICE_TYPE> defaultId, final IServiceId<IEntityService> entityServiceId, final Class<? extends IBean> beanType, final Object entityId, final Class<SERVICE_TYPE> serviceType) {
    IServiceId<SERVICE_TYPE> result = defaultId;
    final IPluginPropertiesBuilder propertiesBuilder = PluginProperties.builder();
    propertiesBuilder.add(IServiceIdDecoratorPlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    propertiesBuilder.add(IServiceIdDecoratorPlugin.ENTITIY_ID_PROPERTY_KEY, entityId);
    for (final IServiceIdDecoratorPlugin plugin : PluginProvider.getPlugins(IServiceIdDecoratorPlugin.ID, propertiesBuilder.build())) {
        result = plugin.decorateServiceId(result, entityServiceId, beanType, entityId, serviceType);
    }
    return result;
}
Also used : IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IServiceIdDecoratorPlugin(org.jowidgets.cap.service.api.plugin.IServiceIdDecoratorPlugin)

Aggregations

IPluginPropertiesBuilder (org.jowidgets.plugin.api.IPluginPropertiesBuilder)34 IPluginProperties (org.jowidgets.plugin.api.IPluginProperties)21 LinkedList (java.util.LinkedList)6 List (java.util.List)6 IAttributePlugin (org.jowidgets.cap.ui.api.plugin.IAttributePlugin)5 IBeanModelBuilderPlugin (org.jowidgets.cap.ui.api.plugin.IBeanModelBuilderPlugin)5 ArrayList (java.util.ArrayList)3 IAttribute (org.jowidgets.cap.ui.api.attribute.IAttribute)3 IContainer (org.jowidgets.api.widgets.IContainer)2 IBeanProxyLabelRenderer (org.jowidgets.cap.ui.api.bean.IBeanProxyLabelRenderer)2 IBeanProxyLabelRendererPlugin (org.jowidgets.cap.ui.api.plugin.IBeanProxyLabelRendererPlugin)2 IMenuModel (org.jowidgets.api.model.item.IMenuModel)1 IBeanDtoCustomFilterPlugin (org.jowidgets.cap.common.api.plugin.IBeanDtoCustomFilterPlugin)1 IServiceIdDecoratorPlugin (org.jowidgets.cap.service.api.plugin.IServiceIdDecoratorPlugin)1 ICustomFilterPredicateCreatorPlugin (org.jowidgets.cap.service.jpa.api.plugin.ICustomFilterPredicateCreatorPlugin)1 IBeanFormPlugin (org.jowidgets.cap.ui.api.plugin.IBeanFormPlugin)1 IBeanRelationTreeDetailPlugin (org.jowidgets.cap.ui.api.plugin.IBeanRelationTreeDetailPlugin)1 IBeanRelationTreePlugin (org.jowidgets.cap.ui.api.plugin.IBeanRelationTreePlugin)1 IBeanTableMenuContributionPlugin (org.jowidgets.cap.ui.api.plugin.IBeanTableMenuContributionPlugin)1 IBeanTableMenuInterceptorPlugin (org.jowidgets.cap.ui.api.plugin.IBeanTableMenuInterceptorPlugin)1