use of com.evolveum.midpoint.gui.api.component.form.CheckBoxPanel in project midpoint by Evolveum.
the class ApplicablePolicyGroupPanel method initLayout.
private void initLayout() {
Label policyGroupName = new Label(ID_POLICY_GROUP_NAME, Model.of(WebComponentUtil.getDisplayNameOrName(getModelObject(), getPageBase(), OPERATION_LOAD_POLICY_GROUP_NAME)));
policyGroupName.setOutputMarkupId(true);
add(policyGroupName);
ListView<PrismObject<AbstractRoleType>> policiesPanel = new ListView<PrismObject<AbstractRoleType>>(ID_POLICIES_CONTAINER, policiesListModel) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<PrismObject<AbstractRoleType>> listItem) {
PrismObject<AbstractRoleType> abstractRole = listItem.getModelObject();
CheckBoxPanel policyCheckBox = new CheckBoxPanel(ID_POLICY_CHECK_BOX, getCheckboxModel(abstractRole), // label
Model.of(WebComponentUtil.getDisplayNameOrName(abstractRole)), // tooltip
null) {
private static final long serialVersionUID = 1L;
@Override
public void onUpdate(AjaxRequestTarget target) {
onPolicyAddedOrRemoved(listItem.getModelObject(), getValue());
}
};
policyCheckBox.setOutputMarkupId(true);
listItem.add(policyCheckBox);
}
};
policiesPanel.setOutputMarkupId(true);
add(policiesPanel);
}
use of com.evolveum.midpoint.gui.api.component.form.CheckBoxPanel 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);
}
use of com.evolveum.midpoint.gui.api.component.form.CheckBoxPanel in project midpoint by Evolveum.
the class OrgTreeFolderContent method initLayout.
private void initLayout() {
SelectableFolderContent folder = new SelectableFolderContent(ID_FOLDER, tree, getModel(), selected) {
private static final long serialVersionUID = 1L;
@Override
protected void onClick(Optional<AjaxRequestTarget> target) {
super.onClick(target);
OrgTreeFolderContent.this.setSelectedItem(selected.getObject(), orgTreeStorage);
selectTreeItemPerformed(selected.getObject(), target.get());
Component component = get("table");
if (component != null) {
target.get().add(component);
}
}
};
folder.setOutputMarkupId(true);
addOrReplace(folder);
if (selected.getObject().equals(getModelObject())) {
getParent().add(AttributeAppender.append("class", "success"));
} else {
getParent().add(new AttributeAppender("class", "success", " ") {
@Override
protected Serializable newValue(String currentValue, String removeValue) {
currentValue = getSeparator() + currentValue + getSeparator();
removeValue = getSeparator() + removeValue + getSeparator();
return currentValue.replace(removeValue, getSeparator());
}
});
}
MenuMultiButtonPanel<OrgType> menuButtons = new MenuMultiButtonPanel<>(ID_MENU, new PropertyModel<>(getModel(), TreeSelectableBean.F_VALUE), 2, createInlineMenuItemsModel());
menuButtons.setOutputMarkupId(true);
addOrReplace(menuButtons);
CheckBoxPanel checkBoxPanel = new CheckBoxPanel(ID_CHECK, getCheckboxModel(getModel())) {
@Override
public void onUpdate(AjaxRequestTarget target) {
getModelObject().setSelected(!getModelObject().isSelected());
OrgTreeFolderContent.this.onUpdateCheckbox(target);
}
};
checkBoxPanel.add(new VisibleBehaviour(() -> selectable));
addOrReplace(checkBoxPanel);
}
use of com.evolveum.midpoint.gui.api.component.form.CheckBoxPanel in project midpoint by Evolveum.
the class ExecuteChangeOptionsPanel method createContainer.
private void createContainer(String containerId, IModel<Boolean> checkboxModel, String labelKey, String helpKey, boolean show, final boolean reloadPanelOnUpdate) {
CheckBoxPanel panel = new CheckBoxPanel(containerId, checkboxModel, createStringResource(labelKey), createStringResource(helpKey, WebComponentUtil.getMidpointCustomSystemName(getPageBase(), "midPoint"))) {
private static final long serialVersionUID = 1L;
@Override
public void onUpdate(AjaxRequestTarget target) {
if (reloadPanelOnUpdate) {
target.add(ExecuteChangeOptionsPanel.this);
reloadPanelOnOptionsUpdate(target);
}
}
@Override
protected boolean isCheckboxEnabled() {
return isCheckBoxEnabled(containerId);
}
};
panel.setOutputMarkupId(true);
panel.setVisible(show);
add(panel);
}
Aggregations