protected HippoIcon getIcon(final String id, final Node node) throws RepositoryException { return IconRenderUtil.getDocumentOrFolderIcon(id, node, size); } }
return getIconForHandle(id, node, size); } else if (node.isNodeType(HippoNodeType.NT_DOCUMENT)) { if (node instanceof HippoNode) { return HippoIcon.fromSprite(id, Icon.FILE_TEXT, size); } else { return getIconForNodeType(id, node.getPrimaryNodeType(), Icon.FILE_TEXT, size); Node parent = node.getParent(); if (parent != null && parent.isNodeType(HippoNodeType.NT_HANDLE)) { return getIconForNodeType(id, node.getPrimaryNodeType(), Icon.FILE_TEXT, size);
private static HippoIcon getIconForHandle(final String id, final Node node, final IconSize size) throws RepositoryException { if (node.hasNode(node.getName())) { Node child = node.getNode(node.getName()); return getIconForNodeType(id, child.getPrimaryNodeType(), Icon.FILE_TEXT, size); } return HippoIcon.fromSprite(id, Icon.FILE_TEXT, size); }
public static HippoIcon getDocumentOrFolderIcon(final String id, final Node node) throws RepositoryException { return getDocumentOrFolderIcon(id, node, DEFAULT_SIZE); }
private HippoIcon getTypeIcon(final String id, final Node node) { try { return IconRenderUtil.getDocumentOrFolderIcon(id, node); } catch (RepositoryException e) { log.warn("Unable to determine icon for node '{}', using default icon instead", JcrUtils.getNodePathQuietly(node), e); return defaultTypeIcon(id); } }