Java Code Examples for com.intellij.openapi.vcs.FileStatus#NOT_CHANGED
The following examples show how to use
com.intellij.openapi.vcs.FileStatus#NOT_CHANGED .
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: DefaultInspectionToolPresentation.java From consulo with Apache License 2.0 | 6 votes |
@Override @Nonnull public FileStatus getProblemStatus(@Nonnull final CommonProblemDescriptor descriptor) { final GlobalInspectionContextImpl context = getContext(); if (!isDisposed() && context.getUIOptions().SHOW_DIFF_WITH_PREVIOUS_RUN){ if (myOldProblemElements != null){ final Set<CommonProblemDescriptor> allAvailable = new HashSet<CommonProblemDescriptor>(); for (CommonProblemDescriptor[] descriptors : myOldProblemElements.values()) { if (descriptors != null) { ContainerUtil.addAll(allAvailable, descriptors); } } final boolean old = containsDescriptor(descriptor, allAvailable); final boolean current = containsDescriptor(descriptor, getProblemToElements().keySet()); return calcStatus(old, current); } } return FileStatus.NOT_CHANGED; }
Example 2
Source File: ReplaceFileConfirmationDialog.java From consulo with Apache License 2.0 | 6 votes |
public Collection<VirtualFile> collectModifiedFiles(VirtualFile[] files) { ArrayList<VirtualFile> result = new ArrayList<VirtualFile>(); if (files == null) return result; for (int i = 0; i < files.length; i++) { VirtualFile file = files[i]; if (myProgressIndicator != null) { myProgressIndicator.setText(VcsBundle.message("progress.text.searching.for.modified.files")); myProgressIndicator.setText2(file.getPresentableUrl()); } FileStatus status = myFileStatusManager.getStatus(file); if (status != FileStatus.NOT_CHANGED) { result.add(file); if (result.size() > 1) return result; } result.addAll(collectModifiedFiles(file.getChildren())); } return result; }
Example 3
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 4
Source File: VirtualFileListCellRenderer.java From consulo with Apache License 2.0 | 6 votes |
protected FileStatus getStatus(Object value, FilePath path) { final FileStatus fileStatus; if (value instanceof Change) { fileStatus = ((Change) value).getFileStatus(); } else { final VirtualFile virtualFile = path.getVirtualFile(); if (virtualFile != null) { fileStatus = myFileStatusManager.getStatus(virtualFile); } else { fileStatus = FileStatus.NOT_CHANGED; } } return fileStatus; }
Example 5
Source File: DefaultInspectionToolPresentation.java From consulo with Apache License 2.0 | 6 votes |
@Override public boolean hasReportedProblems() { final GlobalInspectionContextImpl context = getContext(); if (!isDisposed() && context.getUIOptions().SHOW_ONLY_DIFF) { for (CommonProblemDescriptor descriptor : getProblemToElements().keySet()) { if (getProblemStatus(descriptor) != FileStatus.NOT_CHANGED) { return true; } } if (myOldProblemElements != null) { for (RefEntity entity : myOldProblemElements.keySet()) { if (getElementStatus(entity) != FileStatus.NOT_CHANGED) { return true; } } } return false; } if (!getProblemElements().isEmpty()) return true; return !isDisposed() && context.getUIOptions().SHOW_DIFF_WITH_PREVIOUS_RUN && myOldProblemElements != null && !myOldProblemElements.isEmpty(); }
Example 6
Source File: DefaultInspectionToolPresentation.java From consulo with Apache License 2.0 | 5 votes |
@Nonnull @Override public FileStatus getElementStatus(final RefEntity element) { final GlobalInspectionContextImpl context = getContext(); if (!isDisposed() && context.getUIOptions().SHOW_DIFF_WITH_PREVIOUS_RUN){ if (myOldProblemElements != null){ final boolean old = RefUtil.contains(element, myOldProblemElements.keySet()); final boolean current = RefUtil.contains(element, getProblemElements().keySet()); return calcStatus(old, current); } } return FileStatus.NOT_CHANGED; }
Example 7
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; }
Example 8
Source File: FileStatusManagerImpl.java From consulo with Apache License 2.0 | 5 votes |
@Nonnull @Override public FileStatus getRecursiveStatus(@Nonnull VirtualFile file) { FileStatus status = super.getRecursiveStatus(file); if (status != FileStatus.NOT_CHANGED || !file.isValid() || !file.isDirectory()) return status; Boolean immediate = myWhetherExactlyParentToChanged.get(file); if (immediate == null) return status; return immediate ? FileStatus.NOT_CHANGED_IMMEDIATE : FileStatus.NOT_CHANGED_RECURSIVE; }
Example 9
Source File: NavigationItemFileStatus.java From consulo with Apache License 2.0 | 5 votes |
public static FileStatus get(NavigationItem item) { if (item instanceof PsiElement) { return getPsiElementFileStatus((PsiElement)item); } if (item instanceof AbstractTreeNode) { return ((AbstractTreeNode) item).getFileStatus(); } if (item instanceof PsiElementNavigationItem) { PsiElement target = ((PsiElementNavigationItem) item).getTargetElement(); if (target != null) return getPsiElementFileStatus(target); } return FileStatus.NOT_CHANGED; }
Example 10
Source File: NavigationItemFileStatus.java From consulo with Apache License 2.0 | 5 votes |
private static FileStatus getPsiElementFileStatus(PsiElement psiElement) { if (!psiElement.isPhysical()) return FileStatus.NOT_CHANGED; PsiFile contFile = psiElement.getContainingFile(); if (contFile == null) return FileStatus.NOT_CHANGED; VirtualFile vFile = contFile.getVirtualFile(); return vFile != null ? FileStatusManager.getInstance(psiElement.getProject()).getStatus(vFile) : FileStatus.NOT_CHANGED; }
Example 11
Source File: VirtualFileListCellRenderer.java From consulo with Apache License 2.0 | 5 votes |
@Override protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) { final FilePath path = TreeModelBuilder.getPathForObject(value); renderIcon(path); final FileStatus fileStatus = myIgnoreFileStatus ? FileStatus.NOT_CHANGED : getStatus(value, path); append(getName(path), new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, fileStatus.getColor(), null)); putParentPath(value, path, path); }
Example 12
Source File: ProblemDescriptionNode.java From consulo with Apache License 2.0 | 5 votes |
@Override public FileStatus getNodeStatus() { if (myElement instanceof RefElement){ return getPresentation().getProblemStatus(myDescriptor); } return FileStatus.NOT_CHANGED; }
Example 13
Source File: InspectionTreeNode.java From consulo with Apache License 2.0 | 4 votes |
public FileStatus getNodeStatus(){ return FileStatus.NOT_CHANGED; }
Example 14
Source File: AbstractPsiBasedNode.java From consulo with Apache License 2.0 | 4 votes |
protected static FileStatus computeFileStatus(@Nullable VirtualFile virtualFile, @Nonnull Project project) { if (virtualFile == null) { return FileStatus.NOT_CHANGED; } return FileStatusManager.getInstance(project).getStatus(virtualFile); }
Example 15
Source File: DocumentationManager.java From consulo with Apache License 2.0 | 4 votes |
@Nonnull private static String getVcsStatus(Project project, VirtualFile file) { FileStatus status = ChangeListManager.getInstance(project).getStatus(file); return status != FileStatus.NOT_CHANGED ? "<p><span class='grayed'>VCS Status:</span> <span color='" + ColorUtil.toHex(status.getColor()) + "'>" + status.getText() + "</span>" : ""; }
Example 16
Source File: OfflineProblemDescriptorNode.java From consulo with Apache License 2.0 | 4 votes |
@Override public FileStatus getNodeStatus() { return FileStatus.NOT_CHANGED; }
Example 17
Source File: ChangesBrowserFileNode.java From consulo with Apache License 2.0 | 4 votes |
@Override protected boolean isDirectory() { return getUserObject().isDirectory() && (isLeaf() || FileStatusManager.getInstance(myProject).getStatus(getUserObject()) != FileStatus.NOT_CHANGED); }
Example 18
Source File: FileStatusManagerImpl.java From consulo with Apache License 2.0 | 4 votes |
@Nonnull public static FileStatus getDefaultStatus(@Nonnull final VirtualFile file) { return file.isValid() && file.is(VFileProperty.SPECIAL) ? FileStatus.IGNORED : FileStatus.NOT_CHANGED; }
Example 19
Source File: AbstractTreeNode.java From consulo with Apache License 2.0 | 4 votes |
public FileStatus getFileStatus() { return FileStatus.NOT_CHANGED; }
Example 20
Source File: SimpleNode.java From consulo with Apache License 2.0 | 4 votes |
private FileStatus getFileStatus() { return FileStatus.NOT_CHANGED; }