Search in sources :

Example 16 with CompositedIconBuilder

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

the class OperationalButtonsPanel method createSaveButton.

private void createSaveButton(RepeatingView repeatingView) {
    CompositedIconBuilder iconBuilder = new CompositedIconBuilder().setBasicIcon(GuiStyleConstants.CLASS_ICON_SAVE, LayeredIconCssStyle.IN_ROW_STYLE);
    AjaxCompositedIconSubmitButton save = new AjaxCompositedIconSubmitButton(repeatingView.newChildId(), iconBuilder.build(), getPageBase().createStringResource("PageBase.button.save")) {

        private static final long serialVersionUID = 1L;

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

        @Override
        protected void onError(AjaxRequestTarget target) {
            target.add(getPageBase().getFeedbackPanel());
        }
    };
    save.add(new VisibleBehaviour(this::isSaveButtonVisible));
    save.add(new EnableBehaviour(this::isSavePreviewButtonEnabled));
    save.titleAsLabel(true);
    save.setOutputMarkupId(true);
    save.add(AttributeAppender.append("class", "btn btn-success btn-sm"));
    repeatingView.add(save);
    Form form = save.findParent(Form.class);
    if (form != null) {
        form.setDefaultButton(save);
    }
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) Form(org.apache.wicket.markup.html.form.Form) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder) AjaxCompositedIconSubmitButton(com.evolveum.midpoint.web.component.AjaxCompositedIconSubmitButton) EnableBehaviour(com.evolveum.midpoint.web.component.util.EnableBehaviour)

Example 17 with CompositedIconBuilder

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

the class AbstractAssignmentTypePanel method getAssignmentMenuActions.

private List<InlineMenuItem> getAssignmentMenuActions() {
    List<InlineMenuItem> menuItems = new ArrayList<>();
    ButtonInlineMenuItem unassignMenuItem = createUnassignAction();
    if (unassignMenuItem != null) {
        menuItems.add(unassignMenuItem);
    }
    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 AbstractAssignmentTypePanel.this.createEditColumnAction();
        }
    });
    ButtonInlineMenuItem viewTargetObjectMenuItem = createViewTargetObjectAction();
    menuItems.add(viewTargetObjectMenuItem);
    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 18 with CompositedIconBuilder

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

the class AssignmentHolderOperationalButtonsPanel method createChangeArchetypeButton.

// TODO move to focus??
private void createChangeArchetypeButton(RepeatingView repeatingView) {
    IconType iconType = new IconType();
    iconType.setCssClass(GuiStyleConstants.CLASS_EDIT_MENU_ITEM);
    CompositedIconBuilder iconBuilder = new CompositedIconBuilder().setBasicIcon(GuiStyleConstants.EVO_ARCHETYPE_TYPE_ICON, IconCssStyle.IN_ROW_STYLE).appendLayerIcon(iconType, IconCssStyle.BOTTOM_RIGHT_STYLE);
    AjaxIconButton changeArchetype = new AjaxIconButton(repeatingView.newChildId(), Model.of(GuiStyleConstants.EVO_ARCHETYPE_TYPE_ICON), createStringResource("PageAdminObjectDetails.button.changeArchetype")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            changeArchetypeButtonClicked(target);
        }
    };
    changeArchetype.showTitleAsLabel(true);
    // && CollectionUtils.isNotEmpty(getArchetypeOidsListToAssign())));
    changeArchetype.add(new VisibleBehaviour(() -> isChangeArchetypeButtonVisible()));
    changeArchetype.add(AttributeAppender.append("class", "btn-default btn-sm"));
    repeatingView.add(changeArchetype);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) AjaxIconButton(com.evolveum.midpoint.web.component.AjaxIconButton) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)

Example 19 with CompositedIconBuilder

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

the class AssignmentPanel method createAssignmentIconColumn.

private IColumn<PrismContainerValueWrapper<AssignmentType>, String> createAssignmentIconColumn() {
    return new CompositedIconColumn<>(Model.of("")) {

        @Override
        protected CompositedIcon getCompositedIcon(IModel<PrismContainerValueWrapper<AssignmentType>> rowModel) {
            AssignmentType assignment = rowModel.getObject().getRealValue();
            LOGGER.trace("Create icon for AssignmentType: " + assignment);
            PrismObject<? extends FocusType> object = loadTargetObject(assignment);
            if (object != null) {
                return WebComponentUtil.createCompositeIconForObject(object.asObjectable(), new OperationResult("create_assignment_composited_icon"), getPageBase());
            }
            String displayType = WebComponentUtil.createDefaultBlackIcon(AssignmentsUtil.getTargetType(assignment));
            CompositedIconBuilder iconBuilder = new CompositedIconBuilder();
            iconBuilder.setBasicIcon(displayType, IconCssStyle.IN_ROW_STYLE);
            return iconBuilder.build();
        }
    };
}
Also used : IModel(org.apache.wicket.model.IModel) CompositedIconColumn(com.evolveum.midpoint.gui.impl.component.data.column.CompositedIconColumn) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder) OperationResult(com.evolveum.midpoint.schema.result.OperationResult)

Example 20 with CompositedIconBuilder

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

the class WebComponentUtil method createCreateReportIcon.

public static CompositedIcon createCreateReportIcon() {
    final CompositedIconBuilder builder = new CompositedIconBuilder();
    builder.setBasicIcon(WebComponentUtil.createReportIcon(), IconCssStyle.IN_ROW_STYLE);
    IconType plusIcon = new IconType();
    plusIcon.setCssClass(GuiStyleConstants.CLASS_ADD_NEW_OBJECT);
    plusIcon.setColor("green");
    builder.appendLayerIcon(plusIcon, LayeredIconCssStyle.BOTTOM_RIGHT_STYLE);
    return builder.build();
}
Also used : CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)

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