Skip to content

Commit

Permalink
ProgressBarWidget.java comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kasemir authored May 3, 2024
1 parent dffe5f7 commit 58069e4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/dbwr/widgets/ProgressBarWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,22 @@ public class ProgressBarWidget extends PVWidget
}

public ProgressBarWidget(final ParentWidget parent, final Element xml) throws Exception
{
super(parent, xml, "progressbar");
{
super(parent, xml, "progressbar");

attributes.put("min", XMLUtil.getChildString(parent, xml, "minimum").orElse("0"));
// Turn some parameters from widget XML into HTML attributes
// "min" and "max" will be used by the <meter/>
attributes.put("min", XMLUtil.getChildString(parent, xml, "minimum").orElse("0"));
attributes.put("max", XMLUtil.getChildString(parent, xml, "maximum").orElse("255"));

// "data-..." attributes are for our widget-specific javascript (progressbar.js)
if (XMLUtil.getChildBoolean(xml, "limits_from_pv").orElse(true))
attributes.put("data-limits-from-pv", "true");
}

@Override
protected String getHTMLElement()
{
// Create a "<meter/>"
return "meter";
}
}

0 comments on commit 58069e4

Please sign in to comment.