Search in sources :

Example 1 with IBeanProxyLabelRenderer

use of org.jowidgets.cap.ui.api.bean.IBeanProxyLabelRenderer in project jo-client-platform by jo-source.

the class BeanRelationNodeModelImpl method getPluginDecoratedRenderer.

@SuppressWarnings({ "rawtypes", "unchecked" })
private static IBeanProxyLabelRenderer getPluginDecoratedRenderer(final Object entityId, final Class<?> entityType, final IBeanProxyLabelRenderer renderer) {
    final IPluginPropertiesBuilder propertiesBuilder = PluginProperties.builder();
    propertiesBuilder.add(IBeanProxyLabelRendererPlugin.ENTITIY_ID_PROPERTY_KEY, entityId);
    propertiesBuilder.add(IBeanProxyLabelRendererPlugin.BEAN_TYPE_PROPERTY_KEY, entityType);
    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 IBeanProxyLabelRenderer

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

Aggregations

IBeanProxyLabelRenderer (org.jowidgets.cap.ui.api.bean.IBeanProxyLabelRenderer)2 IBeanProxyLabelRendererPlugin (org.jowidgets.cap.ui.api.plugin.IBeanProxyLabelRendererPlugin)2 IPluginProperties (org.jowidgets.plugin.api.IPluginProperties)2 IPluginPropertiesBuilder (org.jowidgets.plugin.api.IPluginPropertiesBuilder)2