Search in sources :

Example 81 with InlineMenuItem

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

the class ResourceContentPanel method initButton.

private void initButton(String id, String label, String icon, String archetypeOid) {
    ObjectQuery existingTasksQuery = getExistingTasksQuery(archetypeOid);
    OperationResult result = new OperationResult(OPERATION_SEARCH_TASKS_FOR_RESOURCE);
    List<PrismObject<TaskType>> tasksList = WebModelServiceUtils.searchObjects(TaskType.class, existingTasksQuery, result, getPageBase());
    List<InlineMenuItem> items = new ArrayList<>();
    InlineMenuItem item = new InlineMenuItem(getPageBase().createStringResource("ResourceContentResourcePanel.showExisting")) {

        private static final long serialVersionUID = 1L;

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

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    List<TaskType> filteredByKindIntentTasks = getTasksForKind(tasksList);
                    redirectToTasksListPage(createInTaskOidQuery(filteredByKindIntentTasks), archetypeOid);
                }
            };
        }
    };
    items.add(item);
    item = new InlineMenuItem(getPageBase().createStringResource("ResourceContentResourcePanel.newTask")) {

        private static final long serialVersionUID = 1L;

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

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    newTaskPerformed(archetypeOid);
                }
            };
        }
    };
    items.add(item);
    DropdownButtonPanel button = new DropdownButtonPanel(id, new DropdownButtonDto(String.valueOf(tasksList.size()), icon, label, items)) {

        @Override
        protected String getSpecialDropdownMenuClass() {
            return "pull-left";
        }
    };
    add(button);
}
Also used : DropdownButtonDto(com.evolveum.midpoint.gui.api.component.button.DropdownButtonDto) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) PrismObject(com.evolveum.midpoint.prism.PrismObject) InlineMenuItemAction(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) DropdownButtonPanel(com.evolveum.midpoint.gui.api.component.button.DropdownButtonPanel)

Example 82 with InlineMenuItem

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

the class AbstractRoleMemberPanel method createRowActions.

protected List<InlineMenuItem> createRowActions() {
    List<InlineMenuItem> menu = new ArrayList<>();
    createAssignMemberRowAction(menu);
    createUnassignMemberRowAction(menu);
    createRecomputeMemberRowAction(menu);
    if (isAuthorized(GuiAuthorizationConstants.MEMBER_OPERATION_CREATE)) {
        menu.add(new InlineMenuItem(createStringResource("abstractRoleMemberPanel.menu.create")) {

            private static final long serialVersionUID = 1L;

            @Override
            public InlineMenuItemAction initAction() {
                return new HeaderMenuAction(AbstractRoleMemberPanel.this) {

                    private static final long serialVersionUID = 1L;

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        createFocusMemberPerformed(target);
                    }
                };
            }
        });
    }
    if (isAuthorized(GuiAuthorizationConstants.MEMBER_OPERATION_DELETE)) {
        menu.add(new InlineMenuItem(createStringResource("abstractRoleMemberPanel.menu.delete")) {

            private static final long serialVersionUID = 1L;

            @Override
            public InlineMenuItemAction initAction() {
                return new HeaderMenuAction(AbstractRoleMemberPanel.this) {

                    private static final long serialVersionUID = 1L;

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        deleteMembersPerformed(target);
                    }
                };
            }
        });
    }
    return menu;
}
Also used : HeaderMenuAction(com.evolveum.midpoint.web.page.admin.configuration.component.HeaderMenuAction) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) InlineMenuItemAction(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Example 83 with InlineMenuItem

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

the class PageConnectorHosts method initLayout.

protected void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    add(mainForm);
    MainObjectListPanel<ConnectorHostType> table = new MainObjectListPanel<ConnectorHostType>(ID_TABLE, ConnectorHostType.class, getQueryOptions()) {

        @Override
        protected void objectDetailsPerformed(AjaxRequestTarget target, ConnectorHostType host) {
        }

        @Override
        protected UserProfileStorage.TableId getTableId() {
            return UserProfileStorage.TableId.PAGE_RESOURCES_CONNECTOR_HOSTS;
        }

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

        @Override
        protected List<IColumn<SelectableBean<ConnectorHostType>, String>> createDefaultColumns() {
            return PageConnectorHosts.this.initColumns();
        }

        @Override
        protected boolean isCreateNewObjectEnabled() {
            return false;
        }

        @Override
        protected boolean isObjectDetailsEnabled(IModel<SelectableBean<ConnectorHostType>> rowModel) {
            return false;
        }
    };
    table.setOutputMarkupId(true);
    mainForm.add(table);
}
Also used : ConnectorHostType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) IModel(org.apache.wicket.model.IModel) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Example 84 with InlineMenuItem

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

the class PageConnectorHosts method createRowActions.

private List<InlineMenuItem> createRowActions() {
    List<InlineMenuItem> headerMenuItems = new ArrayList<>();
    headerMenuItems.add(new InlineMenuItem(createStringResource("PageBase.button.delete")) {

        private static final long serialVersionUID = 1L;

        @Override
        public InlineMenuItemAction initAction() {
            return new HeaderMenuAction(PageConnectorHosts.this) {

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    deleteHostPerformed(target);
                }
            };
        }
    });
    headerMenuItems.add(new InlineMenuItem(createStringResource("pageResources.button.discoveryRemote")) {

        private static final long serialVersionUID = 1L;

        @Override
        public InlineMenuItemAction initAction() {
            return new HeaderMenuAction(PageConnectorHosts.this) {

                private static final long serialVersionUID = 1L;

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

Example 85 with InlineMenuItem

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

the class InternalsLoggedInUsersPanel method initInlineMenu.

private List<InlineMenuItem> initInlineMenu() {
    List<InlineMenuItem> menuItems = new ArrayList<>();
    menuItems.add(new ButtonInlineMenuItem(createStringResource("InternalsLoggedInUsers.refresh")) {

        private static final long serialVersionUID = 1L;

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

        @Override
        public InlineMenuItemAction initAction() {
            return new ColumnMenuAction<SelectableBean<F>>() {

                @Override
                public void onClick(AjaxRequestTarget target) {
                    if (getRowModel() == null) {
                        terminateSessions(target, null);
                    } else {
                        SelectableBean<F> rowDto = getRowModel().getObject();
                        terminateSessions(target, rowDto.getValue());
                    }
                }
            };
        }

        @Override
        public boolean isHeaderMenuItem() {
            return true;
        }
    });
    return menuItems;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ArrayList(java.util.ArrayList) InlineMenuItemAction(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean) 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) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)

Aggregations

InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)114 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)82 ArrayList (java.util.ArrayList)68 ButtonInlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)47 InlineMenuItemAction (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction)43 IModel (org.apache.wicket.model.IModel)41 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)35 UserProfileStorage (com.evolveum.midpoint.web.session.UserProfileStorage)30 CompositedIconBuilder (com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)26 MainObjectListPanel (com.evolveum.midpoint.gui.api.component.MainObjectListPanel)25 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)24 ColumnMenuAction (com.evolveum.midpoint.web.component.data.column.ColumnMenuAction)19 Label (org.apache.wicket.markup.html.basic.Label)18 MidpointForm (com.evolveum.midpoint.web.component.form.MidpointForm)17 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)15 Form (org.apache.wicket.markup.html.form.Form)15 SelectableBeanImpl (com.evolveum.midpoint.web.component.util.SelectableBeanImpl)13 HeaderMenuAction (com.evolveum.midpoint.web.page.admin.configuration.component.HeaderMenuAction)13 ListItem (org.apache.wicket.markup.html.list.ListItem)12 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)11