PDA

View Full Version : Add space to toolbar



iyeh
3 Nov 2009, 9:30 AM
How do I add space before the first item on ToolBar? I tried setSpacing, but that only sets the spacing between the first item and the following items. I need about 30px spacing between the edge of the toolbar and the first item.

terciofilho
3 Nov 2009, 12:52 PM
What about:



final BoxComponent spaceItem = new BoxComponent()
{
@Override
protected void onRender(final Element target, final int index)
{
this.setElement(DOM.createDiv(), target, index);
}
};
spaceItem.setWidth(50);
toolbar.add(spaceItem);