Search in sources :

Example 1 with IEntityComponentRelationTreeDetailViewPlugin

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

Aggregations

IContainer (org.jowidgets.api.widgets.IContainer)1 IEntityComponentRelationTreeDetailViewPlugin (org.jowidgets.cap.ui.api.plugin.IEntityComponentRelationTreeDetailViewPlugin)1 ICapApiBluePrintFactory (org.jowidgets.cap.ui.api.widgets.ICapApiBluePrintFactory)1 IPluginProperties (org.jowidgets.plugin.api.IPluginProperties)1 IPluginPropertiesBuilder (org.jowidgets.plugin.api.IPluginPropertiesBuilder)1