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