Search in sources :

Example 36 with InlineMenuItemAction

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

the class FocusProjectionsPanel method createShadowMenu.

private List<InlineMenuItem> createShadowMenu() {
    List<InlineMenuItem> items = new ArrayList<>();
    PrismObjectDefinition<F> def = getObjectWrapperModel().getObject().getObject().getDefinition();
    PrismReferenceDefinition ref = def.findReferenceDefinition(UserType.F_LINK_REF);
    InlineMenuItem item;
    PrismPropertyDefinition<ActivationStatusType> administrativeStatus = def.findPropertyDefinition(SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS);
    if (administrativeStatus.canRead() && administrativeStatus.canModify()) {
        item = new ButtonInlineMenuItem(createStringResource("pageAdminFocus.button.enable")) {

            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) {
                        updateShadowActivation(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()), true);
                    }
                };
            }

            @Override
            public CompositedIconBuilder getIconCompositedBuilder() {
                return getDefaultCompositedIconBuilder("fa fa-check");
            }
        };
        items.add(item);
        item = new InlineMenuItem(createStringResource("pageAdminFocus.button.disable")) {

            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) {
                        updateShadowActivation(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()), false);
                    }
                };
            }
        };
        items.add(item);
    }
    if (ref.canRead() && ref.canAdd()) {
        item = new InlineMenuItem(createStringResource("pageAdminFocus.button.unlink")) {

            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) {
                        unlinkProjectionPerformed(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()));
                    }
                };
            }
        };
        items.add(item);
    }
    PrismPropertyDefinition<LockoutStatusType> locakoutStatus = def.findPropertyDefinition(SchemaConstants.PATH_ACTIVATION_LOCKOUT_STATUS);
    if (locakoutStatus.canRead() && locakoutStatus.canModify()) {
        item = new InlineMenuItem(createStringResource("pageAdminFocus.button.unlock")) {

            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) {
                        unlockShadowPerformed(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()));
                    }
                };
            }
        };
        items.add(item);
    }
    if (administrativeStatus.canRead() && administrativeStatus.canModify()) {
        // items.add(new 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) {
                        deleteProjectionPerformed(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().getSelectedObjects());
                    target.add(getPageBase().getFeedbackPanel());
                }
            };
        }
    };
    items.add(item);
    return items;
}
Also used : ArrayList(java.util.ArrayList) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) InlineMenuItemAction(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) ColumnMenuAction(com.evolveum.midpoint.web.component.data.column.ColumnMenuAction) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)

Example 37 with InlineMenuItemAction

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

the class ShadowTablePanel method createRowMenuItems.

