class DataModellerDocksHandler extends AbstractWorkbenchDocksHandler {

    public void onContextChange(@Observes DataModelerWorkbenchContextChangeEvent contextEvent) {
        DataModelerContext newContext = dataModelerWBContext.getActiveContext();

        /*
        Check if we should refresh the docks. The cases are:
        - if any context (lastActiveContext or newContext) are null we should refresh the docks and hide them
        - if there's a context change or there's a edition mode change we should refresh docks and show them.
        - if none of these cases we don't refresh the docks
        */
        boolean doRefresh;
        if (newContext == null) {
            doRefresh = true;
            dataModelerIsHidden = true;
        } else if (!newContext.equals(lastActiveContext) || (newContext.equals(lastActiveContext) && !newContext.getEditionMode().equals(lastEditionMode))) {
            doRefresh = true;
            dataModelerIsHidden = !isGraphicMode(newContext);
            lastEditionMode = newContext.getEditionMode();
        } else {
            doRefresh = false;
        }

        lastActiveContext = newContext;

        refreshDocks(doRefresh,
                     dataModelerIsHidden);
    }

    @Inject public  DataModellerDocksHandler(SessionInfo sessionInfo,
                                    AuthorizationManager authorizationManager,
                                    DataModelerWorkbenchContext dataModelerWBContext);

}