Search in sources :

Example 1 with IBeanTableMenuInterceptorPlugin

use of org.jowidgets.cap.ui.api.plugin.IBeanTableMenuInterceptorPlugin 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)

Aggregations

LinkedList (java.util.LinkedList)1 IBeanTableMenuInterceptorPlugin (org.jowidgets.cap.ui.api.plugin.IBeanTableMenuInterceptorPlugin)1 IBeanTableMenuInterceptor (org.jowidgets.cap.ui.api.table.IBeanTableMenuInterceptor)1 IPluginProperties (org.jowidgets.plugin.api.IPluginProperties)1 IPluginPropertiesBuilder (org.jowidgets.plugin.api.IPluginPropertiesBuilder)1