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

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


    public CombinedLayoutSample() {
        final DockLayout main = new DockLayout();

        final DrawerLayout drawers = new DrawerLayout();

        PanelLayout navigation = new PanelLayout("Navigation");
        navigation.addCloseHandler(new CloseHandler<PanelLayout>() {
            public void onClose(CloseEvent<PanelLayout> event) {
                drawers.hideDrawer(DrawerLayout.Position.LEFT);
            }
        });
        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);

        main.addNorth(createHTML("Header", "#ccffcc"), 100);
        main.add(drawers);

        PanelLayout layout = new PanelLayout("Combined Layout");
        layout.setContent(main);
        layout.setCollapsable(true);
        LayoutUtils.fitParent(main);


        initWidget(layout);
    }
View Full Code Here


@Order(50)
@LayoutSample
public class PanelLayoutSample extends ResizeComposite implements SamplePanel {

    public PanelLayoutSample() {
        PanelLayout panel = new PanelLayout("The Title", WidgetExplorerImages.Instance.get().formGroup().createImage());
        panel.addTool(PanelLayout.Tools.GEAR, new ClickHandler() {
            public void onClick(ClickEvent event) {
                Window.alert("Gear tool was clicked");
            }
        });
        panel.addToggleTool(PanelLayout.ToggleTools.PIN, new ToggleHandler() {
            public void onToggle(ToggleEvent event) {
                Window.alert("Pin tool is " + (event.getState() ? "up" : "down"));
            }
        });
        panel.addMenuTool(PanelLayout.Tools.ADD, new MenuBuilder() {
            public void build(Menu menu) {
                menu.addItem("Action 1", new Command() {
                    public void execute() {
                        Window.alert("Action 1 was executed");
                    }
                });
            }
        }).setEnabled(false);
        panel.setClosable(true);
        panel.addCloseHandler(new CloseHandler<PanelLayout>() {
            public void onClose(CloseEvent<PanelLayout> panelLayoutCloseEvent) {
                Window.alert("Close was clicked");
            }
        });
        panel.addTool(PanelLayout.Tools.ADD, new ClickHandler() {
            public void onClick(ClickEvent event) {
                Window.alert("Add clicked");
            }
        }).setEnabled(false);

        panel.setCollapsable(true);
        panel.setContent(new HTML("The content of the panel"));

        initWidget(panel);
    }
View Full Code Here

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

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

        split.addWest(treePanel, 200);
        tabs = new TabLayout();
        split.add(tabs);
View Full Code Here

        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"));
View Full Code Here

    private Widget createMain2() {
        final DrawerLayout layout = new DrawerLayout();
        layout.setAnimationDurationFunction(new FixedAnimationDurationFunction(200));

        Drawer drawer;
        final PanelLayout navigation = new PanelLayout("Navigation");
        navigation.setContent(new HTML("Navigation"));
        navigation.setClosable(true);
        navigation.addCloseHandler(new CloseHandler<PanelLayout>() {
            public void onClose(CloseEvent<PanelLayout> event) {
                layout.hideDrawer(DrawerLayout.Position.LEFT);
            }
        });
        navigation.getElement().setId("navigation");

        drawer = new Drawer("Properties", new HTML("Properties"), DrawerLayout.Position.RIGHT);
        drawer.setMinSize(500);
        layout.addDrawer(drawer);
View Full Code Here

        return layout;
    }

    private Widget createMain3() {
        PanelLayout layout = new PanelLayout("Test", WidgetExplorerImages.Instance.get().formGroup().createImage());
        Widget content = createMain1();
        layout.setContent(content);
        LayoutUtils.fitParent(content);

        layout.setCollapsable(true);
        layout.setClosable(true);
        layout.addTool(PanelLayout.Tools.GEAR, new ClickHandler() {
            public void onClick(ClickEvent event) {
                Window.alert("gear clicked");
            }
        });
        layout.addToggleTool(PanelLayout.ToggleTools.PIN, new ToggleHandler() {
            public void onToggle(ToggleEvent event) {
                Window.alert("Pin is " + (event.getState() ? "down" : "up"));
            }
        });
        layout.addCloseHandler(new CloseHandler<PanelLayout>() {
            public void onClose(CloseEvent<PanelLayout> panelLayoutCloseEvent) {
                Window.alert("Close");
            }
        });
View Full Code Here

    private final Drawer drawer;

    public DrawerPane(final DrawerLayout layout, final Drawer drawer) {
        this.drawer = drawer;

        main = new PanelLayout(drawer.getName());

        switch (drawer.getPosition()) {
            case LEFT:
                main.setCloseTool(PanelLayout.Tools.SLIDE_LEFT);
                break;
View Full Code Here

TOP

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

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.