Search in sources :

Example 1 with IPluginProperties

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

the class BeanDeleterCommand method getPluginDecoratedRenderer.

@SuppressWarnings({ "rawtypes", "unchecked" })
private IBeanProxyLabelRenderer<BEAN_TYPE> getPluginDecoratedRenderer(final Object entityId, final Class<?> beanType, final IBeanProxyLabelRenderer<BEAN_TYPE> renderer) {
    final IPluginPropertiesBuilder propertiesBuilder = PluginProperties.builder();
    propertiesBuilder.add(IBeanProxyLabelRendererPlugin.ENTITIY_ID_PROPERTY_KEY, entityId);
    propertiesBuilder.add(IBeanProxyLabelRendererPlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    final IPluginProperties properties = propertiesBuilder.build();
    IBeanProxyLabelRenderer result = renderer;
    for (final IBeanProxyLabelRendererPlugin plugin : PluginProvider.getPlugins(IBeanProxyLabelRendererPlugin.ID, properties)) {
        final IDecorator<IBeanProxyLabelRenderer<?>> decorator = plugin.getRendererDecorator(properties);
        if (decorator != null) {
            result = decorator.decorate(result);
        }
    }
    return result;
}
Also used : IBeanProxyLabelRendererPlugin(org.jowidgets.cap.ui.api.plugin.IBeanProxyLabelRendererPlugin) IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IBeanProxyLabelRenderer(org.jowidgets.cap.ui.api.bean.IBeanProxyLabelRenderer)

Example 2 with IPluginProperties

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

the class BeanFormImpl method modifyBeanFormBpByPlugins.

private void modifyBeanFormBpByPlugins(final Object entityId, final Class<BEAN_TYPE> beanType, final IBeanFormBluePrint<BEAN_TYPE> beanFormBp) {
    final IPluginPropertiesBuilder propBuilder = PluginToolkit.pluginPropertiesBuilder();
    propBuilder.add(IBeanFormPlugin.ENTITIY_ID_PROPERTY_KEY, entityId);
    propBuilder.add(IBeanFormPlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    final IPluginProperties properties = propBuilder.build();
    for (final IBeanFormPlugin plugin : PluginProvider.getPlugins(IBeanFormPlugin.ID, properties)) {
        plugin.modifySetup(properties, beanFormBp);
    }
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IBeanFormPlugin(org.jowidgets.cap.ui.api.plugin.IBeanFormPlugin)

Example 3 with IPluginProperties

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

the class BeanTableModelImpl 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;
    IPluginPropertiesBuilder propBuilder = PluginToolkit.pluginPropertiesBuilder();
    propBuilder.add(IAttributePlugin.ENTITIY_ID_PROPERTY_KEY, entityId);
    propBuilder.add(IAttributePlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    IPluginProperties properties = propBuilder.build();
    for (final IAttributePlugin plugin : PluginProvider.getPlugins(IAttributePlugin.ID, properties)) {
        result = plugin.modifyAttributes(properties, result);
    }
    propBuilder = PluginToolkit.pluginPropertiesBuilder();
    propBuilder.add(IBeanTableModelPlugin.ENTITIY_ID_PROPERTY_KEY, entityId);
    propBuilder.add(IBeanTableModelPlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    properties = propBuilder.build();
    for (final IBeanTableModelPlugin plugin : PluginProvider.getPlugins(IBeanTableModelPlugin.ID, properties)) {
        result = plugin.modifyTableAttributes(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) IBeanTableModelPlugin(org.jowidgets.cap.ui.api.plugin.IBeanTableModelPlugin)

Example 4 with IPluginProperties

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

the class ExecutorActionBuilderImpl method decorateActionWithPlugins.

private IAction decorateActionWithPlugins(final IAction action) {
    IAction result = action;
    final IPluginProperties properties = PluginProperties.create(IServiceActionDecoratorPlugin.SERVICE_TYPE_PROPERTY_KEY, IExecutorService.class);
    final IExecutorService<?> executorService = (IExecutorService<?>) executor;
    final List<IServiceActionDecoratorPlugin> plugins = PluginProvider.getPlugins(IServiceActionDecoratorPlugin.ID, properties);
    for (final IServiceActionDecoratorPlugin plugin : plugins) {
        result = plugin.decorate(result, executorService);
        if (result == null) {
            return null;
        }
    }
    return result;
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IAction(org.jowidgets.api.command.IAction) IExecutorService(org.jowidgets.cap.common.api.service.IExecutorService) IServiceActionDecoratorPlugin(org.jowidgets.cap.ui.api.plugin.IServiceActionDecoratorPlugin)

Example 5 with IPluginProperties

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

the class CreatorActionBuilderImpl method decorateActionWithPlugins.

private IAction decorateActionWithPlugins(final IAction action) {
    IAction result = action;
    final IPluginProperties properties = PluginProperties.create(IServiceActionDecoratorPlugin.SERVICE_TYPE_PROPERTY_KEY, ICreatorService.class);
    final List<IServiceActionDecoratorPlugin> plugins = PluginProvider.getPlugins(IServiceActionDecoratorPlugin.ID, properties);
    for (final IServiceActionDecoratorPlugin plugin : plugins) {
        result = plugin.decorate(result, creatorService);
        if (result == null) {
            return null;
        }
    }
    return result;
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IAction(org.jowidgets.api.command.IAction) IServiceActionDecoratorPlugin(org.jowidgets.cap.ui.api.plugin.IServiceActionDecoratorPlugin)

Aggregations

IPluginProperties (org.jowidgets.plugin.api.IPluginProperties)34 IPluginPropertiesBuilder (org.jowidgets.plugin.api.IPluginPropertiesBuilder)21 IAction (org.jowidgets.api.command.IAction)6 IServiceActionDecoratorPlugin (org.jowidgets.cap.ui.api.plugin.IServiceActionDecoratorPlugin)6 IAttributePlugin (org.jowidgets.cap.ui.api.plugin.IAttributePlugin)5 IBeanModelBuilderPlugin (org.jowidgets.cap.ui.api.plugin.IBeanModelBuilderPlugin)5 LinkedList (java.util.LinkedList)3 IBeanDtoConversionProviderPlugin (org.jowidgets.cap.service.api.plugin.IBeanDtoConversionProviderPlugin)3 IAttribute (org.jowidgets.cap.ui.api.attribute.IAttribute)3 List (java.util.List)2 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 IExecutorService (org.jowidgets.cap.common.api.service.IExecutorService)1 ICreatorServiceBuilderPlugin (org.jowidgets.cap.service.api.plugin.ICreatorServiceBuilderPlugin)1 IUpdaterServiceBuilderPlugin (org.jowidgets.cap.service.api.plugin.IUpdaterServiceBuilderPlugin)1 IBeanMessage (org.jowidgets.cap.ui.api.bean.IBeanMessage)1 IBeanFormPlugin (org.jowidgets.cap.ui.api.plugin.IBeanFormPlugin)1 IBeanProxyPlugin (org.jowidgets.cap.ui.api.plugin.IBeanProxyPlugin)1