Package org.damour.base.client.ui

Examples of org.damour.base.client.ui.ToolTip


    buildRepositoryTree(repositoryTreeNode, parentItem);
    buildingTree = false;
    if (createRootItem) {
      rootItem.setState(true);
      rootItemLabel.setText("/");
      new ToolTip(rootItemLabel, null, "File System");
      if (rootItem.getChildCount() == 0) {
        TreeItem hiddenItem = new TreeItem();
        rootItem.addItem(hiddenItem);
        new ToolTip(rootItemLabel, null, "File System (empty)");
        hiddenItem.setVisible(false);
      }
    }
    restoreTreeState();
  }
View Full Code Here


      RepositoryTreeNode treeNode = repositoryTreeNode.getFolders().get(folder);
      if (showOnlyFolders && treeNode.getFolders().size() == 0) {
        TreeItem hiddenItem = new TreeItem();
        folderItem.addItem(hiddenItem);
        String tooltip = folder.getDescription();
        new ToolTip(label, null, tooltip);
        hiddenItem.setVisible(false);
      } else if (treeNode.getFiles().size() == 0 && treeNode.getFolders().size() == 0) {
        TreeItem hiddenItem = new TreeItem();
        folderItem.addItem(hiddenItem);
        String tooltip = folder.getDescription() + " (empty)";
        new ToolTip(label, null, tooltip);
        hiddenItem.setVisible(false);
      } else {
        String tooltip = folder.getDescription();
        new ToolTip(label, null, tooltip);
        buildRepositoryTree(treeNode, folderItem);
      }
    }
    if (showOnlyFolders) {
      return;
    }
    // add files
    Collections.sort(repositoryTreeNode.getFiles(), new FileAlphaComparator(sortAToZ));
    for (File file : repositoryTreeNode.getFiles()) {
      Label treeItemLabel = new Label(file.getName());
      TreeItem fileItem = new TreeItem(treeItemLabel);
      if (!showHiddenFiles && file.isHidden()) {
        fileItem.setVisible(false);
      }
      NumberFormat formatter = NumberFormat.getFormat("#,###");
      String tooltip = "";
      tooltip += "Description: " + file.getDescription();
      tooltip += "<BR>";
      tooltip += "Type: " + file.getContentType();
      tooltip += "<BR>";
      tooltip += "Date Created: " + (new Date(file.getCreationDate()).toLocaleString());
      tooltip += "<BR>";
      tooltip += "Last Modified: " + (new Date(file.getLastModifiedDate()).toLocaleString());
      tooltip += "<BR>";
      tooltip += "Owner: " + file.getOwner().getUsername();
      tooltip += "<BR>";
      tooltip += "Size: " + formatter.format(file.getSize()) + " bytes";

      String thumbnailImageURL = null;
      if (file instanceof Photo) {
        Photo photo = (Photo) file;
        if (photo.getThumbnailImage() != null) {
          thumbnailImageURL = BaseApplication.getSettings().getString("GetFileService", BaseApplication.GET_FILE_SERVICE_PATH) + photo.getThumbnailImage().getId() + "_inline_" + photo.getName();
        }
      }
      new ToolTip(treeItemLabel, thumbnailImageURL, tooltip);
      fileItem.setUserObject(file);
      if (parentItem != null) {
        parentItem.addItem(fileItem);
      } else if (createRootItem) {
        rootItem.addItem(fileItem);
View Full Code Here

TOP

Related Classes of org.damour.base.client.ui.ToolTip

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.