use of org.jowidgets.plugin.api.IPluginProperties in project jo-client-platform by jo-source.
the class BeanTabFolderModelImpl 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;
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;
}
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 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 BeanProxyImpl method getModifiedByPluginMessage.
private IBeanMessage getModifiedByPluginMessage(final IBeanMessage message) {
final IPluginProperties pluginProperties = PluginProperties.create(IBeanProxyPlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
IBeanMessage result = message;
for (final IBeanProxyPlugin plugin : PluginProvider.getPlugins(IBeanProxyPlugin.ID, pluginProperties)) {
result = plugin.addMessage(this, result);
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