Package com.vaadin.ui

Examples of com.vaadin.ui.NativeButton


public class CustomComponentSizeUpdate extends TestBase {

    @Override
    protected void setup() {
        NativeButton nb = new NativeButton(
                "100%x100% button. Click to reduce CustomComponent size");
        nb.setSizeFull();

        final CustomComponent cc = new CustomComponent(nb);
        cc.setWidth("500px");
        cc.setHeight("500px");

        nb.addListener(new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                cc.setWidth((cc.getWidth() - 20) + "px");
                cc.setHeight((cc.getHeight() - 20) + "px");
View Full Code Here


        addComponent(buttonText);
        addComponent(buttonTextIcon);
        addComponent(buttonTextIconAlt);

        NativeButton nativeButtonText = new NativeButton("Only text");

        NativeButton nativeButtonTextIcon = new NativeButton("Text icon");
        nativeButtonTextIcon.setIcon(new ThemeResource(
                "../runo/icons/64/ok.png"));

        NativeButton nativeButtonTextIconAlt = new NativeButton("Text icon alt");
        nativeButtonTextIconAlt.setIcon(new ThemeResource(
                "../runo/icons/64/cancel.png"));
        nativeButtonTextIconAlt.setIconAlternateText(INITIAL_ALTERNATE_TEXT);

        nativeButtonText.addClickListener(this);
        nativeButtonTextIcon.addClickListener(this);
        nativeButtonTextIconAlt.addClickListener(this);

        nativeButtonText.setId(NATIVE_BUTTON_TEXT);
        nativeButtonTextIcon.setId(NATIVE_BUTTON_TEXT_ICON);
        nativeButtonTextIconAlt.setId(NATIVE_BUTTON_TEXT_ICON_ALT);

        addComponent(nativeButtonText);
        addComponent(nativeButtonTextIcon);
        addComponent(nativeButtonTextIconAlt);
    }
View Full Code Here

public class NativeButtonHtml extends TestBase {

    @Override
    protected void setup() {
        NativeButton b = new NativeButton("<b>Plain text button</b>");
        addComponent(b);

        b = new NativeButton(
                "<span style=\"color: red; font-weight: bold;\">HTML</span> button");
        b.setHtmlContentAllowed(true);
        addComponent(b);

        final NativeButton swapButton = new NativeButton("<i>Swap button<i>");
        swapButton.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                swapButton.setHtmlContentAllowed(!swapButton
                        .isHtmlContentAllowed());
            }
        });
        addComponent(swapButton);
    }
View Full Code Here

        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        Window w = new Window("full sized window", layout);
        w.setSizeFull();
        layout.setSizeFull();
        NativeButton b = new NativeButton("A large button");
        b.setSizeFull();
        layout.addComponent(b);
        getMainWindow().addWindow(w);
        setTheme("runo");
    }
View Full Code Here

        layout.setMargin(true);
        layout.setSizeFull();
        Window w = new Window("full sized window", layout);
        w.setWidth("2000px");
        w.setHeight("2000px");
        NativeButton b = new NativeButton("A large button");
        b.setSizeFull();
        layout.addComponent(b);

        getMainWindow().addWindow(w);
    }
View Full Code Here

        @Override
        public Component generateCell(final com.vaadin.ui.Table source,
                final Object itemId, Object columnId) {
            TestBean tb = (TestBean) itemId;
            String identifier = "Item " + itemId + "/" + columnId;
            Button btnCol3 = new NativeButton(identifier);
            btnCol3.setId("cacheTestButton-" + tb.getCol1() + "-"
                    + tb.getCol2());
            btnCol3.addClickListener(new Button.ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    log.log("Button " + event.getButton().getCaption()
                            + " clicked. Row index: "
                            + indexOfId(source, itemId));
View Full Code Here

        @Override
        public Component generateCell(final com.vaadin.ui.Table source,
                final Object itemId, Object columnId) {
            TestBean tb = (TestBean) itemId;
            String identifier = "Expand/Collapse";
            Button btnCol4 = new NativeButton(identifier);
            btnCol4.setId("cacheTestButtonToggle-" + tb.getCol1() + "-"
                    + tb.getCol2());
            btnCol4.addClickListener(new Button.ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    treeTable.setCollapsed(itemId,
                            !treeTable.isCollapsed(itemId));
                }
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

        hl.setMargin(true);

        for (int i = 0; i < buttonStyles.length; i++) {
            Button b;
            if (nativeButtons) {
                b = new NativeButton(buttonStyles[i] + " style");
            } else {
                b = new Button(buttonStyles[i] + " style");
            }
            b.setStyleName(buttonStyles[i].toLowerCase());
            if (icon) {
View Full Code Here

        outerPanel = new Panel("Outer panel, enabled");
        innerTabsheet = new TabSheet();
        innerTabsheet.setCaption("Inner Tabsheet, enabled");

        button = new Button("Button, enabled");
        nativeButton = new NativeButton("NativeButton, enabled");
        textField = new TextField("TextField with caption and value, enabled");
        textField.setValue("Text");
        textArea = new TextArea("TextArea with caption and value, enabled");
        textArea.setValue("Text");
        layout = new VerticalLayout();
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.