use of com.github.bordertech.wcomponents.Margin in project wcomponents by BorderTech.
the class WAudioExample method buildUI.
/**
* Build the UI for this example.
*/
private void buildUI() {
// build the configuration options UI.
WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
layout.setMargin(new Margin(null, null, Size.LARGE, null));
add(layout);
layout.addField("Autoplay", cbAutoPlay);
layout.addField("Loop", cbLoop);
layout.addField("Mute on load", cbMute);
layout.addField("Hide audio", cbHide);
layout.addField("render default controls", cbRenderControls);
layout.addField("Media Group", tfMediaGroup);
layout.addField((WLabel) null, btnApply);
// enable disable option only when control PLAY_PAUSE is used.
WSubordinateControl control = new WSubordinateControl();
add(control);
Rule rule = new Rule();
rule.setCondition(new Equal(cbHide, Boolean.TRUE.toString()));
control.addRule(rule);
rule.addActionOnTrue(new Hide(audio));
rule.addActionOnFalse(new Show(audio));
// allow config to change without reloading the whole page.
add(new WAjaxControl(btnApply, audio));
// add the audio to the UI
add(audio);
add(new WHeading(HeadingLevel.H2, "Audio with single source"));
add(new WAudio("/audio/ogg.ogg"));
}
Aggregations