Examples of ThemeResource


Examples of com.vaadin.server.ThemeResource

            for (String value : values) {
                if (value.equals("Caption")) {
                    tf.setCaption(caption);
                } else if (value.equals("Icon")) {
                    String timestamp = String.valueOf(new Date().getTime());
                    tf.setIcon(new ThemeResource(icons.get(random.nextInt(icons
                            .size())) + "?" + timestamp));
                } else if (value.equals("Required")) {
                    tf.setRequired(true);
                } else if (value.equals("Error")) {
                    tf.setComponentError(new UserError("Nooooo..."));
View Full Code Here

Examples of com.vaadin.server.ThemeResource

public class EmbeddedCssTest {

    private int debugIdCounter = 0;

    public EmbeddedCssTest(TestSampler parent) {
        Embedded e = new Embedded("Embedded with a caption", new ThemeResource(
                parent.ICON_URL));
        e.setId("embedded" + debugIdCounter);
        parent.addComponent(e);

        e = new Embedded(null, new ThemeResource(parent.ICON_URL));
        e.setId("embedded" + debugIdCounter);
        parent.addComponent(e);

        BrowserFrame eBrowser = new BrowserFrame();
        eBrowser.setCaption("A embedded browser");
View Full Code Here

Examples of com.vaadin.server.ThemeResource

        Label l1 = new Label("There are no previously saved actions.");
        Label l2 = new Label("There are no saved notes.");
        Label l3 = new Label("There are currently no issues.");

        acc.addTab(l1, "Actions", new ThemeResource(parent.ICON_URL));
        acc.addTab(l2, "Notes", new ThemeResource(parent.ICON_URL));
        acc.addTab(l3, "Issues", new ThemeResource(parent.ICON_URL));

        acc.getTab(l2).setEnabled(false);

        return acc;
    }
View Full Code Here

Examples of com.vaadin.server.ThemeResource

        Button b = new Button("Default button");
        b.setId("button" + debugIdCounter++);
        addComponent(b);

        b = new Button("Button with icon");
        b.setIcon(new ThemeResource(parent.ICON_URL));
        b.setId("button" + debugIdCounter++);
        addComponent(b);

        b = new Button("Button with tooltip");
        b.setDescription("The tooltip");
        b.setId("button" + debugIdCounter++);
        addComponent(b);

        b = new Button("Link button");
        b.setStyleName(BaseTheme.BUTTON_LINK);
        b.setId("button" + debugIdCounter++);
        addComponent(b);

        b = new Button("Disabled on click button");
        b.setDisableOnClick(true);
        b.setId("button" + debugIdCounter++);
        addComponent(b);

        CheckBox cb = new CheckBox("Checkbox");
        cb.setId("button" + debugIdCounter++);
        addComponent(cb);

        cb = new CheckBox("Checkbox with icon");
        cb.setIcon(new ThemeResource(parent.ICON_URL));
        cb.setId("button" + debugIdCounter++);
        addComponent(cb);

        Link l = new Link("A link", new ExternalResource(""));
        l.setId("button" + debugIdCounter++);
View Full Code Here

Examples of com.vaadin.server.ThemeResource

        if (primaryStyleName != null) {
            b.addStyleName(primaryStyleName);
        }

        if (iconUrl != null) {
            b.setIcon(new ThemeResource(iconUrl));
        }

        addComponent(b);

    }
View Full Code Here

Examples of com.vaadin.server.ThemeResource

    private HorizontalLayout getRow(int i) {
        HorizontalLayout row = new HorizontalLayout();
        row.setWidth("100%");
        row.setSpacing(true);

        Embedded icon = new Embedded(null, new ThemeResource(
                "../runo/icons/32/document.png"));
        row.addComponent(icon);
        row.setComponentAlignment(icon, Alignment.MIDDLE_LEFT);

        Label text = new Label(
View Full Code Here

Examples of com.vaadin.server.ThemeResource

        cb.addContainerProperty("icon", Resource.class, null);
        for (int i = 1; i < 200 + 1; i++) {
            Item item = cb.addItem(i);
            item.getItemProperty("caption").setValue("Item " + i);
            item.getItemProperty("icon").setValue(
                    new ThemeResource("../runo/icons/16/users.png"));
        }
        cb.setItemIconPropertyId("icon");
        cb.setItemCaptionPropertyId("caption");

        addComponent(cb);
View Full Code Here

Examples of com.vaadin.server.ThemeResource

        return 2853;
    }

    @Override
    protected void setup() {
        Embedded e = new Embedded("Embedded caption", new ThemeResource(
                "../runo/icons/64/ok.png"));
        e.setDescription("Embedded tooltip, only shown on caption, not on the image");
        addComponent(e);

    }
View Full Code Here

Examples of com.vaadin.server.ThemeResource

        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.TOP_RIGHT);

        tf = new TextField("Short caption");
        tf.setComponentError(new UserError("error message"));
        tf.setIcon(new ThemeResource("icons/16/calendar.png"));
        tf.setWidth("100px");

        tf.setComponentError(new UserError("error message"));
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.TOP_RIGHT);
View Full Code Here

Examples of com.vaadin.server.ThemeResource

        }

        // =====> THIS CODE generates error
        // WITHOUT THIS CODE works fine

        Embedded e = new Embedded("", new ThemeResource(
                "../runo/icons/64/ok.png"));
        // e.setMimeType("image/jpg");
        e.setWidth("100%");
        e.setHeight("100%");
        mainLayout.addComponent(e);
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.