Package org.wicketstuff.pickwick.bean

Examples of org.wicketstuff.pickwick.bean.Folder


  public FolderTree(String id, TreeModel model) {
    super(id, model);
  }
 
  protected String renderNode(TreeNode node) {
    Folder folder = (Folder) ((DefaultMutableTreeNode) node).getUserObject();
    Sequence sequence = ImageUtils.readSequence(folder.getFile());
    return new DisplaySequence(sequence, folder.getFile()).getTitle();
  }
View Full Code Here


    add(tree);
  }
 
  public MarkupContainer newNodeLink(MarkupContainer parent, String id, TreeNode node) {   
    PageParameters params = new PageParameters();
    Folder folder = (Folder)((DefaultMutableTreeNode)node).getUserObject();
    BookmarkablePageLink nodeLink = new BookmarkablePageLink(id, SequencePage.class, params);
    params.add("uri", imageUtils.getRelativePath(folder.getFile()));
    return nodeLink;
  }
View Full Code Here

  private void add(DefaultMutableTreeNode parent, List<Folder> sub)
  {
    for (Iterator<Folder> folderIt = sub.iterator(); folderIt.hasNext();)
    {
      Folder folder = folderIt.next();
      DefaultMutableTreeNode child = new DefaultMutableTreeNode(folder);
      parent.add(child);
      if (folder.getSubFolders() != null){
        add(child, folder.getSubFolders());
      }
    }
  }
View Full Code Here

          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"){
            @Override
            protected void onComponentTag(ComponentTag tag) {
              super.onComponentTag(tag);
              tag.put("href", imageUtils.getRelativePath(folder.getFile()));
            }
          });
          WebComponent image;
          link.add(image = new WebComponent("thumbnail"){
            @Override
            protected void onComponentTag(ComponentTag tag) {
              super.onComponentTag(tag);
              tag.put("src", urlFor(new ResourceReference(SequenceGridPanel.class, "images/folder.png")));
            }
          });
          String title = null;
          if (sequence != null){
            title = sequence.getTitle();
          }
          if (title == null){
            title = folder.getFile().getName();
          }
          link.add(new Label("thumbnailLabel", title));
        }
      } catch (IOException e) {
        throw new RuntimeException(e);
View Full Code Here

  @Override
  protected Panel getWestPanel(String id) {
    tree = new FolderTreePanel(id) {
      @Override
      public MarkupContainer newNodeLink(MarkupContainer parent, String id, TreeNode node) {
        final Folder folder = (Folder) ((DefaultMutableTreeNode) node).getUserObject();
        AjaxLink nodeLink = new AjaxLink(id) {

          @Override
          public void onClick(AjaxRequestTarget target) {
            panel.setImageDirectory(folder.getFile());
            target.addComponent(panel);
          }
        };

        return nodeLink;
View Full Code Here

    GMap2 gmap = new GMap2("gmap", settings.getGoogleKey());
//    gmap.ssetTypeControl(true);
//    gmap.setSmallMapControl(true);
   
    folders = new ArrayList<Folder>();
    Folder folder = imageUtils.getFolderFor(PickwickSession.get().getUser().getRoles());
    fillFolders(folder);
    String basePath = settings.getImageDirectoryRoot().getAbsolutePath();
    for (Folder current : folders){
     
      Sequence sequence = ImageUtils.readSequence(current.getFile());
View Full Code Here

        List<Role> roles = null;
        if (sequence != null){
          roles = sequence.getRoles();
        }
        if (PickwickAuthorization.isAuthorized(userRole, roles)){
          Folder current = new Folder(file);
          folderList.add(current);
        }
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
View Full Code Here

  /**
   * return a tree representation of the folders in imageDirectoryRoot
   * @return  a tree representation of the folders in imageDirectoryRoot
   */
  public Folder getFolder(){
    return new Folder(settings.getImageDirectoryRoot(), getSubFolder(this.settings.getImageDirectoryRoot(), null));
  }
View Full Code Here

  public Folder getFolder(){
    return new Folder(settings.getImageDirectoryRoot(), getSubFolder(this.settings.getImageDirectoryRoot(), null));
  }
 
  public Folder getFolderFor(List<Role> userRole){
    return new Folder(settings.getImageDirectoryRoot(), getSubFolder(this.settings.getImageDirectoryRoot(), userRole));
  }
View Full Code Here

          List<Role> roles = null;
          if (sequence != null){
            roles = sequence.getRoles();
          }
          if (PickwickAuthorization.isAuthorized(userRole, roles)){
            Folder current = new Folder(file);
            current.setSubFolders(getSubFolder(file, userRole));
            toReturn.add(current);
          }
        }
      }
      return toReturn;
View Full Code Here

TOP

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

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.