Search in sources :

Example 6 with IPluginPropertiesBuilder

use of org.jowidgets.plugin.api.IPluginPropertiesBuilder 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 7 with IPluginPropertiesBuilder

use of org.jowidgets.plugin.api.IPluginPropertiesBuilder 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 8 with IPluginPropertiesBuilder

use of org.jowidgets.plugin.api.IPluginPropertiesBuilder in project jo-client-platform by jo-source.

the class BeanSelectionObservable method fireSelectionChangedOnPlugins.

@SuppressWarnings({ "rawtypes", "unchecked" })
private void fireSelectionChangedOnPlugins(final IBeanSelectionEvent event) {
    final Class<?> beanType = event.getBeanType();
    final Class<?> eventSourceType = event.getSource().getClass();
    final IPluginPropertiesBuilder propBuilder = PluginToolkit.pluginPropertiesBuilder();
    propBuilder.add(IBeanSelectionProviderPlugin.ENTITIY_ID_PROPERTY_KEY, event.getEntityId());
    propBuilder.add(IBeanSelectionProviderPlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    propBuilder.add(IBeanSelectionProviderPlugin.SELECTION_SOURCE_TYPE_PROPERTY_KEY, eventSourceType);
    propBuilder.add(IBeanSelectionProviderPlugin.SELECTION_EMPTY_PROPERTY_KEY, event.getFirstSelected() == null);
    final IPluginProperties properties = propBuilder.build();
    for (final IBeanSelectionProviderPlugin<?> plugin : PluginProvider.getPlugins(IBeanSelectionProviderPlugin.ID, properties)) {
        plugin.selectionChanged(event, properties);
    }
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder)

Example 9 with IPluginPropertiesBuilder

use of org.jowidgets.plugin.api.IPluginPropertiesBuilder in project jo-client-platform by jo-source.

the class UpdaterServiceBuilderImpl method createPluginProperties.

private IPluginProperties createPluginProperties() {
    final IPluginPropertiesBuilder builder = PluginProperties.builder();
    builder.add(IUpdaterServiceBuilderPlugin.BEAN_TYPE_PROPERTY_KEY, beanAccess.getBeanType());
    builder.add(IUpdaterServiceBuilderPlugin.BEAN_TYPE_ID_PROPERTY_KEY, beanAccess.getBeanTypeId());
    return builder.build();
}
Also used : IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder)

Example 10 with IPluginPropertiesBuilder

use of org.jowidgets.plugin.api.IPluginPropertiesBuilder in project jo-client-platform by jo-source.

the class SyncExecutorServiceImpl method createExecutorServiceInterceptorPlugins.

@SuppressWarnings({ "rawtypes", "unchecked" })
private List<IExecutorServiceInterceptorPlugin<BEAN_TYPE, PARAM_TYPE>> createExecutorServiceInterceptorPlugins(final Class<?> beanType) {
    final IPluginPropertiesBuilder propBuilder = PluginToolkit.pluginPropertiesBuilder();
    propBuilder.add(IExecutorServiceInterceptorPlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    final List result = PluginProvider.getPlugins(IExecutorServiceInterceptorPlugin.ID, propBuilder.build());
    return result;
}
Also used : IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) List(java.util.List)

Aggregations

IPluginPropertiesBuilder (org.jowidgets.plugin.api.IPluginPropertiesBuilder)34 IPluginProperties (org.jowidgets.plugin.api.IPluginProperties)21 LinkedList (java.util.LinkedList)6 List (java.util.List)6 IAttributePlugin (org.jowidgets.cap.ui.api.plugin.IAttributePlugin)5 IBeanModelBuilderPlugin (org.jowidgets.cap.ui.api.plugin.IBeanModelBuilderPlugin)5 ArrayList (java.util.ArrayList)3 IAttribute (org.jowidgets.cap.ui.api.attribute.IAttribute)3 IContainer (org.jowidgets.api.widgets.IContainer)2 IBeanProxyLabelRenderer (org.jowidgets.cap.ui.api.bean.IBeanProxyLabelRenderer)2 IBeanProxyLabelRendererPlugin (org.jowidgets.cap.ui.api.plugin.IBeanProxyLabelRendererPlugin)2 IMenuModel (org.jowidgets.api.model.item.IMenuModel)1 IBeanDtoCustomFilterPlugin (org.jowidgets.cap.common.api.plugin.IBeanDtoCustomFilterPlugin)1 IServiceIdDecoratorPlugin (org.jowidgets.cap.service.api.plugin.IServiceIdDecoratorPlugin)1 ICustomFilterPredicateCreatorPlugin (org.jowidgets.cap.service.jpa.api.plugin.ICustomFilterPredicateCreatorPlugin)1 IBeanFormPlugin (org.jowidgets.cap.ui.api.plugin.IBeanFormPlugin)1 IBeanRelationTreeDetailPlugin (org.jowidgets.cap.ui.api.plugin.IBeanRelationTreeDetailPlugin)1 IBeanRelationTreePlugin (org.jowidgets.cap.ui.api.plugin.IBeanRelationTreePlugin)1 IBeanTableMenuContributionPlugin (org.jowidgets.cap.ui.api.plugin.IBeanTableMenuContributionPlugin)1 IBeanTableMenuInterceptorPlugin (org.jowidgets.cap.ui.api.plugin.IBeanTableMenuInterceptorPlugin)1