Package com.vaadin.ui

Examples of com.vaadin.ui.NativeButton


        w.setData(windowCount);
        w.setWidth("200px");
        w.setHeight("300px");
        w.setPositionX(200);
        w.setPositionY(200);
        final NativeButton maximize = new NativeButton("Maximize");
        Button.ClickListener listener = new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                if (w.getWindowMode() == WindowMode.MAXIMIZED) {
                    w.setWindowMode(WindowMode.NORMAL);
                    maximize.setCaption("Maximize");
                } else {
                    w.setWindowMode(WindowMode.MAXIMIZED);
                    maximize.setCaption("Restore");
                }
            }

        };
        maximize.addClickListener(listener);
        ((ComponentContainer) w.getContent()).addComponent(maximize);

        w.addWindowModeChangeListener(new WindowModeChangeListener() {

            @Override
            public void windowModeChanged(WindowModeChangeEvent event) {
                WindowMode state = (event.getWindow().getWindowMode());
                if (state == WindowMode.NORMAL) {
                    w.setCaption("Window " + w.getData() + " Normal");
                    maximize.setCaption("Maximize");
                } else if (state == WindowMode.MAXIMIZED) {
                    w.setCaption("Window " + w.getData() + " Maximized");
                    maximize.setCaption("Restore");
                }
            }
        });
        final CheckBox resizeable = new CheckBox("Resizeable");
        resizeable.setValue(w.isResizable());
        resizeable.addValueChangeListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                w.setResizable(resizeable.getValue());
            }
        });
        ((ComponentContainer) w.getContent()).addComponent(resizeable);
        final CheckBox closeable = new CheckBox("Closeable");
        closeable.setValue(w.isClosable());
        closeable.addValueChangeListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                w.setClosable(closeable.getValue());
            }
        });
        ((ComponentContainer) w.getContent()).addComponent(closeable);
        NativeButton contentFull = new NativeButton("Set Content Size Full",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        w.getContent().setSizeFull();
                    }
                });
        contentFull.setWidth("100%");
        ((ComponentContainer) w.getContent()).addComponent(contentFull);

        NativeButton center = new NativeButton("Center");
        center.addClickListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                w.center();
            }
View Full Code Here


        addComponent(layout);

        final Label label = new Label("");
        layout.addComponent(label);

        NativeButton addRowButton = new NativeButton("Add row",
                new NativeButton.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        addRow(datasource);
                    }
                });

        NativeButton jumpToLastRowButton = new NativeButton("Jump to last row",
                new NativeButton.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        jumpToLastRow(table);
                    }
                });
        NativeButton jumpTo15thRowButton = new NativeButton("Jump to 15th row",
                new NativeButton.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        jumpToFifteenthRow(table);
                    }
                });
        NativeButton jumpToFirstRowButton = new NativeButton(
                "Jump to first row", new NativeButton.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        jumpToFirstRow(table);
                    }
                });

        NativeButton updateLabelButton = new NativeButton("UpdateLabel",
                new NativeButton.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        label.setValue(Integer.toString(table
                                .getCurrentPageFirstItemIndex()));
View Full Code Here

    protected static final String LONG_TOOLTIP_TEXT = LoremIpsum.get(5000);
    protected static final Integer MAX_WIDTH = 500;

    @Override
    protected void setup(VaadinRequest request) {
        NativeButton componentWithShortTooltip = new NativeButton(
                "Short tooltip");
        componentWithShortTooltip.setDescription(SHORT_TOOLTIP_TEXT);
        componentWithShortTooltip.setId("shortTooltip");

        getTooltipConfiguration().setMaxWidth(MAX_WIDTH);
        getTooltipConfiguration().setCloseTimeout(200);

        NativeButton componentWithLongTooltip = new NativeButton("Long tooltip");
        componentWithLongTooltip.setId("longTooltip");
        componentWithLongTooltip.setDescription(LONG_TOOLTIP_TEXT);

        VerticalLayout vl = new VerticalLayout();

        TextField component1 = new TextField("TextField");
        component1.setId("component1");
View Full Code Here

        b.setTabIndex(i);
        return b;
    }

    private NativeButton createNativeButton(int i) {
        NativeButton b = new NativeButton("NativeButton with tab index " + i);
        b.setTabIndex(i);
        return b;
    }
View Full Code Here

    private TextField openDelay;
    private TextField quickOpenDelay;

    @Override
    protected void setup(VaadinRequest request) {
        NativeButton componentWithShortTooltip = new NativeButton(
                "Short tooltip");
        componentWithShortTooltip.setDescription("This is a short tooltip");
        componentWithShortTooltip.setId("shortTooltip");

        NativeButton componentWithLongTooltip = new NativeButton("Long tooltip");
        componentWithLongTooltip.setId("longTooltip");
        componentWithLongTooltip.setDescription(LoremIpsum.get(5000));

        closeTimeout = createIntegerTextField("Close timeout",
                getState().tooltipConfiguration.closeTimeout);
        closeTimeout.addValueChangeListener(new Property.ValueChangeListener() {
            @Override
View Full Code Here

                }
            }
        };

        layout.addComponent(new Button("Toggle icon", iconToggleListener));
        layout.addComponent(new NativeButton("Toggle icon", iconToggleListener));
    }
View Full Code Here

    }

    private Button createButton(String text, boolean nativeButton) {
        Button b;
        if (nativeButton) {
            b = new NativeButton(text);
        } else {
            b = new Button(text);
        }

        return b;
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    protected void setup(VaadinRequest request) {
        Button b = new Button("Undefined wide");
        addComponent(b);
        NativeButton b2 = new NativeButton("Undefined wide");
        addComponent(b2);

        Table t = new Table();
        t.addContainerProperty("A", Button.class, null);
        t.setWidth("500px");

        Item i = t.addItem("1");
        i.getItemProperty("A").setValue(new Button("Undef wide"));
        Item i2 = t.addItem("2");
        i2.getItemProperty("A").setValue(new NativeButton("Undef wide"));

        addComponent(t);
    }
View Full Code Here

        b = new Button((String) null);
        b.setIcon(new ThemeResource("../runo/icons/16/ok.png"));

        addComponent(b);

        b = new NativeButton("Text and icon");
        b.setIcon(new ThemeResource("../runo/icons/16/ok.png"));

        addComponent(b);

        b = new NativeButton("Only text");

        addComponent(b);
        b = new NativeButton(null);
        b.setIcon(new ThemeResource("../runo/icons/16/ok.png"));

        addComponent(b);
    }
View Full Code Here

        addComponent(buttons);
    }

    private NativeButton createResetButton(final Object property,
            final Table table) {
        return new NativeButton("Reset " + property + " width",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        table.setColumnWidth(property, -1);
View Full Code Here

TOP

Related Classes of com.vaadin.ui.NativeButton

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.