Search in sources :

Example 31 with InlineMenuItem

use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.

the class PageTasks method initNodeColumns.

private List<IColumn<NodeDto, String>> initNodeColumns() {
    List<IColumn<NodeDto, String>> columns = new ArrayList<>();
    IColumn column = new CheckBoxHeaderColumn<>();
    columns.add(column);
    column = new PropertyColumn<>(createStringResource("pageTasks.node.name"), "name", "name");
    columns.add(column);
    columns.add(new EnumPropertyColumn<NodeDto>(createStringResource("pageTasks.node.executionStatus"), "executionStatus") {

        @Override
        protected String translate(Enum en) {
            return createStringResource(en).getString();
        }
    });
    columns.add(new PropertyColumn(createStringResource("pageTasks.node.managementPort"), "managementPort"));
    columns.add(new AbstractColumn<NodeDto, String>(createStringResource("pageTasks.node.lastCheckInTime")) {

        @Override
        public void populateItem(Item<ICellPopulator<NodeDto>> item, String componentId, final IModel<NodeDto> rowModel) {
            item.add(new Label(componentId, new AbstractReadOnlyModel<Object>() {

                @Override
                public Object getObject() {
                    return createLastCheckInTime(rowModel);
                }
            }));
        }
    });
    CheckBoxColumn check = new CheckBoxColumn(createStringResource("pageTasks.node.clustered"), "clustered");
    check.setEnabled(false);
    columns.add(check);
    columns.add(new PropertyColumn(createStringResource("pageTasks.node.statusMessage"), "statusMessage"));
    IColumn<NodeDto, String> menuColumn = new InlineMenuButtonColumn<NodeDto>(createNodesInlineMenu(false), 2, PageTasks.this) {

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

        @Override
        protected List<InlineMenuItem> getHeaderMenuItems() {
            return createNodesInlineMenu(true);
        }
    };
    columns.add(menuColumn);
    return columns;
}
Also used : PropertyColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn) Label(org.apache.wicket.markup.html.basic.Label) ICellPopulator(org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) PrismObject(com.evolveum.midpoint.prism.PrismObject) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Example 32 with InlineMenuItem

use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.

the class RoleGovernanceRelationsPanel method createNewMemberInlineMenuItems.

@Override
protected List<InlineMenuItem> createNewMemberInlineMenuItems() {
    List<InlineMenuItem> newMemberMenuItems = new ArrayList<>();
    newMemberMenuItems.add(new InlineMenuItem(createStringResource("roleMemberPanel.menu.createApprover"), false, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            createFocusMemberPerformed(RelationTypes.APPROVER.getRelation(), target);
        }
    }));
    newMemberMenuItems.add(new InlineMenuItem(createStringResource("roleMemberPanel.menu.assignApprovers"), false, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            addMembers(RelationTypes.APPROVER.getRelation(), target);
        }
    }));
    newMemberMenuItems.add(new InlineMenuItem(createStringResource("roleMemberPanel.menu.createOwner"), false, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            createFocusMemberPerformed(RelationTypes.OWNER.getRelation(), target);
        }
    }));
    newMemberMenuItems.add(new InlineMenuItem(createStringResource("roleMemberPanel.menu.assignOwners"), false, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            addMembers(RelationTypes.OWNER.getRelation(), target);
        }
    }));
    newMemberMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.createManager"), false, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            createFocusMemberPerformed(RelationTypes.MANAGER.getRelation(), target);
        }
    }));
    newMemberMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.addManagers"), false, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            addMembers(RelationTypes.MANAGER.getRelation(), target);
        }
    }));
    return newMemberMenuItems;
}
Also used : HeaderMenuAction(com.evolveum.midpoint.web.page.admin.configuration.component.HeaderMenuAction) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ArrayList(java.util.ArrayList) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Example 33 with InlineMenuItem

use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.

the class OrgTreePanel method createTreeMenuInternal.

private List<InlineMenuItem> createTreeMenuInternal() {
    List<InlineMenuItem> items = new ArrayList<>();
    InlineMenuItem item = new InlineMenuItem(createStringResource("TreeTablePanel.collapseAll"), new InlineMenuItemAction() {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            collapseAllPerformed(target);
        }
    });
    items.add(item);
    item = new InlineMenuItem(createStringResource("TreeTablePanel.expandAll"), new InlineMenuItemAction() {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            expandAllPerformed(target);
        }
    });
    items.add(item);
    List<InlineMenuItem> additionalActions = createTreeMenu();
    if (additionalActions != null) {
        items.addAll(additionalActions);
    }
    return items;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) InlineMenuItemAction(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Example 34 with InlineMenuItem

use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.

the class PageCreatedReports method initInlineMenu.

private List<InlineMenuItem> initInlineMenu() {
    List<InlineMenuItem> headerMenuItems = new ArrayList<>();
    headerMenuItems.add(new InlineMenuItem(createStringResource("pageCreatedReports.inlineMenu.deleteAll"), true, new HeaderMenuAction(this) {

        @Override
        public void onSubmit(AjaxRequestTarget target, Form<?> form) {
            deleteAllPerformed(target, ReportDeleteDialogDto.Operation.DELETE_ALL);
        }
    }));
    headerMenuItems.add(new InlineMenuItem(createStringResource("pageCreatedReports.inlineMenu.deleteSelected"), true, new HeaderMenuAction(this) {

        @Override
        public void onSubmit(AjaxRequestTarget target, Form<?> form) {
            deleteSelectedPerformed(target, ReportDeleteDialogDto.Operation.DELETE_SELECTED, null);
        }
    }));
    return headerMenuItems;
}
Also used : HeaderMenuAction(com.evolveum.midpoint.web.page.admin.configuration.component.HeaderMenuAction) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) Form(org.apache.wicket.markup.html.form.Form) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Example 35 with InlineMenuItem

use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.

the class AbstractRoleMemberPanel method createMemberRecomputeInlineMenuItems.

protected List<InlineMenuItem> createMemberRecomputeInlineMenuItems() {
    List<InlineMenuItem> recomputeMenuItems = new ArrayList<>();
    recomputeMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.recomputeMembersSelected"), false, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            recomputeMembersPerformed(QueryScope.SELECTED, target);
        }
    }));
    recomputeMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.recomputeMembersAllDirect"), false, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            recomputeMembersPerformed(QueryScope.ALL_DIRECT, target);
        }
    }));
    recomputeMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.recomputeMembersAll"), false, new HeaderMenuAction(this) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            recomputeMembersPerformed(QueryScope.ALL, target);
        }
    }));
    return recomputeMenuItems;
}
Also used : HeaderMenuAction(com.evolveum.midpoint.web.page.admin.configuration.component.HeaderMenuAction) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ArrayList(java.util.ArrayList) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Aggregations

InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)45 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)36 ArrayList (java.util.ArrayList)24 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)11 HeaderMenuAction (com.evolveum.midpoint.web.page.admin.configuration.component.HeaderMenuAction)11 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)10 IModel (org.apache.wicket.model.IModel)10 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)9 Form (org.apache.wicket.markup.html.form.Form)9 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)8 MainObjectListPanel (com.evolveum.midpoint.gui.api.component.MainObjectListPanel)7 InlineMenuItemAction (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction)7 Label (org.apache.wicket.markup.html.basic.Label)7 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)7 Model (org.apache.wicket.model.Model)7 ColumnMenuAction (com.evolveum.midpoint.web.component.data.column.ColumnMenuAction)5 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)4 ObjectBrowserPanel (com.evolveum.midpoint.gui.api.component.ObjectBrowserPanel)3 PrismObject (com.evolveum.midpoint.prism.PrismObject)3 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)3