use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.
the class PageTraceView method initLayout.
private void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
DropDownChoicePanel<GenericTraceVisualizationType> clockworkExecutionChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_CLOCKWORK_EXECUTION, createClockworkLevels(), new PropertyModel<>(model, TraceViewDto.F_CLOCKWORK_EXECUTION), this, false);
clockworkExecutionChoice.setOutputMarkupId(true);
mainForm.add(clockworkExecutionChoice);
DropDownChoicePanel<GenericTraceVisualizationType> clockworkClickChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_CLOCKWORK_CLICK, createClockworkLevels(), new PropertyModel<>(model, TraceViewDto.F_CLOCKWORK_CLICK), this, false);
clockworkClickChoice.setOutputMarkupId(true);
mainForm.add(clockworkClickChoice);
DropDownChoicePanel<GenericTraceVisualizationType> mappingEvaluationChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_MAPPING_EVALUATION, createMappingLevels(), new PropertyModel<>(model, TraceViewDto.F_MAPPING_EVALUATION), this, false);
mappingEvaluationChoice.setOutputMarkupId(true);
mainForm.add(mappingEvaluationChoice);
DropDownChoicePanel<GenericTraceVisualizationType> focusLoadChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_FOCUS_LOAD, createStandardLevels(), new PropertyModel<>(model, TraceViewDto.F_FOCUS_LOAD), this, false);
focusLoadChoice.setOutputMarkupId(true);
mainForm.add(focusLoadChoice);
DropDownChoicePanel<GenericTraceVisualizationType> projectionLoadChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_PROJECTION_LOAD, createStandardLevels(), new PropertyModel<>(model, TraceViewDto.F_PROJECTION_LOAD), this, false);
projectionLoadChoice.setOutputMarkupId(true);
mainForm.add(projectionLoadChoice);
DropDownChoicePanel<GenericTraceVisualizationType> focusChangeChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_FOCUS_CHANGE, createStandardLevels(), new PropertyModel<>(model, TraceViewDto.F_FOCUS_CHANGE), this, false);
focusChangeChoice.setOutputMarkupId(true);
mainForm.add(focusChangeChoice);
DropDownChoicePanel<GenericTraceVisualizationType> projectionChangeChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_PROJECTION_CHANGE, createStandardLevels(), new PropertyModel<>(model, TraceViewDto.F_PROJECTION_CHANGE), this, false);
projectionChangeChoice.setOutputMarkupId(true);
mainForm.add(projectionChangeChoice);
DropDownChoicePanel<GenericTraceVisualizationType> otherChoice = WebComponentUtil.createEnumPanel(GenericTraceVisualizationType.class, ID_OTHERS, createOthersLevels(), new PropertyModel<>(model, TraceViewDto.F_OTHERS), this, false);
otherChoice.setOutputMarkupId(true);
mainForm.add(otherChoice);
mainForm.add(new CheckBox(ID_SHOW_INVOCATION_ID, new PropertyModel<>(model, TraceViewDto.F_SHOW_INVOCATION_ID)));
mainForm.add(new CheckBox(ID_SHOW_DURATION_BEFORE, new PropertyModel<>(model, TraceViewDto.F_SHOW_DURATION_BEFORE)));
mainForm.add(new CheckBox(ID_SHOW_DURATION_AFTER, new PropertyModel<>(model, TraceViewDto.F_SHOW_DURATION_AFTER)));
mainForm.add(new CheckBox(ID_SHOW_REPO_OP_COUNT, new PropertyModel<>(model, TraceViewDto.F_SHOW_REPO_OP_COUNT)));
mainForm.add(new CheckBox(ID_SHOW_CONN_ID_OP_COUNT, new PropertyModel<>(model, TraceViewDto.F_SHOW_CONN_ID_OP_COUNT)));
mainForm.add(new CheckBox(ID_SHOW_REPO_OP_TIME, new PropertyModel<>(model, TraceViewDto.F_SHOW_REPO_OP_TIME)));
mainForm.add(new CheckBox(ID_SHOW_CONN_ID_OP_TIME, new PropertyModel<>(model, TraceViewDto.F_SHOW_CONN_ID_OP_TIME)));
AjaxSubmitButton showButton = new AjaxSubmitButton(ID_SHOW, createStringResource("PageTraceView.button.show")) {
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getFeedbackPanel());
}
@Override
protected void onSubmit(AjaxRequestTarget target) {
visualize();
target.add(PageTraceView.this);
}
};
mainForm.add(showButton);
Label resultLabel = new Label(ID_RESULT_LABEL, (IModel<String>) () -> {
if (!model.getObject().isVisualized()) {
return "";
} else {
return getString("PageTraceView.trace");
}
});
mainForm.add(resultLabel);
AceEditor resultText = new AceEditor(ID_RESULT_TEXT, new PropertyModel<>(model, TraceViewDto.F_VISUALIZED_TRACE));
resultText.setReadonly(true);
resultText.setResizeToMaxHeight(true);
resultText.setMode(null);
resultText.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return model.getObject().isVisualized();
}
});
mainForm.add(resultText);
}
use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.
the class ImportOptionsPanel method initLayout.
private void initLayout() {
add(new CheckBox(ID_PROTECTED_BY_ENCRYPTION, new PropertyModel<>(model, "encryptProtectedValues")));
add(new CheckBox(ID_FETCH_RESOURCE_SCHEMA, new PropertyModel<>(model, "fetchResourceSchema")));
add(new CheckBox(ID_KEEP_OID, new PropertyModel<>(model, "keepOid")));
add(new CheckBox(ID_OVERWRITE_EXISTING_OBJECT, new PropertyModel<>(model, "overwrite")));
add(new CheckBox(ID_REFERENTIAL_INTEGRITY, new PropertyModel<>(model, "referentialIntegrity")));
add(new CheckBox(ID_SUMMARIZE_ERRORS, new PropertyModel<>(model, "summarizeErrors")));
add(new CheckBox(ID_SUMMARIZE_SUCCESSES, new PropertyModel<>(model, "summarizeSucceses")));
add(new CheckBox(ID_VALIDATE_DYNAMIC_SCHEMA, new PropertyModel<>(model, "validateDynamicSchema")));
add(new CheckBox(ID_VALIDATE_STATIC_SCHEMA, new PropertyModel<>(model, "validateStaticSchema")));
add(new CheckBox(ID_FULL_PROCESSING, fullProcessingModel));
add(new TextField<Integer>(ID_ERRORS, new PropertyModel<>(model, "stopAfterErrors")));
add(new CheckBox(ID_COMPAT_MODE, new PropertyModel<>(model, "compatMode")));
}
use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.
the class TypedAssignablePanel method initAssignmentParametersPanel.
protected void initAssignmentParametersPanel() {
DropDownChoicePanel<ObjectTypes> typeSelect = new DropDownChoicePanel<>(ID_TYPE, typeModel, Model.ofList(getObjectTypesList()), new EnumChoiceRenderer<>());
typeSelect.getBaseFormComponent().add(new OnChangeAjaxBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(get(ID_TABLES_CONTAINER));
target.add(addOrReplace(createCountContainer()));
}
});
typeSelect.setOutputMarkupId(true);
add(typeSelect);
WebMarkupContainer relationContainer = new WebMarkupContainer(ID_RELATION_CONTAINER);
relationContainer.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return TypedAssignablePanel.this.isRelationPanelVisible() && !ResourceType.COMPLEX_TYPE.equals(typeModel.getObject().getTypeQName());
}
});
relationContainer.setOutputMarkupId(true);
add(relationContainer);
DropDownChoicePanel<RelationTypes> relationSelector = WebComponentUtil.createEnumPanel(RelationTypes.class, ID_RELATION, WebComponentUtil.createReadonlyModelFromEnum(RelationTypes.class), Model.of(RelationTypes.MEMBER), TypedAssignablePanel.this, false);
relationSelector.getBaseFormComponent().add(new EmptyOnChangeAjaxFormUpdatingBehavior());
relationSelector.setOutputMarkupId(true);
relationSelector.setOutputMarkupPlaceholderTag(true);
relationContainer.add(relationSelector);
WebMarkupContainer kindContainer = new WebMarkupContainer(ID_KIND_CONTAINER);
kindContainer.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return ResourceType.COMPLEX_TYPE.equals(typeModel.getObject().getTypeQName());
}
});
kindContainer.setOutputMarkupId(true);
add(kindContainer);
DropDownChoicePanel kindSelector = WebComponentUtil.createEnumPanel(ShadowKindType.class, ID_KIND, WebComponentUtil.createReadonlyModelFromEnum(ShadowKindType.class), Model.of(ShadowKindType.ACCOUNT), TypedAssignablePanel.this, false);
kindSelector.setOutputMarkupId(true);
kindSelector.getBaseFormComponent().add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isEnabled() {
return ResourceType.COMPLEX_TYPE.equals(typeModel.getObject().getTypeQName()) && getSelectedResourceCount() > 0;
}
});
kindSelector.getBaseFormComponent().add(new AjaxFormComponentUpdatingBehavior("change") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(TypedAssignablePanel.this);
}
});
kindSelector.getBaseFormComponent().add(new EmptyOnChangeAjaxFormUpdatingBehavior());
kindSelector.setOutputMarkupPlaceholderTag(true);
kindContainer.add(kindSelector);
WebMarkupContainer intentContainer = new WebMarkupContainer(ID_INTENT_CONTAINER);
intentContainer.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return ResourceType.COMPLEX_TYPE.equals(typeModel.getObject().getTypeQName());
}
});
intentContainer.setOutputMarkupId(true);
add(intentContainer);
DropDownChoicePanel<?> intentSelector = new DropDownChoicePanel<>(ID_INTENT, intentValueModel, intentValues);
intentSelector.getBaseFormComponent().add(new EmptyOnChangeAjaxFormUpdatingBehavior());
intentSelector.getBaseFormComponent().add(new AjaxFormComponentUpdatingBehavior("change") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(TypedAssignablePanel.this);
}
});
intentSelector.getBaseFormComponent().add(new EmptyOnChangeAjaxFormUpdatingBehavior());
intentSelector.setOutputMarkupId(true);
intentSelector.setOutputMarkupPlaceholderTag(true);
intentSelector.getBaseFormComponent().add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isEnabled() {
return ResourceType.COMPLEX_TYPE.equals(typeModel.getObject().getTypeQName()) && getSelectedResourceCount() > 0;
}
});
intentContainer.add(intentSelector);
WebMarkupContainer orgTreeViewContainer = new WebMarkupContainer(ID_ORG_TREE_VIEW_CONTAINER);
orgTreeViewContainer.setOutputMarkupId(true);
orgTreeViewContainer.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
boolean res = OrgType.COMPLEX_TYPE.equals(typeModel.getObject().getTypeQName());
return res;
}
});
add(orgTreeViewContainer);
CheckBox orgTreeViewCheckbox = new CheckBox(ID_ORG_TREE_VIEW, orgTreeViewModel);
orgTreeViewCheckbox.add(new AjaxEventBehavior("change") {
@Override
protected void onEvent(AjaxRequestTarget ajaxRequestTarget) {
orgTreeViewModel.setObject(!orgTreeViewModel.getObject());
ajaxRequestTarget.add(TypedAssignablePanel.this);
}
});
orgTreeViewCheckbox.setOutputMarkupId(true);
orgTreeViewContainer.add(orgTreeViewCheckbox);
}
use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.
the class SearchPanel method initPopover.
private void initPopover() {
WebMarkupContainer popover = new WebMarkupContainer(ID_POPOVER);
popover.setOutputMarkupId(true);
add(popover);
final WebMarkupContainer propList = new WebMarkupContainer(ID_PROP_LIST);
propList.setOutputMarkupId(true);
popover.add(propList);
ListView properties = new ListView<SearchItemDefinition>(ID_PROPERTIES, new PropertyModel<>(moreDialogModel, MoreDialogDto.F_PROPERTIES)) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<SearchItemDefinition> item) {
CheckBox check = new CheckBox(ID_CHECK, new PropertyModel<>(item.getModel(), SearchItemDefinition.F_SELECTED));
check.add(new AjaxFormComponentUpdatingBehavior("change") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
// nothing, just update model.
}
});
item.add(check);
AjaxLink<Void> propLink = new AjaxLink<Void>(ID_PROP_LINK) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
addOneItemPerformed(item.getModelObject(), target);
}
};
item.add(propLink);
Label name = new Label(ID_PROP_NAME, new PropertyModel<>(item.getModel(), SearchItemDefinition.F_NAME));
name.setRenderBodyOnly(true);
propLink.add(name);
Label help = new Label(ID_HELP);
IModel<String> helpModel = new PropertyModel<>(item.getModel(), SearchItemDefinition.F_HELP);
help.add(AttributeModifier.replace("title", createStringResource(helpModel.getObject() != null ? helpModel.getObject() : "")));
help.add(new InfoTooltipBehavior() {
@Override
public String getDataPlacement() {
return "left";
}
});
help.add(new VisibleBehaviour(() -> StringUtils.isNotEmpty(helpModel.getObject())));
item.add(help);
item.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
SearchItemDefinition property = item.getModelObject();
Search<C> search = SearchPanel.this.getModelObject();
if (!search.getAvailableDefinitions().contains(property)) {
return false;
}
for (SearchItem searchItem : search.getItems()) {
if (searchItem.getDefinition().equals(property)) {
return false;
}
if (searchItem instanceof PropertySearchItem) {
ItemPath propertyPath = property.getPath();
if (propertyPath != null && QNameUtil.match(propertyPath.lastName(), ((PropertySearchItem) searchItem).getPath().lastName())) {
return false;
}
}
}
MoreDialogDto dto = moreDialogModel.getObject();
String nameFilter = dto.getNameFilter();
String propertyName = property.getName().toLowerCase();
if (StringUtils.isNotEmpty(nameFilter) && !propertyName.contains(nameFilter.toLowerCase())) {
return false;
}
return true;
}
});
}
};
propList.add(properties);
TextField<?> addText = new TextField<>(ID_ADD_TEXT, new PropertyModel<>(moreDialogModel, MoreDialogDto.F_NAME_FILTER));
addText.add(WebComponentUtil.preventSubmitOnEnterKeyDownBehavior());
popover.add(addText);
addText.add(new AjaxFormComponentUpdatingBehavior("keyup") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(propList);
}
});
popover.add(addText);
AjaxButton add = new AjaxButton(ID_ADD, createStringResource("SearchPanel.add")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
addItemPerformed(target);
}
};
popover.add(add);
AjaxButton close = new AjaxButton(ID_CLOSE, createStringResource("SearchPanel.close")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
closeMorePopoverPerformed(target);
}
};
popover.add(close);
}
use of org.apache.wicket.markup.html.form.CheckBox in project midpoint by Evolveum.
the class CapabilityScriptPanel method initLayout.
protected void initLayout(final WebMarkupContainer capabilitiesTable, PageResourceWizard parentPage) {
parentPage.addEditingEnabledBehavior(this);
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);
MultiValueTextPanel onConnector = new MultiValueTextPanel(ID_ON_CONNECTOR, prepareOnConnectorModel(), parentPage.getReadOnlyModel(), true);
add(onConnector);
MultiValueTextPanel onResource = new MultiValueTextPanel(ID_ON_RESOURCE, Model.of(prepareOnResourceModel()), parentPage.getReadOnlyModel(), true);
add(onResource);
Label enabledTooltip = new Label(ID_T_ENABLED);
enabledTooltip.add(new InfoTooltipBehavior());
add(enabledTooltip);
Label onConnectorTooltip = new Label(ID_T_ON_CONNECTOR);
onConnectorTooltip.add(new InfoTooltipBehavior());
add(onConnectorTooltip);
Label onResourceTooltip = new Label(ID_T_ON_RESOURCE);
onResourceTooltip.add(new InfoTooltipBehavior());
add(onResourceTooltip);
}
Aggregations