Examples of VirtualFilePointer


Examples of com.intellij.openapi.vfs.pointers.VirtualFilePointer

    private static class AdditionalPathListCellRenderer extends ColoredListCellRenderer {
        @Override
        protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) {
            if (value instanceof VirtualFilePointer) {
                VirtualFilePointer filePointer = (VirtualFilePointer) value;
                setIcon(PlatformIcons.DIRECTORY_CLOSED_ICON);
                append(filePointer.getPresentableUrl(), filePointer.isValid() ? SimpleTextAttributes.REGULAR_ATTRIBUTES : SimpleTextAttributes.ERROR_ATTRIBUTES, null);
            }
        }
View Full Code Here

Examples of com.intellij.openapi.vfs.pointers.VirtualFilePointer

    addFile(file.getUrl());
  }

  public void addFile(@NonNls final String url) {
    if (!StringUtil.isEmptyOrSpaces(url)) {
      final VirtualFilePointer filePointer = VirtualFilePointerManager.getInstance().create(url, this, null);
      files.add(filePointer);
    }
  }
View Full Code Here

Examples of com.intellij.openapi.vfs.pointers.VirtualFilePointer

        return true;
      }
    });

    for (Iterator<VirtualFilePointer> i = fileSet.getFiles().iterator(); i.hasNext(); ) {
      final VirtualFilePointer pointer = i.next();
      final VirtualFile file = pointer.getFile();
      if (file == null || !configured.contains(file)) {
        i.remove();
      }
    }
  }
View Full Code Here

Examples of com.intellij.openapi.vfs.pointers.VirtualFilePointer

            myBuffer.remove(fileSet);
          }
        }
      }
      else if (node instanceof ConfigFileNode) {
        final VirtualFilePointer filePointer = ((ConfigFileNode)node).myFilePointer;
        final StrutsFileSet fileSet = ((FileSetNode)node.getParent()).mySet;
        fileSet.removeFile(filePointer);
      }
    }
  }
View Full Code Here

Examples of com.intellij.openapi.vfs.pointers.VirtualFilePointer

    boolean useUserDefinedFields = !osgiRunConfiguration.isGenerateWorkingDir();
    myWorkingDirField.setText(osgiRunConfiguration.getWorkingDir());
    if (myWorkingDirField.getText().length() == 0) {
      final CompilerProjectExtension extension = CompilerProjectExtension.getInstance(myProject);
      if (extension != null) {
        final VirtualFilePointer outputDirPointer = extension.getCompilerOutputPointer();
        if (outputDirPointer != null) {
          myWorkingDirField.setText(VfsUtilCore.urlToPath(outputDirPointer.getUrl() + "/run.osgi/"));
        }
      }
    }

    myWorkingDirField.setEnabled(useUserDefinedFields);
View Full Code Here

Examples of com.intellij.openapi.vfs.pointers.VirtualFilePointer

   */
  @NotNull
  public static String getDefaultBundlesOutputPath(Project project) {
    CompilerProjectExtension instance = CompilerProjectExtension.getInstance(project);
    if (instance != null) {
      final VirtualFilePointer compilerOutput = instance.getCompilerOutputPointer();
      if (compilerOutput != null) {
        return VfsUtilCore.urlToPath(compilerOutput.getUrl()) + "/bundles";
      }
    }
    // this actually should never happen (only in tests)
    return FileUtil.getTempDirectory();
  }
View Full Code Here

Examples of com.intellij.openapi.vfs.pointers.VirtualFilePointer

  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.