Add a generic ProgressBar component to wicket-extensions

未关闭
#1,635 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@reiern70 已经在做这个了。

开始于 2026年10月1日。

评估

这个 Issue 还没有评估数据。

描述

Wicket has no general-purpose progress bar. UploadProgressBar is tied to file uploads, so applications that need to show the progress of some work (a background job, an import, a multi-step process) each build their own markup and CSS.

This proposes org.apache.wicket.extensions.markup.html.progress.ProgressBar, a small CSS-only component:

  • Model: an IModel<? extends Number> holding a percentage. Values are rounded and clamped to 0–100.
  • Indeterminate: a null model value renders an indeterminate bar, for work whose end is unknown ("working on it"): no percentage, only an animated striped bar. isIndeterminate() tells which state the bar is in.
  • Markup: attached to a . It renders a native element (no value attribute when indeterminate) and a label such as 42%. Existing class attributes on the tag are kept. The same markup is available as a string from ProgressBar.markup(value) and ProgressBar.indeterminateMarkup(), for example as the template of a column rendered in the browser.
  • Content Security Policy: no inline style; the width comes from the progress element itself, so the bar works under a strict CSP.
  • Accessibility: the native progress element carries the value for assistive technology; the visible label is aria-hidden.
  • Styling: the look comes from wicket-progress-bar.css, contributed by the component. It uses the classes wicket-progress-bar, wicket-progress-bar-value and wicket-progress-bar-label, so applications can restyle it. The filled part is striped and the stripes move; the animation stops when the user prefers reduced motion. The label is bold on a chip of the track's color, so it stays readable over the filled part and on dark pages. Colors come from the shared themes of wicket-extensions (org.apache.wicket.extensions.theme) where a theme applies, with a neutral default otherwise.
  • Updating: the component re-renders like any other, so target.add(progressBar) in an Ajax or web socket request updates it.
主要语言
Java
星标
800
派生
437
平均合并
21 小时 36 分钟
30 天内合并 PR
167

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/wicket 的其他 Issue

查看 apache/wicket 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。