Search in sources :

Example 1 with MappingColumnPanel

use of com.evolveum.midpoint.gui.impl.component.MappingColumnPanel in project midpoint by Evolveum.

the class ObjectTemplateItemPanel method createAdditionalColumns.

@Override
protected List<IColumn<PrismContainerValueWrapper<ObjectTemplateItemDefinitionType>, String>> createAdditionalColumns() {
    List<IColumn<PrismContainerValueWrapper<ObjectTemplateItemDefinitionType>, String>> columns = new ArrayList<>();
    columns.add(new AbstractColumn<>(createStringResource("ObjectTemplateItemDefinitionType.mapping")) {

        @Override
        public void populateItem(Item<ICellPopulator<PrismContainerValueWrapper<ObjectTemplateItemDefinitionType>>> cellItem, String componentId, IModel<PrismContainerValueWrapper<ObjectTemplateItemDefinitionType>> rowModel) {
            IModel<PrismContainerWrapper<MappingType>> mappingModel = PrismContainerWrapperModel.fromContainerValueWrapper(rowModel, ObjectTemplateItemDefinitionType.F_MAPPING);
            cellItem.add(new MappingColumnPanel(componentId, mappingModel));
        }
    });
    List<InlineMenuItem> items = new ArrayList<>();
    InlineMenuItem item = new InlineMenuItem(createStringResource("pageAdminFocus.button.delete")) {

        private static final long serialVersionUID = 1L;

        @Override
        public InlineMenuItemAction initAction() {
            return new ColumnMenuAction() {

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    getMultivalueContainerListPanel().deleteItemPerformed(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()));
                }
            };
        }
    };
    items.add(item);
    item = new ButtonInlineMenuItem(createStringResource("PageBase.button.edit")) {

        private static final long serialVersionUID = 1L;

        @Override
        public CompositedIconBuilder getIconCompositedBuilder() {
            return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_EDIT_MENU_ITEM);
        }

        @Override
        public InlineMenuItemAction initAction() {
            return new ColumnMenuAction() {

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    getMultivalueContainerListPanel().editItemPerformed(target, getRowModel(), getMultivalueContainerListPanel().getSelectedItems());
                    target.add(getMultivalueContainerListPanel().getFeedbackPanel());
                }
            };
        }
    };
    items.add(item);
    columns.add(new InlineMenuButtonColumn(items, getPageBase()) {

        @Override
        public String getCssClass() {
            return "col-xs-1";
        }
    });
    return columns;
}
Also used : MappingType(com.evolveum.midpoint.xml.ns._public.common.common_3.MappingType) ObjectTemplateMappingType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectTemplateMappingType) IModel(org.apache.wicket.model.IModel) InlineMenuButtonColumn(com.evolveum.midpoint.web.component.data.column.InlineMenuButtonColumn) ArrayList(java.util.ArrayList) ObjectTemplateItemDefinitionType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectTemplateItemDefinitionType) ICellPopulator(org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) MappingColumnPanel(com.evolveum.midpoint.gui.impl.component.MappingColumnPanel) InlineMenuItemAction(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem) ColumnMenuAction(com.evolveum.midpoint.web.component.data.column.ColumnMenuAction) PrismContainerValueWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerValueWrapper) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)

Aggregations

PrismContainerValueWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerValueWrapper)1 MappingColumnPanel (com.evolveum.midpoint.gui.impl.component.MappingColumnPanel)1 CompositedIconBuilder (com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)1 ColumnMenuAction (com.evolveum.midpoint.web.component.data.column.ColumnMenuAction)1 InlineMenuButtonColumn (com.evolveum.midpoint.web.component.data.column.InlineMenuButtonColumn)1 ButtonInlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)1 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)1 InlineMenuItemAction (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction)1 MappingType (com.evolveum.midpoint.xml.ns._public.common.common_3.MappingType)1 ObjectTemplateItemDefinitionType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectTemplateItemDefinitionType)1 ObjectTemplateMappingType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectTemplateMappingType)1 ArrayList (java.util.ArrayList)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 ICellPopulator (org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator)1 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)1 IModel (org.apache.wicket.model.IModel)1