Example usage for org.apache.wicket.markup.html.image NonCachingImage NonCachingImage

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

Introduction

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

Prototype

public NonCachingImage(String id) 

Source Link

Document

Construct.

Usage

From source file:com.doculibre.constellio.wicket.panels.fold.FoldableSectionPanel.java

License:Open Source License

private void initComponents(IModel titleModel) {
    titleSection = new WebMarkupContainer("titleSection");
    add(titleSection);/*from   www.j a va 2  s  . c om*/
    titleSection.add(new SimpleAttributeModifier("class", getTitleSectionStyleClass()));

    toggleLink = newToggleLink("toggleLink");
    titleSection.add(toggleLink);
    toggleLink.add(new Label("title", titleModel));

    toggleImg = new NonCachingImage("toggleImg") {
        @Override
        protected ResourceReference getImageResourceReference() {
            ResourceReference imageResourceReference;
            if (isOpened()) {
                imageResourceReference = OPENED_IMG_RESOURCE_REFERENCE;
            } else {
                imageResourceReference = CLOSED_IMG_RESOURCE_REFERENCE;
            }
            return imageResourceReference;
        }
    };
    toggleImg.setOutputMarkupId(true);
    toggleLink.add(toggleImg);

    foldableSectionContainer = newFoldableSectionContainer("foldableSectionContainer");
    foldableSectionContainer.setOutputMarkupId(true);
    add(foldableSectionContainer);
    foldableSection = newFoldableSection("foldableSection");
    foldableSectionContainer.add(foldableSection);
    foldableSection.setOutputMarkupId(true);
}

From source file:com.userweave.pages.test.BasePageSurvey.java

License:Open Source License

public BasePageSurvey() {
    super();//ww  w .  j  a v  a  2  s  .co m

    add(noscriptPanel = new NoScriptPanel("noscript_panel"));

    addLinksAndModalWindows();

    add(countLabelTop = createCountLabelTop(new Model<Integer>(0)));

    //add(createHelpArrow());

    add(moduleConfigurationDescription = new Label("moduleConfigurationDescription", new Model<String>("")));

    add(headline = new Label("headline", ""));
    add(description = new Label("description", ""));
    add(logo = new NonCachingImage(LOGO));

    addLoadingPanel();

    WebMarkupContainer progressContainer = new WebMarkupContainer("progressContainer") {
        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return progressCounterIsVisible();
        }
    };

    add(progressContainer);

    progressContainer.add(createProgress1());
    progressContainer.add(createProgress2());

    percentCountLabel = createPercentCountLabel(new Model<String>("0 %"));
    progressContainer.add(percentCountLabel);

    headTitleString = new StringResourceModel("you_can", this, null).getString() + " "
            + new StringResourceModel("agile", this, null).getString() + " - "
            + new StringResourceModel("url_short_usability_methods", this, null).getString();

    headTitle = new Label(HEAD_TITLE, new Model<String>(headTitleString));
    add(headTitle);
}

From source file:com.userweave.pages.test.NoScriptPanel.java

License:Open Source License

public NoScriptPanel(String id) {
    super(id);/*  ww  w.  j  a  va2 s.  co m*/

    add(noscript_logo = new NonCachingImage(NOSCRIPT_LOGO));

    add(new ImprintPanel("imprintPanel_noscript"));
}

From source file:de.tudarmstadt.ukp.clarin.webanno.monitoring.page.MonitoringPage.java

License:Apache License

