Search in sources :

Example 31 with InfoTooltipBehavior

use of com.evolveum.midpoint.web.util.InfoTooltipBehavior in project midpoint by Evolveum.

the class ResourceIterationEditor method initLayout.

protected void initLayout(PageResourceWizard parentPage) {
    loadModel();
    getModel();
    TextField maxIteration = new TextField<>(ID_MAX_ITERATION, new PropertyModel<Integer>(model, IterationSpecificationTypeDto.F_ITERATION + "." + "maxIterations"));
    parentPage.addEditingEnabledBehavior(maxIteration);
    add(maxIteration);
    prepareIterationSubsectionBody(IterationSpecificationType.F_TOKEN_EXPRESSION.getLocalPart(), ID_TOKEN_DESCRIPTION, ID_TOKEN_VARIABLE_LIST, ID_TOKEN_RETURN_MULTIPLICITY, ID_TOKEN_EXPR_TYPE, ID_TOKEN_EXPR, ID_TOKEN_EXPR_LANG, ID_TOKEN_EXPR_POLICY, IterationSpecificationTypeDto.TOKEN_EXPRESSION_PREFIX, ID_TOKEN_LANG_CONTAINER, ID_TOKEN_POLICY_CONTAINER, parentPage);
    prepareIterationSubsectionBody(IterationSpecificationType.F_PRE_ITERATION_CONDITION.getLocalPart(), ID_PRE_DESCRIPTION, ID_PRE_VARIABLE_LIST, ID_PRE_RETURN_MULTIPLICITY, ID_PRE_EXPR_TYPE, ID_PRE_EXPR, ID_PRE_EXPR_LANG, ID_PRE_EXPR_POLICY, IterationSpecificationTypeDto.PRE_EXPRESSION_PREFIX, ID_PRE_LANG_CONTAINER, ID_PRE_POLICY_CONTAINER, parentPage);
    prepareIterationSubsectionBody(IterationSpecificationType.F_POST_ITERATION_CONDITION.getLocalPart(), ID_POST_DESCRIPTION, ID_POST_VARIABLE_LIST, ID_POST_RETURN_MULTIPLICITY, ID_POST_EXPR_TYPE, ID_POST_EXPR, ID_POST_EXPR_LANG, ID_POST_EXPR_POLICY, IterationSpecificationTypeDto.POST_EXPRESSION_PREFIX, ID_POST_LANG_CONTAINER, ID_POST_POLICY_CONTAINER, parentPage);
    Label maxItTooltip = new Label(ID_T_MAX_ITERATION);
    maxItTooltip.add(new InfoTooltipBehavior());
    add(maxItTooltip);
    Label tokenVarTooltip = new Label(ID_T_TOKEN_VAR);
    tokenVarTooltip.add(new InfoTooltipBehavior());
    add(tokenVarTooltip);
    Label tokenMulTooltip = new Label(ID_T_TOKEN_MUL);
    tokenMulTooltip.add(new InfoTooltipBehavior());
    add(tokenMulTooltip);
    Label preVarTooltip = new Label(ID_T_PRE_VAR);
    preVarTooltip.add(new InfoTooltipBehavior());
    add(preVarTooltip);
    Label preMulTooltip = new Label(ID_T_PRE_MUL);
    preMulTooltip.add(new InfoTooltipBehavior());
    add(preMulTooltip);
    Label postVarTooltip = new Label(ID_T_POST_VAR);
    postVarTooltip.add(new InfoTooltipBehavior());
    add(postVarTooltip);
    Label postMulTooltip = new Label(ID_T_POST_MUL);
    postMulTooltip.add(new InfoTooltipBehavior());
    add(postMulTooltip);
    initModals();
}
Also used : InfoTooltipBehavior(com.evolveum.midpoint.web.util.InfoTooltipBehavior) Label(org.apache.wicket.markup.html.basic.Label) TextField(org.apache.wicket.markup.html.form.TextField)

Example 32 with InfoTooltipBehavior

use of com.evolveum.midpoint.web.util.InfoTooltipBehavior in project midpoint by Evolveum.

the class PrismPropertyPanel method initLayout.

private void initLayout(final IModel<IW> model, final Form form) {
    WebMarkupContainer labelContainer = new WebMarkupContainer(ID_LABEL_CONTAINER);
    labelContainer.setOutputMarkupId(true);
    labelContainer.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return labelContainerVisible;
        }
    });
    add(labelContainer);
    final IModel<String> label = createDisplayName(model);
    labelContainer.add(new Label(ID_LABEL, label));
    final IModel<String> helpText = new LoadableModel<String>(false) {

        private static final long serialVersionUID = 1L;

        @Override
        protected String load() {
            return loadHelpText(model);
        }
    };
    Label help = new Label(ID_HELP);
    help.add(AttributeModifier.replace("title", helpText));
    help.add(new InfoTooltipBehavior());
    help.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return StringUtils.isNotEmpty(helpText.getObject());
        }
    });
    labelContainer.add(help);
    WebMarkupContainer required = new WebMarkupContainer("required");
    required.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            IW wrapper = model.getObject();
            ItemDefinition def = wrapper.getItemDefinition();
            if (ObjectType.F_NAME.equals(def.getName())) {
                //fix for "name as required" MID-789
                return true;
            }
            return def.isMandatory();
        }
    });
    labelContainer.add(required);
    WebMarkupContainer hasOutbound = new WebMarkupContainer("hasOutbound");
    hasOutbound.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return hasOutbound(model);
        }
    });
    labelContainer.add(hasOutbound);
    WebMarkupContainer hasPendingModification = new WebMarkupContainer(ID_HAS_PENDING_MODIFICATION);
    hasPendingModification.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return hasPendingModification(model);
        }
    });
    labelContainer.add(hasPendingModification);
    ListView<ValueWrapper> values = new ListView<ValueWrapper>("values", new PropertyModel<List<ValueWrapper>>(model, "values")) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(final ListItem<ValueWrapper> item) {
            PrismValuePanel panel = new PrismValuePanel("value", item.getModel(), label, form, getValueCssClass(), getInputCssClass(), pageBase);
            item.add(panel);
            item.add(AttributeModifier.append("class", createStyleClassModel(item.getModel())));
            item.add(new VisibleEnableBehaviour() {

                private static final long serialVersionUID = 1L;

                @Override
                public boolean isVisible() {
                    return isVisibleValue(item.getModel());
                }
            });
        }
    };
    values.add(new AttributeModifier("class", getValuesClass()));
    values.setReuseItems(true);
    add(values);
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) AttributeModifier(org.apache.wicket.AttributeModifier) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) InfoTooltipBehavior(com.evolveum.midpoint.web.util.InfoTooltipBehavior) ListView(org.apache.wicket.markup.html.list.ListView) LoadableModel(com.evolveum.midpoint.gui.api.model.LoadableModel) List(java.util.List) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) ListItem(org.apache.wicket.markup.html.list.ListItem)

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