Search in sources :

Example 6 with IContainer

use of org.jowidgets.api.widgets.IContainer 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 7 with IContainer

use of org.jowidgets.api.widgets.IContainer 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

IContainer (org.jowidgets.api.widgets.IContainer)7 MigLayoutDescriptor (org.jowidgets.common.widgets.layout.MigLayoutDescriptor)5 IComposite (org.jowidgets.api.widgets.IComposite)2 IExpandComposite (org.jowidgets.api.widgets.IExpandComposite)2 IExpandCompositeBluePrint (org.jowidgets.api.widgets.blueprint.IExpandCompositeBluePrint)2 IPluginProperties (org.jowidgets.plugin.api.IPluginProperties)2 IPluginPropertiesBuilder (org.jowidgets.plugin.api.IPluginPropertiesBuilder)2 ArrayList (java.util.ArrayList)1 IExpandListener (org.jowidgets.api.controller.IExpandListener)1 IControl (org.jowidgets.api.widgets.IControl)1 ITextLabelBluePrint (org.jowidgets.api.widgets.blueprint.ITextLabelBluePrint)1 BeanFormGroupRendering (org.jowidgets.cap.ui.api.form.BeanFormGroupRendering)1 IBeanFormGroup (org.jowidgets.cap.ui.api.form.IBeanFormGroup)1 IBeanFormInfo (org.jowidgets.cap.ui.api.form.IBeanFormInfo)1 IBeanFormProperty (org.jowidgets.cap.ui.api.form.IBeanFormProperty)1 IEntityComponentRelationTreeDetailViewPlugin (org.jowidgets.cap.ui.api.plugin.IEntityComponentRelationTreeDetailViewPlugin)1 IEntityComponentRelationTreeViewPlugin (org.jowidgets.cap.ui.api.plugin.IEntityComponentRelationTreeViewPlugin)1 ICapApiBluePrintFactory (org.jowidgets.cap.ui.api.widgets.ICapApiBluePrintFactory)1 AlignmentVertical (org.jowidgets.common.types.AlignmentVertical)1 Position (org.jowidgets.common.types.Position)1