Cleanup (warnings; typos; formatting)

GitOrigin-RevId: 7c0d00bb4421dbd80cf1d7c8ccea59531a6dcda1
This commit is contained in:
Roman Shevchenko
2019-08-22 01:50:10 +03:00
committed by intellij-monorepo-bot
parent 811d1cbbe7
commit 2aa816fb81
3 changed files with 20 additions and 33 deletions
@@ -58,18 +58,20 @@ public class PsiFileNode extends BasePsiNode<PsiFile> implements NavigatableWith
@Override
protected void updateImpl(@NotNull PresentationData data) {
PsiFile value = getValue();
data.setPresentableText(value.getName());
data.setIcon(value.getIcon(Iconable.ICON_FLAG_READ_STATUS));
if (value != null) {
data.setPresentableText(value.getName());
data.setIcon(value.getIcon(Iconable.ICON_FLAG_READ_STATUS));
VirtualFile file = getVirtualFile();
if (file != null && file.is(VFileProperty.SYMLINK)) {
String target = file.getCanonicalPath();
if (target == null) {
data.setAttributesKey(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES);
data.setTooltip(IdeBundle.message("node.project.view.bad.link"));
}
else {
data.setTooltip(FileUtil.toSystemDependentName(target));
VirtualFile file = getVirtualFile();
if (file != null && file.is(VFileProperty.SYMLINK)) {
String target = file.getCanonicalPath();
if (target == null) {
data.setAttributesKey(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES);
data.setTooltip(IdeBundle.message("node.project.view.bad.link"));
}
else {
data.setTooltip(FileUtil.toSystemDependentName(target));
}
}
}
}
@@ -126,11 +128,7 @@ public class PsiFileNode extends BasePsiNode<PsiFile> implements NavigatableWith
@Override
public String getTitle() {
VirtualFile file = getVirtualFile();
if (file != null) {
return FileUtil.getLocationRelativeToUserHome(file.getPresentableUrl());
}
return super.getTitle();
return file != null ? FileUtil.getLocationRelativeToUserHome(file.getPresentableUrl()) : super.getTitle();
}
@Override
@@ -139,7 +137,7 @@ public class PsiFileNode extends BasePsiNode<PsiFile> implements NavigatableWith
}
@Override
public Comparable getTypeSortKey() {
public Comparable<ExtensionSortKey> getTypeSortKey() {
String extension = extension(getValue());
return extension == null ? null : new ExtensionSortKey(extension);
}
@@ -156,18 +154,16 @@ public class PsiFileNode extends BasePsiNode<PsiFile> implements NavigatableWith
return null;
}
public static class ExtensionSortKey implements Comparable {
public static class ExtensionSortKey implements Comparable<ExtensionSortKey> {
private final String myExtension;
public ExtensionSortKey(final String extension) {
public ExtensionSortKey(@NotNull String extension) {
myExtension = extension;
}
@Override
public int compareTo(final Object o) {
if (!(o instanceof ExtensionSortKey)) return 0;
ExtensionSortKey rhs = (ExtensionSortKey) o;
return myExtension.compareTo(rhs.myExtension);
public int compareTo(ExtensionSortKey o) {
return o == null ? 0 : myExtension.compareTo(o.myExtension);
}
}
@@ -1,7 +1,6 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.util.ui;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.ui.UIBundle;
@@ -13,13 +12,6 @@ public class SelectDateDialog extends DialogWrapper {
private CalendarView myCalendarView;
private JPanel myPanel;
public SelectDateDialog(Project project) {
super(project, true);
init();
setTitle(UIBundle.message("date.dialog.title"));
pack();
}
public SelectDateDialog(Component component) {
super(component, true);
init();
@@ -61,14 +61,13 @@ date.format.n.hours.ago={0,choice, 0#zero hours|1#one hour|2#{0,number} hours} a
date.format.n.months.ago={0,choice, 0#zero months|1#one month|2#{0,number} months} ago
date.format.n.weeks.ago={0,choice, 0#zero weeks|1#one week|2#{0,number} weeks} ago
date.format.n.years.ago={0,choice, 0#zero years|1#one year|2#{0,number} years} ago
date.frequency=Once {0}
failed.to.make.the.following.files.writable.error.message=Failed to make the following files writable:{0}
failed.to.make.file.writable.error.message=Failed to make {0} writable.
error.reading.color.scheme.from.file.error.message=Error reading color scheme from {0}
button.background=&Background
button.load.file=Load File
date.frequency=Once {0}
name.label.text=Na&me:
comparison.policy.default.name=Default