Package org.gwtoolbox.widget.client.panel.layout

Examples of org.gwtoolbox.widget.client.panel.layout.CompletionCallback


        drawer.setButtonless(true);
        layout.addDrawer(drawer);

        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                layout.hideDrawer(DrawerLayout.Position.LEFT, new CompletionCallback() {
                    @Override
                    public void onComplete() {
                        layout.showDrawer("Console2");
                    }
                });
View Full Code Here


        split.setAnimationDurationFunction(animationDurationFunction);
    }

    public void addDrawer(final Drawer drawer) {
        if (runtimeDrawerById.containsKey(drawer.getId())) {
            removeDrawer(drawer.getId(), new CompletionCallback() {
                @Override
                public void onComplete() {
                    doAddDrawer(drawer);
                }
            });
View Full Code Here

        final RuntimeDrawer rtDrawer = runtimeDrawerById.remove(id);
        if (rtDrawer == null) {
            callback.onComplete();
            return null;
        }
        hideDrawer(rtDrawer.getDrawer().getPosition(), new CompletionCallback() {
            public void onComplete() {
                ToggleButton button = buttonById.remove(id);
                if (button != null) {
                    switch (rtDrawer.getDrawer().getPosition()) {
                        case LEFT:
View Full Code Here

        });
        return rtDrawer.getDrawer();
    }

    public void clear() {
        clear(new CompletionCallback() {
            public void onComplete() {
            }
        });
    }
View Full Code Here

            }
        });
    }

    public void clear(final CompletionCallback callback) {
        hideAllDrawers(new CompletionCallback() {
            @Override
            public void onComplete() {
                DrawerRemovalDelegatingCompletionCallback clbk = new DrawerRemovalDelegatingCompletionCallback(callback, null);
                for (String id : getAllDrawerIds()) {
                    clbk = new DrawerRemovalDelegatingCompletionCallback(clbk, id);
View Full Code Here

    }

    public void hideDrawer(Position position, final CompletionCallback callback) {
        switch (position) {
            case LEFT:
                hideDrawer(leftDrawerContent, currentLeftDrawer, new CompletionCallback() {
                    public void onComplete() {
                        currentLeftDrawer = null;
                        DeferredCommand.addCommand(new Command() {
                            public void execute() {
                                callback.onComplete();
                            }
                        });
                    }
                });
                break;

            case RIGHT:
                hideDrawer(rightDrawerContent, currentRightDrawer, new CompletionCallback() {
                    public void onComplete() {
                        currentRightDrawer = null;
                        DeferredCommand.addCommand(new Command() {
                            public void execute() {
                                callback.onComplete();
                            }
                        });
                    }
                });
                break;

            default:
                hideDrawer(bottomDrawerContent, currentBottomDrawer, new CompletionCallback() {
                    public void onComplete() {
                        currentBottomDrawer = null;
                        DeferredCommand.addCommand(new Command() {
                            public void execute() {
                                callback.onComplete();
View Full Code Here

                });
        }
    }

    public void hideAllDrawers(final CompletionCallback callback) {
        hideDrawer(Position.LEFT, new CompletionCallback() {
            @Override
            public void onComplete() {
                hideDrawer(Position.RIGHT, new CompletionCallback() {
                    @Override
                    public void onComplete() {
                        hideDrawer(Position.BOTTOM, callback);
                    }
                });
View Full Code Here

    //================================================ Helper Methods ==================================================

    private void showDrawer(final RuntimeDrawer drawer, final CompletionCallback callback) {
        switch (drawer.getDrawer().getPosition()) {
            case LEFT:
                showDrawer(leftDrawerContent, currentLeftDrawer, drawer, new CompletionCallback() {
                    @Override
                    public void onComplete() {
                        currentLeftDrawer = drawer;
                        DeferredCommand.addCommand(new Command() {
                            public void execute() {
                                if (callback != null) {
                                    callback.onComplete();
                                }
                            }
                        });
                    }
                });
                break;

            case RIGHT:
                showDrawer(rightDrawerContent, currentRightDrawer, drawer, new CompletionCallback() {
                    @Override
                    public void onComplete() {
                        currentRightDrawer = drawer;
                        DeferredCommand.addCommand(new Command() {
                            public void execute() {
                                if (callback != null) {
                                    callback.onComplete();
                                }
                            }
                        });
                    }
                });
                break;

            default:
                showDrawer(bottomDrawerContent, currentBottomDrawer, drawer, new CompletionCallback() {
                    @Override
                    public void onComplete() {
                        currentBottomDrawer = drawer;
                        DeferredCommand.addCommand(new Command() {
                            public void execute() {
View Full Code Here

    private void showDrawer(final SimplePanel drawerContent, final RuntimeDrawer currentDrawer, final RuntimeDrawer drawer, final CompletionCallback callback) {
        if (currentDrawer == drawer) {
            return;
        }
        hideDrawer(drawerContent, currentDrawer, new CompletionCallback() {
            @Override
            public void onComplete() {
                //todo add support for un/docking
                Widget widget = drawer.getContentWidget();
                drawerContent.setWidget(widget);
View Full Code Here

        });
    }

    private void hideDrawer(Widget drawerContent, final RuntimeDrawer currentDrawer, final CompletionCallback callback) {
        final int size = split.getWidgetSize(drawerContent);
        split.closeWidget(drawerContent, new CompletionCallback() {
            @Override
            public void onComplete() {
                if (currentDrawer != null) {
                    if (!currentDrawer.getDrawer().isButtonless()) {
                        buttonById.get(currentDrawer.getDrawer().getId()).setDown(false);
View Full Code Here

TOP

Related Classes of org.gwtoolbox.widget.client.panel.layout.CompletionCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.