Search in sources :

Example 21 with InfoTooltipBehavior

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));
}
Also used : StartEndDateValidator(com.evolveum.midpoint.web.page.admin.server.dto.StartEndDateValidator) ScheduleValidator(com.evolveum.midpoint.web.page.admin.server.dto.ScheduleValidator) PropertyModel(org.apache.wicket.model.PropertyModel) Label(org.apache.wicket.markup.html.basic.Label) AjaxCheckBox(org.apache.wicket.ajax.markup.html.form.AjaxCheckBox) DateTimeField(org.apache.wicket.extensions.yui.calendar.DateTimeField) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) Date(java.util.Date) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) InfoTooltipBehavior(com.evolveum.midpoint.web.util.InfoTooltipBehavior) TextField(org.apache.wicket.markup.html.form.TextField) AutoCompleteTextField(org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField) DateTextField(org.apache.wicket.datetime.markup.html.form.DateTextField) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)

Example 22 with InfoTooltipBehavior

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);
}
Also used : InfoTooltipBehavior(com.evolveum.midpoint.web.util.InfoTooltipBehavior) PasswordPanel(com.evolveum.midpoint.gui.api.component.password.PasswordPanel) EmptyOnBlurAjaxFormUpdatingBehaviour(com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour) Label(org.apache.wicket.markup.html.basic.Label) MultiLineLabel(org.apache.wicket.markup.html.basic.MultiLineLabel) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) ProtectedStringType(com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType) StringResourceModel(org.apache.wicket.model.StringResourceModel)

Example 23 with InfoTooltipBehavior

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);
}
Also used : ListDataProvider(com.evolveum.midpoint.web.component.util.ListDataProvider) AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) Label(org.apache.wicket.markup.html.basic.Label) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) InfoTooltipBehavior(com.evolveum.midpoint.web.util.InfoTooltipBehavior) DataView(org.apache.wicket.markup.repeater.data.DataView) Item(org.apache.wicket.markup.repeater.Item) CapabilityDto(com.evolveum.midpoint.web.component.wizard.resource.dto.CapabilityDto) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) AjaxLink(org.apache.wicket.ajax.markup.html.AjaxLink) ModalWindow(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow) AttributeAppender(org.apache.wicket.behavior.AttributeAppender)

Example 24 with InfoTooltipBehavior

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);
}
Also used : ProfilingLevel(com.evolveum.midpoint.web.page.admin.configuration.dto.ProfilingLevel) Label(org.apache.wicket.markup.html.basic.Label) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) InfoTooltipBehavior(com.evolveum.midpoint.web.util.InfoTooltipBehavior) DropDownChoice(org.apache.wicket.markup.html.form.DropDownChoice) CheckBox(org.apache.wicket.markup.html.form.CheckBox)

Example 25 with InfoTooltipBehavior

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);
}
Also used : InfoTooltipBehavior(com.evolveum.midpoint.web.util.InfoTooltipBehavior) Label(org.apache.wicket.markup.html.basic.Label)

Aggregations

InfoTooltipBehavior (com.evolveum.midpoint.web.util.InfoTooltipBehavior)32 Label (org.apache.wicket.markup.html.basic.Label)32 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)16 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)16 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)15 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)13 List (java.util.List)10 DropDownChoice (org.apache.wicket.markup.html.form.DropDownChoice)9 AttributeAppender (org.apache.wicket.behavior.AttributeAppender)8 TextField (org.apache.wicket.markup.html.form.TextField)8 ListItem (org.apache.wicket.markup.html.list.ListItem)8 EmptyOnChangeAjaxFormUpdatingBehavior (com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnChangeAjaxFormUpdatingBehavior)7 ArrayList (java.util.ArrayList)7 AjaxSubmitLink (org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink)7 CheckBox (org.apache.wicket.markup.html.form.CheckBox)7 MultiValueTextEditPanel (com.evolveum.midpoint.web.component.form.multivalue.MultiValueTextEditPanel)6 PropertyModel (org.apache.wicket.model.PropertyModel)6 MultiValueTextPanel (com.evolveum.midpoint.web.component.form.multivalue.MultiValueTextPanel)5 ObjectReferenceChoiceRenderer (com.evolveum.midpoint.web.component.input.ObjectReferenceChoiceRenderer)5 QName (javax.xml.namespace.QName)5