@Override public void populateItem( final Item<ICellPopulator<Misaligned>> cellItem, final String componentId, final IModel<Misaligned> rowModel) { cellItem.add(new Label(componentId, rowModel.getObject().getOnResource().toString())); cellItem.add(new AttributeModifier("class", "code-addition")); } });
public Behavior getDatePickerStyle() { return new CompositeBehavior(AttributeModifier.append("class", "date-pick"), AttributeModifier.replace("size", String.valueOf(format_.length())), AttributeModifier.replace("maxlength", String.valueOf(format_.length())), AttributeModifier.replace("title", format_)); } }
@Override protected void onInitialize() { super.onInitialize(); WebMarkupContainer ownerLink = new WebMarkupContainer("ownerLink"); ownerLink.add(new AttributeModifier("href", new ResourceModel("footer.product.owner.addr"))); ownerLink.add(new AttributeModifier("title", new ResourceModel("footer.product.owner.title"))); add(new Label("version", Model.of(getVersion()))); add(ownerLink); }
@SuppressWarnings("rawtypes") public HtmlEscapingVelocityPanel(String id, IModel<? extends Map> model, PackageResourceStream packageResourceStream, String classAttribute) { super(id, model); this.templateResource = packageResourceStream; add(new AttributeModifier("class", new Model<String>(classAttribute))); }
/** * Construct. * * @param id the component id * @param model the default image url */ public ThumbnailBorder(String id, IModel<String> model) { super(id, model); add(title = new Label("title", Model.of("")), image = new Label("image").add(new AttributeModifier("url", getDefaultModel()))); }
public ButtonPanel(final String id, final String label, final ButtonType... buttonTypes) { super(id); button = new Button(BUTTON_ID, new Model<String>(label)); button.add(new Label("title", label)); for (final ButtonType buttonType : buttonTypes) { button.add(AttributeModifier.append("class", buttonType.getClassAttrValue())); } add(button); }
public RadioButtonLabelPanel(final String id, final IModel<T> model, final String label) { super(id); radioButton = new Radio<T>("radioButton", model); add(radioButton); final Model<String> labelModel = new Model<String>(label); radioButton.setLabel(labelModel); // I18n key must be implemented as Model not as String because in constructor (before adding this component to parent) a warning will be // logged for using getString(String). add(new Label("label", labelModel).add(AttributeModifier.replace("for", radioButton.getMarkupId()))); setRenderBodyOnly(true); }
/** * creates a new image element * * @param markupId the markup id of the header * @param image the current image for this header * @return new image component */ protected Component newImage(final String markupId, final ICarouselImage image) { final Label img = new Label(markupId); img.add(new AttributeModifier("src", image.url())); return img; }
@Override protected void onPopulateItem(Property<ElasticAttribute> property, ListItem<Property<ElasticAttribute>> item) { if (property == ElasticAttributeProvider.STORED) { item.add(new AttributeModifier("style",Model.of("text-align:center"))); } else if (property == ElasticAttributeProvider.ANALYZED) { item.add(new AttributeModifier("style",Model.of("text-align:center"))); } } };
public LinkFragment(String id, UrlMenuItem item) { super(id, "link-fragment", Menu.this); WebMarkupContainer link = new WebMarkupContainer("link"); link.add(AttributeModifier.replace("href", item.getUrl())); link.add(new EmptyPanel("icon").add(AttributeModifier.append("class", KendoIcon.getCssClass(item.getIcon())))); link.add(new Label("title", item.getTitle()).setRenderBodyOnly(true)); this.add(link); } }
protected void populateItem(ListItem<T> item) { item.add(new AttributeModifier("dndType", getDndValue(item))); item.add(new CssClass("dojoDndItem")); String displayValue = renderer.getDisplayValue(item.getModelObject()).toString(); item.add(new Label("value", displayValue)); String sortValue = getSortValue(item); Label sortLabel = new Label("sortValue", sortValue); sortLabel.setVisible(sortValue != null); item.add(sortLabel); }
MasterDetailNoRecordsToolbar(DataTable<?, ?> table) { super(table); final WebMarkupContainer td = new WebMarkupContainer("td"); add(td); td.add(AttributeModifier.replace("colspan", new AbstractReadOnlyModel<String>() { @Override public String getObject() { return String.valueOf(table.getColumns().size()).intern(); } })); td.add(new Label("msg", $m.ofValue("Nenhum item foi adicionado."))); }
protected ProgressComponent(String id, final IModel modelObject) { super(id); add(new AttributeModifier("style", new AbstractReadOnlyModel() { @Override public Object getObject() { Object obj = modelObject.getObject(); return generateNewAttributeString(getProgress(obj), obj); } })); }
public ItemFragment(String id, IMenuItem item) { super(id, "item-fragment", Menu.this); this.add(new EmptyPanel("icon").add(AttributeModifier.append("class", KendoIcon.getCssClass(item.getIcon())))); this.add(new Label("title", item.getTitle()).setRenderBodyOnly(true)); } }
@Override protected void onInitialize() { super.onInitialize(); // As the Form is posted, Form#findSubmittingButton() expect to retrieve this component by the request parameter 'name'. // But as this component is not an input, it does not have a name attribute. Thus, it should match the #getInputName() path this.add(new HiddenField<Serializable>("submitter", new Model<Serializable>()).add(AttributeModifier.replace("name", this.getInputName()))); }
/** * Creates a attribute modifier that removes an attribute with the specified name * * @param attributeName * the name of the attribute to be removed * @return the attribute modifier * @since 1.5 */ public static AttributeModifier remove(String attributeName) { Args.notEmpty(attributeName, "attributeName"); return replace(attributeName, Model.of(VALUELESS_ATTRIBUTE_REMOVE)); } }