use of com.github.bordertech.wcomponents.WPanel in project wcomponents by BorderTech.
the class WSkipLinksExample method buildPanel.
/**
* Creates a panel for the example.
*
* @param title the panel title.
* @param accessKey the panel access key
* @return a panel for use in the example.
*/
private WPanel buildPanel(final String title, final char accessKey) {
WPanel panel = buildPanel(title);
panel.setAccessKey(accessKey);
return panel;
}
use of com.github.bordertech.wcomponents.WPanel in project wcomponents by BorderTech.
the class WSkipLinksExample method buildPanel.
/**
* Creates a panel for the example.
*
* @param title the panel title.
* @return a panel for use in the example.
*/
private WPanel buildPanel(final String title) {
WPanel panel = new WPanel(WPanel.Type.CHROME);
panel.setTitleText(title);
WProgressBar progress = new WProgressBar(18);
progress.setValue(15);
panel.add(progress);
panel.add(new WHorizontalRule());
WTextField input = new WTextField();
WLabel label = new WLabel("Text input", input);
panel.add(label);
panel.add(input);
return panel;
}
use of com.github.bordertech.wcomponents.WPanel in project wcomponents by BorderTech.
the class ColumnLayoutExample method addHgapVGapExample.
/**
* Build an example using hgap and vgap.
*
* @param hgap the hgap width
* @param vgap the vgap width
*/
private void addHgapVGapExample(final Size hgap, final Size vgap) {
add(new WHeading(HeadingLevel.H2, "Column Layout: hgap=" + hgap.toString() + " vgap=" + vgap.toString()));
WPanel panel = new WPanel();
panel.setLayout(new ColumnLayout(new int[] { 25, 25, 25, 25 }, hgap, vgap));
add(panel);
for (int i = 0; i < 8; i++) {
panel.add(new BoxComponent("25%"));
}
add(new WHorizontalRule());
}
use of com.github.bordertech.wcomponents.WPanel in project wcomponents by BorderTech.
the class ColumnLayoutExample method addResponsiveExample.
/**
* Add a column layout which will change its rendering on small screens.
*/
private void addResponsiveExample() {
add(new WHeading(HeadingLevel.H2, "Default responsive design"));
add(new ExplanatoryText("This example applies the theme's default responsive design rules for ColumnLayout.\n " + "The columns have width and alignment and there is also a hgap and a vgap."));
WPanel panel = new WPanel();
panel.setLayout(new ColumnLayout(new int[] { 33, 33, 33 }, new Alignment[] { Alignment.LEFT, Alignment.CENTER, Alignment.RIGHT }, 12, 18));
panel.setHtmlClass(HtmlClassProperties.RESPOND);
add(panel);
panel.add(new BoxComponent("Left"));
panel.add(new BoxComponent("Center"));
panel.add(new BoxComponent("Right"));
panel.add(new BoxComponent("Left"));
panel.add(new BoxComponent("Center"));
panel.add(new BoxComponent("Right"));
}
use of com.github.bordertech.wcomponents.WPanel in project wcomponents by BorderTech.
the class ColumnLayoutExample method addAutoWidthExample.
/**
* This example shows a column which does not have widths set in Java. This is a "good thing": widths should be set in CSS.
*/
private void addAutoWidthExample() {
add(new WHeading(HeadingLevel.H2, "Automatic (app defined) widths"));
add(new ExplanatoryText("This example shows what happens if you use undefined (0) column width and do not then define them in CSS."));
WPanel panel = new WPanel();
panel.setLayout(new ColumnLayout(new int[] { 0, 0, 0 }, new Alignment[] { Alignment.LEFT, Alignment.CENTER, Alignment.RIGHT }));
add(panel);
panel.add(new BoxComponent("Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."));
panel.add(new BoxComponent("Praesent eu turpis convallis, fringilla elit nec, ullamcorper purus. Proin dictum ac nunc rhoncus fringilla. " + "Pellentesque habitant morbi tristique senectus et netus et malesuada fames."));
panel.add(new BoxComponent("Vestibulum vehicula a turpis et efficitur. Integer maximus enim a orci posuere, id fermentum magna dignissim. " + "Sed condimentum, dui et condimentum faucibus, quam erat pharetra."));
panel.add(new BoxComponent("Left"));
panel.add(new BoxComponent("Center"));
panel.add(new BoxComponent("Right"));
add(new WHorizontalRule());
}
Aggregations