Java Code Examples for com.intellij.openapi.vcs.FileStatus#UNKNOWN
The following examples show how to use
com.intellij.openapi.vcs.FileStatus#UNKNOWN .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TfsFileUtil.java From azure-devops-intellij with MIT License | 6 votes |
/** * Recursively look for files that have a status UNKNOWN * * @param files * @param fileStatusManager * @return */ public static boolean findUnknownFiles(final VirtualFile[] files, final FileStatusManager fileStatusManager) { for (VirtualFile file : files) { // if directory then check children if (file.isDirectory()) { if (findUnknownFiles(file.getChildren(), fileStatusManager)) { return true; } } else { final FileStatus fileStatus = fileStatusManager.getStatus(file); if (fileStatus == FileStatus.UNKNOWN) { return true; } } } return false; }
Example 2
Source File: LineStatusTrackerManager.java From consulo with Apache License 2.0 | 6 votes |
private boolean shouldBeInstalled(@javax.annotation.Nullable final VirtualFile virtualFile) { if (isDisabled()) return false; if (virtualFile == null || virtualFile instanceof LightVirtualFile) return false; final FileStatusManager statusManager = FileStatusManager.getInstance(myProject); if (statusManager == null) return false; if (!myStatusProvider.isSupported(virtualFile)) { log("shouldBeInstalled failed: no support found", virtualFile); return false; } final FileStatus status = statusManager.getStatus(virtualFile); if (status == FileStatus.NOT_CHANGED || status == FileStatus.ADDED || status == FileStatus.UNKNOWN || status == FileStatus.IGNORED) { log("shouldBeInstalled skipped: status=" + status, virtualFile); return false; } return true; }
Example 3
Source File: P4Vcs.java From p4ic4idea with Apache License 2.0 | 5 votes |
/** * Returns true if the specified file path represents a file which exists in the VCS repository (is neither * unversioned nor scheduled for addition). * This method is called only for directories which are mapped to this VCS in the project configuration. * * @param path the path to check. * @return true if the corresponding file exists in the repository, false otherwise. */ @Override public boolean fileExistsInVcs(FilePath path) { // TODO if this ends up being called as we expect, then delete this overridden method. final VirtualFile virtualFile = path.getVirtualFile(); if (virtualFile != null) { final FileStatus fileStatus = FileStatusManager.getInstance(myProject).getStatus(virtualFile); LOG.info("Checking if file exists in VCS; if so, then it will use the `VcsHandleType` to edit the file. File: [" + path + "]; status: " + fileStatus); return fileStatus != FileStatus.UNKNOWN && fileStatus != FileStatus.ADDED; } return true; }
Example 4
Source File: FileEditorManagerImpl.java From consulo with Apache License 2.0 | 5 votes |
@Override public boolean isChanged(@Nonnull final EditorComposite editor) { final FileStatusManager fileStatusManager = FileStatusManager.getInstance(myProject); if (fileStatusManager == null) return false; FileStatus status = fileStatusManager.getStatus(editor.getFile()); return status != FileStatus.UNKNOWN && status != FileStatus.NOT_CHANGED; }