Refine search
/** * Constructs a rating component with 5 stars, using the rating for retrieving the rating. * * @param id * the component id * @param rating * the model to get the rating */ public RatingPanel(final String id, final IModel<? extends Number> rating) { this(id, rating, new Model<Integer>(5), null, new Model<>(Boolean.FALSE), true); }
/** * Constructor. * * @param id * The name of this component * @param href * the href attribute to set */ public ExternalLink(final String id, final String href) { this(id, Model.of(href)); }
@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); }
public TextDialog(IModel<String> title, IModel<String> question, IModel<String> textModel) { super(); this.title = title; add(new Label("question", question)); TextAreaWidget textfield; add(textfield = new TextAreaWidget("value", textModel)); textfield.addBehaviourOnFormComponent( new AttributeAppender("class", true, new Model<String>("text-dialog-textarea"), " ")); setFocus(textfield.getFocusComponent()); }
@Override public void populateItem(final Item<ICellPopulator<HRPlanningEntryDO>> item, final String componentId, final IModel<HRPlanningEntryDO> rowModel) { final String formattedPriority = priorityFormatter.getFormattedPriority(rowModel.getObject().getPriority()); final Label label = new Label(componentId, new Model<String>(formattedPriority)); label.setEscapeModelStrings(false); item.add(label); cellItemListener.populateItem(item, componentId, rowModel); cellItemListener.populateItem(item, componentId, rowModel); } });
@Override public void populateItem(final Item<ICellPopulator<AuftragDO>> item, final String componentId, final IModel<AuftragDO> rowModel) { item.add(new Label(componentId, NumberFormatter.format(rowModel.getObject().getPersonDays()))); item.add(AttributeModifier.append("style", new Model<String>("text-align: right;"))); cellItemListener.populateItem(item, componentId, rowModel); } });
@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()))); }
/** * creates a new label component * * @param markupId the component id of the label * @return new label component */ protected Component newLabel(final String markupId) { return new Label(markupId, new Model<>("")) .setRenderBodyOnly(true); }
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); }
@Override public void populateItem(final Item<ICellPopulator<HRViewUserData>> item, final String componentId, final IModel<HRViewUserData> rowModel) { final HRViewUserData userData = rowModel.getObject(); addLabel(item, componentId, userData.getPlannedDaysRestSum(), userData.getActualDaysRestSum()); item.add(AttributeModifier.append("style", new Model<String>("text-align: right;"))); cellItemListener.populateItem(item, componentId, rowModel); } });
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); }
@Override protected Label buildLabel(String id, AttributeModel<String> labelModel) { String s = labelModel.getObject(); s = s.replace("\n", "<br />"); Label label = new Label(id, Model.of(s)); label.setEscapeModelStrings(false); return label; }
public DemoDatatable(String id) { super(id); setOutputMarkupId(true); add(new AttributeModifier("class", Model.of("display"))); }