use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.
the class CapabilityActivationPanel method initLayout.
protected void initLayout(PageResourceWizard parentPage) {
parentPage.addEditingEnabledBehavior(this);
CheckBox validFromEnabled = new CheckBox(ID_CHECK_VALID_FROM_ENABLED, new PropertyModel<>(getModel(), "capability.validFrom.enabled"));
add(validFromEnabled);
CheckBox validFromReturned = new CheckBox(ID_CHECK_VALID_FROM_RETURNED, new PropertyModel<>(getModel(), "capability.validFrom.returnedByDefault"));
add(validFromReturned);
CheckBox validToEnabled = new CheckBox(ID_CHECK_VALID_TO_ENABLED, new PropertyModel<>(getModel(), "capability.validTo.enabled"));
add(validToEnabled);
CheckBox validToReturned = new CheckBox(ID_CHECK_VALID_TO_RETURNED, new PropertyModel<>(getModel(), "capability.validTo.returnedByDefault"));
add(validToReturned);
add(new CheckBox(ID_CHECK_STATUS_ENABLED, new PropertyModel<>(getModel(), "capability.status.enabled")));
add(new CheckBox(ID_CHECK_STATUS_RETURNED, new PropertyModel<>(getModel(), "capability.status.returnedByDefault")));
add(new CheckBox(ID_CHECK_STATUS_IGNORE, new PropertyModel<>(getModel(), "capability.status.ignoreAttribute")));
MultiValueTextPanel statusEnableList = new MultiValueTextPanel<String>(ID_STATUS_ENABLE_LIST, new PropertyModel<>(getModel(), "capability.status.enableValue"), parentPage.getReadOnlyModel(), false) {
@Override
protected StringResourceModel createEmptyItemPlaceholder() {
return createStringResource("capabilityActivationPanel.list.placeholder");
}
};
add(statusEnableList);
MultiValueTextPanel statusDisableList = new MultiValueTextPanel<String>(ID_STATUS_DISABLE_LIST, new PropertyModel<>(getModel(), "capability.status.disableValue"), parentPage.getReadOnlyModel(), false) {
@Override
protected StringResourceModel createEmptyItemPlaceholder() {
return createStringResource("capabilityActivationPanel.list.placeholder");
}
};
add(statusDisableList);
IChoiceRenderer<QName> renderer = new QNameChoiceRenderer(true);
DropDownChoice statusChoice = new DropDownChoice<>(ID_SELECT_STATUS, new PropertyModel<>(getModel(), "capability.status.attribute"), createAttributeChoiceModel(renderer), renderer);
add(statusChoice);
add(new CheckBox(ID_CHECK_LOCKOUT_ENABLED, new PropertyModel<>(getModel(), "capability.lockoutStatus.enabled")));
add(new CheckBox(ID_CHECK_LOCKOUT_RETURNED, new PropertyModel<>(getModel(), "capability.lockoutStatus.returnedByDefault")));
add(new CheckBox(ID_CHECK_LOCKOUT_IGNORE, new PropertyModel<>(getModel(), "capability.lockoutStatus.ignoreAttribute")));
MultiValueTextPanel lockoutNormalList = new MultiValueTextPanel<String>(ID_LOCKOUT_NORMAL_LIST, new PropertyModel<>(getModel(), "capability.lockoutStatus.normalValue"), parentPage.getReadOnlyModel(), false) {
@Override
protected StringResourceModel createEmptyItemPlaceholder() {
return createStringResource("capabilityActivationPanel.list.placeholder");
}
};
add(lockoutNormalList);
MultiValueTextPanel lockoutLockedList = new MultiValueTextPanel<String>(ID_LOCKOUT_LOCKED_LIST, new PropertyModel<>(getModel(), "capability.lockoutStatus.lockedValue"), parentPage.getReadOnlyModel(), false) {
@Override
protected StringResourceModel createEmptyItemPlaceholder() {
return createStringResource("capabilityActivationPanel.list.placeholder");
}
};
add(lockoutLockedList);
IChoiceRenderer<QName> lockoutRenderer = new QNameChoiceRenderer(true);
DropDownChoice lockoutChoice = new DropDownChoice<>(ID_SELECT_LOCKOUT, new PropertyModel<>(getModel(), "capability.lockoutStatus.attribute"), createAttributeChoiceModel(lockoutRenderer), lockoutRenderer);
add(lockoutChoice);
add(WebComponentUtil.createHelp(ID_T_L_ENABLED));
add(WebComponentUtil.createHelp(ID_T_L_RETURNED_BY_DEFAULT));
add(WebComponentUtil.createHelp(ID_T_L_IGNORE_ATTR));
add(WebComponentUtil.createHelp(ID_T_L_ATTR_NAME));
add(WebComponentUtil.createHelp(ID_T_L_NORMAL_LIST));
add(WebComponentUtil.createHelp(ID_T_L_LOCKED_LIST));
Label enabledTooltip = new Label(ID_T_ENABLED);
enabledTooltip.add(new InfoTooltipBehavior());
add(enabledTooltip);
Label returnTooltip = new Label(ID_T_RETURNED_BY_DEFAULT);
returnTooltip.add(new InfoTooltipBehavior());
add(returnTooltip);
Label ignoreTooltip = new Label(ID_T_IGNORE_ATTR);
ignoreTooltip.add(new InfoTooltipBehavior());
add(ignoreTooltip);
Label attributeNameTooltip = new Label(ID_T_ATTR_NAME);
attributeNameTooltip.add(new InfoTooltipBehavior());
add(attributeNameTooltip);
Label enableListTooltip = new Label(ID_T_ENABLE_LIST);
enableListTooltip.add(new InfoTooltipBehavior());
add(enableListTooltip);
Label disableListTooltip = new Label(ID_T_DISABLE_LIST);
disableListTooltip.add(new InfoTooltipBehavior());
add(disableListTooltip);
Label vFromEnabledTooltip = new Label(ID_T_V_FROM_ENABLED);
vFromEnabledTooltip.add(new InfoTooltipBehavior());
add(vFromEnabledTooltip);
Label vFromReturnTooltip = new Label(ID_T_V_FROM_RETURN);
vFromReturnTooltip.add(new InfoTooltipBehavior());
add(vFromReturnTooltip);
Label vToEnabledTooltip = new Label(ID_T_V_TO_ENABLED);
vToEnabledTooltip.add(new InfoTooltipBehavior());
add(vToEnabledTooltip);
Label vToReturnTooltip = new Label(ID_T_V_TO_RETURN);
vToReturnTooltip.add(new InfoTooltipBehavior());
add(vToReturnTooltip);
}
use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.
the class CapabilityCredentialsPanel method initLayout.
protected void initLayout(final WebMarkupContainer capabilitiesTable, PageResourceWizard parentPage) {
parentPage.addEditingEnabledBehavior(this);
Label passLabel = new Label(ID_LABEL_PASSWORD, createStringResource("capabilityCredentialsPanel.label.password"));
add(passLabel);
CheckBox enabled = new CheckBox(ID_ENABLED, new PropertyModel<>(getModel(), "capability.enabled"));
enabled.add(new EmptyOnChangeAjaxFormUpdatingBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(capabilitiesTable);
}
});
add(enabled);
CheckBox passwordEnabled = new CheckBox(ID_PASSWORD_ENABLED, new PropertyModel<>(getModel(), "capability.password.enabled"));
add(passwordEnabled);
CheckBox passwordReturned = new CheckBox(ID_PASSWORD_RETURNED, new PropertyModel<>(getModel(), "capability.password.returnedByDefault"));
add(passwordReturned);
Label enabledTooltip = new Label(ID_T_ENABLED);
enabledTooltip.add(new InfoTooltipBehavior());
add(enabledTooltip);
Label passEnabledTooltip = new Label(ID_T_PASS_ENABLED);
passEnabledTooltip.add(new InfoTooltipBehavior());
add(passEnabledTooltip);
Label passReturnTooltip = new Label(ID_T_PASS_RETURN);
passReturnTooltip.add(new InfoTooltipBehavior());
add(passReturnTooltip);
}
use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.
the class PageBulkAction method initLayout.
private void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
CheckBox async = new CheckBox(ID_ASYNC, new PropertyModel<>(model, BulkActionDto.F_ASYNC));
mainForm.add(async);
AceEditor editor = new AceEditor(ID_EDITOR, new PropertyModel<>(model, BulkActionDto.F_SCRIPT));
mainForm.add(editor);
AjaxSubmitButton start = new AjaxSubmitButton(ID_START, createStringResource("PageBulkAction.button.start")) {
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getFeedbackPanel());
}
@Override
protected void onSubmit(AjaxRequestTarget target) {
startPerformed(target);
}
};
mainForm.add(start);
}
use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.
the class PageTaskAdd method initAdvanced.
private void initAdvanced(Form mainForm) {
CheckBox runUntilNodeDown = new CheckBox(ID_RUN_UNTIL_NODW_DOWN, new PropertyModel<Boolean>(model, TaskAddDto.F_RUN_UNTIL_NODW_DOWN));
mainForm.add(runUntilNodeDown);
final IModel<Boolean> createSuspendedCheck = new PropertyModel<>(model, TaskAddDto.F_SUSPENDED_STATE);
CheckBox createSuspended = new CheckBox(ID_CREATE_SUSPENDED, createSuspendedCheck);
mainForm.add(createSuspended);
DropDownChoice threadStop = new DropDownChoice<>(ID_THREAD_STOP, new Model<ThreadStopActionType>() {
@Override
public ThreadStopActionType getObject() {
TaskAddDto dto = model.getObject();
// }
return dto.getThreadStop();
}
@Override
public void setObject(ThreadStopActionType object) {
model.getObject().setThreadStop(object);
}
}, WebComponentUtil.createReadonlyModelFromEnum(ThreadStopActionType.class), new EnumChoiceRenderer<ThreadStopActionType>(PageTaskAdd.this));
mainForm.add(threadStop);
mainForm.add(new TsaValidator(runUntilNodeDown, threadStop));
DropDownChoice misfire = new DropDownChoice<>(ID_MISFIRE_ACTION, new PropertyModel<MisfireActionType>(model, TaskAddDto.F_MISFIRE_ACTION), WebComponentUtil.createReadonlyModelFromEnum(MisfireActionType.class), new EnumChoiceRenderer<MisfireActionType>(PageTaskAdd.this));
mainForm.add(misfire);
}
use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.
the class PageTaskAdd method initLayout.
private void initLayout() {
Form mainForm = new Form(ID_FORM_MAIN);
add(mainForm);
final DropDownChoice resource = new DropDownChoice<>(ID_RESOURCE, new PropertyModel<TaskAddResourcesDto>(model, TaskAddDto.F_RESOURCE), new AbstractReadOnlyModel<List<TaskAddResourcesDto>>() {
@Override
public List<TaskAddResourcesDto> getObject() {
return createResourceList();
}
}, new ChoiceableChoiceRenderer<TaskAddResourcesDto>());
resource.add(new VisibleEnableBehaviour() {
@Override
public boolean isEnabled() {
TaskAddDto dto = model.getObject();
boolean sync = TaskCategory.LIVE_SYNCHRONIZATION.equals(dto.getCategory());
boolean recon = TaskCategory.RECONCILIATION.equals(dto.getCategory());
boolean importAccounts = TaskCategory.IMPORTING_ACCOUNTS.equals(dto.getCategory());
return sync || recon || importAccounts;
}
});
resource.add(new AjaxFormComponentUpdatingBehavior("change") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
PageTaskAdd.this.loadResource();
target.add(get(ID_FORM_MAIN + ":" + ID_OBJECT_CLASS));
}
});
resource.setOutputMarkupId(true);
mainForm.add(resource);
final DropDownChoice focusType = new DropDownChoice<>(ID_FOCUS_TYPE, new PropertyModel<QName>(model, TaskAddDto.F_FOCUS_TYPE), new AbstractReadOnlyModel<List<QName>>() {
@Override
public List<QName> getObject() {
return createFocusTypeList();
}
}, new QNameChoiceRenderer());
focusType.setOutputMarkupId(true);
focusType.add(new VisibleEnableBehaviour() {
@Override
public boolean isEnabled() {
TaskAddDto dto = model.getObject();
return TaskCategory.RECOMPUTATION.equals(dto.getCategory());
}
});
mainForm.add(focusType);
final DropDownChoice kind = new DropDownChoice<>(ID_KIND, new PropertyModel<ShadowKindType>(model, TaskAddDto.F_KIND), WebComponentUtil.createReadonlyModelFromEnum(ShadowKindType.class), new EnumChoiceRenderer<ShadowKindType>());
kind.setOutputMarkupId(true);
kind.add(new VisibleEnableBehaviour() {
@Override
public boolean isEnabled() {
TaskAddDto dto = model.getObject();
boolean sync = TaskCategory.LIVE_SYNCHRONIZATION.equals(dto.getCategory());
boolean recon = TaskCategory.RECONCILIATION.equals(dto.getCategory());
boolean importAccounts = TaskCategory.IMPORTING_ACCOUNTS.equals(dto.getCategory());
return sync || recon || importAccounts;
}
});
mainForm.add(kind);
final TextField<String> intent = new TextField<>(ID_INTENT, new PropertyModel<String>(model, TaskAddDto.F_INTENT));
mainForm.add(intent);
intent.setOutputMarkupId(true);
intent.add(new VisibleEnableBehaviour() {
@Override
public boolean isEnabled() {
TaskAddDto dto = model.getObject();
boolean sync = TaskCategory.LIVE_SYNCHRONIZATION.equals(dto.getCategory());
boolean recon = TaskCategory.RECONCILIATION.equals(dto.getCategory());
boolean importAccounts = TaskCategory.IMPORTING_ACCOUNTS.equals(dto.getCategory());
return sync || recon || importAccounts;
}
});
if (model.getObject() != null && model.getObject().getResource() != null && model.getObject().getResource().getOid() != null) {
loadResource();
}
AutoCompleteSettings autoCompleteSettings = new AutoCompleteSettings();
autoCompleteSettings.setShowListOnEmptyInput(true);
autoCompleteSettings.setMaxHeightInPx(200);
final AutoCompleteTextField<String> objectClass = new AutoCompleteTextField<String>(ID_OBJECT_CLASS, new PropertyModel<String>(model, TaskAddDto.F_OBJECT_CLASS), autoCompleteSettings) {
@Override
protected Iterator<String> getChoices(String input) {
return prepareObjectClassChoiceList(input);
}
};
objectClass.add(new VisibleEnableBehaviour() {
@Override
public boolean isEnabled() {
TaskAddDto dto = model.getObject();
boolean sync = TaskCategory.LIVE_SYNCHRONIZATION.equals(dto.getCategory());
boolean recon = TaskCategory.RECONCILIATION.equals(dto.getCategory());
boolean importAccounts = TaskCategory.IMPORTING_ACCOUNTS.equals(dto.getCategory());
return sync || recon || importAccounts;
}
});
mainForm.add(objectClass);
DropDownChoice type = new DropDownChoice<>(ID_CATEGORY, new PropertyModel<String>(model, TaskAddDto.F_CATEGORY), new AbstractReadOnlyModel<List<String>>() {
@Override
public List<String> getObject() {
return WebComponentUtil.createTaskCategoryList();
}
}, new StringChoiceRenderer("pageTask.category."));
type.add(new AjaxFormComponentUpdatingBehavior("change") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(resource);
target.add(intent);
target.add(kind);
target.add(objectClass);
target.add(focusType);
}
});
type.setRequired(true);
mainForm.add(type);
TextField<String> name = new TextField<>(ID_NAME, new PropertyModel<String>(model, TaskAddDto.F_NAME));
name.setRequired(true);
mainForm.add(name);
initScheduling(mainForm);
initAdvanced(mainForm);
CheckBox dryRun = new CheckBox(ID_DRY_RUN, new PropertyModel<Boolean>(model, TaskAddDto.F_DRY_RUN));
mainForm.add(dryRun);
initButtons(mainForm);
}
Aggregations