mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-170942 vcs: use background color from scope for non-existent files
This commit is contained in:
@@ -700,10 +700,10 @@ public abstract class ChangesTree extends Tree implements DataProvider {
|
||||
public Color getFileColorFor(Object object) {
|
||||
VirtualFile file;
|
||||
if (object instanceof FilePath) {
|
||||
file = ((FilePath)object).getVirtualFile();
|
||||
file = getVirtualFileFor((FilePath)object);
|
||||
}
|
||||
else if (object instanceof Change) {
|
||||
file = ((Change)object).getVirtualFile();
|
||||
file = getVirtualFileFor(ChangesUtil.getFilePath((Change)object));
|
||||
}
|
||||
else {
|
||||
file = ObjectUtils.tryCast(object, VirtualFile.class);
|
||||
@@ -715,6 +715,12 @@ public abstract class ChangesTree extends Tree implements DataProvider {
|
||||
return super.getFileColorFor(object);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static VirtualFile getVirtualFileFor(@NotNull FilePath filePath) {
|
||||
if (filePath.isNonLocal()) return null;
|
||||
return ChangesUtil.findValidParentAccurately(filePath);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processMouseEvent(MouseEvent e) {
|
||||
if (e.getID() == MouseEvent.MOUSE_PRESSED) {
|
||||
|
||||
Reference in New Issue
Block a user