use of com.evolveum.midpoint.web.component.menu.cog.CheckboxMenuItem in project midpoint by Evolveum.
the class ExecuteChangeOptionsPanel method createOptionsDropdownButton.
private void createOptionsDropdownButton(List<InlineMenuItem> items) {
DropdownButtonDto model = new DropdownButtonDto(null, GuiStyleConstants.CLASS_OPTIONS_BUTTON_ICON, getPageBase().createStringResource("ExecuteChangeOptionsPanel.options").getString(), items);
DropdownButtonPanel dropdownButtonPanel = new DropdownButtonPanel(ID_OPTIONS, model) {
@Override
protected void populateMenuItem(String componentId, ListItem<InlineMenuItem> menuItem) {
InlineMenuItem item = menuItem.getModelObject();
if (!(item instanceof CheckboxMenuItem)) {
super.populateMenuItem(componentId, menuItem);
return;
}
CheckboxMenuItem checkboxMenuItem = (CheckboxMenuItem) item;
CheckBoxPanel panel = new CheckBoxPanel(componentId, checkboxMenuItem.getCheckBoxModel(), checkboxMenuItem.getLabel(), null) {
@Override
public void onUpdate(AjaxRequestTarget target) {
// checkboxMenuItem.getCheckBoxModel().setObject(!checkboxMenuItem.getCheckBoxModel().getObject());
}
};
panel.setOutputMarkupId(true);
menuItem.add(panel);
}
@Override
protected String getSpecialButtonClass() {
return "btn-sm btn-default btn-margin-right";
}
@Override
protected String getSpecialDropdownMenuClass() {
return "execute-options";
}
@Override
protected String getSpecialLabelClass() {
return "execute-options-label";
}
};
add(dropdownButtonPanel);
dropdownButtonPanel.setOutputMarkupId(true);
}
Aggregations