use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction in project midpoint by Evolveum.
the class UserPersonasPanel method initLayout.
protected void initLayout() {
MainObjectListPanel<UserType> userListPanel = new MainObjectListPanel<UserType>(ID_PERSONAS_TABLE, UserType.class, null) {
private static final long serialVersionUID = 1L;
@Override
protected IColumn<SelectableBean<UserType>, String> createCheckboxColumn() {
return null;
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
List<InlineMenuItem> menuItems = new ArrayList<>();
menuItems.add(new ButtonInlineMenuItem(createStringResource("AssignmentPanel.viewTargetObject")) {
private static final long serialVersionUID = 1L;
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_NAVIGATE_ARROW);
}
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction<SelectableBeanImpl<UserType>>() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
SelectableBean<UserType> personaRefSelectableBean = getRowModel().getObject();
UserType personaRefObj = personaRefSelectableBean.getValue();
ObjectReferenceType ort = new ObjectReferenceType();
ort.setOid(personaRefObj.getOid());
ort.setType(WebComponentUtil.classToQName(UserPersonasPanel.this.getPrismContext(), personaRefObj.getClass()));
WebComponentUtil.dispatchToObjectDetailsPage(ort, UserPersonasPanel.this, false);
}
};
}
@Override
public boolean isHeaderMenuItem() {
return false;
}
});
return menuItems;
}
@Override
protected void objectDetailsPerformed(AjaxRequestTarget target, UserType object) {
}
@Override
protected boolean isCreateNewObjectEnabled() {
return false;
}
@Override
protected ISelectableDataProvider<UserType, SelectableBean<UserType>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> getFocusPersonasQuery(), null);
}
// @Override
// protected ObjectQuery getCustomizeContentQuery() {
//
// }
@Override
protected boolean isObjectDetailsEnabled(IModel<SelectableBean<UserType>> rowModel) {
return false;
}
@Override
protected UserProfileStorage.TableId getTableId() {
return null;
}
@Override
protected boolean enableSavePageSize() {
return false;
}
};
userListPanel.setOutputMarkupId(true);
add(userListPanel);
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction 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.web.component.menu.cog.InlineMenuItemAction in project midpoint by Evolveum.
the class PageCertCampaigns method createInlineMenu.
@NotNull
private List<InlineMenuItem> createInlineMenu() {
List<InlineMenuItem> items = new ArrayList<>();
items.add(new InlineMenuItem(createStringResource("PageCertCampaigns.menu.startSelected")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new HeaderMenuAction(PageCertCampaigns.this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
startSelectedCampaignsPerformed(target);
}
};
}
@Override
public boolean isHeaderMenuItem() {
return true;
}
});
items.add(new InlineMenuItem(createStringResource("PageCertCampaigns.menu.closeSelected")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new HeaderMenuAction(PageCertCampaigns.this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
closeSelectedCampaignsConfirmation(target);
}
};
}
@Override
public boolean isHeaderMenuItem() {
return true;
}
});
items.add(new InlineMenuItem(createStringResource("PageCertCampaigns.menu.reiterateSelected")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new HeaderMenuAction(PageCertCampaigns.this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
reiterateSelectedCampaignsConfirmation(target);
}
};
}
@Override
public boolean isHeaderMenuItem() {
return true;
}
});
items.add(new InlineMenuItem(createStringResource("PageCertCampaigns.menu.deleteSelected")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new HeaderMenuAction(PageCertCampaigns.this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
deleteSelectedCampaignsConfirmation(target);
}
};
}
@Override
public boolean isHeaderMenuItem() {
return true;
}
});
return items;
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction 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.web.component.menu.cog.InlineMenuItemAction in project midpoint by Evolveum.
the class PageWorkItemsClaimable method createRowActions.
@Override
protected List<InlineMenuItem> createRowActions() {
List<InlineMenuItem> menu = new ArrayList<>();
menu.add(new ButtonInlineMenuItem(createStringResource("pageWorkItem.button.claim")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new ColumnMenuAction<PrismContainerValueWrapper<CaseWorkItemType>>() {
@Override
public void onClick(AjaxRequestTarget target) {
claimWorkItemPerformed(getRowModel(), target);
}
};
}
@Override
public IModel<Boolean> getEnabled() {
IModel<PrismContainerValueWrapper<CaseWorkItemType>> rowModel = ((ColumnMenuAction<PrismContainerValueWrapper<CaseWorkItemType>>) getAction()).getRowModel();
if (rowModel != null && rowModel.getObject() != null && rowModel.getObject().getRealValue() != null) {
CaseWorkItemType workItem = rowModel.getObject().getRealValue();
return Model.of(CaseTypeUtil.isCaseWorkItemNotClosed(workItem));
} else {
return super.getEnabled();
}
}
@Override
public IModel<String> getConfirmationMessageModel() {
return createStringResource("CaseWorkItemsPanel.confirmWorkItemsClaimAction");
}
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_ICON_CLAIM);
}
});
return menu;
}
Aggregations