use of com.github.bordertech.wcomponents.ImageResource in project wcomponents by BorderTech.
the class ExampleSection method buildUI.
/**
* Add the controls to the section in the right order.
*/
private void buildUI() {
add(messages);
add(tabset);
// add(new AccessibilityWarningContainer());
container.add(new WText("Select an example from the menu"));
// Set a static ID on container and it becomes a de-facto naming context.
container.setIdName("eg");
tabset.addTab(container, "(no selection)", WTabSet.TAB_MODE_CLIENT);
WImage srcImage = new WImage(new ImageResource("/image/text-x-source.png", "View Source"));
srcImage.setCacheKey("srcTabImage");
tabset.addTab(source, new WDecoratedLabel(srcImage), WTabSet.TAB_MODE_LAZY).setToolTip("View Source");
// The refresh current view button.
WButton refreshButton = new WButton("\u200b");
refreshButton.setToolTip("Refresh");
refreshButton.setHtmlClass(HtmlIconUtil.getIconClasses("fa-refresh"));
// refreshButton.setImage("/image/refresh-w.png");
refreshButton.setRenderAsLink(true);
refreshButton.setAction(new ValidatingAction(messages.getValidationErrors(), refreshButton) {
@Override
public void executeOnValid(final ActionEvent event) {
// Do Nothing
}
});
// The reset example button.
final WButton resetButton = new WButton("\u200b");
resetButton.setToolTip("Reset");
resetButton.setHtmlClass(HtmlIconUtil.getIconClasses("fa-times-circle"));
// resetButton.setImage("/image/cancel-w.png");
resetButton.setRenderAsLink(true);
resetButton.setAction(new ValidatingAction(messages.getValidationErrors(), resetButton) {
@Override
public void executeOnValid(final ActionEvent event) {
resetExample();
}
});
addToTail(refreshButton);
addToTail(new WText("\u2002"));
addToTail(resetButton);
}
Aggregations