use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction in project midpoint by Evolveum.
the class PageValuePolicies method createInlineMenu.
private List<InlineMenuItem> createInlineMenu() {
List<InlineMenuItem> menu = new ArrayList<>();
menu.add(new ButtonInlineMenuItem(createStringResource("pageValuePolicies.button.delete")) {
private static final long serialVersionUID = 1L;
@Override
public CompositedIconBuilder getIconCompositedBuilder() {
return getDefaultCompositedIconBuilder(GuiStyleConstants.CLASS_DELETE_MENU_ITEM);
}
@Override
public InlineMenuItemAction initAction() {
return null;
}
});
return menu;
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction in project midpoint by Evolveum.
the class ExecuteChangeOptionsPanel method createTracingOptionsPanel.
private void createTracingOptionsPanel() {
List<InlineMenuItem> items = new ArrayList<>();
items.add(new InlineMenuItem(createStringResource("Tracing")) {
@Override
public InlineMenuItemAction initAction() {
return null;
}
});
DropdownButtonDto model = new DropdownButtonDto(null, GuiStyleConstants.CLASS_TRACING_BUTTON_ICON, "Tracing", items);
DropdownButtonPanel dropdownButtonPanel = new DropdownButtonPanel(ID_TRACING, model) {
@Override
protected void populateMenuItem(String componentId, ListItem<InlineMenuItem> menuItem) {
menuItem.add(createTracingRadioChoicesFragment(componentId));
}
@Override
protected String getSpecialButtonClass() {
return "btn-sm btn-default btn-margin-right";
}
@Override
protected String getSpecialDropdownMenuClass() {
return "execute-options radio";
}
@Override
protected String getSpecialLabelClass() {
return "execute-options-label";
}
};
add(dropdownButtonPanel);
dropdownButtonPanel.setOutputMarkupId(true);
dropdownButtonPanel.add(new VisibleBehaviour(this::isTracingEnabled));
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction in project midpoint by Evolveum.
the class AbstractAssignmentTypePanel method getAssignmentMenuActions.
private List<InlineMenuItem> getAssignmentMenuActions() {
List<InlineMenuItem> menuItems = new ArrayList<>();
ButtonInlineMenuItem unassignMenuItem = createUnassignAction();
if (unassignMenuItem != null) {
menuItems.add(unassignMenuItem);
}
menuItems.add(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 AbstractAssignmentTypePanel.this.createEditColumnAction();
}
});
ButtonInlineMenuItem viewTargetObjectMenuItem = createViewTargetObjectAction();
menuItems.add(viewTargetObjectMenuItem);
return menuItems;
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction in project midpoint by Evolveum.
the class MenuMultiButtonPanel method initLayout.
private void initLayout() {
DropdownButtonPanel inlineMenu = new DropdownButtonPanel(ID_INLINE_MENU_PANEL, new DropdownButtonDto(null, null, null, menuItemsModel.getObject())) {
private static final long serialVersionUID = 1L;
@Override
protected String getSpecialButtonClass() {
return "btn-xs btn-default";
}
@Override
protected void onBeforeClickMenuItem(AjaxRequestTarget target, InlineMenuItemAction action, IModel<InlineMenuItem> item) {
MenuMultiButtonPanel.this.onBeforeClickMenuItem(target, action, item);
}
};
add(inlineMenu);
inlineMenu.add(new VisibleBehaviour(() -> {
List<InlineMenuItem> menuItems = menuItemsModel.getObject();
for (InlineMenuItem menuItem : menuItems) {
if (!(menuItem instanceof ButtonInlineMenuItem)) {
return true;
}
}
return false;
}));
}
use of com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction in project midpoint by Evolveum.
the class AssignmentTablePanel method createAssignmentMenu.
protected List<InlineMenuItem> createAssignmentMenu() {
List<InlineMenuItem> items = new ArrayList<>();
InlineMenuItem item;
if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_ASSIGN_ACTION_URI)) {
item = new InlineMenuItem(createStringResource("AssignmentTablePanel.menu.assign")) {
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) {
TypedAssignablePanel panel = new TypedAssignablePanel(getPageBase().getMainPopupBodyId(), RoleType.class) {
private static final long serialVersionUID = 1L;
@Override
protected void addPerformed(AjaxRequestTarget target, List selected, QName relation, ShadowKindType kind, String intent) {
super.addPerformed(target, selected, relation, kind, intent);
addSelectedAssignablePerformed(target, selected, relation, getPageBase().getMainPopup().getId());
reloadMainFormButtons(target);
}
};
panel.setOutputMarkupId(true);
getPageBase().showMainPopup(panel, target);
}
};
}
};
items.add(item);
item = new InlineMenuItem(createStringResource("AssignmentTablePanel.menu.assignOrg")) {
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) {
int count = WebModelServiceUtils.countObjects(OrgType.class, null, getPageBase());
if (count > 0) {
OrgTreeAssignablePanel orgTreePanel = new OrgTreeAssignablePanel(getPageBase().getMainPopupBodyId(), true) {
private static final long serialVersionUID = 1L;
@Override
protected void assignSelectedOrgPerformed(List<OrgType> selectedOrgs, AjaxRequestTarget target) {
// TODO Auto-generated method stub
addSelectedAssignablePerformed(target, (List) selectedOrgs, WebComponentUtil.getDefaultRelationOrFail(), getPageBase().getMainPopup().getId());
reloadMainFormButtons(target);
}
};
orgTreePanel.setOutputMarkupId(true);
getPageBase().showMainPopup(orgTreePanel, target);
} else {
warn(createStringResource("AssignmentTablePanel.menu.assignOrg.noorgs").getString());
target.add(getPageBase().getFeedbackPanel());
}
}
};
}
};
items.add(item);
}
if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_UNASSIGN_ACTION_URI)) {
item = new InlineMenuItem(createStringResource("AssignmentTablePanel.menu.unassign")) {
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) {
AssignmentTablePanel.this.deleteAssignmentPerformed(target, null);
}
};
}
};
items.add(item);
}
if (isShowAllAssignmentsVisible()) {
item = new InlineMenuItem(createStringResource("AssignmentTablePanel.menu.showAllAssignments")) {
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) {
showAllAssignments(target);
}
};
}
};
items.add(item);
}
return items;
}
Aggregations