use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction 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.web.component.menu.cog.InlineMenuItemAction in project midpoint by Evolveum.
the class ResourceContentPanel method initButton.
private void initButton(String id, String label, String icon, String archetypeOid) {
ObjectQuery existingTasksQuery = getExistingTasksQuery(archetypeOid);
OperationResult result = new OperationResult(OPERATION_SEARCH_TASKS_FOR_RESOURCE);
List<PrismObject<TaskType>> tasksList = WebModelServiceUtils.searchObjects(TaskType.class, existingTasksQuery, result, getPageBase());
List<InlineMenuItem> items = new ArrayList<>();
InlineMenuItem item = new InlineMenuItem(getPageBase().createStringResource("ResourceContentResourcePanel.showExisting")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new InlineMenuItemAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
List<TaskType> filteredByKindIntentTasks = getTasksForKind(tasksList);
redirectToTasksListPage(createInTaskOidQuery(filteredByKindIntentTasks), archetypeOid);
}
};
}
};
items.add(item);
item = new InlineMenuItem(getPageBase().createStringResource("ResourceContentResourcePanel.newTask")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new InlineMenuItemAction() {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
newTaskPerformed(archetypeOid);
}
};
}
};
items.add(item);
DropdownButtonPanel button = new DropdownButtonPanel(id, new DropdownButtonDto(String.valueOf(tasksList.size()), icon, label, items)) {
@Override
protected String getSpecialDropdownMenuClass() {
return "pull-left";
}
};
add(button);
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction in project midpoint by Evolveum.
the class AbstractRoleMemberPanel method createRowActions.
protected List<InlineMenuItem> createRowActions() {
List<InlineMenuItem> menu = new ArrayList<>();
createAssignMemberRowAction(menu);
createUnassignMemberRowAction(menu);
createRecomputeMemberRowAction(menu);
if (isAuthorized(GuiAuthorizationConstants.MEMBER_OPERATION_CREATE)) {
menu.add(new InlineMenuItem(createStringResource("abstractRoleMemberPanel.menu.create")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new HeaderMenuAction(AbstractRoleMemberPanel.this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
createFocusMemberPerformed(target);
}
};
}
});
}
if (isAuthorized(GuiAuthorizationConstants.MEMBER_OPERATION_DELETE)) {
menu.add(new InlineMenuItem(createStringResource("abstractRoleMemberPanel.menu.delete")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new HeaderMenuAction(AbstractRoleMemberPanel.this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
deleteMembersPerformed(target);
}
};
}
});
}
return menu;
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction in project midpoint by Evolveum.
the class PageConnectorHosts method createRowActions.
private List<InlineMenuItem> createRowActions() {
List<InlineMenuItem> headerMenuItems = new ArrayList<>();
headerMenuItems.add(new InlineMenuItem(createStringResource("PageBase.button.delete")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new HeaderMenuAction(PageConnectorHosts.this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
deleteHostPerformed(target);
}
};
}
});
headerMenuItems.add(new InlineMenuItem(createStringResource("pageResources.button.discoveryRemote")) {
private static final long serialVersionUID = 1L;
@Override
public InlineMenuItemAction initAction() {
return new HeaderMenuAction(PageConnectorHosts.this) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
discoveryRemotePerformed(target);
}
};
}
});
return headerMenuItems;
}
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;
}
Aggregations