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;
}
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);
}
}
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;
}
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;
}
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;
}
Aggregations