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;
}
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;
}
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;
}
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;
}
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);
}
}
}
}
Aggregations