Package org.wicketstuff.pickwick.bean

Examples of org.wicketstuff.pickwick.bean.Image


    @Override
    protected void populateItem(Item item) {
      try {
        if (item.getModelObject() instanceof Image){
          Image imageProperties = (Image) item.getModelObject();
          if (!imageProperties.getFile().getCanonicalPath().startsWith(
              settings.getImageDirectoryRoot().getCanonicalPath()))
            throw new RuntimeException("Requested image directory not within the root image directory");
          WebMarkupContainer link;
          String imagePath = imageUtils.getRelativePath(imageProperties.getFile());
          PageParameters params = new PageParameters();
          params.add("uri", imagePath);
          item.add(link = new WebMarkupContainer("link"));
          link.add(new AttributeModifier("href", true, new Model(getRequest()
              .getRelativePathPrefixToContextRoot()
              + PickwickApplication.IMAGE_PAGE_PATH + "/" + imagePath)));
          WebComponent image;
          link.add(image = new WebComponent("thumbnail"));
          image.add(new AttributeModifier("src", true, new Model(getRequest()
              .getRelativePathPrefixToContextRoot()
              + PickwickApplication.THUMBNAIL_IMAGE_PATH + "/" + imagePath)));
          link.add(new Label("thumbnailLabel", imageProperties.getTitle()));
        } else if (item.getModelObject() instanceof Folder){
          final Folder folder = (Folder) item.getModelObject();
          Sequence sequence = imageUtils.readSequence(folder.getFile());
          WebMarkupContainer link;
          item.add(link = new WebMarkupContainer("link"){
View Full Code Here


    }
    return folderList;
  }

  final public static Image getImageProperties(File file) throws FileNotFoundException, IOException {
    Image p = new Image();
    p.setFile(file);
    return p;
    // TODO load sequence information: image title, caption, date, ...
  }
View Full Code Here

TOP

Related Classes of org.wicketstuff.pickwick.bean.Image

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.