@SuppressWarnings({ "unchecked", "rawtypes" })
public MonitoringPage() throws UIMAException, IOException, ClassNotFoundException {
    projectSelectionForm = new ProjectSelectionForm("projectSelectionForm");

    monitoringDetailForm = new MonitoringDetailForm("monitoringDetailForm");

    add(agreementForm = new AgreementForm("agreementForm"));

    trainingResultForm = new TrainingResultForm("trainingResultForm");
    trainingResultForm.setVisible(false);
    add(trainingResultForm);// w ww  .j  a va  2 s .c  om

    annotatorsProgressImage = new NonCachingImage("annotator");
    annotatorsProgressImage.setOutputMarkupPlaceholderTag(true);
    annotatorsProgressImage.setVisible(false);

    annotatorsProgressPercentageImage = new NonCachingImage("annotatorPercentage");
    annotatorsProgressPercentageImage.setOutputMarkupPlaceholderTag(true);
    annotatorsProgressPercentageImage.setVisible(false);

    overallProjectProgressImage = new NonCachingImage("overallProjectProgressImage");
    final Map<String, Integer> overallProjectProgress = getOverallProjectProgress();
    overallProjectProgressImage.setImageResource(createProgressChart(overallProjectProgress, 100, true));
    overallProjectProgressImage.setOutputMarkupPlaceholderTag(true);
    overallProjectProgressImage.setVisible(true);
    add(overallProjectProgressImage);
    add(overview = new Label("overview", "overview of projects"));

    add(projectSelectionForm);
    projectName = new Label("projectName", "");

    Project project = repository.listProjects().get(0);

    List<List<String>> userAnnotationDocumentLists = new ArrayList<List<String>>();
    List<SourceDocument> dc = repository.listSourceDocuments(project);
    List<SourceDocument> trainingDoc = new ArrayList<SourceDocument>();
    for (SourceDocument sdc : dc) {
        if (sdc.isTrainingDocument()) {
            trainingDoc.add(sdc);
        }
    }
    dc.removeAll(trainingDoc);
    for (int j = 0; j < repository.listProjectUsersWithPermissions(project).size(); j++) {
        List<String> userAnnotationDocument = new ArrayList<String>();
        userAnnotationDocument.add("");
        for (int i = 0; i < dc.size(); i++) {
            userAnnotationDocument.add("");
        }
        userAnnotationDocumentLists.add(userAnnotationDocument);
    }
    List<String> documentListAsColumnHeader = new ArrayList<String>();
    documentListAsColumnHeader.add("Users");
    for (SourceDocument d : dc) {
        documentListAsColumnHeader.add(d.getName());
    }
    TableDataProvider prov = new TableDataProvider(documentListAsColumnHeader, userAnnotationDocumentLists);

    List<IColumn<?, ?>> cols = new ArrayList<IColumn<?, ?>>();

    for (int i = 0; i < prov.getColumnCount(); i++) {
        cols.add(new DocumentStatusColumnMetaData(prov, i, new Project(), repository));
    }
    annotationDocumentStatusTable = new DefaultDataTable("rsTable", cols, prov, 2);
    monitoringDetailForm.setVisible(false);
    add(monitoringDetailForm.add(annotatorsProgressImage).add(annotatorsProgressPercentageImage)
            .add(projectName).add(annotationDocumentStatusTable));
    annotationDocumentStatusTable.setVisible(false);

}

From source file:org.sakaiproject.sitestats.tool.wicket.components.AjaxLazyLoadImage.java

License:Educational Community License

private Image createImage(final String id, final byte[] imageData) {
    NonCachingImage chartImage = new NonCachingImage(id) {
        private static final long serialVersionUID = 1L;

        @Override/* w  w w  .  j ava2  s.c om*/
        protected IResource getImageResource() {
            return new DynamicImageResource() {
                private static final long serialVersionUID = 1L;

                @Override
                protected byte[] getImageData(IResource.Attributes attributes) {
                    return imageData;
                }

                // adapted from https://cwiki.apache.org/confluence/display/WICKET/JFreeChart+and+wicket+example
                @Override
                protected void configureResponse(AbstractResource.ResourceResponse response,
                        IResource.Attributes attributes) {
                    super.configureResponse(response, attributes);

                    response.setCacheDuration(Duration.NONE);
                    response.setCacheScope(CacheScope.PRIVATE);
                }
            };
        }
    };
    chartImage.setOutputMarkupId(true);
    chartImage.setOutputMarkupPlaceholderTag(true);
    return chartImage;
}

From source file:org.sakaiproject.sitestats.tool.wicket.pages.MaximizedImagePage.java

License:Educational Community License

@SuppressWarnings("serial")
private void renderBody() {
    NonCachingImage image = new NonCachingImage("image") {
        @SuppressWarnings("serial")
        @Override//from   www .  j  a va  2s  .c  o  m
        protected IResource getImageResource() {
            return new DynamicImageResource() {

                @Override
                protected byte[] getImageData(IResource.Attributes attributes) {
                    return getMaximizedImageData();
                }

                // adapted from https://cwiki.apache.org/confluence/display/WICKET/JFreeChart+and+wicket+example
                @Override
                protected void configureResponse(AbstractResource.ResourceResponse response,
                        IResource.Attributes attributes) {
                    super.configureResponse(response, attributes);

                    response.setCacheDuration(Duration.NONE);
                    response.setCacheScope(WebResponse.CacheScope.PRIVATE);
                }
            };
        }
    };
    add(image);

    Form form = new Form("form");
    add(form);

    Button back = new Button("back") {
        @Override
        public void onSubmit() {
            if (returnPage != null) {
                setResponsePage(returnPage);
            } else if (returnClass != null) {
                setResponsePage(returnClass);
            }
            super.onSubmit();
        }
    };
    back.setDefaultFormProcessing(true);
    form.add(back);
}