当前位置: 首页>>代码示例>>Java>>正文


Java FilePath.isDirectory方法代码示例

本文整理汇总了Java中com.intellij.openapi.vcs.FilePath.isDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java FilePath.isDirectory方法的具体用法?Java FilePath.isDirectory怎么用?Java FilePath.isDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.vcs.FilePath的用法示例。


在下文中一共展示了FilePath.isDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
public void run() {
  // if put directly into dirty scope, to access a copy will be created every time
  final Set<FilePath> files = myIn.getDirtyFilesNoExpand();

  for (FilePath file : files) {
    if (file.isDirectory()) {
      final VirtualFile vFile = file.getVirtualFile();
      // todo take care about this 'not valid' - right now keeping things as they used to be
      final MyDirNonRecursive me = createOrGet(file);
      if (vFile != null && vFile.isValid()) {
        for (VirtualFile child : vFile.getChildren()) {
          me.add(VcsUtil.getFilePath(child));
        }
      }
    }
    else {
      final FilePath parent = file.getParentPath();
      if (parent != null) {
        final MyDirNonRecursive item = createOrGet(parent);
        item.add(file);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:SvnScopeZipper.java

示例2: render

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
@Override
public void render(final ChangesBrowserNodeRenderer renderer, final boolean selected, final boolean expanded, final boolean hasFocus) {
  final FilePath path = (FilePath)userObject;
  if (path.isDirectory() || !isLeaf()) {
    renderer.append(getRelativePath(safeCastToFilePath(((ChangesBrowserNode)getParent()).getUserObject()), path),
           SimpleTextAttributes.REGULAR_ATTRIBUTES);
    if (!isLeaf()) {
      appendCount(renderer);
    }
    renderer.setIcon(PlatformIcons.DIRECTORY_CLOSED_ICON);
  }
  else {
    if (renderer.isShowFlatten()) {
      renderer.append(path.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
      FilePath parentPath = path.getParentPath();
      renderer.append(spaceAndThinSpace() + FileUtil.getLocationRelativeToUserHome(parentPath.getPresentableUrl()), SimpleTextAttributes.GRAYED_ATTRIBUTES);
    }
    else {
      renderer.append(getRelativePath(safeCastToFilePath(((ChangesBrowserNode)getParent()).getUserObject()), path),
                      SimpleTextAttributes.REGULAR_ATTRIBUTES);
    }
    renderer.setIcon(path.getFileType().getIcon());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ChangesBrowserFilePathNode.java

示例3: createParentRevision

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
@NotNull
private GitFileRevision createParentRevision(@NotNull GitRepository repository, @NotNull GitFileRevision currentRevision,
                                             @NotNull String parentHash) throws VcsException {
  FilePath currentRevisionPath = currentRevision.getPath();
  if (currentRevisionPath.isDirectory()) {
    // for directories the history doesn't follow renames
    return makeRevisionFromHash(currentRevisionPath, parentHash);
  }

  // can't limit by the path: in that case rename information will be missed
  Collection<Change> changes = GitChangeUtils.getDiff(myProject, repository.getRoot(), parentHash, currentRevision.getHash(), null);
  for (Change change : changes) {
    ContentRevision afterRevision = change.getAfterRevision();
    ContentRevision beforeRevision = change.getBeforeRevision();
    if (afterRevision != null && afterRevision.getFile().equals(currentRevisionPath)) {
      // if the file was renamed, taking the path how it was in the parent; otherwise the path didn't change
      FilePath path = (beforeRevision != null ? beforeRevision.getFile() : afterRevision.getFile());
      return new GitFileRevision(myProject, path, new GitRevisionNumber(parentHash));
    }
  }
  LOG.error(String.format("Could not find parent revision. Will use the path from parent revision. Current revision: %s, parent hash: %s",
                          currentRevision, parentHash));
  return makeRevisionFromHash(currentRevisionPath, parentHash);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:GitDiffFromHistoryHandler.java

示例4: getTitle

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
@NotNull
public static String getTitle(@NotNull FilePath path1, @NotNull FilePath path2, @NotNull String separator) {
  if ((path1.isDirectory() || path2.isDirectory()) && path1.getPath().equals(path2.getPath())) return path1.getPath();
  if (path1.isDirectory() ^ path2.isDirectory()) return getContentTitle(path1) + " vs " + getContentTitle(path2);

  FilePath parent1 = path1.getParentPath();
  FilePath parent2 = path2.getParentPath();
  return getRequestTitle(path1.getName(), path1.getPath(), parent1 != null ? parent1.getPath() : null,
                         path2.getName(), path2.getPath(), parent2 != null ? parent2.getPath() : null,
                         separator);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:DiffRequestFactoryImpl.java

示例5: renderIcon

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
@Override
protected void renderIcon(FilePath path) {
  final String module = myModules.get(path.getVirtualFile());
  if (module != null) {
    setIcon(PlatformIcons.CONTENT_ROOT_ICON_CLOSED);
  }
  else {
    if (path.isDirectory()) {
      setIcon(PlatformIcons.DIRECTORY_CLOSED_ICON);
    }
    else {
      setIcon(path.getFileType().getIcon());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:VcsStructureChooser.java

示例6: processStatusFirstPass

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
void processStatusFirstPass(@NotNull FilePath filePath, @NotNull Status status) throws SVNException {
  if (status.getRemoteLock() != null) {
    myChangelistBuilder.processLogicallyLockedFolder(filePath.getVirtualFile(), status.getRemoteLock().toLogicalLock(false));
  }
  if (status.getLocalLock() != null) {
    myChangelistBuilder.processLogicallyLockedFolder(filePath.getVirtualFile(), status.getLocalLock().toLogicalLock(true));
  }
  if (filePath.isDirectory() && status.isLocked()) {
    myChangelistBuilder.processLockedFolder(filePath.getVirtualFile());
  }
  if ((status.is(StatusType.STATUS_ADDED) || StatusType.STATUS_MODIFIED.equals(status.getNodeStatus())) &&
      status.getCopyFromURL() != null) {
    addCopiedFile(filePath, status, status.getCopyFromURL());
  }
  else if (status.is(StatusType.STATUS_DELETED)) {
    myDeletedFiles.add(new SvnChangedFile(filePath, status));
  }
  else {
    String parentCopyFromURL = getParentCopyFromURL(filePath);
    if (parentCopyFromURL != null) {
      addCopiedFile(filePath, status, parentCopyFromURL);
    }
    else {
      processStatus(filePath, status);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:SvnChangeProviderContext.java

示例7: getCvsConnectionSettings

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
public static CvsConnectionSettings getCvsConnectionSettings(FilePath path){
  VirtualFile virtualFile = path.getVirtualFile();
  if (virtualFile == null || !path.isDirectory()){
    return CvsEntriesManager.getInstance().getCvsConnectionSettingsFor(path.getVirtualFileParent());
  } else {
    return CvsEntriesManager.getInstance().getCvsConnectionSettingsFor(virtualFile);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:CvsUtil.java

示例8: staticFrom

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
private static StaticFilePath staticFrom(final FilePath fp) {
  final String path = fp.getPath();
  if (fp.isNonLocal() && (! FileUtil.isAbsolute(path) || VcsUtil.isPathRemote(path))) {
    return new StaticFilePath(fp.isDirectory(), fp.getIOFile().getPath().replace('\\', '/'), fp.getVirtualFile());
  }
  return new StaticFilePath(fp.isDirectory(), new File(fp.getIOFile().getPath().replace('\\', '/')).getAbsolutePath(), fp.getVirtualFile());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:TreeModelBuilder.java

示例9: renderIcon

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
protected void renderIcon(FilePath path) {
  if (path.isDirectory()) {
    setIcon(PlatformIcons.DIRECTORY_CLOSED_ICON);
  } else {
    setIcon(path.getFileType().getIcon());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:VirtualFileListCellRenderer.java

示例10: SvnIntegratePanel

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
public SvnIntegratePanel(final SvnVcs vcs, Collection<FilePath> roots) {
  super(vcs);
  init(roots);

  boolean descend = false;
  for (FilePath root : roots) {
    if (root.isDirectory()) {
      descend = true;
      break;
    }
  }
  myDepthCombo.setVisible(descend);
  myDepthLabel.setVisible(descend);
  myDepthLabel.setLabelFor(myDepthCombo);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:SvnIntegratePanel.java

示例11: canCreateRequest

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
public static boolean canCreateRequest(Change change) {
  if (ChangesUtil.isTextConflictingChange(change) || change.isTreeConflict() || change.isPhantom()) return false;
  if (ShowDiffAction.isBinaryChange(change)) return false;
  final FilePath filePath = ChangesUtil.getFilePath(change);
  if (filePath.isDirectory()) return false;
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:FragmentedDiffRequestFromChange.java

示例12: markFilesDirty

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
public static void markFilesDirty(@NotNull Project project, @NotNull List<FilePath> affectedFiles) {
  final VcsDirtyScopeManager dirty = VcsDirtyScopeManager.getInstance(project);
  for (FilePath file : affectedFiles) {
    if (file.isDirectory()) {
      dirty.dirDirtyRecursively(file);
    }
    else {
      dirty.fileDirty(file);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:VcsFileUtil.java

示例13: addFile

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
private void addFile(FilePath file, CvsConfiguration cvsConfiguration) {
  final CheckoutFileOperation operation =
    new CheckoutFileOperation(file.getVirtualFileParent(), cvsConfiguration, file.getName(),
                              CvsEntriesManager.getInstance().getEntryFor(file.getVirtualFileParent(), file.getName()),
                              cvsConfiguration.MAKE_NEW_FILES_READONLY, file.isDirectory());
  addOperation(operation);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:CheckoutFilesOperation.java

示例14: loadEntriesFile

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
/**
 * Ensures that the contents of the 'entries' file is cached in the VFS, so that the VFS will send
 * correct events when the 'entries' file is changed externally (to be received by SvnEntriesFileListener)
 *
 * @param filePath the path of a changed file.
 */
private void loadEntriesFile(@NotNull FilePath filePath) {
  final FilePath parentPath = filePath.getParentPath();
  if (parentPath == null) {
    return;
  }
  refreshDotSvnAndEntries(parentPath);
  if (filePath.isDirectory()) {
    refreshDotSvnAndEntries(filePath);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:SvnChangeProviderContext.java

示例15: getModuleName

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
public static String getModuleName(FilePath path) {
  if (path.isDirectory()) {
    return CvsEntriesManager.getInstance().getRepositoryFor(path.getVirtualFile());
  } else {
    return CvsEntriesManager.getInstance().getRepositoryFor(path.getVirtualFileParent()) + "/" + path.getName();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:CvsUtil.java


注:本文中的com.intellij.openapi.vcs.FilePath.isDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。