Example usage for org.apache.wicket.core.util.resource PackageResourceStream PackageResourceStream

List of usage examples for org.apache.wicket.core.util.resource PackageResourceStream PackageResourceStream

Introduction

In this page you can find the example usage for org.apache.wicket.core.util.resource PackageResourceStream PackageResourceStream.

Prototype

public PackageResourceStream(Class<?> scope, String path) 

Source Link

Document

Obtains an IResourceStream from the application's IResourceStreamLocator#locate(Class,String)

Usage

From source file:com.norconex.commons.wicket.markup.html.panel.FilePanel.java

License:Apache License

public FilePanel(String id, Class<?> scope, String fileName) {
    super(id, new MapModel<String, Object>());
    this.fileStream = new PackageResourceStream(scope, fileName);
}

From source file:com.norconex.commons.wicket.markup.html.panel.VelocityFilePanel.java

License:Apache License

public VelocityFilePanel(String id, Class<?> scope, String fileName, Map<String, Serializable> variables) {
    super(id, new MapModel<String, Object>());
    this.templateStream = new PackageResourceStream(scope, fileName);
    if (variables != null) {
        this.variables.putAll(variables);
    }//from   ww w  .j a va2s .  co m
}

From source file:sf.wicklet.wicketext.test.TestMarkupParser01.java

License:Apache License

@Test
public void test01() throws Exception {
    final String input = ResourceUtil.readString(
            new PackageResourceStream(getClass(), "sf/wicklet/wicketext/test/TestMarkupParser01Test01.html"));
    final MarkupParser parser = new MarkupParser(input);
    final IRootMarkup ret = parser.parse();
    final MarkupStat stat = WicketExtrasUtil.dump(System.out, DEBUG, ret);
    assertEquals(17, stat.ctags);/*from  w ww  .j  a  v  a  2s .c  om*/
    assertEquals(18, stat.rtags);
    assertEquals(0, stat.others);
}