Search in sources :

Example 31 with IPluginPropertiesBuilder

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

the class BeanRelationTreeImpl method modififySetupFromPlugins.

@SuppressWarnings({ "unchecked", "rawtypes" })
private IBeanRelationTreeBluePrint<CHILD_BEAN_TYPE> modififySetupFromPlugins(final IBeanRelationTreeBluePrint<CHILD_BEAN_TYPE> bluePrint) {
    final IBeanRelationTreeBluePrint<CHILD_BEAN_TYPE> result = CapUiToolkit.bluePrintFactory().beanRelationTree();
    result.setSetup(bluePrint);
    final IBeanRelationNodeModel<Void, CHILD_BEAN_TYPE> rootNode = bluePrint.getModel().getRoot();
    final IPluginPropertiesBuilder propertiesBuilder = PluginProperties.builder();
    propertiesBuilder.add(IBeanRelationTreePlugin.ENTITIY_ID_PROPERTY_KEY, rootNode.getChildEntityId());
    propertiesBuilder.add(IBeanRelationTreePlugin.BEAN_TYPE_PROPERTY_KEY, rootNode.getChildBeanType());
    final IPluginProperties pluginProperties = propertiesBuilder.build();
    final List<IBeanRelationTreePlugin<?>> plugins = PluginProvider.getPlugins(IBeanRelationTreePlugin.ID, pluginProperties);
    for (final IBeanRelationTreePlugin plugin : plugins) {
        plugin.modifySetup(pluginProperties, result);
    }
    return result;
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IBeanRelationTreePlugin(org.jowidgets.cap.ui.api.plugin.IBeanRelationTreePlugin)

Example 32 with IPluginPropertiesBuilder

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

the class BeanTableImpl method getMenuInterceptorsFromPlugins.

@SuppressWarnings({ "unchecked", "rawtypes" })
private List<IBeanTableMenuInterceptor<BEAN_TYPE>> getMenuInterceptorsFromPlugins(final IBeanTableMenuInterceptor<BEAN_TYPE> initialInterceptor, final Object entityId, final Class<BEAN_TYPE> beanType) {
    final List<IBeanTableMenuInterceptor<BEAN_TYPE>> result = new LinkedList<IBeanTableMenuInterceptor<BEAN_TYPE>>();
    if (initialInterceptor != null) {
        result.add(initialInterceptor);
    }
    final IPluginPropertiesBuilder propBuilder = PluginToolkit.pluginPropertiesBuilder();
    propBuilder.add(IBeanTableMenuInterceptorPlugin.ENTITIY_ID_PROPERTY_KEY, entityId);
    propBuilder.add(IBeanTableMenuInterceptorPlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    final IPluginProperties properties = propBuilder.build();
    final List<IBeanTableMenuInterceptorPlugin<?>> plugins = PluginProvider.getPlugins(IBeanTableMenuInterceptorPlugin.ID, properties);
    for (final IBeanTableMenuInterceptorPlugin plugin : plugins) {
        final IBeanTableMenuInterceptor<?> interceptor = plugin.getMenuInterceptor(properties, this);
        if (interceptor != null) {
            result.add((IBeanTableMenuInterceptor<BEAN_TYPE>) interceptor);
        }
    }
    return result;
}
Also used : IBeanTableMenuInterceptor(org.jowidgets.cap.ui.api.table.IBeanTableMenuInterceptor) IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IBeanTableMenuInterceptorPlugin(org.jowidgets.cap.ui.api.plugin.IBeanTableMenuInterceptorPlugin) LinkedList(java.util.LinkedList)

Example 33 with IPluginPropertiesBuilder

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

the class BeanTableImpl method addMenusFromPlugins.

@SuppressWarnings({ "rawtypes", "unchecked" })
private void addMenusFromPlugins(final Class<BEAN_TYPE> beanType, final Object entityId, final IMenuModel menuModel, final IMenuModel cellMenuModel, final IMenuModel headerMenuModel) {
    final IPluginPropertiesBuilder propBuilder = PluginToolkit.pluginPropertiesBuilder();
    propBuilder.add(IBeanTableMenuContributionPlugin.ENTITIY_ID_PROPERTY_KEY, entityId);
    propBuilder.add(IBeanTableMenuContributionPlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    final IPluginProperties properties = propBuilder.build();
    final List<IBeanTableMenuContributionPlugin<?>> plugins = PluginProvider.getPlugins(IBeanTableMenuContributionPlugin.ID, properties);
    if (plugins != null) {
        for (final IBeanTableMenuContributionPlugin plugin : plugins) {
            final IMenuModel menu = plugin.getTableMenu(properties, this);
            if (menu != null) {
                menuModel.addItemsOfModel(menu);
            }
            final IMenuModel cellMenu = plugin.getCellMenu(properties, this);
            if (menu != null) {
                cellMenuModel.addItemsOfModel(cellMenu);
            }
            final IMenuModel headerMenu = plugin.getHeaderMenu(properties, this);
            if (menu != null) {
                headerMenuModel.addItemsOfModel(headerMenu);
            }
        }
    }
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IMenuModel(org.jowidgets.api.model.item.IMenuModel) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IBeanTableMenuContributionPlugin(org.jowidgets.cap.ui.api.plugin.IBeanTableMenuContributionPlugin)

Example 34 with IPluginPropertiesBuilder

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

the class EntityServiceAttributesFactory method createModifiedByPluginsAttributes.

@SuppressWarnings({ "unchecked", "rawtypes" })
private static List<IAttribute<Object>> createModifiedByPluginsAttributes(final Object entityId, final Class<?> beanType, final Collection<IAttribute<Object>> 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)

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