diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiFileNode.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiFileNode.java index e839c514c4d2..280b567160ed 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiFileNode.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiFileNode.java @@ -58,18 +58,20 @@ public class PsiFileNode extends BasePsiNode 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 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 implements NavigatableWith } @Override - public Comparable getTypeSortKey() { + public Comparable getTypeSortKey() { String extension = extension(getValue()); return extension == null ? null : new ExtensionSortKey(extension); } @@ -156,18 +154,16 @@ public class PsiFileNode extends BasePsiNode implements NavigatableWith return null; } - public static class ExtensionSortKey implements Comparable { + public static class ExtensionSortKey implements Comparable { 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); } } diff --git a/platform/platform-api/src/com/intellij/util/ui/SelectDateDialog.java b/platform/platform-api/src/com/intellij/util/ui/SelectDateDialog.java index 1e93ad996d2b..fc5f65f3ddaf 100644 --- a/platform/platform-api/src/com/intellij/util/ui/SelectDateDialog.java +++ b/platform/platform-api/src/com/intellij/util/ui/SelectDateDialog.java @@ -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(); diff --git a/platform/platform-resources-en/src/messages/CommonBundle.properties b/platform/platform-resources-en/src/messages/CommonBundle.properties index beee4aac690c..e713e393f62a 100644 --- a/platform/platform-resources-en/src/messages/CommonBundle.properties +++ b/platform/platform-resources-en/src/messages/CommonBundle.properties @@ -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