use of com.intellij.openapi.vcs.FileStatus in project intellij-community by JetBrains.
the class SvnIgnoreTest method testImpl.
private void testImpl(VirtualFile file) {
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
Assert.assertTrue(clManager.getDefaultChangeList().getChanges().isEmpty());
VcsDirtyScopeManager.getInstance(myProject).fileDirty(file);
clManager.ensureUpToDate(false);
Assert.assertTrue(clManager.getDefaultChangeList().getChanges().isEmpty());
final FileStatus status = clManager.getStatus(file);
Assert.assertTrue(status.getText(), FileStatus.IGNORED.equals(status));
}
use of com.intellij.openapi.vcs.FileStatus in project intellij-community by JetBrains.
the class InspectionTreeCellRenderer method getMainForegroundAttributes.
private static SimpleTextAttributes getMainForegroundAttributes(InspectionTreeNode node) {
SimpleTextAttributes foreground = SimpleTextAttributes.REGULAR_ATTRIBUTES;
if (node instanceof RefElementNode) {
RefEntity refElement = ((RefElementNode) node).getElement();
if (refElement instanceof RefElement) {
refElement = ((RefElement) refElement).getContainingEntry();
if (((RefElement) refElement).isEntry() && ((RefElement) refElement).isPermanentEntry()) {
foreground = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.blue);
}
}
}
final FileStatus nodeStatus = node.getNodeStatus();
if (nodeStatus != FileStatus.NOT_CHANGED) {
foreground = new SimpleTextAttributes(foreground.getBgColor(), nodeStatus.getColor(), foreground.getWaveColor(), foreground.getStyle());
}
return foreground;
}
use of com.intellij.openapi.vcs.FileStatus in project intellij-community by JetBrains.
the class ChangeListTodosTreeStructure method accept.
@Override
public boolean accept(final PsiFile psiFile) {
if (!psiFile.isValid())
return false;
VirtualFile file = psiFile.getVirtualFile();
ChangeListManager listManager = ChangeListManager.getInstance(myProject);
FileStatus status = listManager.getStatus(file);
if (status == FileStatus.NOT_CHANGED)
return false;
FilePath filePath = VcsUtil.getFilePath(file);
final Collection<Change> changes = listManager.getDefaultChangeList().getChanges();
for (Change change : changes) {
ContentRevision afterRevision = change.getAfterRevision();
if (afterRevision != null && afterRevision.getFile().equals(filePath)) {
return (myTodoFilter != null && myTodoFilter.accept(mySearchHelper, psiFile) || (myTodoFilter == null && mySearchHelper.getTodoItemsCount(psiFile) > 0));
}
}
return false;
}
use of com.intellij.openapi.vcs.FileStatus in project intellij-community by JetBrains.
the class PsiChangeTracker method getElementsChanged.
public static <T extends PsiElement> Map<T, FileStatus> getElementsChanged(PsiElement file, PsiElement oldFile, final PsiFilter<T> filter) {
final HashMap<T, FileStatus> result = new HashMap<>();
final List<T> oldElements = new ArrayList<>();
final List<T> elements = new ArrayList<>();
if (file == null) {
oldFile.accept(filter.createVisitor(oldElements));
calculateStatuses(elements, oldElements, result, filter);
return result;
}
final Project project = file.getProject();
file.accept(filter.createVisitor(elements));
final VirtualFile vf = file.getContainingFile().getVirtualFile();
FileStatus status = vf == null ? null : FileStatusManager.getInstance(project).getStatus(vf);
if (status == null && oldFile == null) {
status = FileStatus.ADDED;
}
if (status == FileStatus.ADDED || status == FileStatus.DELETED || status == FileStatus.DELETED_FROM_FS || status == FileStatus.UNKNOWN) {
for (T element : elements) {
result.put(element, status);
}
return result;
}
if (oldFile == null)
return result;
oldFile.accept(filter.createVisitor(oldElements));
calculateStatuses(elements, oldElements, result, filter);
return result;
}
use of com.intellij.openapi.vcs.FileStatus in project intellij-community by JetBrains.
the class FileStatusColorsPageFactory method collectFileTypes.
private static Collection<String> collectFileTypes() {
ArrayList<String> result = new ArrayList<>();
FileStatus[] statuses = FileStatusFactory.getInstance().getAllFileStatuses();
for (FileStatus status : statuses) {
result.add(status.getText());
}
return result;
}
Aggregations