Search in sources :

Example 31 with IPluginProperties

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

the class BeanTableImpl method getMenuInterceptorsFromPlugins.

@SuppressWarnings({ "unchecked", "rawtypes" })
private List<IBeanTableMenuInterceptor<BEAN_TYPE>> getMenuInterceptorsFromPlugins(final IBeanTableMenuInterceptor<BEAN_TYPE> initialInterceptor, final Object entityId, final Class<BEAN_TYPE> beanType) {
    final List<IBeanTableMenuInterceptor<BEAN_TYPE>> result = new LinkedList<IBeanTableMenuInterceptor<BEAN_TYPE>>();
    if (initialInterceptor != null) {
        result.add(initialInterceptor);
    }
    final IPluginPropertiesBuilder propBuilder = PluginToolkit.pluginPropertiesBuilder();
    propBuilder.add(IBeanTableMenuInterceptorPlugin.ENTITIY_ID_PROPERTY_KEY, entityId);
    propBuilder.add(IBeanTableMenuInterceptorPlugin.BEAN_TYPE_PROPERTY_KEY, beanType);
    final IPluginProperties properties = propBuilder.build();
    final List<IBeanTableMenuInterceptorPlugin<?>> plugins = PluginProvider.getPlugins(IBeanTableMenuInterceptorPlugin.ID, properties);
    for (final IBeanTableMenuInterceptorPlugin plugin : plugins) {
        final IBeanTableMenuInterceptor<?> interceptor = plugin.getMenuInterceptor(properties, this);
        if (interceptor != null) {
            result.add((IBeanTableMenuInterceptor<BEAN_TYPE>) interceptor);
        }
    }
    return result;
}
Also used : IBeanTableMenuInterceptor(org.jowidgets.cap.ui.api.table.IBeanTableMenuInterceptor) IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IBeanTableMenuInterceptorPlugin(org.jowidgets.cap.ui.api.plugin.IBeanTableMenuInterceptorPlugin) LinkedList(java.util.LinkedList)

Example 32 with IPluginProperties

use of org.jowidgets.plugin.api.IPluginProperties 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)

Example 33 with IPluginProperties

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

the class EntityRelationTreeDetailView method initialize.

void initialize(final IBeanTable<?> rootTable, final IBeanRelationTree<?> relationTree, final Collection<IAction> linkCreatorActions) {
    if (!intialized) {
        final IContainer container = context.getContainer();
        container.setLayout(MigLayoutFactory.growingInnerCellLayout());
        final ICapApiBluePrintFactory cbpf = CapUiToolkit.bluePrintFactory();
        final IBeanRelationTreeDetailBluePrint<?> treeDetailBp = cbpf.beanRelationTreeDetail(relationTree.getModel());
        final IBeanRelationTreeDetail<?> relationTreeDetail = container.add(treeDetailBp, MigLayoutFactory.GROWING_CELL_CONSTRAINTS);
        final IBeanTableModel<?> rootTableModel = rootTable.getModel();
        final IPluginPropertiesBuilder propBuilder = PluginProperties.builder();
        propBuilder.add(IEntityComponentRelationTreeDetailViewPlugin.BEAN_TYPE_PROPERTY_KEY, rootTableModel.getBeanType());
        propBuilder.add(IEntityComponentRelationTreeDetailViewPlugin.ENTITIY_ID_PROPERTY_KEY, rootTableModel.getEntityId());
        final IPluginProperties pluginProperties = propBuilder.build();
        final List<IEntityComponentRelationTreeDetailViewPlugin> plugins = PluginProvider.getPlugins(IEntityComponentRelationTreeDetailViewPlugin.ID, pluginProperties);
        for (final IEntityComponentRelationTreeDetailViewPlugin plugin : plugins) {
            plugin.onInitialize(pluginProperties, context, rootTable, relationTree, relationTreeDetail, linkCreatorActions);
        }
        intialized = true;
    }
}
Also used : IEntityComponentRelationTreeDetailViewPlugin(org.jowidgets.cap.ui.api.plugin.IEntityComponentRelationTreeDetailViewPlugin) IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) ICapApiBluePrintFactory(org.jowidgets.cap.ui.api.widgets.ICapApiBluePrintFactory) IContainer(org.jowidgets.api.widgets.IContainer)

Example 34 with IPluginProperties

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

the class EntityRelationTreeView method initialize.

void initialize(final IBeanTable<?> rootTable, final IBeanRelationTreeModel<?> parentModel, final IBeanRelationTreeMenuInterceptor treeMenuInterceptor, final Collection<IAction> linkCreatorActions) {
    if (!intialized) {
        final IContainer container = context.getContainer();
        container.setLayout(MigLayoutFactory.growingInnerCellLayout());
        final IBeanRelationTreeBluePrint<?> beanRelationTreeBp = CapUiToolkit.bluePrintFactory().beanRelationTree(parentModel);
        beanRelationTreeBp.setRootCreatorAction(rootTable.getDefaultCreatorAction());
        beanRelationTreeBp.addMenuInterceptor(treeMenuInterceptor);
        this.tree = container.add(beanRelationTreeBp, MigLayoutFactory.GROWING_CELL_CONSTRAINTS);
        final IBeanTableModel<?> rootTableModel = rootTable.getModel();
        final IPluginPropertiesBuilder propBuilder = PluginProperties.builder();
        propBuilder.add(IEntityComponentRelationTreeViewPlugin.BEAN_TYPE_PROPERTY_KEY, rootTableModel.getBeanType());
        propBuilder.add(IEntityComponentRelationTreeViewPlugin.ENTITIY_ID_PROPERTY_KEY, rootTableModel.getEntityId());
        final IPluginProperties pluginProperties = propBuilder.build();
        final List<IEntityComponentRelationTreeViewPlugin> plugins = PluginProvider.getPlugins(IEntityComponentRelationTreeViewPlugin.ID, pluginProperties);
        for (final IEntityComponentRelationTreeViewPlugin plugin : plugins) {
            plugin.onInitialize(pluginProperties, context, rootTable, tree, linkCreatorActions);
        }
        intialized = true;
    }
}
Also used : IPluginProperties(org.jowidgets.plugin.api.IPluginProperties) IEntityComponentRelationTreeViewPlugin(org.jowidgets.cap.ui.api.plugin.IEntityComponentRelationTreeViewPlugin) IPluginPropertiesBuilder(org.jowidgets.plugin.api.IPluginPropertiesBuilder) IContainer(org.jowidgets.api.widgets.IContainer)

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