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

Examples of org.gwtoolbox.widget.client.panel.layout.SplitLayout$Splitter


            }
        });
        Drawer navigationDrawer = new Drawer("Navigation", navigation, DrawerLayout.Position.LEFT);
        drawers.addDrawer(navigationDrawer);

        SplitLayout split = new SplitLayout();
        split.addNorth(createHTML("Top content", "#ffcccc"), 200);

        TabLayout tabs = new TabLayout();
        tabs.addTab("Tab 1", createHTML("Tab Content", "white"));
        split.add(tabs);
        LayoutUtils.fitParent(tabs);
       
        drawers.setContent(split);
        LayoutUtils.fitParent(split);
View Full Code Here


@Order(20)
@LayoutSample
public class SplitLayoutSample extends ResizeComposite implements SamplePanel {

    public SplitLayoutSample() {
        final SplitLayout split = new SplitLayout();

        final HTML north = new HTML("North");
        split.addNorth(north, 100);
        split.addNorth(new HTML("North 2"), 100);
        final HTML south = new HTML("South");
        split.addSouth(south, 100);
        split.addSouth(new HTML("South 2"), 100);
//        split.addSouth(new HTML("South 2"), 100);
        final HTML east = new HTML("East");
        split.addEast(east, 100);
        split.addEast(new HTML("East 2"), 100);
        final HTML west = new HTML("West");
        split.addWest(west, 100);
        split.addWest(new HTML("West 2"), 100);

        FlowPanel buttons = new FlowPanel();
        ToggleButton button = new ToggleButton("Hide North", "Show North");
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                split.setWidgetVisible(north, !((ToggleButton) clickEvent.getSource()).isDown());
            }
        });
        buttons.add(button);
        button = new ToggleButton("Hide South", "Show South");
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                split.setWidgetVisible(south, !((ToggleButton) clickEvent.getSource()).isDown());
            }
        });
        buttons.add(button);
        button = new ToggleButton("Hide West", "Show West");
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                split.setWidgetVisible(west, !((ToggleButton) clickEvent.getSource()).isDown());
            }
        });
        buttons.add(button);
        button = new ToggleButton("Hide East", "Show East");
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                split.setWidgetVisible(east, !((ToggleButton) clickEvent.getSource()).isDown());
            }
        });
        buttons.add(button);

        split.add(buttons);

        initWidget(split);
    }
View Full Code Here

                    public void onClick(ClickEvent event) {
                        dialog.setHeight("200px");
                    }
                });

                SplitLayout main = new SplitLayout();
                main.addWest(html, 100);
                main.add(closeButton);
                main.setSize("100%", "100%");

                dialog = new Dialog(false, true);
                dialog.setAnimationEnabled(animationType != null);
                if (animationType != null) {
                    dialog.setAnimationType(animationType);
                }
                dialog.setWidget(main);
                dialog.setCaption("This is a caption");
                dialog.setClosable(closable.getValue());
                dialog.setResizable(resizable.getValue());
                dialog.setPixelSize(300, 250);

                if (center.getValue()) {
                    dialog.center();
                } else {
                    final int x = parseX();
                    final int y = parseY();
                    if (x < 0 || y < 0) {
                        return;
                    }
                    dialog.setPopupPositionAndShow(new Popup.PositionCallback() {
                        public void setPosition(int offsetWidth, int offsetHeight) {
                            GWT.log("offsetWidth: " + offsetWidth + ", offsetHeight: " + offsetHeight, null);
                            dialog.setPopupPosition(x, y);
                        }
                    });
                }

//                hideHandlerRegistration = closeButton.addClickHandler(new ClickHandler() {
//                    public void onClick(ClickEvent event) {
//                        dialog.hide();
//                    }
//                });
            }
        });

        HorizontalPanel buttonRow = new HorizontalPanel();
        buttonRow.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
        buttonRow.add(openButton);
        addGap(buttonRow, "10px");
        buttonRow.add(new Label("X:"));
        addGap(buttonRow, "3px");
        buttonRow.add(xBox = new TextBox());
        addGap(buttonRow, "10px");
        buttonRow.add(new Label("Y:"));
        addGap(buttonRow, "3px");
        buttonRow.add(yBox = new TextBox());

        VerticalPanel main = new VerticalPanel();
        main.add(buttonRow);
        addGap(main, "10px");
        HorizontalPanel checks = new HorizontalPanel();
        main.add(checks);
        addGap(main, "10px");

        closable = new CheckBox("Closable");
        checks.add(closable);
        addGap(checks, "10px");

        resizable = new CheckBox("Risizable");
        checks.add(resizable);
        addGap(checks, "10px");

        center = new CheckBox("Center");
        center.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
            public void onValueChange(ValueChangeEvent<Boolean> event) {
                xBox.setEnabled(!event.getValue());
                yBox.setEnabled(!event.getValue());
            }
        });
        checks.add(center);
        addGap(checks, "10px");

        HorizontalPanel animations = new HorizontalPanel();
        main.add(animations);
        addGap(main, "100%");

        final RadioButton slideRight = new RadioButton("animation", "Slide (from left)");
        slideRight.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
