use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder in project midpoint by Evolveum.
the class AbstractAssignmentTypePanel 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 CreateTemplatePanel method createCompositedIcon.
// TODO copied from MainObjectListPanel
private CompositedIcon createCompositedIcon(CompiledObjectCollectionView collectionView) {
DisplayType additionalButtonDisplayType = GuiDisplayTypeUtil.getNewObjectDisplayTypeFromCollectionView(collectionView, getPageBase());
CompositedIconBuilder builder = new CompositedIconBuilder();
builder.setBasicIcon(WebComponentUtil.getIconCssClass(additionalButtonDisplayType), IconCssStyle.IN_ROW_STYLE).appendColorHtmlValue(WebComponentUtil.getIconColor(additionalButtonDisplayType));
return builder.build();
}
use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder in project midpoint by Evolveum.
the class InternalsLoggedInUsersPanel method initInlineMenu.
private List<InlineMenuItem> initInlineMenu() {
List<InlineMenuItem> menuItems = new ArrayList<>();
menuItems.add(new ButtonInlineMenuItem(createStringResource("InternalsLoggedInUsers.refresh")) {
private static final long serialVersionUID = 1L;
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_ICON_SIGN_OUT);
}
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction<SelectableBean<F>>() {
@Override
public void onClick(AjaxRequestTarget target) {
if (getRowModel() == null) {
terminateSessions(target, null);
} else {
SelectableBean<F> rowDto = getRowModel().getObject();
terminateSessions(target, rowDto.getValue());
}
}
};
}
@Override
public boolean isHeaderMenuItem() {
return true;
}
});
return menuItems;
}
use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder in project midpoint by Evolveum.
the class PageCases method createActions.
private List<InlineMenuItem> createActions() {
List<InlineMenuItem> menu = new ArrayList<>();
menu.add(new ButtonInlineMenuItem(createStringResource("pageCases.button.stopProcess")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction<SelectableBeanImpl<CaseType>>() {
@Override
public void onClick(AjaxRequestTarget target) {
if (getRowModel() == null && warnIfNoCaseSelected(target)) {
return;
}
if (getRowModel() == null) {
stopCaseProcessConfirmed(target);
} else {
stopCaseProcessConfirmed(target, Collections.singletonList(getRowModel().getObject().getValue()));
}
}
};
}
@Override
public IModel<Boolean> getEnabled() {
IModel<SelectableBeanImpl<CaseType>> rowModel = ((ColumnMenuAction<SelectableBeanImpl<CaseType>>) getAction()).getRowModel();
if (rowModel != null && rowModel.getObject() != null && rowModel.getObject().getValue() != null) {
return Model.of(!CaseTypeUtil.isClosed(rowModel.getObject().getValue()));
} else {
return super.getEnabled();
}
}
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_STOP_MENU_ITEM);
}
@Override
public IModel<String> getConfirmationMessageModel() {
return getTablePanel().getSelectedObjectsCount() > 0 ? createStringResource("pageCases.button.stopProcess.multiple.confirmationMessage", getTablePanel().getSelectedObjectsCount()) : createStringResource("pageCases.button.stopProcess.confirmationMessage");
}
});
menu.add(new ButtonInlineMenuItem(createStringResource("pageCases.button.delete")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction<SelectableBeanImpl<CaseType>>() {
@Override
public void onClick(AjaxRequestTarget target) {
if (getRowModel() == null && warnIfNoCaseSelected(target)) {
return;
}
if (getRowModel() == null) {
deleteCaseObjectsConfirmed(target);
} else {
deleteCaseObjectsConfirmed(target, Collections.singletonList(getRowModel().getObject().getValue()));
}
}
};
}
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_DELETE_MENU_ITEM);
}
@Override
public IModel<Boolean> getEnabled() {
IModel<SelectableBeanImpl<CaseType>> rowModel = ((ColumnMenuAction<SelectableBeanImpl<CaseType>>) getAction()).getRowModel();
if (rowModel != null && rowModel.getObject() != null && rowModel.getObject().getValue() != null) {
return Model.of(!CaseTypeUtil.isClosed(rowModel.getObject().getValue()));
} else {
return super.getEnabled();
}
}
@Override
public IModel<String> getConfirmationMessageModel() {
return getTablePanel().getSelectedObjectsCount() > 0 ? createStringResource("pageCases.button.delete.multiple.confirmationMessage", getTablePanel().getSelectedObjectsCount()) : createStringResource("pageCases.button.delete.confirmationMessage");
}
});
return menu;
}
use of com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder in project midpoint by Evolveum.
the class FocusProjectionsPanel method createShadowMenu.
private List<InlineMenuItem> createShadowMenu() {
List<InlineMenuItem> items = new ArrayList<>();
PrismObjectDefinition<F> def = getObjectWrapperModel().getObject().getObject().getDefinition();
PrismReferenceDefinition ref = def.findReferenceDefinition(UserType.F_LINK_REF);
InlineMenuItem item;
PrismPropertyDefinition<ActivationStatusType> administrativeStatus = def.findPropertyDefinition(SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS);
if (administrativeStatus.canRead() && administrativeStatus.canModify()) {
item = new ButtonInlineMenuItem(createStringResource("pageAdminFocus.button.enable")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
updateShadowActivation(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()), true);
}
};
}
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder("fa fa-check");
}
};
items.add(item);
item = new InlineMenuItem(createStringResource("pageAdminFocus.button.disable")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
updateShadowActivation(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()), false);
}
};
}
};
items.add(item);
}
if (ref.canRead() && ref.canAdd()) {
item = new InlineMenuItem(createStringResource("pageAdminFocus.button.unlink")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
unlinkProjectionPerformed(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()));
}
};
}
};
items.add(item);
}
PrismPropertyDefinition<LockoutStatusType> locakoutStatus = def.findPropertyDefinition(SchemaConstants.PATH_ACTIVATION_LOCKOUT_STATUS);
if (locakoutStatus.canRead() && locakoutStatus.canModify()) {
item = new InlineMenuItem(createStringResource("pageAdminFocus.button.unlock")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
unlockShadowPerformed(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()));
}
};
}
};
items.add(item);
}
if (administrativeStatus.canRead() && administrativeStatus.canModify()) {
// items.add(new InlineMenuItem());
item = new InlineMenuItem(createStringResource("pageAdminFocus.button.delete")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
deleteProjectionPerformed(target, getMultivalueContainerListPanel().getPerformedSelectedItems(getRowModel()));
}
};
}
};
items.add(item);
}
item = 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 new ColumnMenuAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
getMultivalueContainerListPanel().editItemPerformed(target, getRowModel(), getMultivalueContainerListPanel().getSelectedItems());
target.add(getPageBase().getFeedbackPanel());
}
};
}
};
items.add(item);
return items;
}
Aggregations