use of com.evolveum.midpoint.web.util.InfoTooltipBehavior in project midpoint by Evolveum.
the class PageTaskAdd method initScheduling.
private void initScheduling(final Form mainForm) {
final WebMarkupContainer container = new WebMarkupContainer(ID_CONTAINER);
container.setOutputMarkupId(true);
mainForm.add(container);
final IModel<Boolean> recurringCheck = new PropertyModel<>(model, TaskAddDto.F_RECURRING);
final IModel<Boolean> boundCheck = new PropertyModel<>(model, TaskAddDto.F_BOUND);
final WebMarkupContainer boundContainer = new WebMarkupContainer(ID_BOUND_CONTAINER);
boundContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return recurringCheck.getObject();
}
});
boundContainer.setOutputMarkupId(true);
container.add(boundContainer);
final WebMarkupContainer intervalContainer = new WebMarkupContainer(ID_INTERVAL_CONTAINER);
intervalContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return recurringCheck.getObject();
}
});
intervalContainer.setOutputMarkupId(true);
container.add(intervalContainer);
final WebMarkupContainer cronContainer = new WebMarkupContainer(ID_CRON_CONTAINER);
cronContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return recurringCheck.getObject() && !boundCheck.getObject();
}
});
cronContainer.setOutputMarkupId(true);
container.add(cronContainer);
AjaxCheckBox recurring = new AjaxCheckBox(ID_RECURRING, recurringCheck) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(container);
}
};
mainForm.add(recurring);
AjaxCheckBox bound = new AjaxCheckBox(ID_BOUND, boundCheck) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(container);
}
};
boundContainer.add(bound);
Label boundHelp = new Label(ID_BOUND_HELP);
boundHelp.add(new InfoTooltipBehavior());
boundContainer.add(boundHelp);
TextField<Integer> interval = new TextField<>(ID_INTERVAL, new PropertyModel<Integer>(model, TaskAddDto.F_INTERVAL));
interval.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
intervalContainer.add(interval);
TextField<String> cron = new TextField<>(ID_CRON, new PropertyModel<String>(model, TaskAddDto.F_CRON));
cron.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
// if (recurringCheck.getObject() && !boundCheck.getObject()) {
// cron.setRequired(true);
// }
cronContainer.add(cron);
Label cronHelp = new Label(ID_CRON_HELP);
cronHelp.add(new InfoTooltipBehavior());
cronContainer.add(cronHelp);
final DateTimeField notStartBefore = new DateTimeField(ID_NO_START_BEFORE_FIELD, new PropertyModel<Date>(model, TaskAddDto.F_NOT_START_BEFORE)) {
@Override
protected DateTextField newDateTextField(String id, PropertyModel dateFieldModel) {
// todo i18n
return DateTextField.forDatePattern(id, dateFieldModel, "dd/MMM/yyyy");
}
};
notStartBefore.setOutputMarkupId(true);
mainForm.add(notStartBefore);
final DateTimeField notStartAfter = new DateTimeField(ID_NO_START_AFTER_FIELD, new PropertyModel<Date>(model, TaskAddDto.F_NOT_START_AFTER)) {
@Override
protected DateTextField newDateTextField(String id, PropertyModel dateFieldModel) {
// todo i18n
return DateTextField.forDatePattern(id, dateFieldModel, "dd/MMM/yyyy");
}
};
notStartAfter.setOutputMarkupId(true);
mainForm.add(notStartAfter);
mainForm.add(new StartEndDateValidator(notStartBefore, notStartAfter));
mainForm.add(new ScheduleValidator(getTaskManager(), recurring, bound, interval, cron));
}
use of com.evolveum.midpoint.web.util.InfoTooltipBehavior in project midpoint by Evolveum.
the class PageSelfRegistration method createPasswordPanel.
private void createPasswordPanel(WebMarkupContainer staticRegistrationForm) {
// ProtectedStringType initialPassword = null;
PasswordPanel password = new PasswordPanel(ID_PASSWORD, new PropertyModel<ProtectedStringType>(userModel, "credentials.password.value"), false, true);
password.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
password.getBaseFormComponent().setRequired(true);
staticRegistrationForm.add(password);
Label help = new Label(ID_TOOLTIP);
final StringResourceModel tooltipText = createStringResource("PageSelfRegistration.password.policy");
help.add(AttributeModifier.replace("title", tooltipText));
help.add(new InfoTooltipBehavior());
help.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return StringUtils.isNotEmpty(tooltipText.getObject());
}
});
staticRegistrationForm.add(help);
}
use of com.evolveum.midpoint.web.util.InfoTooltipBehavior in project midpoint by Evolveum.
the class CapabilityStep method initLayout.
protected void initLayout() {
final ListDataProvider<CapabilityDto<CapabilityType>> capabilityProvider = new ListDataProvider<>(this, new PropertyModel<List<CapabilityDto<CapabilityType>>>(dtoModel, CapabilityStepDto.F_CAPABILITIES));
WebMarkupContainer tableBody = new WebMarkupContainer(ID_CAPABILITY_TABLE);
tableBody.setOutputMarkupId(true);
add(tableBody);
WebMarkupContainer configBody = new WebMarkupContainer(ID_CAPABILITY_CONFIG);
configBody.setOutputMarkupId(true);
add(configBody);
DataView<CapabilityDto<CapabilityType>> capabilityDataView = new DataView<CapabilityDto<CapabilityType>>(ID_CAPABILITY_ROW, capabilityProvider) {
@Override
protected void populateItem(final Item<CapabilityDto<CapabilityType>> capabilityRow) {
final CapabilityDto<CapabilityType> dto = capabilityRow.getModelObject();
AjaxLink name = new AjaxLink(ID_CAPABILITY_LINK) {
@Override
public void onClick(AjaxRequestTarget target) {
editCapabilityPerformed(target, dto);
}
};
Label label = new Label(ID_CAPABILITY_NAME, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
String rv = dto.getDisplayName();
if (Boolean.FALSE.equals(dto.getCapability().isEnabled())) {
rv += " " + getString("CapabilityStep.disabled");
}
return rv;
}
});
name.add(label);
capabilityRow.add(name);
Label tooltipLabel = new Label(ID_TOOLTIP, new Model<>());
if (dto.getTooltipKey() != null) {
tooltipLabel.add(new AttributeAppender("data-original-title", getString(dto.getTooltipKey())));
tooltipLabel.add(new InfoTooltipBehavior());
} else {
tooltipLabel.setVisible(false);
}
tooltipLabel.setOutputMarkupId(true);
tooltipLabel.setOutputMarkupPlaceholderTag(true);
name.add(tooltipLabel);
AjaxLink deleteLink = new AjaxLink(ID_CAPABILITY_DELETE) {
@Override
public void onClick(AjaxRequestTarget target) {
deleteCapabilityPerformed(target, dto);
}
};
deleteLink.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return !dto.isAmongNativeCapabilities() && !parentPage.isReadOnly();
}
});
name.add(deleteLink);
capabilityRow.add(AttributeModifier.replace("class", new AbstractReadOnlyModel<Object>() {
@Override
public Object getObject() {
return isSelected(capabilityRow.getModelObject()) ? "success" : null;
}
}));
}
};
tableBody.add(capabilityDataView);
AjaxLink addLink = new AjaxLink(ID_CAPABILITY_ADD) {
@Override
public void onClick(AjaxRequestTarget target) {
addCapabilityPerformed(target);
}
};
parentPage.addEditingVisibleBehavior(addLink);
add(addLink);
ModalWindow dialog = new AddCapabilityDialog(DIALOG_SELECT_CAPABILITY, dtoModel) {
@Override
protected void addPerformed(AjaxRequestTarget target) {
addCapabilitiesPerformed(target, getSelectedData());
}
};
add(dialog);
}
use of com.evolveum.midpoint.web.util.InfoTooltipBehavior in project midpoint by Evolveum.
the class ProfilingConfigPanel method initLayout.
private void initLayout(PageSystemConfiguration parentPage) {
WebMarkupContainer profilingEnabledNote = new WebMarkupContainer(ID_PROFILING_ENABLED_NOTE);
profilingEnabledNote.setVisible(!parentPage.getMidpointConfiguration().isProfilingEnabled());
add(profilingEnabledNote);
//Entry-Exit profiling init
DropDownChoice<ProfilingLevel> profilingLevel = new DropDownChoice<>("profilingLevel", new PropertyModel<ProfilingLevel>(getModel(), "profilingLevel"), WebComponentUtil.createReadonlyModelFromEnum(ProfilingLevel.class), new EnumChoiceRenderer<ProfilingLevel>(this));
profilingLevel.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
add(profilingLevel);
DropDownChoice<String> profilingAppender = new DropDownChoice<>("profilingAppender", new PropertyModel<String>(getModel(), "profilingAppender"), createAppendersListModel());
profilingAppender.setNullValid(true);
profilingAppender.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
add(profilingAppender);
//Subsystem and general profiling init
CheckBox requestFilter = WebComponentUtil.createAjaxCheckBox("requestFilter", new PropertyModel<Boolean>(getModel(), "requestFilter"));
CheckBox performanceStatistics = WebComponentUtil.createAjaxCheckBox("performanceStatistics", new PropertyModel<Boolean>(getModel(), "performanceStatistics"));
CheckBox subsystemModel = WebComponentUtil.createAjaxCheckBox("subsystemModel", new PropertyModel<Boolean>(getModel(), "subsystemModel"));
CheckBox subsystemRepository = WebComponentUtil.createAjaxCheckBox("subsystemRepository", new PropertyModel<Boolean>(getModel(), "subsystemRepository"));
CheckBox subsystemProvisioning = WebComponentUtil.createAjaxCheckBox("subsystemProvisioning", new PropertyModel<Boolean>(getModel(), "subsystemProvisioning"));
//CheckBox subsystemUcf = WebComponentUtil.createAjaxCheckBox("subsystemUcf", new PropertyModel<Boolean>(getModel(), "subsystemUcf"));
CheckBox subsystemResourceObjectChangeListener = WebComponentUtil.createAjaxCheckBox("subsystemSynchronizationService", new PropertyModel<Boolean>(getModel(), "subsystemSynchronizationService"));
CheckBox subsystemTaskManager = WebComponentUtil.createAjaxCheckBox("subsystemTaskManager", new PropertyModel<Boolean>(getModel(), "subsystemTaskManager"));
CheckBox subsystemWorkflow = WebComponentUtil.createAjaxCheckBox("subsystemWorkflow", new PropertyModel<Boolean>(getModel(), "subsystemWorkflow"));
add(requestFilter);
add(performanceStatistics);
add(subsystemModel);
add(subsystemRepository);
add(subsystemProvisioning);
//add(subsystemUcf);
add(subsystemResourceObjectChangeListener);
add(subsystemTaskManager);
add(subsystemWorkflow);
TextField<Integer> dumpInterval = WebComponentUtil.createAjaxTextField("dumpInterval", new PropertyModel<Integer>(getModel(), "dumpInterval"));
add(dumpInterval);
Label dumpIntervalTooltip = new Label(ID_DUMP_INTERVAL_TOOLTIP);
dumpIntervalTooltip.add(new InfoTooltipBehavior());
add(dumpIntervalTooltip);
}
use of com.evolveum.midpoint.web.util.InfoTooltipBehavior in project midpoint by Evolveum.
the class ResourceActivationEditor method initLayout.
protected void initLayout(NonEmptyModel<Boolean> readOnlyModel) {
prepareActivationPanelBody(ResourceActivationDefinitionType.F_EXISTENCE.getLocalPart(), ID_EXISTENCE_FS, ID_EXISTENCE_OUT, ID_EXISTENCE_IN, readOnlyModel);
prepareActivationPanelBody(ResourceActivationDefinitionType.F_ADMINISTRATIVE_STATUS.getLocalPart(), ID_ADM_STATUS_FS, ID_ADM_STATUS_OUT, ID_ADM_STATUS_IN, readOnlyModel);
prepareActivationPanelBody(ResourceActivationDefinitionType.F_VALID_FROM.getLocalPart(), ID_VALID_FROM_FS, ID_VALID_FROM_OUT, ID_VALID_FROM_IN, readOnlyModel);
prepareActivationPanelBody(ResourceActivationDefinitionType.F_VALID_TO.getLocalPart(), ID_VALID_TO_FS, ID_VALID_TO_OUT, ID_VALID_TO_IN, readOnlyModel);
Label exFetchTooltip = new Label(ID_T_EX_FETCH);
exFetchTooltip.add(new InfoTooltipBehavior());
add(exFetchTooltip);
Label exOutTooltip = new Label(ID_T_EX_OUT);
exOutTooltip.add(new InfoTooltipBehavior());
add(exOutTooltip);
Label exInTooltip = new Label(ID_T_EX_IN);
exInTooltip.add(new InfoTooltipBehavior());
add(exInTooltip);
Label admFetchTooltip = new Label(ID_T_ADM_FETCH);
admFetchTooltip.add(new InfoTooltipBehavior());
add(admFetchTooltip);
Label admOutTooltip = new Label(ID_T_ADM_OUT);
admOutTooltip.add(new InfoTooltipBehavior());
add(admOutTooltip);
Label admInTooltip = new Label(ID_T_ADM_IN);
admInTooltip.add(new InfoTooltipBehavior());
add(admInTooltip);
Label validFromFetchTooltip = new Label(ID_T_VALID_F_FETCH);
validFromFetchTooltip.add(new InfoTooltipBehavior());
add(validFromFetchTooltip);
Label validFromOutTooltip = new Label(ID_T_VALID_F_OUT);
validFromOutTooltip.add(new InfoTooltipBehavior());
add(validFromOutTooltip);
Label validFromInTooltip = new Label(ID_T_VALID_F_IN);
validFromInTooltip.add(new InfoTooltipBehavior());
add(validFromInTooltip);
Label validToFetchTooltip = new Label(ID_T_VALID_T_FETCH);
validToFetchTooltip.add(new InfoTooltipBehavior());
add(validToFetchTooltip);
Label validToOutTooltip = new Label(ID_T_VALID_T_OUT);
validToOutTooltip.add(new InfoTooltipBehavior());
add(validToOutTooltip);
Label validToInTooltip = new Label(ID_T_VALID_T_IN);
validToInTooltip.add(new InfoTooltipBehavior());
add(validToInTooltip);
initModals(readOnlyModel);
}
Aggregations