Package com.vaadin.ui

Examples of com.vaadin.ui.Image


    @Override
    protected void setup() {
        AbstractEmbedded e;

        e = new Image("Image w/o alt text");
        addComponent(e);

        e = new Image("Image w/ alt text");
        e.setAlternateText("Image");
        addComponent(e);

        e = new Flash("Flash w/o alt text");
        addComponent(e);
View Full Code Here


        images.setSpacing(true);

        Label l = new Label("Chameleon theme image in caption");
        l.setIcon(new ThemeResource("img/magnifier.png"));
        images.addComponent(l);
        Image image = new Image("Runo theme image", new ThemeResource(
                "icons/64/ok.png"));
        images.addComponent(image);
        image = new Image("Reindeer theme image", new ThemeResource(
                "button/img/left-focus.png"));
        images.addComponent(image);
        addComponent(images);
        addComponent(gl);
View Full Code Here

        Resource resource = new ExternalResource(IMAGE_URL + "?text=Hello!");

        getSession().addRequestHandler(requestHandler);

        // Add an image using the resource
        Image image = new Image("A dynamically generated image", resource);

        addComponent(image);
    }
View Full Code Here

    protected void setup() {

        final Label label = new Label(labelText());
        addComponent(label);

        final Image image = new Image();
        final MyImageSource imageSource = new MyImageSource();
        final StreamResource imageResource = new StreamResource(imageSource,
                "testimage.png");
        image.setSource(imageResource);
        image.addClickListener(new ClickListener() {

            @Override
            public void click(ClickEvent event) {
                ++clickCounter;
                imageResource.setFilename("testimage.png?"
                        + new Date().getTime());
                image.markAsDirty();
                label.setValue(labelText());
            }

        });
        addComponent(image);
View Full Code Here

public class ImageAltText extends TestBase {

    @Override
    protected void setup() {
        final Image image = new Image("Caption", new ThemeResource(
                "../runo/icons/64/ok.png"));
        image.setDebugId("image");
        image.setAlternateText("Original alt text");
        addComponent(image);

        Button changeAltTexts = new Button("Change alt text",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        image.setAlternateText("New alt text!");
                    }
                });
        addComponent(changeAltTexts);
    }
View Full Code Here

        CssLayout layout = new CssLayout();
        layout.addStyleName("demo-panel-d");
        layout.setWidth("100%");
        layout.setHeight("100%");

        Image image = new Image();
        image.setSource(new ThemeResource("images/meme.jpg"));
        image.addStyleName("demo-meme");
        layout.addComponent(image);

        return layout;
    }
View Full Code Here

        noneIconResource = new ClassResource(QueryItemStatusColumnGenerator.class, "images/textfield.png");
        addedIconResource = new ClassResource(QueryItemStatusColumnGenerator.class, "images/textfield_add.png");
        modifiedIconResource = new ClassResource(QueryItemStatusColumnGenerator.class, "images/textfield_rename.png");
        removedIconResource = new ClassResource(QueryItemStatusColumnGenerator.class, "images/textfield_delete.png");

        statusIcon = new Image(null, noneIconResource);
        statusIcon.setHeight("16px");

        if (statusProperty instanceof ValueChangeNotifier) {
            ValueChangeNotifier notifier = (ValueChangeNotifier) statusProperty;
            notifier.addValueChangeListener(this);
View Full Code Here

                        // User menu
                        addComponent(new VerticalLayout() {
                            {
                                setSizeUndefined();
                                addStyleName("user");
                                Image profilePic = new Image(
                                        null,
                                        new ThemeResource("img/profile-pic.png"));
                                profilePic.setWidth("34px");
                                addComponent(profilePic);
                                Label userName = new Label("");
                                userName.setSizeUndefined();
                                addComponent(userName);
View Full Code Here

        drafts.setSpacing(true);
        titleAndDrafts.addComponent(drafts);

        CssLayout draftThumb = new CssLayout();
        draftThumb.addStyleName("draft-thumb");
        Image draft = new Image(null, new ThemeResource(
                "img/draft-report-thumb.png"));
        draftThumb.addComponent(draft);
        Label draftTitle = new Label(
                "Monthly revenue<br><span>Last modified 1 day ago</span>",
                ContentMode.HTML);
        draftTitle.setSizeUndefined();
        draftThumb.addComponent(draftTitle);
        drafts.addComponent(draftThumb);
        // TODO layout bug, we need to set the alignment also for the first
        // child
        drafts.setComponentAlignment(draftThumb, Alignment.MIDDLE_CENTER);

        final Button delete = new Button("×");
        delete.setPrimaryStyleName("delete-button");
        draftThumb.addComponent(delete);
        delete.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                Notification.show("Not implemented in this demo");
            }
        });

        draftThumb.addLayoutClickListener(new LayoutClickListener() {
            @Override
            public void layoutClick(LayoutClickEvent event) {
                if (event.getButton() == MouseButton.LEFT
                        && event.getChildComponent() != delete) {
                    editors.addTab(createEditorInstance(1, null, null))
                            .setClosable(true);
                    editors.setSelectedTab(editors.getComponentCount() - 1);
                }
            }
        });
        draft.setDescription("Click to edit");
        delete.setDescription("Delete draft");

        VerticalLayout createBox = new VerticalLayout();
        createBox.setWidth(null);
        createBox.addStyleName("create");
View Full Code Here

        Label help = new Label("Drag items to the canvas");
        help.addStyleName("help");
        paletteLayout.addComponent(help);

        CssLayout wrap = new CssLayout();
        Image l = new Image(null, new ThemeResource("img/palette-text.png"));
        wrap.addComponent(l);
        Label caption = new Label("Text Block");
        caption.setSizeUndefined();
        wrap.addComponent(caption);
        DragAndDropWrapper rte = new DragAndDropWrapper(wrap);
        rte.setSizeUndefined();
        rte.setCaption("text");
        paletteLayout.addComponent(rte);
        rte.setDragStartMode(DragStartMode.WRAPPER);

        wrap = new CssLayout();
        l = new Image(null, new ThemeResource("img/palette-grid.png"));
        wrap.addComponent(l);
        caption = new Label("Top 10 Movies");
        caption.setSizeUndefined();
        wrap.addComponent(caption);
        DragAndDropWrapper grid = new DragAndDropWrapper(wrap);
        grid.setCaption("grid");
        grid.setSizeUndefined();
        paletteLayout.addComponent(grid);
        grid.setDragStartMode(DragStartMode.WRAPPER);

        wrap = new CssLayout();
        l = new Image(null, new ThemeResource("img/palette-chart.png"));
        wrap.addComponent(l);
        caption = new Label("Top 4 Revenue");
        caption.setSizeUndefined();
        wrap.addComponent(caption);
        DragAndDropWrapper chart = new DragAndDropWrapper(wrap);
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Image

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.