Search in sources :

Example 26 with IPluginProperties

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

the class DeleterActionBuilder method decorateActionWithPlugins.

private IAction decorateActionWithPlugins(final IAction action) {
    IAction result = action;
    final IPluginProperties properties = PluginProperties.create(IServiceActionDecoratorPlugin.SERVICE_TYPE_PROPERTY_KEY, IDeleterService.class);
    final List<IServiceActionDecoratorPlugin> plugins = PluginProvider.getPlugins(IServiceActionDecoratorPlugin.ID, properties);
    for (final IServiceActionDecoratorPlugin plugin : plugins) {
        result = plugin.decorate(result, deleterService);
        if (result == null) {
            return null;
        }
    }
    return result;
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IAction(org.jowidgets.api.command.IAction) IServiceActionDecoratorPlugin(org.jowidgets.cap.ui.api.plugin.IServiceActionDecoratorPlugin)

Example 27 with IPluginProperties

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

the class LinkCreatorActionBuilderImpl method decorateActionWithPlugins.

private IAction decorateActionWithPlugins(final IAction action) {
    IAction result = action;
    final IPluginProperties properties = PluginProperties.create(IServiceActionDecoratorPlugin.SERVICE_TYPE_PROPERTY_KEY, ILinkCreatorService.class);
    final List<IServiceActionDecoratorPlugin> plugins = PluginProvider.getPlugins(IServiceActionDecoratorPlugin.ID, properties);
    for (final IServiceActionDecoratorPlugin plugin : plugins) {
        result = plugin.decorate(result, linkCreatorService);
        if (result == null) {
            return null;
        }
    }
    return result;
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IAction(org.jowidgets.api.command.IAction) IServiceActionDecoratorPlugin(org.jowidgets.cap.ui.api.plugin.IServiceActionDecoratorPlugin)

Example 28 with IPluginProperties

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

the class BeanRelationTreeDetailImpl method modififySetupFromPlugins.

@SuppressWarnings({ "unchecked", "rawtypes" })
private IBeanRelationTreeDetailBluePrint<CHILD_BEAN_TYPE> modififySetupFromPlugins(final IBeanRelationTreeDetailBluePrint<CHILD_BEAN_TYPE> bluePrint) {
    final IBeanRelationTreeDetailBluePrint<CHILD_BEAN_TYPE> result = CapUiToolkit.bluePrintFactory().beanRelationTreeDetail();
    result.setSetup(bluePrint);
    final IBeanRelationNodeModel<Void, CHILD_BEAN_TYPE> rootNode = bluePrint.getModel().getRoot();
    final IPluginPropertiesBuilder propertiesBuilder = PluginProperties.builder();
    propertiesBuilder.add(IBeanRelationTreeDetailPlugin.ENTITIY_ID_PROPERTY_KEY, rootNode.getChildEntityId());
    propertiesBuilder.add(IBeanRelationTreeDetailPlugin.BEAN_TYPE_PROPERTY_KEY, rootNode.getChildBeanType());
    final IPluginProperties pluginProperties = propertiesBuilder.build();
    final List<IBeanRelationTreeDetailPlugin<?>> plugins = PluginProvider.getPlugins(IBeanRelationTreeDetailPlugin.ID, pluginProperties);
    for (final IBeanRelationTreeDetailPlugin plugin : plugins) {
        plugin.modifySetup(pluginProperties, result);
    }
    return result;
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IBeanRelationTreeDetailPlugin(org.jowidgets.cap.ui.api.plugin.IBeanRelationTreeDetailPlugin) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder)

Example 29 with IPluginProperties

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

the class BeanRelationTreeImpl method modififySetupFromPlugins.

@SuppressWarnings({ "unchecked", "rawtypes" })
private IBeanRelationTreeBluePrint<CHILD_BEAN_TYPE> modififySetupFromPlugins(final IBeanRelationTreeBluePrint<CHILD_BEAN_TYPE> bluePrint) {
    final IBeanRelationTreeBluePrint<CHILD_BEAN_TYPE> result = CapUiToolkit.bluePrintFactory().beanRelationTree();
    result.setSetup(bluePrint);
    final IBeanRelationNodeModel<Void, CHILD_BEAN_TYPE> rootNode = bluePrint.getModel().getRoot();
    final IPluginPropertiesBuilder propertiesBuilder = PluginProperties.builder();
    propertiesBuilder.add(IBeanRelationTreePlugin.ENTITIY_ID_PROPERTY_KEY, rootNode.getChildEntityId());
    propertiesBuilder.add(IBeanRelationTreePlugin.BEAN_TYPE_PROPERTY_KEY, rootNode.getChildBeanType());
    final IPluginProperties pluginProperties = propertiesBuilder.build();
    final List<IBeanRelationTreePlugin<?>> plugins = PluginProvider.getPlugins(IBeanRelationTreePlugin.ID, pluginProperties);
    for (final IBeanRelationTreePlugin plugin : plugins) {
        plugin.modifySetup(pluginProperties, result);
    }
    return result;
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IBeanRelationTreePlugin(org.jowidgets.cap.ui.api.plugin.IBeanRelationTreePlugin)

Example 30 with IPluginProperties

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

the class BeanTableImpl method addMenusFromPlugins.

@SuppressWarnings({ "rawtypes", "unchecked" })
private void addMenusFromPlugins(final Class<BEAN_TYPE> beanType, final Object entityId, final IMenuModel menuModel, final IMenuModel cellMenuModel, final IMenuModel headerMenuModel) {
    final IPluginPropertiesBuilder propBuilder = PluginToolkit.pluginPropertiesBuilder();
    propBuilder.add(IBeanTableMenuContributionPlugin.ENTITIY_ID_PROPERTY_KEY, entityId);
    propBuilder.add(IBeanTableMenuContributionPlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    final IPluginProperties properties = propBuilder.build();
    final List<IBeanTableMenuContributionPlugin<?>> plugins = PluginProvider.getPlugins(IBeanTableMenuContributionPlugin.ID, properties);
    if (plugins != null) {
        for (final IBeanTableMenuContributionPlugin plugin : plugins) {
            final IMenuModel menu = plugin.getTableMenu(properties, this);
            if (menu != null) {
                menuModel.addItemsOfModel(menu);
            }
            final IMenuModel cellMenu = plugin.getCellMenu(properties, this);
            if (menu != null) {
                cellMenuModel.addItemsOfModel(cellMenu);
            }
            final IMenuModel headerMenu = plugin.getHeaderMenu(properties, this);
            if (menu != null) {
                headerMenuModel.addItemsOfModel(headerMenu);
            }
        }
    }
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IMenuModel(org.jowidgets.api.model.item.IMenuModel) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IBeanTableMenuContributionPlugin(org.jowidgets.cap.ui.api.plugin.IBeanTableMenuContributionPlugin)

Aggregations

IPluginProperties (org.jowidgets.plugin.api.IPluginProperties)34 IPluginPropertiesBuilder (org.jowidgets.plugin.api.IPluginPropertiesBuilder)21 IAction (org.jowidgets.api.command.IAction)6 IServiceActionDecoratorPlugin (org.jowidgets.cap.ui.api.plugin.IServiceActionDecoratorPlugin)6 IAttributePlugin (org.jowidgets.cap.ui.api.plugin.IAttributePlugin)5 IBeanModelBuilderPlugin (org.jowidgets.cap.ui.api.plugin.IBeanModelBuilderPlugin)5 LinkedList (java.util.LinkedList)3 IBeanDtoConversionProviderPlugin (org.jowidgets.cap.service.api.plugin.IBeanDtoConversionProviderPlugin)3 IAttribute (org.jowidgets.cap.ui.api.attribute.IAttribute)3 List (java.util.List)2 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 IExecutorService (org.jowidgets.cap.common.api.service.IExecutorService)1 ICreatorServiceBuilderPlugin (org.jowidgets.cap.service.api.plugin.ICreatorServiceBuilderPlugin)1 IUpdaterServiceBuilderPlugin (org.jowidgets.cap.service.api.plugin.IUpdaterServiceBuilderPlugin)1 IBeanMessage (org.jowidgets.cap.ui.api.bean.IBeanMessage)1 IBeanFormPlugin (org.jowidgets.cap.ui.api.plugin.IBeanFormPlugin)1 IBeanProxyPlugin (org.jowidgets.cap.ui.api.plugin.IBeanProxyPlugin)1