Search in sources :

Example 6 with CompositedIconBuilder

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

the class ChooseMemberPopup method createCompositedIconButtonDto.

private CompositedIconButtonDto createCompositedIconButtonDto(DisplayType buttonDisplayType, AssignmentObjectRelation relation, CompositedIcon icon) {
    CompositedIconButtonDto compositedIconButtonDto = new CompositedIconButtonDto();
    compositedIconButtonDto.setAdditionalButtonDisplayType(buttonDisplayType);
    if (icon != null) {
        compositedIconButtonDto.setCompositedIcon(icon);
    } else {
        CompositedIconBuilder mainButtonIconBuilder = new CompositedIconBuilder();
        mainButtonIconBuilder.setBasicIcon(WebComponentUtil.getIconCssClass(buttonDisplayType), IconCssStyle.IN_ROW_STYLE).appendColorHtmlValue(WebComponentUtil.getIconColor(buttonDisplayType));
        compositedIconButtonDto.setCompositedIcon(mainButtonIconBuilder.build());
    }
    compositedIconButtonDto.setAssignmentObjectRelation(relation);
    return compositedIconButtonDto;
}
Also used : CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)

Example 7 with CompositedIconBuilder

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

the class MainObjectListPanel method createCompositedIcon.

private CompositedIcon createCompositedIcon(CompiledObjectCollectionView collectionView) {
    DisplayType display = GuiDisplayTypeUtil.getNewObjectDisplayTypeFromCollectionView(collectionView, getPageBase());
    CompositedIconBuilder builder = new CompositedIconBuilder();
    PolyStringType tooltip = display != null ? display.getTooltip() : null;
    builder.setBasicIcon(WebComponentUtil.getIconCssClass(display), IconCssStyle.IN_ROW_STYLE).appendColorHtmlValue(WebComponentUtil.getIconColor(display)).setTitle(WebComponentUtil.getTranslatedPolyString(tooltip));
    return builder.build();
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)

Example 8 with CompositedIconBuilder

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

the class MainObjectListPanel method createNewObjectButton.

private Component createNewObjectButton(String buttonId) {
    DisplayType newObjectButtonDisplayType = getNewObjectButtonStandardDisplayType();
    CompositedIconBuilder builder = new CompositedIconBuilder();
    builder.setBasicIcon(WebComponentUtil.getIconCssClass(newObjectButtonDisplayType), IconCssStyle.IN_ROW_STYLE).appendColorHtmlValue(WebComponentUtil.getIconColor(newObjectButtonDisplayType));
    CompiledObjectCollectionView view = getObjectCollectionView();
    if (ObjectCollectionViewUtil.isArchetypedCollectionView(view)) {
        IconType plusIcon = new IconType();
        plusIcon.setCssClass(GuiStyleConstants.CLASS_ADD_NEW_OBJECT);
        plusIcon.setColor("green");
        builder.appendLayerIcon(plusIcon, LayeredIconCssStyle.BOTTOM_RIGHT_STYLE);
    }
    String iconTitle = WebComponentUtil.getDisplayTypeTitle(newObjectButtonDisplayType);
    AjaxCompositedIconButton createNewObjectButton = new AjaxCompositedIconButton(buttonId, builder.build(), createStringResource(StringUtils.isEmpty(iconTitle) ? "MainObjectListPanel.newObject" : iconTitle)) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            if (isCollectionViewPanelForCompiledView()) {
                CompiledObjectCollectionView collectionView = getObjectCollectionView();
                // HACK TODO clenup and think about generic mechanism for this
                if (isCollectionViewWithoutMorePossibleNewType(collectionView)) {
                    newObjectPerformed(target, null, collectionView);
                    return;
                }
            }
            if (!showNewObjectCreationPopup()) {
                newObjectPerformed(target, null, getObjectCollectionView());
                return;
            }
            NewObjectCreationPopup buttonsPanel = new NewObjectCreationPopup(getPageBase().getMainPopupBodyId(), new PropertyModel<>(loadButtonDescriptions(), MultiFunctinalButtonDto.F_ADDITIONAL_BUTTONS)) {

                private static final long serialVersionUID = 1L;

                @Override
                protected void buttonClickPerformed(AjaxRequestTarget target, AssignmentObjectRelation relationSpec, CompiledObjectCollectionView collectionViews, Class<? extends WebPage> page) {
                    getPageBase().hideMainPopup(target);
                    MainObjectListPanel.this.newObjectPerformed(target, relationSpec, collectionViews);
                }
            };
            getPageBase().showMainPopup(buttonsPanel, target);
        }
    };
    createNewObjectButton.add(new VisibleBehaviour(this::isCreateNewObjectEnabled));
    createNewObjectButton.add(AttributeAppender.append("class", "btn btn-default btn-sm"));
    return createNewObjectButton;
}
Also used : AjaxCompositedIconButton(com.evolveum.midpoint.gui.impl.component.AjaxCompositedIconButton) WebPage(org.apache.wicket.markup.html.WebPage) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView) AssignmentObjectRelation(com.evolveum.midpoint.model.api.AssignmentObjectRelation) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)

