Examples of LightFilePointer


Examples of com.intellij.openapi.roots.ui.LightFilePointer

  }

  public static CellAppearance forVirtualFile(VirtualFile virtualFile) {
    return virtualFile.isValid() ?
           forValidVirtualFile(virtualFile) :
           forInvalidVirtualFilePointer(new LightFilePointer(virtualFile.getUrl()));
  }
View Full Code Here

Examples of com.intellij.openapi.roots.ui.LightFilePointer

    String[] files = library.getUrls(OrderRootType.CLASSES);
    if (files.length == 0) {
      return SimpleTextCellAppearance.invalid(ProjectBundle.message("library.empty.library.item"), Icons.LIBRARY_ICON);
    }
    if (files.length == 1) {
      return forVirtualFilePointer(new LightFilePointer(files[0]));
    }
    String url = files[0];
    if (url.endsWith(JarFileSystem.JAR_SEPARATOR)) {
      url = url.substring(0, url.length() - JarFileSystem.JAR_SEPARATOR.length());
    }
View Full Code Here

Examples of com.intellij.openapi.roots.ui.LightFilePointer

  public static CellAppearance forModule(Module module) {
    return SimpleTextCellAppearance.normal(module.getName(), IconUtilEx.getIcon(module, 0));
  }

  public static CellAppearance forContentEntry(ContentEntry contentEntry) {
    return forVirtualFilePointer(new LightFilePointer(contentEntry.getUrl()));
  }
View Full Code Here

Examples of com.intellij.openapi.roots.ui.LightFilePointer

  public static CellAppearance forContentEntry(ContentEntry contentEntry) {
    return forVirtualFilePointer(new LightFilePointer(contentEntry.getUrl()));
  }

  public static SimpleTextCellAppearance formatRelativePath(ContentFolder folder, Icon icon) {
    VirtualFilePointer contentFile = new LightFilePointer(folder.getContentEntry().getUrl());
    VirtualFilePointer folderFile = new LightFilePointer(folder.getUrl());
    if (!contentFile.isValid()) return forInvalidVirtualFilePointer(folderFile);
    String contentPath = contentFile.getFile().getPath();
    char separator = File.separatorChar;
    String relativePath;
    SimpleTextAttributes textAttributes;
    if (!folderFile.isValid()) {
      textAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES;
      String absolutePath = folderFile.getPresentableUrl();
      relativePath =
      absolutePath.startsWith(contentPath) ? absolutePath.substring(contentPath.length()) : absolutePath;
    }
    else {
      relativePath = VfsUtil.getRelativePath(folderFile.getFile(), contentFile.getFile(), separator);
      textAttributes = SimpleTextAttributes.REGULAR_ATTRIBUTES;
    }
    if (relativePath == null) relativePath = "";
    relativePath = relativePath.length() == 0 ? "." + File.separatorChar : relativePath;
    return new SimpleTextCellAppearance(relativePath, icon, textAttributes);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.