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);
}
}
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;
}
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);
}
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();
}
};
}
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();
}
Aggregations