Example 9 with CompositedIconBuilder

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

the class NotificationConfigTabPanel method getMenuActions.

private List<InlineMenuItem> getMenuActions() {
    List<InlineMenuItem> menuItems = new ArrayList<>();
    menuItems.add(new ButtonInlineMenuItem(createStringResource("PageBase.button.unassign")) {

        private static final long serialVersionUID = 1L;

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

        @Override
        public InlineMenuItemAction initAction() {
            return createDeleteColumnAction();
        }
    });
    menuItems.add(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 createEditColumnAction();
        }
    });
    return menuItems;
}
Also used : ArrayList(java.util.ArrayList) 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) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)

Example 10 with CompositedIconBuilder

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

the class ReportOperationalButtonsPanel method initSaveAndRunButton.

private void initSaveAndRunButton(RepeatingView repeatingView) {
    IconType iconType = new IconType();
    iconType.setCssClass(GuiStyleConstants.CLASS_PLAY);
    CompositedIconBuilder iconBuilder = new CompositedIconBuilder().setBasicIcon(GuiStyleConstants.CLASS_ICON_SAVE, IconCssStyle.IN_ROW_STYLE);
    // .appendLayerIcon(iconType, IconCssStyle.BOTTOM_RIGHT_STYLE);
    AjaxCompositedIconSubmitButton saveAndRunButton = new AjaxCompositedIconSubmitButton(repeatingView.newChildId(), iconBuilder.build(), createStringResource("pageReport.button.saveAndRun")) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            saveAndRunPerformed(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target) {
            target.add(getPageBase().getFeedbackPanel());
        }
    };
    saveAndRunButton.titleAsLabel(true);
    saveAndRunButton.add(new VisibleBehaviour(() -> !getModelObject().isReadOnly()));
    saveAndRunButton.setOutputMarkupId(true);
    saveAndRunButton.setOutputMarkupPlaceholderTag(true);
    saveAndRunButton.add(AttributeAppender.append("class", "btn-primary btn-sm"));
    repeatingView.add(saveAndRunButton);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder) AjaxCompositedIconSubmitButton(com.evolveum.midpoint.web.component.AjaxCompositedIconSubmitButton)

Aggregations

CompositedIconBuilder (com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)57 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)32 ButtonInlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)26 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)26 InlineMenuItemAction (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction)26 ArrayList (java.util.ArrayList)26 IModel (org.apache.wicket.model.IModel)17 ColumnMenuAction (com.evolveum.midpoint.web.component.data.column.ColumnMenuAction)11 CompositedIconButtonDto (com.evolveum.midpoint.web.component.CompositedIconButtonDto)9 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)9 AssignmentObjectRelation (com.evolveum.midpoint.model.api.AssignmentObjectRelation)7 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)7 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)7 SelectableBeanImpl (com.evolveum.midpoint.web.component.util.SelectableBeanImpl)7 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)6 CompositedIcon (com.evolveum.midpoint.gui.impl.component.icon.CompositedIcon)6 PrismContainerValueWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerValueWrapper)5 CompositedIconColumn (com.evolveum.midpoint.gui.impl.component.data.column.CompositedIconColumn)4 InlineMenuButtonColumn (com.evolveum.midpoint.web.component.data.column.InlineMenuButtonColumn)4 UserProfileStorage (com.evolveum.midpoint.web.session.UserProfileStorage)4