addTabButton.setHeight(25);
addTabButton.setZIndex(ZIndexes.TAB_CONTROLS);//Otherwise the onclick of the tab bar is used..
addTabButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
TabSettings tabSettings = new TabSettings(view.getSettings());
if (view.getSelectedTabSettings() != null) {
//copy current selected endpoint, to the new tab
tabSettings.setEndpoint(view.getSelectedTabSettings().getEndpoint());
}
view.getSettings().addTabSettings(tabSettings);
view.getTabs().addTab(tabSettings, true);
LocalStorageHelper.storeSettings(view.getSettings());
view.getHistory().setHistoryCheckpoint();