Example usage for org.apache.wicket.markup.html.image.resource BlobImageResource BlobImageResource

List of usage examples for org.apache.wicket.markup.html.image.resource BlobImageResource BlobImageResource

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.image.resource BlobImageResource BlobImageResource.

Prototype

public BlobImageResource() 

Source Link

Document

Construct.

Usage

From source file:au.org.theark.core.web.StudyHelper.java

License:Open Source License

public void setStudyLogoImage(final Study study, String id, WebMarkupContainer studyLogoImageContainer) {
    // Set the study logo
    if (study != null && study.getStudyLogoBlob() != null) {
        final java.sql.Blob studyLogoBlob = study.getStudyLogoBlob();

        if (studyLogoBlob != null) {
            BlobImageResource blobImageResource = new BlobImageResource() {
                private static final long serialVersionUID = 1L;

                @Override//from   w ww  .j  av  a2  s. c  om
                protected Blob getBlob() {
                    return studyLogoBlob;
                }
            };

            Image studyLogoImage = new Image(id, blobImageResource);
            studyLogoImageContainer.addOrReplace(studyLogoImage);
        }
    } else {
        noStudyLogoImage = new ContextImage("study.studyLogoImage",
                new Model<String>("images/no_study_logo.gif"));
        studyLogoImageContainer.addOrReplace(noStudyLogoImage);
    }
}

From source file:au.org.theark.study.web.component.managestudy.form.DetailForm.java

License:Open Source License

private void initStudyLogo() {
    // Set maximum logo image size to 100K
    setMaxSize(Bytes.kilobytes(Constants.STUDY_LOGO_FILESIZE_KB));

    if (containerForm.getModelObject().getStudy() != null
            && containerForm.getModelObject().getStudy().getStudyLogoBlob() != null) {
        final java.sql.Blob studyLogoBlob = containerForm.getModelObject().getStudy().getStudyLogoBlob();

        if (studyLogoBlob != null) {
            BlobImageResource blobImageResource = new BlobImageResource() {
                private static final long serialVersionUID = 1L;

                @Override/*from   w w  w .ja v a2 s.c  o m*/
                protected Blob getBlob() {
                    return studyLogoBlob;
                }
            };

            studyLogoImage = new NonCachingImage("study.studyLogoImage", blobImageResource);
        }
    } else {
        studyLogoImage = new NonCachingImage("study.studyLogoImage", NO_STUDY_LOGO);
    }

    studyLogoImage.setVisible(true);
    studyLogoImage.setOutputMarkupPlaceholderTag(true);
    studyCrudVO.getDetailPanelFormContainer().addOrReplace(studyLogoImage);
}

From source file:com.userweave.module.methoden.iconunderstandability.page.report.ImageWrapper.java

License:Open Source License

public ImageWrapper(String id, final int imageId) {
    super(id);/* w ww  . j av a  2  s  .c o m*/

    add(new Image("image", new BlobImageResource() {

        @Override
        protected Blob getBlob() {
            return new BlobImpl(itmImageDao.findById(imageId).getImageData());
        }
    }));
}