Package org.gwtoolbox.widget.client.button

Examples of org.gwtoolbox.widget.client.button.SimpleToggleButton$Face


        DockPanel main = new DockPanel();

        FlowPanel buttons = new FlowPanel();
        buttons.setWidth("100%");
        final SimpleToggleButton toggleLeftBtn = new SimpleToggleButton("Hide Left");
        toggleLeftBtn.getDownFace().setText("Show Left");
        DOM.setStyleAttribute(toggleLeftBtn.getElement(), "marginRight", "20px");
        buttons.add(toggleLeftBtn);
        final SimpleToggleButton toggleRightBtn = new SimpleToggleButton("Hide Right");
        toggleRightBtn.getDownFace().setText("Show Right");
        buttons.add(toggleRightBtn);

        final DoubleHorizontalSplitPanel hsp = new DoubleHorizontalSplitPanel();
        hsp.setSize("100%", "100%");
        ScrollPanel sp = new ScrollPanel(createContent("#CCFFCC"));
        sp.setSize("100%", "100%");
        hsp.setLeftWidget(sp);
        sp = new ScrollPanel(createContent("#FFC0CB"));
        sp.setSize("100%", "100%");
        hsp.setCenterWidget(sp);
        sp = new ScrollPanel(createContent("#FFFBA3"));
        sp.setSize("100%", "100%");
        hsp.setRightWidget(sp);
        hsp.setSize("100%", "100%");

        toggleLeftBtn.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                hsp.setLeftWidgetVisible(!toggleLeftBtn.isDown());
            }
        });

        toggleRightBtn.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                hsp.setRightWidgetVisible(!toggleRightBtn.isDown());
            }
        });

        main.add(buttons, DockPanel.NORTH);
        main.add(hsp, DockPanel.CENTER);
View Full Code Here


    public SimpleToggleButtonSample() {

        HorizontalPanel buttons = new HorizontalPanel();

        final SimpleToggleButton button = new SimpleToggleButton("Toggle Button");
        button.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                showMessage(button.isDown() ? "Button is down" : "Button is up");
            }
        });
        button.getDownFace().setText("Toggle Button (down)");
        buttons.add(button);

        addGap(buttons, "10px");

        final SimpleToggleButton iconButton = new SimpleToggleButton("Icon Toggle Button", WidgetImages.Instance.get().icon_Printer().createImage());
        iconButton.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                showMessage(iconButton.isDown() ? "Button is down" : "Button is up");
            }
        });
        buttons.add(iconButton);

        addGap(buttons, "10px");

        final SimpleToggleButton customButton = new SimpleToggleButton("Toggle Button Custom Width", WidgetImages.Instance.get().icon_Printer().createImage());
        customButton.setWidth("250px");
        customButton.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                showMessage(customButton.isDown() ? "Button is down" : "Button is up");
            }
        });
        buttons.add(customButton);

        addGap(buttons, "10px");

        SimpleToggleButton disabledButton = new SimpleToggleButton("Disabled Toggle Button", WidgetImages.Instance.get().icon_CubeGreen().createImage());
        disabledButton.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                showMessage("Show never be shown");
            }
        });
        disabledButton.setEnabled(false);
        buttons.add(disabledButton);

        addGap(buttons, "10px");

        SimpleToggleButton group1Button= new SimpleToggleButton("Group 1", WidgetImages.Instance.get().icon_CubeGreen().createImage());
        group1Button.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                showMessage("Group 1 was clicked");
            }
        });
        group1Button.setGroup("group");
        buttons.add(group1Button);

        addGap(buttons, "10px");

        SimpleToggleButton group2Button= new SimpleToggleButton("Group 2", WidgetImages.Instance.get().icon_CubeGreen().createImage());
        group2Button.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                showMessage("Group 2 was clicked");
            }
        });
        group2Button.setGroup("group");
        buttons.add(group2Button);

        VerticalPanel main = new VerticalPanel();

        main.add(buttons);
