Search in sources :

Example 1 with InlineMenuButtonColumn

use of com.evolveum.midpoint.web.component.data.column.InlineMenuButtonColumn in project midpoint by Evolveum.

the class PageServices method initLayout.

private void initLayout() {
    Form mainForm = new Form(ID_MAIN_FORM);
    add(mainForm);
    MainObjectListPanel<ServiceType> servicePanel = new MainObjectListPanel<ServiceType>(ID_TABLE, ServiceType.class, TableId.TABLE_SERVICES, null, this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void objectDetailsPerformed(AjaxRequestTarget target, ServiceType service) {
            PageServices.this.serviceDetailsPerformed(target, service);
        }

        @Override
        protected List<IColumn<SelectableBean<ServiceType>, String>> createColumns() {
            return ColumnUtils.getDefaultServiceColumns();
        }

        @Override
        protected IColumn<SelectableBean<ServiceType>, String> createActionsColumn() {
            return new InlineMenuButtonColumn<SelectableBean<ServiceType>>(listInlineMenuHelper.createRowActions(false), 3, PageServices.this) {

                @Override
                protected int getHeaderNumberOfButtons() {
                    return 2;
                }

                @Override
                protected List<InlineMenuItem> getHeaderMenuItems() {
                    return listInlineMenuHelper.createRowActions(true);
                }
            };
        }

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            return listInlineMenuHelper.createRowActions(false);
        }

        @Override
        protected void newObjectPerformed(AjaxRequestTarget target) {
            navigateToNext(PageService.class);
        }
    };
    servicePanel.setAdditionalBoxCssClasses(GuiStyleConstants.CLASS_OBJECT_SERVICE_BOX_CSS_CLASSES);
    servicePanel.setOutputMarkupId(true);
    mainForm.add(servicePanel);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) Form(org.apache.wicket.markup.html.form.Form) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) ServiceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ServiceType) InlineMenuButtonColumn(com.evolveum.midpoint.web.component.data.column.InlineMenuButtonColumn) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Aggregations

MainObjectListPanel (com.evolveum.midpoint.gui.api.component.MainObjectListPanel)1 InlineMenuButtonColumn (com.evolveum.midpoint.web.component.data.column.InlineMenuButtonColumn)1 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)1 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)1 ServiceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ServiceType)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)1 Form (org.apache.wicket.markup.html.form.Form)1