protected List getChildNodes() { if (myChildren == null) { myChildren = new ArrayList<>(); VFile[] projectFiles = myProjectFiles; Arrays.sort(projectFiles); for (VFile projectFile : projectFiles) { if (myShowReadOnly || projectFile.isWritable()) { myChildren.add(new FileNode(this, projectFile)); } } } return myChildren; }
private String getExtension() { final String contentPath = myVFile.getFullPath(); if (contentPath != null) { int i = contentPath.lastIndexOf('.'); if (i > 0) { return contentPath.substring(i + 1); } } return "none"; }
protected Component renderIn(JLabel label, boolean selected, boolean hasFocus) { if (myVFile.isWritable()) { label.setIcon(getIconByExtension()); } else { LayeredIcon layeredIcon = new LayeredIcon(2); layeredIcon.setIcon(getIconByExtension(), 0); layeredIcon.setIcon(AllIcons.Nodes.Locked, 1); label.setIcon(layeredIcon); } return label; }
public String toString() { String path = myVFile.getContentPath(); return path == null ? myVFile.getFullPath() : path; }