private List<InlineMenuItem> createRowMenuItems() {
    List<InlineMenuItem> items = new ArrayList<>();
    items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.enableAccount"), true) {

        private static final long serialVersionUID = 1L;

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

                private static final long serialVersionUID = 1L;

                @Override
                public void onSubmit(AjaxRequestTarget target) {
                    updateResourceObjectStatusPerformed(getRowModel(), target, true);
                }
            };
        }
    });
    items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.disableAccount"), true) {

        private static final long serialVersionUID = 1L;

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

                private static final long serialVersionUID = 1L;

                @Override
                public void onSubmit(AjaxRequestTarget target) {
                    updateResourceObjectStatusPerformed(getRowModel(), target, false);
                }
            };
        }
    });
    items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.deleteAccount"), true) {

        private static final long serialVersionUID = 1L;

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

                private static final long serialVersionUID = 1L;

                @Override
                public void onSubmit(AjaxRequestTarget target) {
                    deleteResourceObjectPerformed(getRowModel(), target);
                }
            };
        }
    });
    items.add(new ButtonInlineMenuItem(createStringResource("pageContentAccounts.menu.importAccount"), true) {

        private static final long serialVersionUID = 1L;

        @Override
        public InlineMenuItemAction initAction() {
            return new ColumnMenuAction<SelectableBeanImpl<ShadowType>>() {

                private static final long serialVersionUID = 1L;

                @Override
                public void onSubmit(AjaxRequestTarget target) {
                    if (getRowModel() == null) {
                        importResourceObject(null, target);
                    } else {
                        SelectableBeanImpl<ShadowType> shadow = getRowModel().getObject();
                        importResourceObject(shadow.getValue(), target);
                    }
                }
            };
        }

        @Override
        public CompositedIconBuilder getIconCompositedBuilder() {
            return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_IMPORT_MENU_ITEM);
        }
    });
    // items.add(new InlineMenuItem());
    items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.removeOwner"), true) {

        private static final long serialVersionUID = 1L;

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

                private static final long serialVersionUID = 1L;

                @Override
                public void onSubmit(AjaxRequestTarget target) {
                    changeOwner(getRowModel(), target, null, true);
                }
            };
        }
    });
    items.add(new ButtonInlineMenuItem(createStringResource("pageContentAccounts.menu.changeOwner"), true) {

        private static final long serialVersionUID = 1L;

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

                private static final long serialVersionUID = 1L;

                @Override
                public void onSubmit(AjaxRequestTarget target) {
                    ObjectBrowserPanel<FocusType> browser = new ObjectBrowserPanel<>(getPageBase().getMainPopupBodyId(), UserType.class, WebComponentUtil.createFocusTypeList(), false, getPageBase()) {

                        @Override
                        protected void onSelectPerformed(AjaxRequestTarget target, FocusType focus) {
                            changeOwner(getRowModel(), target, focus, false);
                        }
                    };
                    getPageBase().showMainPopup(browser, target);
                }
            };
        }

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

        @Override
        public boolean isHeaderMenuItem() {
            return false;
        }
    });
    return items;
}
Also used : SelectableBeanImpl(com.evolveum.midpoint.web.component.util.SelectableBeanImpl) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ObjectBrowserPanel(com.evolveum.midpoint.gui.api.component.ObjectBrowserPanel) 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) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)

Example 38 with InlineMenuItemAction

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

the class PageUsers method createRowActions.

