/** * Creates an AttributeModifier that appends the appendModel's value to the current value of the * attribute, and will add the attribute when it is not there already. * * @param attribute * the attribute to append the appendModels value to * @param appendModel * the model supplying the value to append * @param separator * the separator string, comes between the original value and the append value */ public AttributeAppender(String attribute, IModel<?> appendModel, String separator) { super(attribute, appendModel); setSeparator(separator); }
/** * Creates an AttributeModifier that appends the value to the current value of the * attribute, and will add the attribute when it is not there already. * * @param attribute * the attribute to append the appendModels value to * @param value * the value to append * @param separator * the separator string, comes between the original value and the append value */ public AttributeAppender(String attribute, Serializable value, String separator) { super(attribute, value); setSeparator(separator); }
/** * Creates an AttributeModifier that appends the value to the current value of the * attribute, and will add the attribute when it is not there already. * * @param attribute * the attribute to append the appendModels value to * @param value * the value to append * @param separator * the separator string, comes between the original value and the append value */ public AttributeAppender(String attribute, Serializable value, String separator) { super(attribute, value); setSeparator(separator); }
/** * Creates an AttributeModifier that appends the appendModel's value to the current value of the * attribute, and will add the attribute when it is not there already. * * @param attribute * the attribute to append the appendModels value to * @param appendModel * the model supplying the value to append * @param separator * the separator string, comes between the original value and the append value */ public AttributeAppender(String attribute, IModel<?> appendModel, String separator) { super(attribute, appendModel); setSeparator(separator); }
/** * Creates a attribute modifier that appends the current value with the given {@code value} * using a default space character (' ') separator. * * @param attributeName * @param value * @return the attribute modifier * @since 1.5 * @see AttributeAppender */ public static AttributeAppender append(String attributeName, IModel<?> value) { Args.notEmpty(attributeName, "attributeName"); return new AttributeAppender(attributeName, value).setSeparator(" "); }
/** * Creates a attribute modifier that appends the current value with the given {@code value} * using a default space character (' ') separator. * * @param attributeName * @param value * @return the attribute modifier * @since 1.5 * @see AttributeAppender */ public static AttributeAppender append(String attributeName, IModel<?> value) { Args.notEmpty(attributeName, "attributeName"); return new AttributeAppender(attributeName, value).setSeparator(" "); }
public FoundationSplitButton(String id, IModel<String> buttonTitleModel, IModel<List<String>> linkTitleModels, IModel<SplitButtonOptions> optionsModel) { super(id); final DropdownContainer dropdownContainer = new DropdownContainer("dropdown", linkTitleModels); add(dropdownContainer); AbstractLink button = createButton("button"); add(button); button.add(new AttributeAppender("class", "button").setSeparator(" ")); button.add(new AttributeAppender("class", "split").setSeparator(" ")); SplitButtonOptions options = optionsModel.getObject(); if (options.getColor() != null) { button.add(new AttributeAppender("class", StringUtil.EnumNameToCssClassName(options.getColor().name())).setSeparator(" ")); } if (options.getRadius() != null) { button.add(new AttributeAppender("class", StringUtil.EnumNameToCssClassName(options.getRadius().name())).setSeparator(" ")); } if (options.getSize() != null) { button.add(new AttributeAppender("class", StringUtil.EnumNameToCssClassName(options.getSize().name())).setSeparator(" ")); } button.add(new Label("buttonText", buttonTitleModel)); button.add(new WebMarkupContainer("buttonData") { private static final long serialVersionUID = 1L; @Override protected void onComponentTag(ComponentTag tag) { Attribute.addAttribute(tag, "data-dropdown", dropdownContainer.getMarkupId()); super.onComponentTag(tag); } }); }
if (!initiallyExpanded) section.add(AttributeModifier.append("style", "display:none").setSeparator(";"));
if (!initiallyExpanded) section.add(AttributeModifier.append("style", "display:none").setSeparator(";"));