Tabsheet add 'close all" button

would you mind to add button "close all tabs " to tabsheet? I didn’t find any easy way to edit this component.
I imagine there would be special button next to tab scroll buttons on the right side of tab bar.

Thank you

I extended this component.
Interesting code:

    public static final String COMMAND_CLOSE_ALL_TABS = "commandCloseAllTabs";
    private static final String CLASSNAME_CLOSE_ALL = "v-closeabletabsheet-closebutton";
    private final Element closeAllButtonForm = DOM.createForm();
    private final Element closeAllButton = DOM.createButton();
    private final Element tabs;
    private String paintableId;
    private ApplicationConnection client;

    public VCloseableTabsheet() {
        tabs = DOM.getFirstChild(getElement());

        DOM.setElementProperty(closeAllButton, "className", CLASSNAME_CLOSE_ALL);
        DOM.setElementProperty(closeAllButton, "title", "Press to close all tabs.");
        DOM.appendChild(tabs, closeAllButtonForm);
        DOM.appendChild(closeAllButtonForm, closeAllButton);

        DOM.setInnerText(closeAllButton, "×");

        DOM.sinkEvents(closeAllButton, Event.ONCLICK);

     * Called whenever an update is received from the server
    public void updateFromUIDL(UIDL aUidl, ApplicationConnection aClient) {
        super.updateFromUIDL(aUidl, aClient);
        if (aClient != null && aUidl != null) {
            // Save reference to server connection object to be able to send
            // user interaction later
            this.client = aClient;
            // Save the client side identifier (paintable id) for the widget
            paintableId = aUidl.getId();


    public void onBrowserEvent(Event event) {
        if (DOM.eventGetTarget(event) == closeAllButton) {
            if (client != null && paintableId != null) {
                client.updateVariable(paintableId, COMMAND_CLOSE_ALL_TABS, true, true);
        } else {

public abstract class CloseableTabsheet extends TabSheet {
    public void changeVariables(Object source, Map<String, Object> variables) {
        super.changeVariables(source, variables);
        if (variables.containsKey(VCloseableTabsheet.COMMAND_CLOSE_ALL_TABS)) {

    protected void closeAllTabs() {
        List<Component> allTabs = Lists.newLinkedList();
        for (Iterator<Component> it = this.getComponentIterator(); it.hasNext();) {
        for (Component tabComponent : allTabs) {

    protected abstract void closeTab(Component tabComponent);