Example usage for org.apache.wicket.markup.html WebMarkupContainer addOrReplace

List of usage examples for org.apache.wicket.markup.html WebMarkupContainer addOrReplace

Introduction

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

Prototype

public MarkupContainer addOrReplace(final Component... children) 

Source Link

Document

Replaces a child component of this container with another or just adds it in case no child with the same id existed yet.

Usage

From source file:au.org.theark.core.util.ContextHelper.java

License:Open Source License

@SuppressWarnings("unchecked")
public void resetContextLabel(AjaxRequestTarget target, WebMarkupContainer arkContextMarkup) {
    studyLabel = new Label("studyLabel", new Model(""));
    arkContextMarkup.addOrReplace(studyLabel);
    subjectLabel = new Label("subjectLabel", new Model(""));
    arkContextMarkup.addOrReplace(subjectLabel);
    phenoLabel = new Label("phenoLabel", new Model(""));
    arkContextMarkup.addOrReplace(phenoLabel);
    genoLabel = new Label("genoLabel", new Model(""));
    arkContextMarkup.addOrReplace(genoLabel);
    target.add(arkContextMarkup);/*from  w w w . j  av  a2 s.co  m*/
}

From source file:au.org.theark.core.util.ContextHelper.java

License:Open Source License

@SuppressWarnings("unchecked")
public void setStudyContextLabel(AjaxRequestTarget target, String label, WebMarkupContainer arkContextMarkup) {
    studyLabel = new Label("studyLabel", new Model("Study: " + label));
    arkContextMarkup.addOrReplace(studyLabel);
    target.add(arkContextMarkup);/*from   ww w.  j  av a2 s  .c o  m*/
}

From source file:au.org.theark.core.util.ContextHelper.java

License:Open Source License

/**
 * Overloaded method that does not use a AjaxRequestTarget
 * @param label/*  w  w  w . j  a v a 2 s  . c om*/
 * @param arkContextMarkup
 */
@SuppressWarnings("unchecked")
public void setStudyContextLabel(String label, WebMarkupContainer arkContextMarkup) {
    studyLabel = new Label("studyLabel", new Model("Study: " + label));
    arkContextMarkup.addOrReplace(studyLabel);
}

From source file:au.org.theark.core.util.ContextHelper.java

License:Open Source License

@SuppressWarnings("unchecked")
public void setSubjectContextLabel(AjaxRequestTarget target, String label,
        WebMarkupContainer arkContextMarkup) {
    subjectLabel = new Label("subjectLabel", new Model("Subject UID: " + label));
    arkContextMarkup.addOrReplace(subjectLabel);
    target.add(arkContextMarkup);//from  w  ww  . j a  v  a  2s .  c o  m
}

From source file:au.org.theark.core.util.ContextHelper.java

License:Open Source License

@SuppressWarnings("unchecked")
public void setSubjectContextLabel(String label, WebMarkupContainer arkContextMarkup) {
    subjectLabel = new Label("subjectLabel", new Model("Subject UID: " + label));
    arkContextMarkup.addOrReplace(subjectLabel);
}

From source file:au.org.theark.core.util.ContextHelper.java

License:Open Source License

@SuppressWarnings("unchecked")
public void setPhenoContextLabel(AjaxRequestTarget target, String label, WebMarkupContainer arkContextMarkup) {
    phenoLabel = new Label("phenoLabel", new Model("Pheno Col.: " + label));
    arkContextMarkup.addOrReplace(phenoLabel);
    target.add(arkContextMarkup);/*from   w w  w  .j a va2 s.co m*/
}

From source file:au.org.theark.core.util.ContextHelper.java

License:Open Source License

@SuppressWarnings("unchecked")
public void setGenoContextLabel(AjaxRequestTarget target, String label, WebMarkupContainer arkContextMarkup) {
    genoLabel = new Label("genoLabel", new Model("Geno Col.: " + label));
    arkContextMarkup.addOrReplace(genoLabel);
    target.add(arkContextMarkup);/*from  w  w  w  .j  av a  2s . c o  m*/
}

From source file:au.org.theark.core.util.ContextHelper.java

License:Open Source License

@SuppressWarnings("unchecked")
public void setContextLabel(AjaxRequestTarget target, Label label, WebMarkupContainer arkContextMarkup) {
    if (label.getId() == "phenoLabel") {
        phenoLabel = new Label("phenoLabel", new Model("Pheno Col.: " + label));
        arkContextMarkup.addOrReplace(phenoLabel);
    }//  ww  w.  j  a  v  a 2  s.  c o m

    target.add(arkContextMarkup);
}

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 w w  .j  a  va2 s. com*/
                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.core.web.StudyHelper.java

License:Open Source License

public void setStudyContextLabel(AjaxRequestTarget target, String studyName,
        WebMarkupContainer arkContextMarkup) {
    studyLabel = new Label("studyLabel", new Model<String>("Study: " + studyName));
    arkContextMarkup.addOrReplace(studyLabel);
    target.add(arkContextMarkup);//from  ww  w .  ja  va2  s. c  o  m
}