private List<InlineMenuItem> createRowActions() {
    List<InlineMenuItem> menu = new ArrayList<>();
    ButtonInlineMenuItem enableItem = new ButtonInlineMenuItem(createStringResource("pageUsers.menu.enable")) {

        private static final long serialVersionUID = 1L;

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

                @Override
                public void onClick(AjaxRequestTarget target) {
                    updateActivationPerformed(target, true, getRowModel());
                }
            };
        }

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

        @Override
        public IModel<String> getConfirmationMessageModel() {
            String actionName = createStringResource("pageUsers.message.enableAction").getString();
            return getTable().getConfirmationMessageModel((ColumnMenuAction) getAction(), actionName);
        }
    };
    enableItem.setVisibilityChecker(FocusListInlineMenuHelper::isObjectDisabled);
    menu.add(enableItem);
    ButtonInlineMenuItem disableItem = new ButtonInlineMenuItem(createStringResource("pageUsers.menu.disable")) {

        private static final long serialVersionUID = 1L;

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

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    updateActivationPerformed(target, false, getRowModel());
                }
            };
        }

        @Override
        public CompositedIconBuilder getIconCompositedBuilder() {
            CompositedIconBuilder builder = getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_OBJECT_USER_ICON);
            builder.appendLayerIcon(WebComponentUtil.createIconType(GuiStyleConstants.CLASS_BAN), IconCssStyle.BOTTOM_RIGHT_STYLE);
            return builder;
        }

        @Override
        public IModel<String> getConfirmationMessageModel() {
            String actionName = createStringResource("pageUsers.message.disableAction").getString();
            return getTable().getConfirmationMessageModel((ColumnMenuAction) getAction(), actionName);
        }
    };
    disableItem.setVisibilityChecker(FocusListInlineMenuHelper::isObjectEnabled);
    menu.add(disableItem);
    menu.add(new ButtonInlineMenuItem(createStringResource("pageUsers.menu.reconcile")) {

        private static final long serialVersionUID = 1L;

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

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    reconcilePerformed(target, getRowModel());
                }
            };
        }

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

        @Override
        public IModel<String> getConfirmationMessageModel() {
            String actionName = createStringResource("pageUsers.message.reconcileAction").getString();
            return getTable().getConfirmationMessageModel((ColumnMenuAction) getAction(), actionName);
        }
    });
    menu.add(new InlineMenuItem(createStringResource("pageUsers.menu.unlock")) {

        private static final long serialVersionUID = 1L;

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

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    unlockPerformed(target, getRowModel());
                }
            };
        }

        @Override
        public IModel<String> getConfirmationMessageModel() {
            String actionName = createStringResource("pageUsers.message.unlockAction").getString();
            return getTable().getConfirmationMessageModel((ColumnMenuAction) getAction(), actionName);
        }
    });
    menu.add(getTable().createDeleteInlineMenu());
    // TODO: shouldn't  be visible only if supported?
    menu.add(new InlineMenuItem(createStringResource("pageUsers.menu.merge")) {

        private static final long serialVersionUID = 1L;

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

                @Override
                public void onClick(AjaxRequestTarget target) {
                    OperationResult result = new OperationResult(OPERATION_LOAD_MERGE_CONFIGURATION);
                    List<MergeConfigurationType> mergeConfiguration;
                    try {
                        mergeConfiguration = getModelInteractionService().getMergeConfiguration(result);
                    } catch (ObjectNotFoundException | SchemaException ex) {
                        LOGGER.error("Couldn't load merge configuration: {}", ex.getLocalizedMessage());
                        result.recomputeStatus();
                        getFeedbackMessages().error(PageUsers.this, ex.getLocalizedMessage());
                        target.add(getFeedbackPanel());
                        return;
                    }
                    if (mergeConfiguration == null || mergeConfiguration.size() == 0) {
                        getFeedbackMessages().warn(PageUsers.this, createStringResource("PageUsers.noMergeConfigurationMessage").getString());
                        target.add(getFeedbackPanel());
                        return;
                    }
                    if (getRowModel() == null) {
                        mergePerformed(target, null);
                    } else {
                        SelectableBean<UserType> rowDto = getRowModel().getObject();
                        mergePerformed(target, rowDto.getValue());
                    }
                }
            };
        }

        @Override
        public boolean isHeaderMenuItem() {
            return false;
        }
    });
    return menu;
}
Also used : IModel(org.apache.wicket.model.IModel) ArrayList(java.util.ArrayList) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) 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) ArrayList(java.util.ArrayList) List(java.util.List) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem) FocusListInlineMenuHelper(com.evolveum.midpoint.web.component.util.FocusListInlineMenuHelper)

Example 39 with InlineMenuItemAction

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

the class PageResources method createRowMenuItems.

