Example usage for org.apache.wicket.markup.html.image Image setImageResourceReference

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

Introduction

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

Prototype

public void setImageResourceReference(final ResourceReference resourceReference) 

Source Link

Usage

From source file:ch.qos.mistletoe.wicket.TreeExpansionLink.java

License:Open Source License

@SuppressWarnings("unchecked")
@Override//w ww  .  j  a  v  a2 s.  c o m
public void onClick(AjaxRequestTarget target) {
    TestReportPanel nodePanel = (TestReportPanel) getParent();
    if (nodePanel == null || nodePanel.testReport == null) {
        warn("Failed to find node panel");
        return;
    }

    if (nodePanel.testReport.isSuite()) {
        expanded = !expanded;
        System.out.println("expanded=" + expanded);

        TreeExpansionLink link = (TreeExpansionLink) nodePanel.get(Constants.TREE_CONTROL_ID);

        target.add(link.getParent());

        Image image = (Image) link.get(Constants.TREE_CONTROL_SYMBOL_ID);
        ResourceReference ref = getControlSymbolResourceReference(expanded);
        image.setImageResourceReference(ref);

        ListView<Node> payloadNode = (ListView<Node>) nodePanel.get(Constants.PAYLOAD_ID);
        payloadNode.setVisible(expanded);

        // can't update a ListView
        target.add(payloadNode.getParent());
    }
}

From source file:org.dcm4chee.wizard.panel.LinkPanel.java

License:LGPL

public LinkPanel setImage(ResourceReference linkIcon, StringResourceModel resultMessage) {
    Image image = (Image) ajaxLink.get("wickettree.link.image");
    if (linkIcon != null) {
        image.setImageResourceReference(linkIcon);
        image.add(new ImageSizeBehaviour("vertical-align: middle;"));
    }/*from  www  . j  a va  2  s  .c  om*/
    if (resultMessage != null)
        image.add(new AttributeModifier("title", resultMessage));
    return this;
}