View Full Code Here

        DockPanel main = new DockPanel();

        FlowPanel buttons = new FlowPanel();
        buttons.setWidth("100%");
        final SimpleToggleButton toggleLeftBtn = new SimpleToggleButton("Hide Left");
        toggleLeftBtn.getDownFace().setText("Show Left");
        DOM.setStyleAttribute(toggleLeftBtn.getElement(), "marginRight", "20px");
        buttons.add(toggleLeftBtn);
        final SimpleToggleButton toggleRightBtn = new SimpleToggleButton("Hide Right");
        toggleRightBtn.getDownFace().setText("Show Right");
        buttons.add(toggleRightBtn);

        final SimpleHorizontalSplitPanel hsp = new SimpleHorizontalSplitPanel();
        hsp.setSize("100%", "100%");

        ScrollPanel lsp = new ScrollPanel(createContent(createVeryLongText(), "#CCFFCC"));
        lsp.setSize("100%", "100%");
        hsp.setLeftWidget(lsp);

        ScrollPanel rsp = new ScrollPanel(createContent(createVeryLongText(), "#FFFBA3"));
        rsp.setSize("100%", "100%");
        hsp.setRightWidget(rsp);

        hsp.setSize("100%", "100%");

        toggleLeftBtn.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                hsp.setLeftWidgetVisible(!toggleLeftBtn.isDown());
                toggleRightBtn.setDown(!toggleLeftBtn.isDown());
            }
        });

        toggleRightBtn.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                hsp.setRightWidgetVisible(!toggleRightBtn.isDown());
                toggleLeftBtn.setDown(!toggleRightBtn.isDown());
            }
        });

        main.add(buttons, DockPanel.NORTH);
        main.add(hsp, DockPanel.CENTER);
View Full Code Here

        vsp.setTopWidget(hsp);
        vsp.setBottomWidget(vp);
        vsp.setSplitPosition("75%");

        HorizontalPanel buttons = new HorizontalPanel();
        final SimpleToggleButton hideLeftButton = new SimpleToggleButton("Hide Left");
        hideLeftButton.getDownFace().setText("Show Left");
        hideLeftButton.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                hsp.setLeftWidgetVisible(!hideLeftButton.isDown());
            }
        });
        buttons.add(hideLeftButton);
        addGap(buttons, "10px");

        final SimpleToggleButton hideRightButton = new SimpleToggleButton("Hide Right");
        hideRightButton.getDownFace().setText("Show Right");
        hideRightButton.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
               hsp.setRightWidgetVisible(!hideRightButton.isDown());
            }
        });
        buttons.add(hideRightButton);
        addGap(buttons, "10px");

        final SimpleToggleButton hideBottomButton = new SimpleToggleButton("Hide Bottom");
        hideBottomButton.getDownFace().setText("Show Bottom");
        hideBottomButton.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                vsp.setBottomWidgetVisible(!hideBottomButton.isDown());
            }
        });
        buttons.add(hideBottomButton);

        buttons.setWidth("100%");
View Full Code Here

            }
        });
        clearButton.getElement().getStyle().setMarginLeft(10, Style.Unit.PX);
        buttons.add(clearButton);

        SimpleToggleButton enableDisableButton = new SimpleToggleButton("Disable Animation");
        enableDisableButton.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                deck.setAnimationEnabled(!deck.isAnimationEnabled());
            }
        });
        enableDisableButton.getElement().getStyle().setMarginLeft(10, Style.Unit.PX);
        buttons.add(enableDisableButton);

        initWidget(main);

    }
