Examples of ThemeResource


Examples of com.vaadin.server.ThemeResource

        hl.addComponent(wrap("A cached image", "cancel.png"));
        addComponent(hl);
    }

    private CustomComponent wrap(String caption, String themeImage) {
        Embedded image = new Embedded(caption, new ThemeResource(
                "../runo/icons/64/" + themeImage));
        CustomComponent cc = new CustomComponent(image);
        return cc;
    }
View Full Code Here

Examples of com.vaadin.server.ThemeResource

    @Override
    protected void setup(VaadinRequest request) {
        Button buttonText = new Button("Only text");

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

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

        buttonText.addClickListener(this);
        buttonTextIcon.addClickListener(this);
        buttonTextIconAlt.addClickListener(this);

        buttonText.setId(BUTTON_TEXT);
        buttonTextIcon.setId(BUTTON_TEXT_ICON);
        buttonTextIconAlt.setId(BUTTON_TEXT_ICON_ALT);

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

Examples of com.vaadin.server.ThemeResource

public class EmbeddedClickListenerRelativeCoordinates extends TestBase {

    @Override
    protected void setup() {
        Embedded e = new Embedded("Embedded caption", new ThemeResource(
                "../runo/icons/64/ok.png"));
        e.addListener(new ClickListener() {

            @Override
            public void click(ClickEvent event) {
View Full Code Here

Examples of com.vaadin.server.ThemeResource

    }

    @Override
    protected void setup() {
        CheckBox checkbox = new CheckBox("A checkbox");
        checkbox.setIcon(new ThemeResource("../runo/icons/32/calendar.png"));
        checkbox.setDescription("Tooltip for checkbox");

        addComponent(checkbox);
    }
View Full Code Here

Examples of com.vaadin.server.ThemeResource

                icon = "bullet.png";
            }
            mySelect = new Select("Width: " + (width == null ? "auto" : width));
            String bar = "Only item";
            mySelect.addItem(bar);
            mySelect.setItemIcon(bar, new ThemeResource("common/icons/" + icon
                    + "?w=" + width));
            mySelect.select(bar);
            mySelect.setWidth(width);
            addComponent(mySelect);
        }
View Full Code Here

Examples of com.vaadin.server.ThemeResource

        p.setSizeFull();
        Label l = new Label("Spacer");
        l.setHeight("400px");
        ol.addComponent(l);

        embedded = new Embedded(null, new ThemeResource(
                "icons/64/folder-add.png"));
        layout.addComponent(embedded);
        Button b = new Button(
                "Replace image with new embedded component (flashes)",
                new ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        Embedded newEmbedded = new Embedded(null,
                                new ThemeResource("icons/64/folder-add.png"));
                        getMainWindow().replaceComponent(embedded, newEmbedded);
                        embedded = newEmbedded;

                    }

                });
        ol.addComponent(b);

        b = new Button("Change image source (is fine)", new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                String img = "folder-add";
                if (((ThemeResource) embedded.getSource()).getResourceId()
                        .contains("folder-add")) {
                    img = "folder-delete";
                }
                embedded.setSource(new ThemeResource("icons/64/" + img + ".png"));

            }

        });
View Full Code Here

Examples of com.vaadin.server.ThemeResource

        layout.setSizeUndefined();
        Window zoom = new Window("Image Preview", layout);
        zoom.setSizeUndefined();

        String res = "icons/EmbeddedInSubWindow-image.png";
        Embedded imagePreview = new Embedded(null, new ThemeResource(res));
        imagePreview.setSizeUndefined();

        layout.addComponent(imagePreview);
        zoom.setModal(true);
        zoom.setResizable(false);
View Full Code Here

Examples of com.vaadin.server.ThemeResource

                ComponentContainer new_name = (ComponentContainer) c;
                new_name.addComponent(new Label("component 1 in test container"));
                new_name.addComponent(new Button("component 2"));
            } else if (c instanceof Embedded) {
                Embedded em = (Embedded) c;
                em.setSource(new ThemeResource("test.png"));
            } else if (c instanceof Label) {
                ((Label) c).setValue("Test label");
            }

            for (Iterator<Configuration> i = configurations.iterator(); i
View Full Code Here

Examples of com.vaadin.server.ThemeResource

            } else {
                b = new Button(buttonStyles[i] + " style");
            }
            b.setStyleName(buttonStyles[i].toLowerCase());
            if (icon) {
                b.setIcon(new ThemeResource("../runo/icons/"
                        + (largeIcons ? "64" : "16") + "/document.png"));
            }
            if (error) {
                b.setComponentError(new UserError("Error"));
            }
View Full Code Here

Examples of com.vaadin.server.ThemeResource

public class ResourceInStateUI extends UI {

    @Override
    protected void init(VaadinRequest request) {
        ResourceInStateComponent component = new ResourceInStateComponent();
        component.setMyIcon(new ThemeResource("../runo/icons/32/calendar.png"));

        setContent(component);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.