use of org.jowidgets.plugin.api.IPluginPropertiesBuilder 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;
}
use of org.jowidgets.plugin.api.IPluginPropertiesBuilder 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;
}
use of org.jowidgets.plugin.api.IPluginPropertiesBuilder 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);
}
}
}
}
use of org.jowidgets.plugin.api.IPluginPropertiesBuilder 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;
}
Aggregations