View Full Code Here

        DockPanel main = new DockPanel();

        FlowPanel buttons = new FlowPanel();
        buttons.setWidth("100%");
        final SimpleToggleButton toggleTopBtn = new SimpleToggleButton("Hide Top");
        toggleTopBtn.getDownFace().setText("Show Top");
        DOM.setStyleAttribute(toggleTopBtn.getElement(), "marginRight", "20px");
        buttons.add(toggleTopBtn);
        final SimpleToggleButton toggleBottomBtn = new SimpleToggleButton("Hide Bottom");
        toggleBottomBtn.getDownFace().setText("Show Bottom");
        buttons.add(toggleBottomBtn);

        final SimpleVerticalSplitPanel vsp = new SimpleVerticalSplitPanel();
        vsp.setSize("100%", "100%");
        ScrollPanel tsp = new ScrollPanel(createContent(createVeryLongText(), "#CCFFCC"));
        tsp.setSize("100%", "100%");
        vsp.setTopWidget(tsp);
        ScrollPanel bsp = new ScrollPanel(createContent(createVeryLongText(), "#FFFBA3"));
        bsp.setSize("100%", "100%");
        vsp.setBottomWidget(bsp);

        toggleTopBtn.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                vsp.setTopWidgetVisible(!toggleTopBtn.isDown());
                toggleBottomBtn.setDown(!toggleTopBtn.isDown());
            }
        });

        toggleBottomBtn.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                vsp.setBottomWidgetVisible(!toggleBottomBtn.isDown());
                toggleTopBtn.setDown(!toggleBottomBtn.isDown());
            }
        });

        main.add(buttons, DockPanel.NORTH);
        main.add(vsp, DockPanel.CENTER);
View Full Code Here

        DockPanel main = new DockPanel();

        FlowPanel buttons = new FlowPanel();
        buttons.setWidth("100%");
        final SimpleToggleButton toggleLeftBtn = new SimpleToggleButton("Hide Left");
        toggleLeftBtn.getDownFace().setText("Show Left");
        DOM.setStyleAttribute(toggleLeftBtn.getElement(), "marginRight", "20px");
        buttons.add(toggleLeftBtn);
        final SimpleToggleButton toggleRightBtn = new SimpleToggleButton("Hide Right");
        toggleRightBtn.getDownFace().setText("Show Right");
        DOM.setStyleAttribute(toggleRightBtn.getElement(), "marginRight", "20px");
        buttons.add(toggleRightBtn);
        final SimpleToggleButton toggleBottomBtn = new SimpleToggleButton("Hide Bottom");
        toggleBottomBtn.getDownFace().setText("Show Bottom");
        buttons.add(toggleBottomBtn);
        DOM.setStyleAttribute(toggleBottomBtn.getElement(), "marginRight", "20px");       
        final SimpleToggleButton toggleTopBtn = new SimpleToggleButton("Hide Top");
        toggleTopBtn.getDownFace().setText("Show Top");
        buttons.add(toggleTopBtn);


        final DoubleHorizontalSplitPanel hsp = new DoubleHorizontalSplitPanel();
        hsp.setSize("100%", "100%");
        hsp.setLeftWidget(createContent("Left", "#CCFFCC"));
        hsp.setCenterWidget(createContent("Center", "#FFC0CB"));
        hsp.setRightWidget(createContent("Right", "#FFFBA3"));

        final SimpleVerticalSplitPanel vsp = new SimpleVerticalSplitPanel();
        vsp.setSize("100%", "100%");
        vsp.setTopWidget(hsp);
        vsp.setBottomWidget(createContent("Bottom", "#E6E6FA"));
        vsp.setSplitPosition("70%");
        vsp.setTopWidgetVisible(false);

        toggleLeftBtn.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                hsp.setLeftWidgetVisible(!toggleLeftBtn.isDown());
            }
        });

        toggleRightBtn.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                hsp.setRightWidgetVisible(!toggleRightBtn.isDown());
            }
        });

        toggleBottomBtn.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                vsp.setBottomWidgetVisible(!toggleBottomBtn.isDown());
            }
        });
        toggleTopBtn.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                vsp.setTopWidgetVisible(!toggleTopBtn.isDown());
            }
        });
        toggleTopBtn.setDown(true);

        main.add(buttons, DockPanel.NORTH);
        main.add(vsp, DockPanel.CENTER);
        main.setCellHeight(buttons, "30px");
        main.setCellWidth(buttons, "100%");
View Full Code Here

TOP

Related Classes of org.gwtoolbox.widget.client.button.SimpleToggleButton$Face

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.