What is Borders API? What is it for?

The library provides basic APi for rendering borders (like in Swing). The main advantage of the API is that doesn't use images or browser specific styles. It supports CSS as other widgets and each border can be decorated by themes.

Some advanced widgets (for instance AdvancedTabPanel) use this API ofr their purposes. But if need something very powerful probably you should consider usage of standard tools like GWT DecoratorPanel.

[top]


What kinds of the borders provided by the library?

Currently only two borders:

  • SingleBorder
  • RoundedCornerBorder

[top]


Is the RounCornerBorder supported by all browsers?

Yes. It doesn't use CSS 3.0 or browser specific styles.

[top]


How to use borders?

In most cases the border is a panel that contains other widgets (usually one of them is a parent for others). Everything you need is to create a border panel and include any widget into it:

RoundCornerBorder border = new RoundCornerBorder();
border.addStyleName("border");
border.setWidget(new Label("Shadow under the border"));
layout.setWidget(3, 0, border);
border.setShadowVisibile(true);

[top]


How to display a shadow under the border?

There is nothing difficult in this operation. Simply invoke the Border.setShadowVisible() method.

[top]