private List<InlineMenuItem> createRowMenuItems() {
    List<InlineMenuItem> menuItems = new ArrayList<>();
    menuItems.add(new ButtonInlineMenuItem(createStringResource("PageResources.inlineMenuItem.test")) {

        private static final long serialVersionUID = 1L;

        @Override
        public InlineMenuItemAction initAction() {
            return new ColumnMenuAction<SelectableBeanImpl<ResourceType>>() {

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    SelectableBeanImpl<ResourceType> rowDto = getRowModel().getObject();
                    testResourcePerformed(target, rowDto.getValue());
                }
            };
        }

        @Override
        public boolean isHeaderMenuItem() {
            return false;
        }

        @Override
        public CompositedIconBuilder getIconCompositedBuilder() {
            return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_TEST_CONNECTION_MENU_ITEM);
        }
    });
    menuItems.add(new ButtonInlineMenuItem(createStringResource("pageResources.button.editAsXml")) {

        private static final long serialVersionUID = 1L;

        @Override
        public InlineMenuItemAction initAction() {
            return new ColumnMenuAction<SelectableBeanImpl<ResourceType>>() {

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    SelectableBeanImpl<ResourceType> rowDto = getRowModel().getObject();
                    editAsXmlPerformed(rowDto.getValue());
                }
            };
        }

        @Override
        public boolean isHeaderMenuItem() {
            return false;
        }

        @Override
        public CompositedIconBuilder getIconCompositedBuilder() {
            return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_EDIT_MENU_ITEM);
        }
    });
    menuItems.add(new InlineMenuItem(createStringResource("pageResources.inlineMenuItem.editResource")) {

        private static final long serialVersionUID = 1L;

        @Override
        public InlineMenuItemAction initAction() {
            return new ColumnMenuAction<SelectableBeanImpl<ResourceType>>() {

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    SelectableBeanImpl<ResourceType> rowDto = getRowModel().getObject();
                    editResourcePerformed(rowDto.getValue());
                }
            };
        }

        @Override
        public boolean isHeaderMenuItem() {
            return false;
        }
    });
    menuItems.add(new InlineMenuItem(createStringResource("pageResource.button.refreshSchema")) {

        private static final long serialVersionUID = 1L;

        @Override
        public InlineMenuItemAction initAction() {
            return new ColumnMenuAction<SelectableBeanImpl<ResourceType>>() {

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    SelectableBeanImpl<ResourceType> rowDto = getRowModel().getObject();
                    refreshSchemaPerformed(rowDto.getValue(), target);
                }
            };
        }

        @Override
        public boolean isHeaderMenuItem() {
            return false;
        }
    });
    menuItems.add(new ButtonInlineMenuItem(createStringResource("PageBase.button.delete")) {

        private static final long serialVersionUID = 1L;

        @Override
        public InlineMenuItemAction initAction() {
            return new ColumnMenuAction<SelectableBeanImpl<ResourceType>>() {

                private static final long serialVersionUID = 1L;

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

        @Override
        public CompositedIconBuilder getIconCompositedBuilder() {
            return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_DELETE_MENU_ITEM);
        }
    });
    menuItems.add(new InlineMenuItem(createStringResource("pageResources.inlineMenuItem.deleteSyncToken")) {

        private static final long serialVersionUID = 1L;

        @Override
        public InlineMenuItemAction initAction() {
            return new ColumnMenuAction<SelectableBeanImpl<ResourceType>>() {

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    SelectableBeanImpl<ResourceType> rowDto = getRowModel().getObject();
                    deleteResourceSyncTokenPerformed(target, rowDto.getValue());
                }
            };
        }

        @Override
        public boolean isHeaderMenuItem() {
            return false;
        }
    });
    menuItems.add(new InlineMenuItem(createStringResource("pageResources.inlineMenuItem.toggleMaintenance")) {

        private static final long serialVersionUID = 1L;

        @Override
        public InlineMenuItemAction initAction() {
            return new ColumnMenuAction<SelectableBeanImpl<ResourceType>>() {

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    SelectableBeanImpl<ResourceType> rowDto = getRowModel().getObject();
                    WebComponentUtil.toggleResourceMaintenance(rowDto.getValue().asPrismContainer(), OPERATION_SET_MAINTENANCE, target, PageResources.this);
                    target.add(getResourceTable());
                }
            };
        }

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

Example 40 with InlineMenuItemAction

use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction 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(target, 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) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) DropdownButtonPanel(com.evolveum.midpoint.gui.api.component.button.DropdownButtonPanel)

Aggregations

InlineMenuItemAction (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction)50 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)49 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)44 ArrayList (java.util.ArrayList)34 CompositedIconBuilder (com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)29 ButtonInlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)29 IModel (org.apache.wicket.model.IModel)21 ColumnMenuAction (com.evolveum.midpoint.web.component.data.column.ColumnMenuAction)14 SelectableBeanImpl (com.evolveum.midpoint.web.component.util.SelectableBeanImpl)12 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)9 ListItem (org.apache.wicket.markup.html.list.ListItem)8 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)7 List (java.util.List)6 QName (javax.xml.namespace.QName)6 DropdownButtonDto (com.evolveum.midpoint.gui.api.component.button.DropdownButtonDto)5 DropdownButtonPanel (com.evolveum.midpoint.gui.api.component.button.DropdownButtonPanel)5 PrismContainerValueWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerValueWrapper)5 HeaderMenuAction (com.evolveum.midpoint.web.page.admin.configuration.component.HeaderMenuAction)5 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)5 ObjectBrowserPanel (com.evolveum.midpoint.gui.api.component.ObjectBrowserPanel)4