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