View Full Code Here

        Label header = new Label("GWToolbox Widget Explorer");
        header.setStylePrimaryName("MainHeader");
        header.setSize("100%", "100%");
        main.addNorth(header, 40);

        SplitLayout split = new SplitLayout();

        tree = new Tree();
        tree.setAnimationEnabled(true);
        tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
            public void onSelection(SelectionEvent<TreeItem> event) {
                TreeItem item = event.getSelectedItem();
                final SamplePanel sample = (SamplePanel) item.getUserObject();
                if (sample == null) {
                    return;
                }
                sample.reset();
                if (tabs.getTabIndex(sample.getName()) < 0) {
                    TabSpec ts = new TabSpec(sample.getName())
                            .setClosable(true)
                            .setText(sample.getName())
                            .setContent(sample.getContentWidget());

                    tabs.addTab(ts);
                }
                tabs.setSelectedTab(sample.getName());
            }
        });

        PanelLayout treePanel = new PanelLayout("Navigation Bar");
        treePanel.setContent(tree);

        split.addWest(treePanel, 200);
        tabs = new TabLayout();
        split.add(tabs);

        main.add(split);

        GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
            public void onUncaughtException(Throwable e) {
View Full Code Here

//        p.add(new HTML("bla balfalkdj alkdsfja;lsdk jfalksdjf alskdjfalsdjfalsdjkflaksdjf alskdjf alsdkjf alsdkjf a;lsdkjfasdfasdf" +
//                "asdflaksdfjlaksdjf;alksdjf;alsdkjfa;lsdkfja;slkdjf alksdfj alskdfj a;ldskfj aslkdf" +
//                "asdlfkajsdf;lkajsdf lakjsdf ;lakjdf;laskdjf" +
//                "adslaksdfj;alksjdf;lakjsdfasdf"));

        final SplitLayout p = new SplitLayout();

        final HTML header = new HTML("header");
        p.addNorth(header, 50);

        final HTML footer = new HTML("footer");
        p.addSouth(footer, 25);

        final PanelLayout navigation = new PanelLayout("Navigation");
        navigation.setClosable(true);
        navigation.addCloseHandler(new CloseHandler<PanelLayout>() {
            public void onClose(CloseEvent<PanelLayout> event) {
                p.setWidgetVisible(navigation, false);
            }
        });
        p.addWest(navigation, 200);
        LayoutUtils.fitParent(navigation);

        final HTML properties = new HTML("properties");
        p.addEast(properties, 200);

        FlowPanel panel = new FlowPanel();
        ToggleButton button = new ToggleButton("Hide header", "Show header");
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                p.setWidgetVisible(header, !((ToggleButton) clickEvent.getSource()).isDown());
            }
        });
        panel.add(button);
        button = new ToggleButton("Hide navigation", "Show navigation");
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                p.setWidgetVisible(navigation, !((ToggleButton) clickEvent.getSource()).isDown());
            }
        });
        panel.add(button);
        button = new ToggleButton("Hide properties", "Show properties");
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                p.setWidgetVisible(properties, !((ToggleButton) clickEvent.getSource()).isDown());
            }
        });
        panel.add(button);
        button = new ToggleButton("Hide footer", "Show footer");
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                p.setWidgetVisible(footer, !((ToggleButton) clickEvent.getSource()).isDown());
            }
        });
        panel.add(button);

        PanelLayout cp = new PanelLayout("Test");
        LayoutUtils.fitParent(cp);
        cp.setContent(new Label("Content"));
        cp.setCollapsable(true);

        TabLayout tabs = new TabLayout();
        tabs.setHideTabBarWithSingleTab(false);
        tabs.addTab("Buttons", panel);
        tabs.addTab("Tab1", new HTML("Tab1 Content"));
//        tabs.addTab("Tab2", new CenterLayout(new HTML("Tab2 Content")));
        tabs.addTab(new TabSpec("contentPanel", "Content Panel", null, cp, true));
//        tabs.add(new HTML("Tab2 Content"), "Tab2");
//        tabs.add(new HTML("Tab3 Content"), "Tab3");
//        tabs.add(new HTML("Tab4 Content"), "Tab4");
//        tabs.add(new HTML("Tab5 Content"), "Tab5");
//        tabs.add(new HTML("Tab6 Content"), "Tab6");
//        tabs.add(new HTML("Tab7 Content"), "Tab7");
//        tabs.add(new HTML("Tab8 Content"), "Tab8");
//        tabs.add(new HTML("Tab9 Content"), "Tab9");
//        tabs.add(new HTML("Tab10 Content"), "Tab10");
//        tabs.add(new HTML("Tab11 Content"), "Tab11");

        p.add(tabs);

        return p;
    }
View Full Code Here

    private RuntimeDrawer currentRightDrawer;
    private RuntimeDrawer currentBottomDrawer;

    public DrawerLayout() {
        main = new DockLayout();
        split = new SplitLayout();
        leftGutter = new Gutter(true);
        rightGutter = new Gutter(false);
        statusBar = new StatusBar();
        main.addEast(rightGutter, GUTTER_WIDTH);
        main.setWidgetVisible(rightGutter, false);
View Full Code Here

TOP

Related Classes of org.gwtoolbox.widget.client.panel.layout.SplitLayout$Splitter

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.