use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder in project midpoint by Evolveum.
the class BasicMultivalueContainerListPanel method createNewButtonDescription.
@Override
protected List<CompositedIconButtonDto> createNewButtonDescription() {
String title = getPageBase().createStringResource("PageAdminObjectDetails.title.new", getContainerNameForNewButton()).getString();
DisplayType defaultButtonDisplayType = GuiDisplayTypeUtil.createDisplayType("fa fa-plus", "green", title);
CompositedIconButtonDto defaultButton = new CompositedIconButtonDto();
CompositedIconBuilder builder = new CompositedIconBuilder();
builder.setBasicIcon(WebComponentUtil.getIconCssClass(defaultButtonDisplayType), IconCssStyle.IN_ROW_STYLE).appendColorHtmlValue(WebComponentUtil.getIconColor(defaultButtonDisplayType));
defaultButton.setAdditionalButtonDisplayType(defaultButtonDisplayType);
defaultButton.setCompositedIcon(builder.build());
return Collections.singletonList(defaultButton);
}
use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder 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;
}
use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder in project midpoint by Evolveum.
the class ResourceContentPanel 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<SelectableBeanImpl<ShadowType>>() {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit(AjaxRequestTarget target) {
if (getRowModel() == null) {
updateResourceObjectStatusPerformed(null, target, true);
} else {
SelectableBeanImpl<ShadowType> shadow = getRowModel().getObject();
updateResourceObjectStatusPerformed(shadow.getValue(), target, true);
}
}
};
}
});
items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.disableAccount"), 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) {
updateResourceObjectStatusPerformed(null, target, false);
} else {
SelectableBeanImpl<ShadowType> shadow = getRowModel().getObject();
updateResourceObjectStatusPerformed(shadow.getValue(), target, false);
}
}
};
}
});
items.add(new InlineMenuItem(createStringResource("pageContentAccounts.menu.deleteAccount"), 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) {
deleteResourceObjectPerformed(null, target);
} else {
SelectableBeanImpl<ShadowType> shadow = getRowModel().getObject();
deleteResourceObjectPerformed(shadow.getValue(), 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<SelectableBeanImpl<ShadowType>>() {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit(AjaxRequestTarget target) {
if (getRowModel() == null) {
changeOwner(null, target, null, Operation.REMOVE);
} else {
SelectableBeanImpl<ShadowType> shadow = getRowModel().getObject();
changeOwner(shadow.getValue(), target, null, Operation.REMOVE);
}
}
};
}
});
items.add(new ButtonInlineMenuItem(createStringResource("pageContentAccounts.menu.changeOwner"), 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) {
final SelectableBeanImpl<ShadowType> shadow = getRowModel().getObject();
ObjectBrowserPanel<FocusType> browser = new ObjectBrowserPanel<>(getPageBase().getMainPopupBodyId(), UserType.class, WebComponentUtil.createFocusTypeList(), false, getPageBase()) {
@Override
protected void onSelectPerformed(AjaxRequestTarget target, FocusType focus) {
changeOwner(shadow.getValue(), target, focus, Operation.MODIFY);
}
};
getPageBase().showMainPopup(browser, target);
}
};
}
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_RECONCILE_MENU_ITEM);
}
@Override
public boolean isHeaderMenuItem() {
return false;
}
});
return items;
}
use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder in project midpoint by Evolveum.
the class AbstractRoleMemberPanel method loadMultiFunctionalButtonModel.
protected LoadableModel<MultiFunctinalButtonDto> loadMultiFunctionalButtonModel(boolean useDefaultObjectRelations) {
return new LoadableModel<>(false) {
@Override
protected MultiFunctinalButtonDto load() {
MultiFunctinalButtonDto multiFunctinalButtonDto = new MultiFunctinalButtonDto();
DisplayType mainButtonDisplayType = getCreateMemberButtonDisplayType();
CompositedIconBuilder builder = new CompositedIconBuilder();
Map<IconCssStyle, IconType> layerIcons = WebComponentUtil.createMainButtonLayerIcon(mainButtonDisplayType);
for (Map.Entry<IconCssStyle, IconType> icon : layerIcons.entrySet()) {
builder.appendLayerIcon(icon.getValue(), icon.getKey());
}
CompositedIconButtonDto mainButton = createCompositedIconButtonDto(mainButtonDisplayType, null, builder.build());
multiFunctinalButtonDto.setMainButton(mainButton);
List<AssignmentObjectRelation> loadedRelations = loadMemberRelationsList();
if (CollectionUtils.isEmpty(loadedRelations) && useDefaultObjectRelations) {
loadedRelations.addAll(getDefaultNewMemberRelations());
}
List<CompositedIconButtonDto> additionalButtons = new ArrayList<>();
if (CollectionUtils.isNotEmpty(loadedRelations)) {
List<AssignmentObjectRelation> relations = WebComponentUtil.divideAssignmentRelationsByAllValues(loadedRelations);
relations.forEach(relation -> {
DisplayType additionalButtonDisplayType = GuiDisplayTypeUtil.getAssignmentObjectRelationDisplayType(getPageBase(), relation, "abstractRoleMemberPanel.menu.createMember");
CompositedIconButtonDto buttonDto = createCompositedIconButtonDto(additionalButtonDisplayType, relation, createCompositedIcon(relation, additionalButtonDisplayType));
additionalButtons.add(buttonDto);
});
}
multiFunctinalButtonDto.setAdditionalButtons(additionalButtons);
return multiFunctinalButtonDto;
}
};
}
use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder in project midpoint by Evolveum.
the class AbstractRoleMemberPanel method loadMultiFunctionalButtonModel.
protected LoadableModel<MultiFunctinalButtonDto> loadMultiFunctionalButtonModel(boolean useDefaultObjectRelations) {
return new LoadableModel<>(false) {
@Override
protected MultiFunctinalButtonDto load() {
MultiFunctinalButtonDto multiFunctinalButtonDto = new MultiFunctinalButtonDto();
DisplayType mainButtonDisplayType = getCreateMemberButtonDisplayType();
CompositedIconBuilder builder = new CompositedIconBuilder();
Map<IconCssStyle, IconType> layerIcons = WebComponentUtil.createMainButtonLayerIcon(mainButtonDisplayType);
for (Map.Entry<IconCssStyle, IconType> icon : layerIcons.entrySet()) {
builder.appendLayerIcon(icon.getValue(), icon.getKey());
}
CompositedIconButtonDto mainButton = createCompositedIconButtonDto(mainButtonDisplayType, null, builder.build());
multiFunctinalButtonDto.setMainButton(mainButton);
List<AssignmentObjectRelation> loadedRelations = loadMemberRelationsList();
if (CollectionUtils.isEmpty(loadedRelations) && useDefaultObjectRelations) {
loadedRelations.addAll(getDefaultNewMemberRelations());
}
List<CompositedIconButtonDto> additionalButtons = new ArrayList<>();
if (CollectionUtils.isNotEmpty(loadedRelations)) {
List<AssignmentObjectRelation> relations = WebComponentUtil.divideAssignmentRelationsByAllValues(loadedRelations);
relations.forEach(relation -> {
DisplayType additionalButtonDisplayType = GuiDisplayTypeUtil.getAssignmentObjectRelationDisplayType(getPageBase(), relation, "abstractRoleMemberPanel.menu.createMember");
CompositedIconButtonDto buttonDto = createCompositedIconButtonDto(additionalButtonDisplayType, relation, createCompositedIcon(relation, additionalButtonDisplayType));
additionalButtons.add(buttonDto);
});
}
multiFunctinalButtonDto.setAdditionalButtons(additionalButtons);
return multiFunctinalButtonDto;
}
};
}
Aggregations