Example usage for com.vaadin.ui Embedded setCaption

List of usage examples for com.vaadin.ui Embedded setCaption

Introduction

In this page you can find the example usage for com.vaadin.ui Embedded setCaption.

Prototype

@Override
    public void setCaption(String caption) 

Source Link

Usage

From source file:com.foc.vaadin.gui.FVIconFactory.java

License:Apache License

public Embedded getFVIcon(String iconName, boolean dispLayCaption) {
    Resource iconResourse = new ThemeResource("../" + THEME_DIR + "/icons/" + iconName);

    Embedded embedded = new Embedded(null, iconResourse);

    if (!iconName.equals(ICON_TRASH_SMALL)) {
        embedded.setWidth("32px");
        embedded.setHeight("32px");
    }//from   w w  w.  j a  va  2  s .co m

    if (dispLayCaption) {
        embedded.setCaption(iconName);
    }

    return embedded;
}

From source file:com.tapas.evidence.fe.components.EvidenceUpload.java

License:Apache License

public void showImage(String path) {
    final Resource imageResource = new ExternalResource(path);
    Embedded image = new Embedded("", imageResource);
    image.setCaption(null);
    image.setWidth("200px");
    imagePanel.setHeight(null);/*from w w  w  .j a va  2  s. c  o m*/
    imagePanel.removeAllComponents();
    imagePanel.addComponent(image);
    status.setValue(null);
}

From source file:com.tapas.evidence.fe.components.EvidenceUpload.java

License:Apache License

public void showImage(final byte[] byteArray) {
    final StreamResource imageResource = new StreamResource(new ImageSource(byteArray), "photo.jpg",
            getApplication());/*w w  w  . ja va 2s.  c  om*/
    imageResource.setCacheTime(0); // disable cache
    Embedded image = new Embedded("", imageResource);
    image.setCaption(null);
    image.setWidth("200px");
    imagePanel.setHeight(null);
    imagePanel.addComponent(image);
    status.setValue(null);
}