Search in sources :

Example 1 with CubaPlaceHolderWidget

use of com.haulmont.cuba.web.toolkit.ui.client.placeholder.CubaPlaceHolderWidget in project cuba by cuba-platform.

the class CubaHorizontalSplitPanelWidget method setDockable.

public void setDockable(boolean dockable) {
    if (isDockable() == dockable) {
        return;
    }
    if (dockable) {
        dockButton = new CubaPlaceHolderWidget();
        dockButton.setStyleName(SP_DOCK_BUTTON);
        dockButton.addStyleName(SP_DOCK_BUTTON_LEFT);
        dockButton.addDomHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                onDockButtonClick();
            }
        }, ClickEvent.getType());
        dockButtonContainer = new VOverlay();
        dockButtonContainer.addStyleName(SP_DOCK_OVERLAY);
        dockButtonContainer.getElement().getStyle().setZIndex(9999);
        if (dockMode == SplitPanelDockMode.LEFT) {
            dockButtonContainer.setStyleName(SP_DOCK_LEFT);
        } else if (dockMode == SplitPanelDockMode.RIGHT) {
            dockButtonContainer.setStyleName(SP_DOCK_RIGHT);
        }
        dockButtonContainer.setOwner(this);
        dockButtonContainer.setWidget(dockButton);
        dockButtonContainer.show();
        updateDockButtonPosition();
    } else {
        if (dockButtonContainer != null) {
            dockButtonContainer.hide();
            dockButtonContainer.removeFromParent();
            dockButtonContainer = null;
            dockButton = null;
        }
    }
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) VOverlay(com.vaadin.client.ui.VOverlay) CubaPlaceHolderWidget(com.haulmont.cuba.web.toolkit.ui.client.placeholder.CubaPlaceHolderWidget)

Aggregations

ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 CubaPlaceHolderWidget (com.haulmont.cuba.web.toolkit.ui.client.placeholder.CubaPlaceHolderWidget)1 VOverlay (com.vaadin.client.ui.VOverlay)1