Search in sources :

Example 1 with IAttributePlugin

use of org.jowidgets.cap.ui.api.plugin.IAttributePlugin 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;
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IAttributePlugin(org.jowidgets.cap.ui.api.plugin.IAttributePlugin) IAttribute(org.jowidgets.cap.ui.api.attribute.IAttribute) IBeanTableModelPlugin(org.jowidgets.cap.ui.api.plugin.IBeanTableModelPlugin)

Example 2 with IAttributePlugin

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

the class BeanFormControl method createModifiedByPluginsAttributes.

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

Example 3 with IAttributePlugin

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

the class SingleBeanModelImpl 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;
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IAttributePlugin(org.jowidgets.cap.ui.api.plugin.IAttributePlugin) IAttribute(org.jowidgets.cap.ui.api.attribute.IAttribute)

Example 4 with IAttributePlugin

use of org.jowidgets.cap.ui.api.plugin.IAttributePlugin 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;
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IAttributePlugin(org.jowidgets.cap.ui.api.plugin.IAttributePlugin) IAttribute(org.jowidgets.cap.ui.api.attribute.IAttribute)

Example 5 with IAttributePlugin

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

IAttributePlugin (org.jowidgets.cap.ui.api.plugin.IAttributePlugin)5 IPluginProperties (org.jowidgets.plugin.api.IPluginProperties)5 IPluginPropertiesBuilder (org.jowidgets.plugin.api.IPluginPropertiesBuilder)5 IAttribute (org.jowidgets.cap.ui.api.attribute.IAttribute)3 LinkedList (java.util.LinkedList)2 List (java.util.List)2 IBeanTableModelPlugin (org.jowidgets.cap.ui.api.plugin.IBeanTableModelPlugin)1