Wrap existing HTML elements as widgets. Support for hyperlinks, images, buttons, and panels.
WButton action = new WButton("action-button");
WHyperlink searchLink = new WHyperlink("link-to-search");
WPanel content = new WPanel("content");
WImage headerImg = new WImage("header-image");
Wrap an existing HTML element with the most appropriate wrapper. WrappedWidget navLinkSearch = WBuilder.getWidgetFromDOM("nav-link-search");
if (navLinkSearch.isHyperlink()) {
((WHyperlink)navLinkSearch).addClickListener(navListener);
}
Replace existing elements and widgets on the page with other widgets. WBuilder.replaceElementWithWidget(element, widget);
WBuilder.replaceWidget(oldWidget, newWidget);
PNGImage widget, with support for transparancy in IE5.5 and IE6.
PNGImage img = new PNGImage("/images/test.png", width, height);
Color and BorderStyle constants for setting styles. Currently used in the new ImageButton widget.
ImageButton widget designed for use in tool bars. Allows for creation of buttons individually, or with the help of the ImageButtonFactory.
ImageButtonFactory fac = new ImageButtonFactory();
fac.setBackgroundOffColor(Color.LIGHT_GRAY);
fac.setBackgroundOnColor(Color.YELLOW);
fac.setBorderOnColor(Color.NONE);
FlowPanel iconBar = new FlowPanel();
iconBar.add(fac.createImageButton("icons/applications-accessories.png", 22, 22));
iconBar.add(fac.createImageButton("icons/applications-development.png", 22, 22));
iconBar.add(fac.createImageButton("icons/applications-games.png", 22, 22));
iconBar.add(fac.createImageButton("icons/applications-graphics.png", 22, 22));
iconBar.add(fac.createImageButton("icons/applications-internet.png", 22, 22));
iconBar.add(fac.createImageButton("icons/applications-multimedia.png", 22, 22));
RootPanel.get().add(iconBar);