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();
}
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);
}
Aggregations