use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class AbstractRoleMemberPanel method initMemberTable.
private void initMemberTable(TableId tableId, Form form) {
WebMarkupContainer memberContainer = new WebMarkupContainer(ID_CONTAINER_MEMBER);
memberContainer.setOutputMarkupId(true);
memberContainer.setOutputMarkupPlaceholderTag(true);
form.add(memberContainer);
MainObjectListPanel<ObjectType> childrenListPanel = new MainObjectListPanel<ObjectType>(ID_MEMBER_TABLE, ObjectType.class, tableId, getSearchOptions(), getPageBase()) {
private static final long serialVersionUID = 1L;
@Override
protected void objectDetailsPerformed(AjaxRequestTarget target, ObjectType object) {
detailsPerformed(target, object);
}
@Override
protected boolean isClickable(IModel<SelectableBean<ObjectType>> rowModel) {
if (rowModel == null || rowModel.getObject() == null || rowModel.getObject().getValue() == null) {
return false;
}
Class<?> objectClass = rowModel.getObject().getValue().getClass();
return WebComponentUtil.hasDetailsPage(objectClass);
}
@Override
protected void newObjectPerformed(AjaxRequestTarget target) {
AbstractRoleMemberPanel.this.createFocusMemberPerformed(null, target);
}
@Override
protected List<IColumn<SelectableBean<ObjectType>, String>> createColumns() {
return createMembersColumns();
}
@Override
protected IColumn<SelectableBean<ObjectType>, String> createActionsColumn() {
return new InlineMenuHeaderColumn(createMembersHeaderInlineMenu());
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
return new ArrayList<>();
}
@Override
protected ObjectQuery createContentQuery() {
ObjectQuery q = super.createContentQuery();
ObjectQuery members = AbstractRoleMemberPanel.this.createContentQuery();
List<ObjectFilter> filters = new ArrayList<>();
if (q != null && q.getFilter() != null) {
filters.add(q.getFilter());
}
if (members != null && members.getFilter() != null) {
filters.add(members.getFilter());
}
if (filters.size() == 1) {
return ObjectQuery.createObjectQuery(filters.iterator().next());
}
return ObjectQuery.createObjectQuery(AndFilter.createAnd(filters));
}
};
childrenListPanel.setOutputMarkupId(true);
memberContainer.add(childrenListPanel);
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class OrgMemberPanel method createManagersHeaderInlineMenu.
private List<InlineMenuItem> createManagersHeaderInlineMenu() {
List<InlineMenuItem> headerMenuItems = new ArrayList<>();
headerMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.createManager"), false, new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
OrgMemberPanel.this.createFocusMemberPerformed(SchemaConstants.ORG_MANAGER, target);
}
}));
headerMenuItems.add(new InlineMenuItem());
headerMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.addManagers"), false, new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
OrgMemberPanel.this.addMembers(SchemaConstants.ORG_MANAGER, target);
}
}));
headerMenuItems.add(new InlineMenuItem());
headerMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.removeManagersAll"), false, new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
removeManagersPerformed(QueryScope.ALL, target);
}
}));
headerMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.recomputeManagersAll"), false, new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
recomputeManagersPerformed(QueryScope.ALL, target);
}
}));
headerMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.deleteManagersAll"), false, new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
OrgMemberPanel.this.deleteMemberPerformed(QueryScope.ALL, SchemaConstants.ORG_MANAGER, target, "TreeTablePanel.menu.deleteManagersAll.confirm");
}
}));
return headerMenuItems;
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class OrgMemberPanel method createMembersHeaderInlineMenu.
@Override
protected List<InlineMenuItem> createMembersHeaderInlineMenu() {
List<InlineMenuItem> headerMenuItems = super.createMembersHeaderInlineMenu();
headerMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.deleteMember"), false, new HeaderMenuAction(this) {
@Override
public void onClick(AjaxRequestTarget target) {
deleteMemberPerformed(QueryScope.SELECTED, null, target, "TreeTablePanel.menu.deleteMember.confirm");
}
}));
headerMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.deleteAllMembers"), false, new HeaderMenuAction(this) {
@Override
public void onClick(AjaxRequestTarget target) {
deleteMemberPerformed(QueryScope.ALL, null, target, "TreeTablePanel.menu.deleteAllMembers.confirm");
}
}));
return headerMenuItems;
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class AbstractRoleMemberPanel method createNewMemberInlineMenuItems.
protected List<InlineMenuItem> createNewMemberInlineMenuItems() {
List<InlineMenuItem> newMemberMenuItems = new ArrayList<>();
newMemberMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.createMember"), false, new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
createFocusMemberPerformed(null, target);
}
}));
newMemberMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.addMembers"), false, new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
addMembers(null, target);
}
}));
return newMemberMenuItems;
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem in project midpoint by Evolveum.
the class InlineMenuButtonColumn method createMenuModel.
private IModel<List<InlineMenuItem>> createMenuModel(final IModel<T> rowModel, List<InlineMenuItem> menuItems) {
return new LoadableModel<List<InlineMenuItem>>(false) {
@Override
public List<InlineMenuItem> load() {
if (rowModel == null) {
return menuItems;
}
if (rowModel.getObject() == null || !(rowModel.getObject() instanceof InlineMenuable)) {
return new ArrayList<InlineMenuItem>();
}
for (InlineMenuItem item : ((InlineMenuable) rowModel.getObject()).getMenuItems()) {
if (!(item.getAction() instanceof ColumnMenuAction)) {
continue;
}
ColumnMenuAction action = (ColumnMenuAction) item.getAction();
action.setRowModel(rowModel);
}
return ((InlineMenuable) rowModel.getObject()).getMenuItems();
}
};
}
Aggregations