mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[i18n] Annotations, literals extracted, warnings fixed
GitOrigin-RevId: e13cca2998c559c6e2b193c06a8d8ecf85a33815
This commit is contained in:
committed by
intellij-monorepo-bot
parent
87649b607c
commit
729152b3a4
@@ -100,12 +100,12 @@ public final class BorderType {
|
||||
|
||||
public static BorderType[] getAllTypes() {
|
||||
return new BorderType[]{
|
||||
BorderType.NONE,
|
||||
BorderType.EMPTY,
|
||||
BorderType.BEVEL_LOWERED,
|
||||
BorderType.BEVEL_RAISED,
|
||||
BorderType.ETCHED,
|
||||
BorderType.LINE
|
||||
NONE,
|
||||
EMPTY,
|
||||
BEVEL_LOWERED,
|
||||
BEVEL_RAISED,
|
||||
ETCHED,
|
||||
LINE
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.intellij.openapi.module.ModuleType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.*;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
@@ -333,7 +334,7 @@ public class CompilerManagerImpl extends CompilerManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void executeTask(@NotNull CompileTask task, @NotNull CompileScope scope, String contentName, Runnable onTaskFinished) {
|
||||
public void executeTask(@NotNull CompileTask task, @NotNull CompileScope scope, @NlsContexts.TabTitle String contentName, Runnable onTaskFinished) {
|
||||
final CompileDriver compileDriver = new CompileDriver(myProject);
|
||||
compileDriver.executeCompileTask(task, scope, contentName, onTaskFinished);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectFileIndex;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -135,7 +136,7 @@ public class CompileAction extends CompileActionBase {
|
||||
presentation.setEnabledAndVisible(forFiles == isForFiles);
|
||||
}
|
||||
|
||||
private String createPresentationText(String elementDescription) {
|
||||
private @NlsSafe String createPresentationText(String elementDescription) {
|
||||
StringBuilder buffer = new StringBuilder(40);
|
||||
buffer.append(ActionsBundle.actionText(bundleKey)).append(" ");
|
||||
int length = elementDescription.length();
|
||||
|
||||
+2
-1
@@ -4,6 +4,7 @@ package com.intellij.compiler.backwardRefs.view;
|
||||
import com.intellij.compiler.CompilerReferenceService;
|
||||
import com.intellij.compiler.backwardRefs.CompilerReferenceServiceImpl;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsActions;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.search.GlobalSearchScopeUtil;
|
||||
@@ -11,7 +12,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public abstract class TestCompilerHierarchyBaseAction extends TestCompilerReferenceServiceAction {
|
||||
public TestCompilerHierarchyBaseAction(String text) {
|
||||
public TestCompilerHierarchyBaseAction(@NlsActions.ActionText String text) {
|
||||
super(text);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -22,12 +22,13 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.util.NlsActions;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public abstract class TestCompilerReferenceServiceAction extends AnAction {
|
||||
public TestCompilerReferenceServiceAction(String text) {
|
||||
public TestCompilerReferenceServiceAction(@NlsActions.ActionText String text) {
|
||||
super(text);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService;
|
||||
import com.intellij.openapi.ui.MessageType;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
@@ -67,7 +68,6 @@ public final class CompileDriver {
|
||||
private static final Key<Boolean> COMPILATION_STARTED_AUTOMATICALLY = Key.create("compilation_started_automatically");
|
||||
private static final Key<ExitStatus> COMPILE_SERVER_BUILD_STATUS = Key.create("COMPILE_SERVER_BUILD_STATUS");
|
||||
private static final long ONE_MINUTE_MS = 60L * 1000L;
|
||||
public static final String CLASSES_UP_TO_DATE_CHECK = "Classes up-to-date check";
|
||||
|
||||
private final Project myProject;
|
||||
private final Map<Module, String> myModuleOutputPaths = new HashMap<>();
|
||||
@@ -103,7 +103,7 @@ public final class CompileDriver {
|
||||
LOG.debug("isUpToDate operation started");
|
||||
}
|
||||
|
||||
final CompilerTask task = new CompilerTask(myProject, CLASSES_UP_TO_DATE_CHECK, true, false, false, isCompilationStartedAutomatically(scope));
|
||||
final CompilerTask task = new CompilerTask(myProject, JavaCompilerBundle.message("classes.up.to.date.check"), true, false, false, isCompilationStartedAutomatically(scope));
|
||||
final CompileContextImpl compileContext = new CompileContextImpl(myProject, task, scope, true, false);
|
||||
|
||||
final Ref<ExitStatus> result = new Ref<>();
|
||||
@@ -566,7 +566,7 @@ public final class CompileDriver {
|
||||
return map.computeIfAbsent(module, k -> CompilerPaths.getModuleOutputPath(module, inTestSourceContent));
|
||||
}
|
||||
|
||||
public void executeCompileTask(final CompileTask task, final CompileScope scope, final String contentName, final Runnable onTaskFinished) {
|
||||
public void executeCompileTask(final CompileTask task, final CompileScope scope, final @NlsContexts.TabTitle String contentName, final Runnable onTaskFinished) {
|
||||
final CompilerTask progressManagerTask = new CompilerTask(myProject, contentName, false, false, true, isCompilationStartedAutomatically(scope));
|
||||
final CompileContextImpl compileContext = new CompileContextImpl(myProject, progressManagerTask, scope, false, false);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.intellij.compiler.impl;
|
||||
import com.intellij.openapi.compiler.CompileContext;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.io.FileAttributes;
|
||||
import com.intellij.openapi.util.io.FileSystemUtil;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
@@ -79,7 +80,7 @@ public final class CompilerUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static <T extends Throwable> void runInContext(CompileContext context, String title, ThrowableRunnable<T> action) throws T {
|
||||
public static <T extends Throwable> void runInContext(CompileContext context, @NlsContexts.ProgressText String title, ThrowableRunnable<T> action) throws T {
|
||||
ProgressIndicator indicator = context.getProgressIndicator();
|
||||
if (title != null) {
|
||||
indicator.pushState();
|
||||
|
||||
@@ -69,7 +69,12 @@ public class ChangeSuperClassFix implements LocalQuickFix, HighPriorityAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
return String.format("Make " + (myImplements ? "implements" : "extends") + " '%s'", myNewSuperName);
|
||||
if (myImplements) {
|
||||
return JavaCompilerBundle.message("intention.name.make.implements", myNewSuperName);
|
||||
}
|
||||
else {
|
||||
return JavaCompilerBundle.message("intention.name.make.extends", myNewSuperName);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -14,6 +15,7 @@ import com.intellij.ui.*;
|
||||
import com.intellij.ui.table.JBTable;
|
||||
import com.intellij.util.ui.EditableModel;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.model.java.compiler.ProcessorConfigProfile;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -86,16 +88,21 @@ public class ProcessorProfilePanel extends JPanel {
|
||||
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createAllButJarContentsDescriptor();
|
||||
final VirtualFile[] files = FileChooser.chooseFiles(descriptor, myProcessorPathField, myProject, null);
|
||||
if (files.length > 0) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
for (VirtualFile file : files) {
|
||||
if (builder.length() > 0) {
|
||||
builder.append(File.pathSeparator);
|
||||
}
|
||||
builder.append(FileUtil.toSystemDependentName(file.getPath()));
|
||||
}
|
||||
myProcessorPathField.setText(builder.toString());
|
||||
myProcessorPathField.setText(getPathString(files));
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private @NlsSafe String getPathString(VirtualFile[] files) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
for (VirtualFile file : files) {
|
||||
if (builder.length() > 0) {
|
||||
builder.append(File.pathSeparator);
|
||||
}
|
||||
builder.append(FileUtil.toSystemDependentName(file.getPath()));
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
});
|
||||
|
||||
myProcessorTablePanel = new JPanel(new BorderLayout());
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.intellij.compiler.options;
|
||||
import com.intellij.openapi.compiler.JavaCompilerBundle;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.ComboBox;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.ui.JBColor;
|
||||
import com.intellij.ui.TableSpeedSearch;
|
||||
@@ -126,7 +127,7 @@ public class TargetOptionsComponent extends JPanel {
|
||||
}
|
||||
}
|
||||
|
||||
public void setProjectBytecodeTargetLevel(String level) {
|
||||
public void setProjectBytecodeTargetLevel(@NlsSafe String level) {
|
||||
myCbProjectTargetLevel.setSelectedItem(level == null ? "" : level);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.intellij.openapi.fileEditor.OpenFileDescriptor;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.wm.ex.ProgressIndicatorEx;
|
||||
import com.intellij.pom.Navigatable;
|
||||
@@ -33,7 +34,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
import static com.intellij.compiler.impl.CompileDriver.CLASSES_UP_TO_DATE_CHECK;
|
||||
import static com.intellij.execution.filters.RegexpFilter.*;
|
||||
import static com.intellij.openapi.util.text.StringUtil.*;
|
||||
import static com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile;
|
||||
@@ -46,9 +46,9 @@ public class BuildOutputService implements BuildViewService {
|
||||
private static final String ANSI_BOLD = "\u001b[1m"; //NON-NLS
|
||||
private final @NotNull Project myProject;
|
||||
private final @NotNull BuildProgress<BuildProgressDescriptor> myBuildProgress;
|
||||
private final @NotNull String myContentName;
|
||||
private final @NotNull @NlsContexts.TabTitle String myContentName;
|
||||
|
||||
public BuildOutputService(@NotNull Project project, @NotNull String contentName) {
|
||||
public BuildOutputService(@NotNull Project project, @NotNull @NlsContexts.TabTitle String contentName) {
|
||||
myProject = project;
|
||||
myContentName = contentName;
|
||||
myBuildProgress = BuildViewManager.createBuildProgress(project);
|
||||
@@ -128,7 +128,7 @@ public class BuildOutputService implements BuildViewService {
|
||||
}
|
||||
else {
|
||||
boolean isUpToDate = exitStatus == ExitStatus.UP_TO_DATE;
|
||||
if (CLASSES_UP_TO_DATE_CHECK.equals(myContentName)) {
|
||||
if (JavaCompilerBundle.message("classes.up.to.date.check").equals(myContentName)) {
|
||||
if (isUpToDate) {
|
||||
myBuildProgress.output(JavaCompilerBundle.message("compiler.build.messages.classes.check.uptodate"), true);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.intellij.openapi.project.ProjectManagerListener;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.wm.ToolWindow;
|
||||
import com.intellij.openapi.wm.ToolWindowId;
|
||||
@@ -51,7 +52,7 @@ public class CompilerMessagesService implements BuildViewService {
|
||||
|
||||
@NotNull private final Project myProject;
|
||||
@NotNull private final Object myContentId;
|
||||
private String myContentName;
|
||||
private @NlsContexts.TabTitle final String myContentName;
|
||||
private Runnable myRestartWork;
|
||||
private final boolean myHeadlessMode;
|
||||
private boolean myMessagesAutoActivated = false;
|
||||
@@ -61,7 +62,7 @@ public class CompilerMessagesService implements BuildViewService {
|
||||
private NewErrorTreeViewPanel myErrorTreeView;
|
||||
private CloseListener myCloseListener;
|
||||
|
||||
public CompilerMessagesService(@NotNull Project project, @NotNull Object contentId, String contentName, boolean headlessMode) {
|
||||
public CompilerMessagesService(@NotNull Project project, @NotNull Object contentId, @NlsContexts.TabTitle String contentName, boolean headlessMode) {
|
||||
myProject = project;
|
||||
myContentId = contentId;
|
||||
myContentName = contentName;
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
import com.intellij.openapi.progress.util.AbstractProgressIndicatorExBase;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -57,12 +58,12 @@ public final class CompilerTask extends Task.Backgroundable {
|
||||
private long myEndCompilationStamp;
|
||||
private ExitStatus myExitStatus;
|
||||
|
||||
public CompilerTask(@NotNull Project project, String contentName, final boolean headlessMode, boolean forceAsync,
|
||||
public CompilerTask(@NotNull Project project, @NlsContexts.TabTitle String contentName, final boolean headlessMode, boolean forceAsync,
|
||||
boolean waitForPreviousSession, boolean compilationStartedAutomatically) {
|
||||
this(project, contentName, headlessMode, forceAsync, waitForPreviousSession, compilationStartedAutomatically, false);
|
||||
}
|
||||
|
||||
public CompilerTask(@NotNull Project project, String contentName, final boolean headlessMode, boolean forceAsync,
|
||||
public CompilerTask(@NotNull Project project, @NlsContexts.TabTitle String contentName, final boolean headlessMode, boolean forceAsync,
|
||||
boolean waitForPreviousSession, boolean compilationStartedAutomatically, boolean modal) {
|
||||
super(project, contentName);
|
||||
myHeadlessMode = headlessMode;
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
// 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.packaging.impl.elements;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.packaging.elements.PackagingElement;
|
||||
import com.intellij.packaging.impl.ui.ArchiveElementPresentation;
|
||||
import com.intellij.packaging.ui.ArtifactEditorContext;
|
||||
@@ -30,7 +31,7 @@ public class ArchivePackagingElement extends CompositeElementWithManifest<Archiv
|
||||
}
|
||||
|
||||
@Attribute(NAME_ATTRIBUTE)
|
||||
public String getArchiveFileName() {
|
||||
public @NlsSafe String getArchiveFileName() {
|
||||
return myArchiveFileName;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -4,6 +4,7 @@ package com.intellij.packaging.impl.elements;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.projectView.PresentationData;
|
||||
import com.intellij.openapi.compiler.JavaCompilerBundle;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.packaging.elements.ArtifactRootElement;
|
||||
import com.intellij.packaging.ui.ArtifactEditorContext;
|
||||
import com.intellij.packaging.ui.PackagingElementPresentation;
|
||||
@@ -20,7 +21,7 @@ public class ArtifactRootElementImpl extends ArtifactRootElement<Object> {
|
||||
public PackagingElementPresentation createPresentation(@NotNull ArtifactEditorContext context) {
|
||||
return new PackagingElementPresentation() {
|
||||
@Override
|
||||
public String getPresentableName() {
|
||||
public @NlsContexts.Label String getPresentableName() {
|
||||
return JavaCompilerBundle.message("packaging.element.text.output.root");
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
// 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.packaging.impl.elements;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.packaging.elements.PackagingElement;
|
||||
import com.intellij.packaging.impl.ui.DirectoryElementPresentation;
|
||||
import com.intellij.packaging.ui.ArtifactEditorContext;
|
||||
@@ -43,7 +44,7 @@ public class DirectoryPackagingElement extends CompositeElementWithManifest<Dire
|
||||
}
|
||||
|
||||
@Attribute(NAME_ATTRIBUTE)
|
||||
public String getDirectoryName() {
|
||||
public @NlsSafe String getDirectoryName() {
|
||||
return myDirectoryName;
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -7,6 +7,7 @@ import com.intellij.facet.FacetTypeRegistry;
|
||||
import com.intellij.ide.util.ChooseElementsDialog;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.packaging.artifacts.Artifact;
|
||||
import com.intellij.packaging.elements.CompositePackagingElement;
|
||||
import com.intellij.packaging.elements.PackagingElement;
|
||||
@@ -64,14 +65,14 @@ public abstract class FacetBasedPackagingElementType<E extends PackagingElement<
|
||||
|
||||
protected abstract E createElement(Project project, F facet);
|
||||
|
||||
protected abstract String getDialogTitle();
|
||||
protected abstract @NlsContexts.DialogTitle String getDialogTitle();
|
||||
|
||||
protected abstract String getDialogDescription();
|
||||
protected abstract @NlsContexts.Label String getDialogDescription();
|
||||
|
||||
protected abstract String getItemText(F item);
|
||||
|
||||
private final class ChooseFacetsDialog extends ChooseElementsDialog<F> {
|
||||
private ChooseFacetsDialog(Project project, List<? extends F> items, String title, String description) {
|
||||
private ChooseFacetsDialog(Project project, List<? extends F> items, @NlsContexts.DialogTitle String title, @NlsContexts.Label String description) {
|
||||
super(project, items, title, description, true);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -17,6 +17,7 @@ package com.intellij.packaging.impl.ui;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.projectView.PresentationData;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.packaging.artifacts.Artifact;
|
||||
import com.intellij.packaging.artifacts.ArtifactPointer;
|
||||
import com.intellij.packaging.ui.ArtifactEditorContext;
|
||||
@@ -38,7 +39,7 @@ public class ArtifactElementPresentation extends TreeNodePresentation {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPresentableName() {
|
||||
public @NlsContexts.Label String getPresentableName() {
|
||||
return myArtifactPointer != null ? myArtifactPointer.getArtifactName(myContext.getArtifactModel()) : "<unknown>";
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ package com.intellij.packaging.impl.ui;
|
||||
|
||||
import com.intellij.ide.util.ChooseElementsDialog;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.packaging.artifacts.Artifact;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -24,7 +25,7 @@ import java.util.List;
|
||||
|
||||
public class ChooseArtifactsDialog extends ChooseElementsDialog<Artifact> {
|
||||
|
||||
public ChooseArtifactsDialog(Project project, List<? extends Artifact> items, String title, String description) {
|
||||
public ChooseArtifactsDialog(Project project, List<? extends Artifact> items, @NlsContexts.DialogTitle String title, @NlsContexts.Label String description) {
|
||||
super(project, items, title, description, true);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -18,6 +18,7 @@ package com.intellij.packaging.impl.ui;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.projectView.PresentationData;
|
||||
import com.intellij.openapi.compiler.JavaCompilerBundle;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -28,7 +29,7 @@ import com.intellij.util.PathUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class DirectoryCopyPresentation extends PackagingElementPresentation {
|
||||
private final String mySourcePath;
|
||||
private final @NlsSafe String mySourcePath;
|
||||
private final String mySourceFileName;
|
||||
private final VirtualFile myFile;
|
||||
|
||||
|
||||
+2
-1
@@ -17,6 +17,7 @@ package com.intellij.packaging.impl.ui;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.projectView.PresentationData;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.packaging.impl.elements.ExtractedDirectoryPackagingElement;
|
||||
@@ -53,7 +54,7 @@ public class ExtractedDirectoryPresentation extends PackagingElementPresentation
|
||||
commentAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES;
|
||||
}
|
||||
}
|
||||
presentationData.addText("Extracted '" + PathUtil.getFileName(myJarPath) + myPathInJar + "'", mainAttributes);
|
||||
presentationData.addText("Extracted '" + getPresentableName() + "'", mainAttributes);
|
||||
presentationData.addText(" (" + parentPath + ")", commentAttributes);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.intellij.packaging.impl.ui;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.presentation.VirtualFilePresentation;
|
||||
import com.intellij.ide.projectView.PresentationData;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -28,7 +29,7 @@ import com.intellij.util.PathUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class FileCopyPresentation extends PackagingElementPresentation {
|
||||
private final String mySourcePath;
|
||||
private final @NlsSafe String mySourcePath;
|
||||
private final String myOutputFileName;
|
||||
private final VirtualFile myFile;
|
||||
|
||||
@@ -63,12 +64,12 @@ public class FileCopyPresentation extends PackagingElementPresentation {
|
||||
public void render(@NotNull PresentationData presentationData, SimpleTextAttributes mainAttributes, SimpleTextAttributes commentAttributes) {
|
||||
if (myFile != null && !myFile.isDirectory()) {
|
||||
presentationData.setIcon(VirtualFilePresentation.getIcon(myFile));
|
||||
presentationData.addText(myOutputFileName, mainAttributes);
|
||||
presentationData.addText(getPresentableName(), mainAttributes);
|
||||
presentationData.addText(" (" + mySourcePath + ")", commentAttributes);
|
||||
}
|
||||
else {
|
||||
presentationData.setIcon(AllIcons.FileTypes.Text);
|
||||
presentationData.addText(myOutputFileName, SimpleTextAttributes.ERROR_ATTRIBUTES);
|
||||
presentationData.addText(getPresentableName(), SimpleTextAttributes.ERROR_ATTRIBUTES);
|
||||
final VirtualFile parentFile = LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(mySourcePath));
|
||||
presentationData.addText("(" + mySourcePath + ")",
|
||||
parentFile != null ? commentAttributes : SimpleTextAttributes.ERROR_ATTRIBUTES);
|
||||
|
||||
+6
-4
@@ -22,6 +22,8 @@ import com.intellij.openapi.roots.impl.libraries.LibraryEx;
|
||||
import com.intellij.openapi.roots.libraries.Library;
|
||||
import com.intellij.openapi.roots.libraries.LibraryTable;
|
||||
import com.intellij.openapi.roots.libraries.LibraryTablePresentation;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.packaging.ui.ArtifactEditorContext;
|
||||
import com.intellij.packaging.ui.PackagingElementPresentation;
|
||||
import com.intellij.packaging.ui.PackagingElementWeights;
|
||||
@@ -32,7 +34,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class LibraryElementPresentation extends PackagingElementPresentation {
|
||||
private final String myLevel;
|
||||
private final String myModuleName;
|
||||
private final @NlsSafe String myModuleName;
|
||||
private final Library myLibrary;
|
||||
private final String myLibraryName;
|
||||
private final ArtifactEditorContext myContext;
|
||||
@@ -64,11 +66,11 @@ public class LibraryElementPresentation extends PackagingElementPresentation {
|
||||
public void render(@NotNull PresentationData presentationData, SimpleTextAttributes mainAttributes, SimpleTextAttributes commentAttributes) {
|
||||
if (myLibrary != null) {
|
||||
presentationData.setIcon(PlatformIcons.LIBRARY_ICON);
|
||||
presentationData.addText(myLibraryName, mainAttributes);
|
||||
presentationData.addText(getPresentableName(), mainAttributes);
|
||||
presentationData.addText(getLibraryTableComment(myLibrary), commentAttributes);
|
||||
}
|
||||
else {
|
||||
presentationData.addText(myLibraryName + " (" + (myModuleName != null ? "module '" + myModuleName + "'" : myLevel) + ")",
|
||||
presentationData.addText(getPresentableName() + " (" + (myModuleName != null ? "module '" + myModuleName + "'" : myLevel) + ")",
|
||||
SimpleTextAttributes.ERROR_ATTRIBUTES);
|
||||
}
|
||||
}
|
||||
@@ -84,7 +86,7 @@ public class LibraryElementPresentation extends PackagingElementPresentation {
|
||||
return presentation.getDisplayName(false);
|
||||
}
|
||||
|
||||
public static String getLibraryTableComment(final Library library) {
|
||||
public static @NlsContexts.Label String getLibraryTableComment(final Library library) {
|
||||
LibraryTable libraryTable = library.getTable();
|
||||
String displayName;
|
||||
if (libraryTable != null) {
|
||||
|
||||
@@ -201,4 +201,8 @@ button.add=&Add...
|
||||
eclipse.compiler.cross.platform.help.message=('/' recommended in paths for cross-platform configurations)
|
||||
eclipse.compiler.path.leave.empty.help.message=Path to ECJ batch compiler tool (leave empty to use bundled):
|
||||
eclipse.compiler.proceed.on.errors.option=Proceed on errors
|
||||
progress.title.cancelling.auto.make.builds=Cancelling Auto-Make Builds
|
||||
progress.title.cancelling.auto.make.builds=Cancelling Auto-Make Builds
|
||||
intention.name.make.implements=Make implements ''{0}''
|
||||
intention.name.make.extends=Make extends ''{0}''
|
||||
classes.up.to.date.check=Classes up-to-Date Check
|
||||
action.run.all.affected.tests.text=Run All Affected Tests
|
||||
+3
-2
@@ -25,6 +25,7 @@ import com.intellij.openapi.compiler.CompileScope;
|
||||
import com.intellij.openapi.compiler.CompilerMessageCategory;
|
||||
import com.intellij.openapi.extensions.ProjectExtensionPointName;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -44,7 +45,7 @@ public abstract class InspectionValidator {
|
||||
public static final ProjectExtensionPointName<InspectionValidator> EP_NAME = new ProjectExtensionPointName<>("com.intellij.compiler.inspectionValidator");
|
||||
private final String myId;
|
||||
private final String myDescription;
|
||||
private final String myProgressIndicatorText;
|
||||
private final @NlsContexts.ProgressText String myProgressIndicatorText;
|
||||
|
||||
private final Class<? extends LocalInspectionTool> @Nullable [] myInspectionToolClasses;
|
||||
|
||||
@@ -97,7 +98,7 @@ public abstract class InspectionValidator {
|
||||
return myDescription;
|
||||
}
|
||||
|
||||
public final String getProgressIndicatorText() {
|
||||
public final @NlsContexts.ProgressText String getProgressIndicatorText() {
|
||||
return myProgressIndicatorText;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.packaging.artifacts;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -33,7 +34,7 @@ public interface ArtifactPointer {
|
||||
@Nullable
|
||||
Artifact getArtifact();
|
||||
|
||||
@NotNull
|
||||
@NotNull @NlsSafe
|
||||
String getArtifactName(@NotNull ArtifactModel artifactModel);
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -15,13 +15,14 @@
|
||||
*/
|
||||
package com.intellij.packaging.ui;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import com.intellij.ide.projectView.PresentationData;
|
||||
import com.intellij.ui.SimpleTextAttributes;
|
||||
|
||||
public abstract class TreeNodePresentation {
|
||||
public abstract String getPresentableName();
|
||||
public abstract @NlsSafe String getPresentableName();
|
||||
|
||||
public String getSearchName() {
|
||||
return getPresentableName();
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.intellij.debugger.ui.tree.render.*;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.options.Configurable;
|
||||
import com.intellij.openapi.options.ShowSettingsUtil;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.xdebugger.frame.XValue;
|
||||
import com.intellij.xdebugger.impl.ui.tree.actions.XDebuggerTreeActionBase;
|
||||
import com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl;
|
||||
@@ -139,9 +140,9 @@ public abstract class ArrayAction extends DebuggerAction {
|
||||
}
|
||||
|
||||
private static class NamedArrayConfigurable extends ArrayRendererConfigurable implements Configurable {
|
||||
private final String myTitle;
|
||||
private final @NlsContexts.ConfigurableName String myTitle;
|
||||
|
||||
NamedArrayConfigurable(String title, ArrayRenderer renderer) {
|
||||
NamedArrayConfigurable(@NlsContexts.ConfigurableName String title, ArrayRenderer renderer) {
|
||||
super(renderer);
|
||||
myTitle = title;
|
||||
}
|
||||
@@ -163,7 +164,7 @@ public abstract class ArrayAction extends DebuggerAction {
|
||||
protected Promise<ArrayRenderer> createNewRenderer(XValueNodeImpl node,
|
||||
ArrayRenderer original,
|
||||
@NotNull DebuggerContextImpl debuggerContext,
|
||||
String title) {
|
||||
@NlsContexts.ConfigurableName String title) {
|
||||
ArrayRenderer clonedRenderer = original.clone();
|
||||
clonedRenderer.setForced(true);
|
||||
if (ShowSettingsUtil.getInstance().editConfigurable(debuggerContext.getProject(), new NamedArrayConfigurable(title, clonedRenderer))) {
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.xdebugger.XDebuggerBundle;
|
||||
import com.intellij.xdebugger.XExpression;
|
||||
@@ -152,7 +153,7 @@ public class ForceEarlyReturnAction extends DebuggerAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void errorOccurred(@NotNull final String errorMessage) {
|
||||
public void errorOccurred(@NotNull final @NlsContexts.DialogMessage String errorMessage) {
|
||||
showError(project, JavaDebuggerBundle.message("error.unable.to.evaluate.expression") + ": " + errorMessage);
|
||||
}
|
||||
}, stackFrame.getSourcePosition());
|
||||
@@ -162,7 +163,7 @@ public class ForceEarlyReturnAction extends DebuggerAction {
|
||||
}
|
||||
}
|
||||
|
||||
private static void showError(Project project, String message) {
|
||||
private static void showError(Project project, @NlsContexts.DialogMessage String message) {
|
||||
PopFrameAction.showError(project, message, UIUtil.removeMnemonic(ActionsBundle.actionText("Debugger.ForceEarlyReturn")));
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.MessageDialogBuilder;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.ui.UIBundle;
|
||||
@@ -46,6 +47,7 @@ import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl;
|
||||
import com.sun.jdi.InvalidStackFrameException;
|
||||
import com.sun.jdi.NativeMethodException;
|
||||
import com.sun.jdi.VMDisconnectedException;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -97,9 +99,9 @@ public class PopFrameAction extends DebuggerAction implements DumbAware {
|
||||
}
|
||||
|
||||
static boolean evaluateFinallyBlocks(Project project,
|
||||
String title,
|
||||
JavaStackFrame stackFrame,
|
||||
XDebuggerEvaluator.XEvaluationCallback callback) {
|
||||
@Nls String title,
|
||||
JavaStackFrame stackFrame,
|
||||
XDebuggerEvaluator.XEvaluationCallback callback) {
|
||||
if (!DebuggerSettings.EVALUATE_FINALLY_NEVER.equals(DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME)) {
|
||||
List<PsiStatement> statements = getFinallyStatements(project, stackFrame.getDescriptor().getSourcePosition());
|
||||
if (!statements.isEmpty()) {
|
||||
@@ -192,7 +194,7 @@ public class PopFrameAction extends DebuggerAction implements DumbAware {
|
||||
}
|
||||
}
|
||||
|
||||
static void showError(Project project, String message, String title) {
|
||||
static void showError(Project project, @NlsContexts.DialogMessage String message, @NlsContexts.DialogTitle String title) {
|
||||
ApplicationManager.getApplication().invokeLater(
|
||||
() -> Messages.showMessageDialog(project, message, title, Messages.getErrorIcon()),
|
||||
ModalityState.any());
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.intellij.openapi.editor.event.DocumentListener;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.components.BorderLayoutPanel;
|
||||
@@ -121,7 +122,7 @@ public class ViewTextAction extends XFetchValueActionBase {
|
||||
DebuggerUIUtil.setTreeNodeValue(myStringNode,
|
||||
XExpressionImpl.fromText(
|
||||
StringUtil.wrapWithDoubleQuote(DebuggerUtils.translateStringValue(myTextViewer.getText()))),
|
||||
errorMessage -> Messages.showErrorDialog(myStringNode.getTree(), errorMessage));
|
||||
(@NlsContexts.DialogMessage String errorMessage) -> Messages.showErrorDialog(myStringNode.getTree(), errorMessage));
|
||||
}
|
||||
super.doOKAction();
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ import com.sun.jdi.request.EventRequestManager;
|
||||
import com.sun.jdi.request.StepRequest;
|
||||
import one.util.streamex.StreamEx;
|
||||
import org.intellij.lang.annotations.MagicConstant;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -654,7 +655,7 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
|
||||
}
|
||||
}
|
||||
|
||||
public void showStatusText(final String text) {
|
||||
public void showStatusText(final @Nls String text) {
|
||||
myStatusUpdateAlarm.cancelAllRequests();
|
||||
myStatusUpdateAlarm.addRequest(() -> {
|
||||
if (!myProject.isDisposed()) {
|
||||
@@ -1731,7 +1732,7 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected String getStatusText() {
|
||||
protected @Nls String getStatusText() {
|
||||
return JavaDebuggerBundle.message("status.step.over");
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.intellij.openapi.extensions.ExtensionPointListener;
|
||||
import com.intellij.openapi.extensions.PluginDescriptor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.NlsActions;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -446,8 +447,8 @@ public class JavaDebugProcess extends XDebugProcess {
|
||||
}
|
||||
|
||||
private static class WatchLastMethodReturnValueAction extends ToggleAction {
|
||||
private final String myText;
|
||||
private final String myTextUnavailable;
|
||||
private final @NlsActions.ActionText String myText;
|
||||
private final @NlsActions.ActionText String myTextUnavailable;
|
||||
|
||||
WatchLastMethodReturnValueAction() {
|
||||
super("", JavaDebuggerBundle.message("action.watch.method.return.value.description"), null);
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.intellij.debugger.ui.impl.watch.StackFrameDescriptorImpl;
|
||||
import com.intellij.debugger.ui.tree.render.DescriptorLabelListener;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.ui.ColoredTextContainer;
|
||||
import com.intellij.ui.SimpleTextAttributes;
|
||||
import com.intellij.xdebugger.frame.XExecutionStack;
|
||||
@@ -275,7 +276,7 @@ public class JavaExecutionStack extends XExecutionStack {
|
||||
return true;
|
||||
}
|
||||
|
||||
private static String calcRepresentation(ThreadReferenceProxyImpl thread) {
|
||||
private static @NlsContexts.ListItem String calcRepresentation(ThreadReferenceProxyImpl thread) {
|
||||
DebuggerManagerThreadImpl.assertIsManagerThread();
|
||||
String name = thread.name();
|
||||
ThreadGroupReferenceProxyImpl gr = thread.threadGroupProxy();
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.psi.PsiCompiledElement;
|
||||
@@ -224,7 +225,7 @@ public final class DebuggerSession implements AbstractDebuggerSession {
|
||||
return getProcess().getProject();
|
||||
}
|
||||
|
||||
public String getSessionName() {
|
||||
public @NlsSafe String getSessionName() {
|
||||
return mySessionName;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,10 +23,7 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.ex.JavaSdkUtil;
|
||||
import com.intellij.openapi.util.JDOMExternalizerUtil;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.ThrowableComputable;
|
||||
import com.intellij.openapi.util.*;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.util.text.StringUtilRt;
|
||||
import com.intellij.psi.*;
|
||||
@@ -163,7 +160,7 @@ public class DebuggerUtilsImpl extends DebuggerUtilsEx{
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiClass chooseClassDialog(String title, Project project) {
|
||||
public PsiClass chooseClassDialog(@NlsContexts.DialogTitle String title, Project project) {
|
||||
TreeClassChooser dialog = TreeClassChooserFactory.getInstance(project).createAllProjectScopeChooser(title);
|
||||
dialog.showDialog();
|
||||
return dialog.getSelected();
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.debugger.memory.action;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.xdebugger.memory.ui.TypeInfo;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.Presentation;
|
||||
@@ -28,10 +29,14 @@ abstract class ShowInstancesAction extends ClassesActionBase {
|
||||
final boolean enabled = isEnabled(e) && ref != null && ref.canGetInstanceInfo();
|
||||
presentation.setEnabled(enabled);
|
||||
if (enabled) {
|
||||
presentation.setText(String.format("%s (%d)", getLabel(), getInstancesCount(e)));
|
||||
presentation.setText(getPresentation(e));
|
||||
}
|
||||
}
|
||||
|
||||
private @NlsSafe String getPresentation(@NotNull AnActionEvent e) {
|
||||
return String.format("%s (%d)", getLabel(), getInstancesCount(e));
|
||||
}
|
||||
|
||||
protected abstract String getLabel();
|
||||
|
||||
protected abstract int getInstancesCount(AnActionEvent e);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.intellij.debugger.memory.ui;
|
||||
|
||||
import com.intellij.debugger.memory.filtering.FilteringResult;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.util.ui.StartupUiUtil;
|
||||
import com.intellij.util.ui.components.BorderLayoutPanel;
|
||||
@@ -92,7 +93,7 @@ class FilteringProgressView extends BorderLayoutPanel {
|
||||
myProgressPanel.setVisible(value);
|
||||
}
|
||||
|
||||
private String getDescription() {
|
||||
private @NlsContexts.ProgressText String getDescription() {
|
||||
int total = myProgressBar.getMaximum();
|
||||
String itemsInfo = String.format("Shown: %d / %d", myMatchedCount, total);
|
||||
if (myIsInProcess || myCompletionReason == null) {
|
||||
|
||||
+4
-7
@@ -36,9 +36,6 @@ import java.util.Objects;
|
||||
|
||||
class InstancesWithStackFrameView {
|
||||
private static final float DEFAULT_SPLITTER_PROPORTION = 0.7f;
|
||||
private static final String EMPTY_TEXT_WHEN_ITEM_NOT_SELECTED = "Select instance to see stack frame";
|
||||
private static final String EMPTY_TEXT_WHEN_STACK_NOT_FOUND = "No stack frame for this instance";
|
||||
private static final String TEXT_FOR_ARRAYS = "Arrays could not be tracked";
|
||||
|
||||
private float myHidedProportion;
|
||||
|
||||
@@ -50,10 +47,10 @@ class InstancesWithStackFrameView {
|
||||
mySplitter.setFirstComponent(new JBScrollPane(tree));
|
||||
|
||||
final Project project = debugSession.getProject();
|
||||
list.setEmptyText(EMPTY_TEXT_WHEN_ITEM_NOT_SELECTED);
|
||||
list.setEmptyText(JavaDebuggerBundle.message("status.text.select.instance.to.see.stack.frame"));
|
||||
JLabel stackTraceLabel;
|
||||
if (isArrayType(className)) {
|
||||
stackTraceLabel = new JBLabel(TEXT_FOR_ARRAYS, SwingConstants.CENTER);
|
||||
stackTraceLabel = new JBLabel(JavaDebuggerBundle.message("label.arrays.could.not.be.tracked"), SwingConstants.CENTER);
|
||||
}
|
||||
else {
|
||||
ActionLink actionLink = new ActionLink(JavaDebuggerBundle.message("enable.tracking.for.new.instances"),
|
||||
@@ -115,10 +112,10 @@ class InstancesWithStackFrameView {
|
||||
}
|
||||
return;
|
||||
}
|
||||
list.setEmptyText(EMPTY_TEXT_WHEN_STACK_NOT_FOUND);
|
||||
list.setEmptyText(JavaDebuggerBundle.message("status.text.no.stack.frame.for.this.instance"));
|
||||
}
|
||||
else {
|
||||
list.setEmptyText(EMPTY_TEXT_WHEN_ITEM_NOT_SELECTED);
|
||||
list.setEmptyText(JavaDebuggerBundle.message("status.text.select.instance.to.see.stack.frame"));
|
||||
}
|
||||
|
||||
list.setFrameItems(Collections.emptyList());
|
||||
|
||||
@@ -22,6 +22,7 @@ package com.intellij.debugger.ui;
|
||||
import com.intellij.debugger.JavaDebuggerBundle;
|
||||
import com.intellij.ide.BrowserUtil;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.ui.DoubleClickListener;
|
||||
import com.intellij.ui.JBColor;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -32,7 +33,7 @@ import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
public class GetJPDADialog extends DialogWrapper {
|
||||
private static final @NonNls String JPDA_URL = "http://java.sun.com/products/jpda";
|
||||
private static final @NlsSafe String JPDA_URL = "http://java.sun.com/products/jpda";
|
||||
|
||||
public GetJPDADialog() {
|
||||
super(false);
|
||||
|
||||
@@ -18,6 +18,8 @@ import com.intellij.openapi.progress.impl.BackgroundableProcessIndicator;
|
||||
import com.intellij.openapi.progress.util.AbstractProgressIndicatorExBase;
|
||||
import com.intellij.openapi.progress.util.ProgressWindow;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.wm.ToolWindowId;
|
||||
import com.intellij.reference.SoftReference;
|
||||
@@ -43,7 +45,7 @@ public class HotSwapProgressImpl extends HotSwapProgress {
|
||||
|
||||
private final TIntObjectHashMap<List<String>> myMessages = new TIntObjectHashMap<>();
|
||||
private final ProgressWindow myProgressWindow;
|
||||
private String myTitle = JavaDebuggerBundle.message("progress.hot.swap.title");
|
||||
private @NlsContexts.ProgressTitle String myTitle = JavaDebuggerBundle.message("progress.hot.swap.title");
|
||||
private final MergingUpdateQueue myUpdateQueue;
|
||||
private WeakReference<XDebugSession> mySessionRef = null;
|
||||
private final List<HotSwapProgressListener> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
@@ -102,7 +104,7 @@ public class HotSwapProgressImpl extends HotSwapProgress {
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyUser(String title, String message, NotificationType type) {
|
||||
private void notifyUser(@NlsContexts.NotificationTitle String title, @NlsContexts.NotificationContent String message, NotificationType type) {
|
||||
NotificationListener notificationListener = null;
|
||||
if (SoftReference.dereference(mySessionRef) != null) {
|
||||
notificationListener = new HotSwapNotificationListener(mySessionRef);
|
||||
@@ -146,7 +148,7 @@ public class HotSwapProgressImpl extends HotSwapProgress {
|
||||
return ContainerUtil.notNullize(myMessages.get(category));
|
||||
}
|
||||
|
||||
private String buildMessage(List<String> messages, boolean withRestart) {
|
||||
private @NlsSafe String buildMessage(List<String> messages, boolean withRestart) {
|
||||
StringBuilder res = new StringBuilder(StreamEx.of(messages).map(m -> StringUtil.trimEnd(m, ';')).joining("\n"));
|
||||
if (SoftReference.dereference(mySessionRef) != null) {
|
||||
res.append("\n").append(JavaDebuggerBundle.message("status.hot.swap.completed.stop"));
|
||||
@@ -168,7 +170,7 @@ public class HotSwapProgressImpl extends HotSwapProgress {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(final String text) {
|
||||
public void setText(final @NlsContexts.ProgressText String text) {
|
||||
myUpdateQueue.queue(new Update("Text") {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -182,7 +184,7 @@ public class HotSwapProgressImpl extends HotSwapProgress {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(final String text) {
|
||||
public void setTitle(final @NlsContexts.ProgressTitle String text) {
|
||||
DebuggerInvocationUtil.invokeLater(getProject(), () -> {
|
||||
if (!myProgressWindow.isCanceled() && myProgressWindow.isRunning()) {
|
||||
myProgressWindow.setTitle(text);
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.JDOMExternalizerUtil;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiCodeFragment;
|
||||
@@ -40,6 +41,7 @@ import com.intellij.ui.SimpleColoredComponent;
|
||||
import com.intellij.ui.classFilter.ClassFilter;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.ThreeState;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.xdebugger.XExpression;
|
||||
import com.intellij.xdebugger.breakpoints.SuspendPolicy;
|
||||
import com.intellij.xdebugger.breakpoints.XBreakpoint;
|
||||
@@ -61,14 +63,13 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public abstract class Breakpoint<P extends JavaBreakpointProperties> implements FilteredRequestor, ClassPrepareRequestor, OverheadProducer {
|
||||
public static final Key<Breakpoint> DATA_KEY = Key.create("JavaBreakpoint");
|
||||
public static final Key<Breakpoint<?>> DATA_KEY = Key.create("JavaBreakpoint");
|
||||
private static final Key<Long> HIT_COUNTER = Key.create("HIT_COUNTER");
|
||||
|
||||
final XBreakpoint<P> myXBreakpoint;
|
||||
@@ -142,10 +143,10 @@ public abstract class Breakpoint<P extends JavaBreakpointProperties> implements
|
||||
|
||||
@Override
|
||||
public boolean isObsolete() {
|
||||
return myXBreakpoint instanceof XBreakpointBase && ((XBreakpointBase)myXBreakpoint).isDisposed();
|
||||
return myXBreakpoint instanceof XBreakpointBase && ((XBreakpointBase<?, ?, ?>)myXBreakpoint).isDisposed();
|
||||
}
|
||||
|
||||
public abstract String getDisplayName ();
|
||||
public abstract @NlsContexts.Label String getDisplayName();
|
||||
|
||||
public String getShortName() {
|
||||
return getDisplayName();
|
||||
@@ -161,12 +162,12 @@ public abstract class Breakpoint<P extends JavaBreakpointProperties> implements
|
||||
}
|
||||
|
||||
public boolean isRemoveAfterHit() {
|
||||
return myXBreakpoint instanceof XLineBreakpoint && ((XLineBreakpoint)myXBreakpoint).isTemporary();
|
||||
return myXBreakpoint instanceof XLineBreakpoint && ((XLineBreakpoint<?>)myXBreakpoint).isTemporary();
|
||||
}
|
||||
|
||||
public void setRemoveAfterHit(boolean value) {
|
||||
if (myXBreakpoint instanceof XLineBreakpoint) {
|
||||
((XLineBreakpoint)myXBreakpoint).setTemporary(value);
|
||||
((XLineBreakpoint<?>)myXBreakpoint).setTemporary(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,7 +356,7 @@ public abstract class Breakpoint<P extends JavaBreakpointProperties> implements
|
||||
* @return true if the ID was added or false otherwise
|
||||
*/
|
||||
private boolean hasObjectID(long id) {
|
||||
return Arrays.stream(getInstanceFilters()).anyMatch(instanceFilter -> instanceFilter.getId() == id);
|
||||
return ContainerUtil.exists(getInstanceFilters(), instanceFilter -> instanceFilter.getId() == id);
|
||||
}
|
||||
|
||||
public boolean evaluateCondition(final EvaluationContextImpl context, LocatableEvent event) throws EvaluateException {
|
||||
@@ -516,7 +517,7 @@ public abstract class Breakpoint<P extends JavaBreakpointProperties> implements
|
||||
return className;
|
||||
}
|
||||
|
||||
protected static boolean typeMatchesClassFilters(@Nullable String typeName, ClassFilter[] includeFilters, ClassFilter[] exludeFilters) {
|
||||
protected static boolean typeMatchesClassFilters(@Nullable String typeName, ClassFilter[] includeFilters, ClassFilter[] excludeFilters) {
|
||||
if (typeName == null) {
|
||||
return true;
|
||||
}
|
||||
@@ -533,7 +534,7 @@ public abstract class Breakpoint<P extends JavaBreakpointProperties> implements
|
||||
if (hasEnabled && !matches) {
|
||||
return false;
|
||||
}
|
||||
return Arrays.stream(exludeFilters).noneMatch(classFilter -> classFilter.isEnabled() && classFilter.matches(typeName));
|
||||
return !ContainerUtil.exists(excludeFilters, classFilter -> classFilter.isEnabled() && classFilter.matches(typeName));
|
||||
}
|
||||
|
||||
private void handleTemporaryBreakpointHit(final DebugProcessImpl debugProcess) {
|
||||
@@ -708,7 +709,7 @@ public abstract class Breakpoint<P extends JavaBreakpointProperties> implements
|
||||
}
|
||||
}
|
||||
|
||||
private static String getSuspendPolicy(XBreakpoint breakpoint) {
|
||||
private static String getSuspendPolicy(XBreakpoint<?> breakpoint) {
|
||||
switch (breakpoint.getSuspendPolicy()) {
|
||||
case ALL:
|
||||
return DebuggerSettings.SUSPEND_ALL;
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.ui.classFilter.ClassFilter;
|
||||
import one.util.streamex.StreamEx;
|
||||
|
||||
@@ -83,8 +84,12 @@ public class ClassFiltersField extends TextFieldWithBrowseButton {
|
||||
}
|
||||
|
||||
private void updateEditor() {
|
||||
setText(StreamEx.of(myClassExclusionFilters).filter(ClassFilter::isEnabled).map(f -> "-" + f.getPattern())
|
||||
.prepend(StreamEx.of(myClassFilters).filter(ClassFilter::isEnabled).map(ClassFilter::getPattern))
|
||||
.joining(" "));
|
||||
setText(getFiltersPresentation());
|
||||
}
|
||||
|
||||
private @NlsSafe String getFiltersPresentation() {
|
||||
return StreamEx.of(myClassExclusionFilters).filter(ClassFilter::isEnabled).map(f -> "-" + f.getPattern())
|
||||
.prepend(StreamEx.of(myClassFilters).filter(ClassFilter::isEnabled).map(ClassFilter::getPattern))
|
||||
.joining(" ");
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ public class StackCapturingLineBreakpoint extends SyntheticMethodBreakpoint {
|
||||
|
||||
@Override
|
||||
public void customizeRenderer(SimpleColoredComponent renderer) {
|
||||
renderer.append("Capture point at " + myCapturePoint.myClassName + "." + myCapturePoint.myMethodName);
|
||||
renderer.append(JavaDebuggerBundle.message("label.capture.point.at", myCapturePoint.myClassName, myCapturePoint.myMethodName));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -89,7 +89,7 @@ public class DebuggerTreeBase extends DnDAwareTree implements Disposable {
|
||||
final JToolTip tooltip = new JToolTip();
|
||||
|
||||
if (tipText == null) {
|
||||
tooltip.setTipText(tipText);
|
||||
tooltip.setTipText(null);
|
||||
}
|
||||
else {
|
||||
Dimension rootSize = getVisibleRect().getSize();
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.CustomShortcutSet;
|
||||
import com.intellij.openapi.actionSystem.DataProvider;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.pom.Navigatable;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.table.TableView;
|
||||
@@ -212,7 +213,7 @@ public class OverheadView extends BorderLayoutPanel implements Disposable, DataP
|
||||
private static class TimingColumnInfo extends ColumnInfo<OverheadProducer, OverheadProducer> {
|
||||
private final Function<? super OverheadProducer, Long> myGetter;
|
||||
|
||||
TimingColumnInfo(@NotNull String name, Function<? super OverheadProducer, Long> getter) {
|
||||
TimingColumnInfo(@NotNull @NlsContexts.ColumnName String name, Function<? super OverheadProducer, Long> getter) {
|
||||
super(name);
|
||||
myGetter = getter;
|
||||
}
|
||||
@@ -242,7 +243,7 @@ public class OverheadView extends BorderLayoutPanel implements Disposable, DataP
|
||||
if (value instanceof OverheadProducer) {
|
||||
OverheadProducer overheadProducer = (OverheadProducer)value;
|
||||
Long val = myGetter.apply(overheadProducer);
|
||||
append(val != null ? String.valueOf(val) : "",
|
||||
append(val != null ? val.toString() : "",
|
||||
overheadProducer.isEnabled() ? SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES : SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,11 +16,12 @@
|
||||
package com.intellij.debugger.ui.tree.render;
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
|
||||
public interface NodeRenderer extends ChildrenRenderer, ValueLabelRenderer {
|
||||
ExtensionPointName<NodeRenderer> EP_NAME = ExtensionPointName.create("com.intellij.debugger.nodeRenderer");
|
||||
|
||||
String getName();
|
||||
@Nls String getName();
|
||||
|
||||
void setName(String text);
|
||||
|
||||
|
||||
@@ -576,4 +576,8 @@ surround.with.runtime.type.template=((RuntimeType)expr)
|
||||
command.name.surround.with.runtime.cast=Surround with runtime cast
|
||||
checkbox.start.tracing=start
|
||||
checkbox.stop.tracing=stop
|
||||
checkbox.tracking.filters=filters
|
||||
checkbox.tracking.filters=filters
|
||||
status.text.select.instance.to.see.stack.frame=Select instance to see stack frame
|
||||
label.arrays.could.not.be.tracked=Arrays could not be tracked
|
||||
status.text.no.stack.frame.for.this.instance=No stack frame for this instance
|
||||
label.capture.point.at=Capture point at {0}.{1}
|
||||
@@ -28,6 +28,7 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsActions;
|
||||
import com.intellij.openapi.util.io.StreamUtil;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
@@ -190,7 +191,7 @@ public class DefaultJavaProgramRunner implements JvmPatchableProgramRunner<Runne
|
||||
private abstract static class ProxyBasedAction extends AnAction {
|
||||
protected final ProcessHandler myProcessHandler;
|
||||
|
||||
protected ProxyBasedAction(String text, String description, Icon icon, ProcessHandler processHandler) {
|
||||
protected ProxyBasedAction(@NlsActions.ActionText String text, @NlsActions.ActionDescription String description, Icon icon, ProcessHandler processHandler) {
|
||||
super(text, description, icon);
|
||||
myProcessHandler = processHandler;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ package com.intellij.execution.jshell;
|
||||
import com.intellij.notification.Notification;
|
||||
import com.intellij.notification.NotificationType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
|
||||
/**
|
||||
@@ -11,9 +13,9 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
*/
|
||||
public final class JShellDiagnostic {
|
||||
private static final String NOTIFICATION_GROUP = "JSHELL_NOTIFICATIONS";
|
||||
private static final String TITLE = "JShell";
|
||||
static final @NlsSafe String TITLE = "JShell";
|
||||
|
||||
public static void notifyInfo(final String text, final Project project) {
|
||||
public static void notifyInfo(final @NlsContexts.NotificationContent String text, final Project project) {
|
||||
new Notification(NOTIFICATION_GROUP, TITLE, text, NotificationType.INFORMATION).notify(project);
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ public final class JShellHandler {
|
||||
@Nullable Sdk alternateSdk) throws Exception{
|
||||
final OSProcessHandler processHandler = launchProcess(project, module, alternateSdk);
|
||||
|
||||
final String title = "JShell " + contentFile.getNameWithoutExtension();
|
||||
final String title = JShellDiagnostic.TITLE + " " + contentFile.getNameWithoutExtension();
|
||||
|
||||
final ConsoleViewImpl consoleView = new MyConsoleView(project);
|
||||
final RunContentDescriptor descriptor = new RunContentDescriptor(consoleView, processHandler, new JPanel(new BorderLayout()), title);
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.intellij.openapi.ui.ComboBox;
|
||||
import com.intellij.openapi.ui.ComponentValidator;
|
||||
import com.intellij.openapi.ui.LabeledComponent;
|
||||
import com.intellij.openapi.ui.ValidationInfo;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
@@ -24,6 +25,7 @@ import com.intellij.ui.components.DropDownLink;
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.UI;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -310,7 +312,7 @@ public class RemoteConfigurable extends SettingsEditor<RemoteConfiguration> {
|
||||
return mainPanel;
|
||||
}
|
||||
|
||||
private static JLabel createLabelFor(String labelText, JComponent forComponent) {
|
||||
private static JLabel createLabelFor(@NlsContexts.Label String labelText, JComponent forComponent) {
|
||||
JLabel label = new JLabel();
|
||||
LabeledComponent.TextWithMnemonic.fromTextWithMnemonic(labelText).setToLabel(label);
|
||||
label.setLabelFor(forComponent);
|
||||
|
||||
+7
-6
@@ -25,6 +25,7 @@ import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.impl.ActionButton;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ReadAction;
|
||||
import com.intellij.openapi.compiler.JavaCompilerBundle;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
@@ -37,6 +38,7 @@ import com.intellij.openapi.ui.popup.JBPopup;
|
||||
import com.intellij.openapi.ui.popup.PopupChooserBuilder;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.NlsActions;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -84,7 +86,6 @@ import static com.intellij.openapi.actionSystem.CommonDataKeys.*;
|
||||
import static com.intellij.openapi.util.Pair.pair;
|
||||
|
||||
public class ShowAffectedTestsAction extends AnAction {
|
||||
private static final String RUN_ALL_ACTION_TEXT = "Run All Affected Tests";
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
@@ -257,7 +258,7 @@ public class ShowAffectedTestsAction extends AnAction {
|
||||
}
|
||||
return virtualFiles == null
|
||||
? Collections.emptyList()
|
||||
: Arrays.stream(virtualFiles).filter(v -> v.isInLocalFileSystem()).collect(Collectors.toList());
|
||||
: ContainerUtil.filter(virtualFiles, v -> v.isInLocalFileSystem());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -298,7 +299,7 @@ public class ShowAffectedTestsAction extends AnAction {
|
||||
ConfigurationContext context = ConfigurationContext.getFromContext(dataContext);
|
||||
|
||||
ActiveComponent runButton =
|
||||
createButton(RUN_ALL_ACTION_TEXT, AllIcons.Actions.Execute, () -> runAllDiscoveredTests(project, tree, ref, context, initTitle), tree);
|
||||
createButton(JavaCompilerBundle.message("action.run.all.affected.tests.text"), AllIcons.Actions.Execute, () -> runAllDiscoveredTests(project, tree, ref, context, initTitle), tree);
|
||||
|
||||
Runnable pinActionListener = () -> {
|
||||
UsageView view = FindUtil.showInUsageView(null, tree.getTestMethods(), param -> param, initTitle, p -> {
|
||||
@@ -309,7 +310,7 @@ public class ShowAffectedTestsAction extends AnAction {
|
||||
p.setExcludeAvailable(false);
|
||||
}, project);
|
||||
if (view != null) {
|
||||
view.addButtonToLowerPane(new AbstractAction(RUN_ALL_ACTION_TEXT, AllIcons.Actions.Execute) {
|
||||
view.addButtonToLowerPane(new AbstractAction(JavaCompilerBundle.message("action.run.all.affected.tests.text"), AllIcons.Actions.Execute) {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
runAllDiscoveredTests(project, tree, ref, context, initTitle);
|
||||
@@ -328,7 +329,7 @@ public class ShowAffectedTestsAction extends AnAction {
|
||||
(findUsageKeyStroke == null ? "" : " " + KeymapUtil.getKeystrokeText(findUsageKeyStroke));
|
||||
ActiveComponent pinButton = createButton(pinTooltip, AllIcons.General.Pin_tab, pinActionListener, tree);
|
||||
|
||||
PopupChooserBuilder builder =
|
||||
PopupChooserBuilder<?> builder =
|
||||
new PopupChooserBuilder(tree)
|
||||
.setTitle(initTitle)
|
||||
.setMovable(true)
|
||||
@@ -415,7 +416,7 @@ public class ShowAffectedTestsAction extends AnAction {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static ActiveComponent createButton(@NotNull String text,
|
||||
private static ActiveComponent createButton(@NotNull @NlsActions.ActionText String text,
|
||||
@NotNull Icon icon,
|
||||
@NotNull Runnable listener,
|
||||
@NotNull DiscoveredTestsTree tree) {
|
||||
|
||||
+2
-1
@@ -9,6 +9,7 @@ import com.intellij.openapi.fileEditor.*;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleUtilCore;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.Segment;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -75,7 +76,7 @@ class TestMethodUsage implements Usage, UsageInFile, UsageInModule, PsiElementUs
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getPlainText() {
|
||||
public @NlsSafe String getPlainText() {
|
||||
return StringUtil.notNullize(Objects.requireNonNull(getElement()).getName());
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -74,14 +74,13 @@ public class TestFailedLineInspection extends LocalInspectionTool {
|
||||
}
|
||||
|
||||
private static class RunActionFix implements LocalQuickFix, Iconable {
|
||||
private final ConfigurationContext myContext;
|
||||
private final Executor myExecutor;
|
||||
private final RunnerAndConfigurationSettings myConfiguration;
|
||||
|
||||
RunActionFix(PsiElement element, String executorId) {
|
||||
myExecutor = ExecutorRegistry.getInstance().getExecutorById(executorId);
|
||||
myContext = new ConfigurationContext(element);
|
||||
myConfiguration = myContext.getConfiguration();
|
||||
ConfigurationContext context = new ConfigurationContext(element);
|
||||
myConfiguration = context.getConfiguration();
|
||||
}
|
||||
|
||||
@Nls(capitalization = Nls.Capitalization.Sentence)
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.ex.MessagesEx;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
@@ -23,9 +24,9 @@ import org.jetbrains.annotations.Nullable;
|
||||
import javax.swing.*;
|
||||
|
||||
public abstract class ClassBrowser<T extends JComponent> extends BrowseModuleValueActionListener<T> {
|
||||
private final String myTitle;
|
||||
private final @NlsContexts.DialogTitle String myTitle;
|
||||
|
||||
public ClassBrowser(@NotNull Project project, String title) {
|
||||
public ClassBrowser(@NotNull Project project, @NlsContexts.DialogTitle String title) {
|
||||
super(project);
|
||||
myTitle = title;
|
||||
}
|
||||
@@ -89,11 +90,11 @@ public abstract class ClassBrowser<T extends JComponent> extends BrowseModuleVal
|
||||
public abstract static class MainClassBrowser<T extends JComponent> extends ClassBrowser<T> {
|
||||
private final Computable<? extends Module> myModuleSelector;
|
||||
|
||||
public MainClassBrowser(@NotNull Project project, @NotNull ConfigurationModuleSelector moduleSelector, String title) {
|
||||
public MainClassBrowser(@NotNull Project project, @NotNull ConfigurationModuleSelector moduleSelector, @NlsContexts.DialogTitle String title) {
|
||||
this(project, () -> moduleSelector.getModule(), title);
|
||||
}
|
||||
|
||||
public MainClassBrowser(@NotNull Project project, @NotNull Computable<? extends Module> moduleSelector, String title) {
|
||||
public MainClassBrowser(@NotNull Project project, @NotNull Computable<? extends Module> moduleSelector, @NlsContexts.DialogTitle String title) {
|
||||
super(project, title);
|
||||
myModuleSelector = moduleSelector;
|
||||
}
|
||||
|
||||
+2
-1
@@ -20,6 +20,7 @@ import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionUtil;
|
||||
import com.intellij.openapi.ide.CopyPasteManager;
|
||||
import com.intellij.openapi.ui.FixedSizeButton;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.ui.PopupHandler;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
@@ -74,7 +75,7 @@ public class ConfigurationArgumentsHelpArea extends JPanel {
|
||||
myHelpArea.setText(text);
|
||||
}
|
||||
|
||||
public void setLabelText(final String text) {
|
||||
public void setLabelText(final @NlsContexts.Label String text) {
|
||||
myLabel.setText(text);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// 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.execution.ui;
|
||||
|
||||
import com.intellij.core.JavaPsiBundle;
|
||||
import com.intellij.execution.ExecutionBundle;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.util.BrowseFilesListener;
|
||||
@@ -12,6 +13,8 @@ import com.intellij.openapi.ui.BrowseFolderRunnable;
|
||||
import com.intellij.openapi.ui.ComboBox;
|
||||
import com.intellij.openapi.ui.LabeledComponent;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -35,7 +38,6 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class JrePathEditor extends LabeledComponent<ComboBox> implements PanelWithAnchor {
|
||||
private static final String DEFAULT_JRE_TEXT = "Default";
|
||||
private final JreComboboxEditor myComboboxEditor;
|
||||
private final DefaultJreItem myDefaultJreItem;
|
||||
private DefaultJreSelector myDefaultJreSelector;
|
||||
@@ -150,7 +152,7 @@ public class JrePathEditor extends LabeledComponent<ComboBox> implements PanelWi
|
||||
}
|
||||
}
|
||||
});
|
||||
field.setTextToTriggerEmptyTextStatus(DEFAULT_JRE_TEXT);
|
||||
field.setTextToTriggerEmptyTextStatus(JavaPsiBundle.message("default.jre.name"));
|
||||
|
||||
return field;
|
||||
}
|
||||
@@ -214,7 +216,7 @@ public class JrePathEditor extends LabeledComponent<ComboBox> implements PanelWi
|
||||
private void updateDefaultJrePresentation() {
|
||||
StatusText text = myComboboxEditor.getEmptyText();
|
||||
text.clear();
|
||||
text.appendText(DEFAULT_JRE_TEXT, SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
text.appendText(JavaPsiBundle.message("default.jre.name"), SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
text.appendText(myDefaultJreSelector.getDescriptionString(), SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
}
|
||||
|
||||
@@ -242,7 +244,7 @@ public class JrePathEditor extends LabeledComponent<ComboBox> implements PanelWi
|
||||
@Nullable
|
||||
default String getVersion() { return null; }
|
||||
@NotNull
|
||||
default String getDescription() { return getPresentableText(); }
|
||||
default @NlsSafe String getDescription() { return getPresentableText(); }
|
||||
int getOrder();
|
||||
}
|
||||
|
||||
@@ -309,7 +311,7 @@ public class JrePathEditor extends LabeledComponent<ComboBox> implements PanelWi
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPresentableText() {
|
||||
public @NlsContexts.Label String getPresentableText() {
|
||||
return myName != null && !myPath.equals(myName) ? myName : FileUtil.toSystemDependentName(myPath);
|
||||
}
|
||||
|
||||
@@ -332,7 +334,7 @@ public class JrePathEditor extends LabeledComponent<ComboBox> implements PanelWi
|
||||
private class DefaultJreItem implements JreComboBoxItem {
|
||||
@Override
|
||||
public void render(SimpleColoredComponent component, boolean selected) {
|
||||
component.append(DEFAULT_JRE_TEXT);
|
||||
component.append(JavaPsiBundle.message("default.jre.name"));
|
||||
//may be null if JrePathEditor is added to a GUI Form where the default constructor is used and setDefaultJreSelector isn't called
|
||||
if (myDefaultJreSelector != null) {
|
||||
component.append(myDefaultJreSelector.getDescriptionString(), SimpleTextAttributes.GRAY_ATTRIBUTES);
|
||||
@@ -341,7 +343,7 @@ public class JrePathEditor extends LabeledComponent<ComboBox> implements PanelWi
|
||||
|
||||
@Override
|
||||
public String getPresentableText() {
|
||||
return DEFAULT_JRE_TEXT;
|
||||
return JavaPsiBundle.message("default.jre.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -374,7 +376,7 @@ public class JrePathEditor extends LabeledComponent<ComboBox> implements PanelWi
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPresentableText() {
|
||||
public @NlsContexts.Label String getPresentableText() {
|
||||
return ExecutionBundle.message("run.configuration.select.alternate.jre.action");
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.intellij.openapi.module.ModuleType;
|
||||
import com.intellij.openapi.module.ModuleTypeManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.ComboBox;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.ui.CollectionComboBoxModel;
|
||||
import com.intellij.ui.ColoredListCellRenderer;
|
||||
import com.intellij.ui.ComboboxSpeedSearch;
|
||||
@@ -38,7 +39,7 @@ public class ModuleClasspathCombo extends ComboBox<ModuleClasspathCombo.Item> {
|
||||
}
|
||||
|
||||
private Module myModule;
|
||||
private String myOptionName;
|
||||
private @NlsSafe String myOptionName;
|
||||
public boolean myOptionValue;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -9,6 +9,7 @@ import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.module.ModuleUtilCore;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
@@ -91,13 +92,13 @@ public class JavaRunConfigurationModule extends RunConfigurationModule {
|
||||
return psiClass;
|
||||
}
|
||||
|
||||
public PsiClass checkModuleAndClassName(final String className, final String expectedClassMessage) throws RuntimeConfigurationException {
|
||||
public PsiClass checkModuleAndClassName(final String className, final @NlsContexts.DialogMessage String expectedClassMessage) throws RuntimeConfigurationException {
|
||||
checkForWarning();
|
||||
return checkClassName(className, expectedClassMessage);
|
||||
}
|
||||
|
||||
|
||||
public PsiClass checkClassName(final String className, final String errorMessage) throws RuntimeConfigurationException {
|
||||
public PsiClass checkClassName(final String className, final @NlsContexts.DialogMessage String errorMessage) throws RuntimeConfigurationException {
|
||||
if (className == null || className.length() == 0) {
|
||||
throw new RuntimeConfigurationError(errorMessage);
|
||||
}
|
||||
|
||||
+2
-1
@@ -31,6 +31,7 @@ import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog;
|
||||
import com.intellij.openapi.roots.ui.configuration.FacetsProvider;
|
||||
import com.intellij.openapi.roots.ui.configuration.ModulesProvider;
|
||||
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.packaging.artifacts.Artifact;
|
||||
import com.intellij.packaging.artifacts.ArtifactModel;
|
||||
import com.intellij.packaging.artifacts.ArtifactType;
|
||||
@@ -145,7 +146,7 @@ public class ArtifactEditorContextImpl implements ArtifactEditorContext {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Artifact> chooseArtifacts(final List<? extends Artifact> artifacts, final String title) {
|
||||
public List<Artifact> chooseArtifacts(final List<? extends Artifact> artifacts, final @NlsContexts.DialogTitle String title) {
|
||||
ChooseArtifactsDialog dialog = new ChooseArtifactsDialog(getProject(), artifacts, title, null);
|
||||
return dialog.showAndGet() ? dialog.getChosenElements() : Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -78,6 +78,8 @@ dataflow.message.storing.array.nullable=Expression <code>#ref</code> might evalu
|
||||
dataflow.message.unboxing.method.reference=Use of <code>#ref</code> #loc would need unboxing which may produce <code>NullPointerException</code>
|
||||
dataflow.message.unboxing=Unboxing of <code>#ref</code> #loc may produce <code>NullPointerException</code>
|
||||
dataflow.message.unreachable.switch.label=Switch label <code>#ref</code> #loc is unreachable
|
||||
dataflow.message.constant.expression=Result of <code>#ref</code> #loc is always ''{0}''
|
||||
dataflow.message.constant.value=Value <code>#ref</code> #loc is always ''{0}''
|
||||
dataflow.method.fails.with.null.argument=Method will throw an exception when parameter is null
|
||||
dataflow.not.precise={0} is complex: data flow results could be imprecise
|
||||
dataflow.too.complex={0} is too complex to analyze by data flow algorithm
|
||||
@@ -426,3 +428,19 @@ suspicious.invocation.handler.implementation.method.unused.message=Method is nev
|
||||
suspicious.invocation.handler.implementation.type.mismatch.message=Incompatible type might be returned when proxying method ''{0}()'': required: {1}; got: {2}
|
||||
suspicious.invocation.handler.implementation.null.returned.for.toString.message=Null might be returned when proxying method 'toString()': this is discouraged
|
||||
suspicious.invocation.handler.implementation.null.returned.message=Null might be returned when proxying method ''{0}()'': this may cause NullPointerException
|
||||
error.class.not.found=Class {0} not found
|
||||
intention.name.qualify.expression=Qualify {0} expression with ''{1}''
|
||||
nullability.null=null
|
||||
nullability.nullable=nullable
|
||||
nullability.non.null=non-null
|
||||
long.range.set.presentation.empty=unknown
|
||||
long.range.set.presentation.any=any value
|
||||
long.range.set.presentation.two.values={0} or {1}
|
||||
long.range.set.presentation.range=in {0}
|
||||
long.range.set.presentation.even=even
|
||||
long.range.set.presentation.odd=odd
|
||||
long.range.set.presentation.divisible.by=divisible by {0}
|
||||
long.range.set.presentation.range.with.mod={0}; {1}
|
||||
duplication.policy.ask=Ask
|
||||
duplication.policy.replace=Replace existing
|
||||
duplication.policy.generate.duplicate=Generate duplicating method
|
||||
|
||||
+1
-1
@@ -395,7 +395,7 @@ public final class AnnotationsHighlightUtil {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static HighlightInfo annotationError(@NotNull PsiAnnotation annotation, @NotNull String message) {
|
||||
private static HighlightInfo annotationError(@NotNull PsiAnnotation annotation, @NotNull @NlsContexts.DetailedDescription String message) {
|
||||
LocalQuickFixAndIntentionActionOnPsiElement fix =
|
||||
QuickFixFactory.getInstance().createDeleteFix(annotation, JavaAnalysisBundle.message("intention.text.remove.annotation"));
|
||||
return annotationError(annotation, message, fix);
|
||||
|
||||
+1
-1
@@ -764,7 +764,7 @@ public final class HighlightUtil {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String formatClass(@NotNull PsiClass aClass) {
|
||||
public static @NlsSafe String formatClass(@NotNull PsiClass aClass) {
|
||||
return formatClass(aClass, true);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -3,6 +3,7 @@ package com.intellij.codeInsight.daemon.impl.analysis;
|
||||
|
||||
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
|
||||
import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
|
||||
import com.intellij.java.analysis.JavaAnalysisBundle;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiImportStaticStatement;
|
||||
@@ -23,7 +24,7 @@ public final class ImportsHighlightUtil {
|
||||
if (resolve != null) {
|
||||
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR)
|
||||
.range(ObjectUtils.notNull(ref.getReferenceNameElement(), ref))
|
||||
.descriptionAndTooltip("Class " + ref.getCanonicalText() + " not found").create();
|
||||
.descriptionAndTooltip(JavaAnalysisBundle.message("error.class.not.found", ref.getCanonicalText())).create();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@ import com.intellij.java.analysis.JavaAnalysisBundle;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleUtilCore;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.util.PsiFormatUtil;
|
||||
@@ -115,7 +116,7 @@ public final class JavaHighlightUtil {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String formatMethod(@NotNull PsiMethod method) {
|
||||
public static @NlsSafe String formatMethod(@NotNull PsiMethod method) {
|
||||
return PsiFormatUtil.formatMethod(method, PsiSubstitutor.EMPTY, PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_PARAMETERS,
|
||||
PsiFormatUtilBase.SHOW_TYPE);
|
||||
}
|
||||
|
||||
+2
-1
@@ -29,6 +29,7 @@ import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.pom.PomNamedTarget;
|
||||
@@ -347,7 +348,7 @@ class PostHighlightingVisitor {
|
||||
return StringUtil.capitalize(message);
|
||||
}
|
||||
|
||||
private HighlightInfo suggestionsToMakeFieldUsed(@NotNull PsiField field, @NotNull PsiIdentifier identifier, @NotNull String message) {
|
||||
private HighlightInfo suggestionsToMakeFieldUsed(@NotNull PsiField field, @NotNull PsiIdentifier identifier, @NotNull @NlsContexts.DetailedDescription String message) {
|
||||
HighlightInfo highlightInfo = UnusedSymbolUtil.createUnusedSymbolInfo(identifier, message, myDeadCodeInfoType);
|
||||
SpecialAnnotationsUtilBase.createAddToSpecialAnnotationFixes(field, annoName -> {
|
||||
QuickFixAction
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ public abstract class QualifyThisOrSuperArgumentFix implements IntentionAction {
|
||||
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
|
||||
if (!myExpression.isValid()) return false;
|
||||
if (!myPsiClass.isValid()) return false;
|
||||
myText = "Qualify " + getQualifierText() + " expression with '" + myPsiClass.getQualifiedName() + "'";
|
||||
myText = JavaAnalysisBundle.message("intention.name.qualify.expression", getQualifierText(), myPsiClass.getQualifiedName());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+5
-7
@@ -38,7 +38,6 @@ import org.jdom.Element;
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Stream;
|
||||
@@ -445,18 +444,17 @@ public abstract class DataFlowInspectionBase extends AbstractBaseJavaLocalInspec
|
||||
ContainerUtil.addIfNotNull(fixes, createExplainFix(ref, new TrackingRunner.ValueDfaProblemType(value)));
|
||||
}
|
||||
|
||||
String valueText;
|
||||
ProblemHighlightType type;
|
||||
String message;
|
||||
if (ref instanceof PsiMethodCallExpression || ref instanceof PsiPolyadicExpression) {
|
||||
type = ProblemHighlightType.GENERIC_ERROR_OR_WARNING;
|
||||
valueText = "Result of";
|
||||
message = JavaAnalysisBundle.message("dataflow.message.constant.expression", presentableName);
|
||||
}
|
||||
else {
|
||||
type = ProblemHighlightType.WEAK_WARNING;
|
||||
valueText = "Value";
|
||||
message = JavaAnalysisBundle.message("dataflow.message.constant.value", presentableName);
|
||||
}
|
||||
reporter.registerProblem(ref, MessageFormat.format("{0} <code>#ref</code> #loc is always ''{1}''", valueText, presentableName),
|
||||
type, fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
|
||||
reporter.registerProblem(ref, message, type, fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
|
||||
}
|
||||
|
||||
private static boolean shouldReportZero(PsiExpression ref) {
|
||||
@@ -477,7 +475,7 @@ public abstract class DataFlowInspectionBase extends AbstractBaseJavaLocalInspec
|
||||
PsiMethodCallExpression call = (PsiMethodCallExpression)ref;
|
||||
PsiExpression qualifier = call.getMethodExpression().getQualifierExpression();
|
||||
if (PsiUtil.isConstantExpression(qualifier) &&
|
||||
Stream.of(call.getArgumentList().getExpressions()).allMatch(PsiUtil::isConstantExpression)) {
|
||||
ContainerUtil.and(call.getArgumentList().getExpressions(), PsiUtil::isConstantExpression)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+13
-10
@@ -5,9 +5,13 @@ import com.intellij.codeInsight.Nullability;
|
||||
import com.intellij.codeInspection.dataFlow.types.DfReferenceType;
|
||||
import com.intellij.codeInspection.dataFlow.types.DfType;
|
||||
import com.intellij.codeInspection.dataFlow.types.DfTypes;
|
||||
import com.intellij.java.analysis.JavaAnalysisBundle;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* Represents a value nullability within DFA. Unlike {@link Nullability} may have more fine-grained
|
||||
* values useful during the DFA. If you have a DfaNullability value (e.g. from {@link CommonDataflow}),
|
||||
@@ -18,21 +22,21 @@ public enum DfaNullability {
|
||||
/**
|
||||
* Means: exactly null
|
||||
*/
|
||||
NULL("Null", "null", Nullability.NULLABLE),
|
||||
NULLABLE("Nullable", "nullable", Nullability.NULLABLE),
|
||||
NOT_NULL("Not-null", "non-null", Nullability.NOT_NULL),
|
||||
UNKNOWN("Unknown", "", Nullability.UNKNOWN),
|
||||
NULL("Null", JavaAnalysisBundle.messagePointer("nullability.null"), Nullability.NULLABLE),
|
||||
NULLABLE("Nullable", JavaAnalysisBundle.messagePointer("nullability.nullable"), Nullability.NULLABLE),
|
||||
NOT_NULL("Not-null", JavaAnalysisBundle.messagePointer("nullability.non.null"), Nullability.NOT_NULL),
|
||||
UNKNOWN("Unknown", () -> "", Nullability.UNKNOWN),
|
||||
/**
|
||||
* Means: non-stable variable declared as Nullable was checked for nullity and flushed afterwards (e.g. by unknown method call),
|
||||
* so we are unsure about its nullability anymore.
|
||||
*/
|
||||
FLUSHED("Flushed", "", Nullability.UNKNOWN);
|
||||
FLUSHED("Flushed", () -> "", Nullability.UNKNOWN);
|
||||
|
||||
private final @NotNull String myInternalName;
|
||||
private final @NotNull String myPresentationalName;
|
||||
private final @NotNull Supplier<@Nls String> myPresentationalName;
|
||||
private final @NotNull Nullability myNullability;
|
||||
|
||||
DfaNullability(@NotNull String internalName, @NotNull String presentationalName, @NotNull Nullability nullability) {
|
||||
DfaNullability(@NotNull String internalName, @NotNull Supplier<@Nls String> presentationalName, @NotNull Nullability nullability) {
|
||||
myInternalName = internalName;
|
||||
myPresentationalName = presentationalName;
|
||||
myNullability = nullability;
|
||||
@@ -43,9 +47,8 @@ public enum DfaNullability {
|
||||
return myInternalName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getPresentationName() {
|
||||
return myPresentationalName;
|
||||
public @NotNull @Nls String getPresentationName() {
|
||||
return myPresentationalName.get();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+3
-3
@@ -454,11 +454,11 @@ public final class TrackingRunner extends DataFlowRunner {
|
||||
}
|
||||
|
||||
static class RangeDfaProblemType extends DfaProblemType {
|
||||
final @NotNull String myTemplate;
|
||||
final @NotNull @Nls String myTemplate;
|
||||
final @NotNull LongRangeSet myRangeSet;
|
||||
final @Nullable PsiPrimitiveType myType;
|
||||
|
||||
RangeDfaProblemType(@NotNull String template, @NotNull LongRangeSet set, @Nullable PsiPrimitiveType type) {
|
||||
RangeDfaProblemType(@NotNull @Nls String template, @NotNull LongRangeSet set, @Nullable PsiPrimitiveType type) {
|
||||
myTemplate = template;
|
||||
myRangeSet = set;
|
||||
myType = type;
|
||||
@@ -1250,7 +1250,7 @@ public final class TrackingRunner extends DataFlowRunner {
|
||||
|
||||
@NotNull
|
||||
private CauseItem fromSingleContract(@NotNull MemoryStateChange history, @NotNull PsiMethodCallExpression call,
|
||||
@NotNull PsiMethod method, @NotNull String prefix, @NotNull MethodContract contract) {
|
||||
@NotNull PsiMethod method, @NotNull @Nls String prefix, @NotNull MethodContract contract) {
|
||||
List<ContractValue> conditions = contract.getConditions();
|
||||
String conditionsText = StringUtil.join(conditions, c -> c.getPresentationText(method), " and ");
|
||||
String returnValueText = contract.getReturnValue().isFail() ? "throws exception" : "returns '" + contract.getReturnValue() + "' value";
|
||||
|
||||
+26
-16
@@ -3,6 +3,8 @@ package com.intellij.codeInspection.dataFlow.rangeSet;
|
||||
|
||||
import com.intellij.codeInsight.AnnotationUtil;
|
||||
import com.intellij.codeInspection.dataFlow.value.RelationType;
|
||||
import com.intellij.java.analysis.JavaAnalysisBundle;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.util.TypeConversionUtil;
|
||||
@@ -664,7 +666,7 @@ public abstract class LongRangeSet {
|
||||
return from < to ? modRange(from, to, Long.SIZE, modBits) : modRange(to, from, Long.SIZE, modBits);
|
||||
}
|
||||
|
||||
private static String formatNumber(long value) {
|
||||
private static @NlsSafe String formatNumber(long value) {
|
||||
if (value == Long.MAX_VALUE) return "Long.MAX_VALUE";
|
||||
if (value == Long.MAX_VALUE - 1) return "Long.MAX_VALUE-1";
|
||||
if (value == Long.MIN_VALUE) return "Long.MIN_VALUE";
|
||||
@@ -971,7 +973,7 @@ public abstract class LongRangeSet {
|
||||
|
||||
@Override
|
||||
public String getPresentationText(PsiType type) {
|
||||
return "unknown";
|
||||
return JavaAnalysisBundle.message("long.range.set.presentation.empty");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1337,7 +1339,7 @@ public abstract class LongRangeSet {
|
||||
if (set != null) {
|
||||
if (set.min() == myFrom) {
|
||||
if (set.max() == myTo) {
|
||||
return "any value";
|
||||
return JavaAnalysisBundle.message("long.range.set.presentation.any");
|
||||
}
|
||||
return "<= " + LongRangeSet.formatNumber(myTo);
|
||||
}
|
||||
@@ -1346,9 +1348,9 @@ public abstract class LongRangeSet {
|
||||
}
|
||||
}
|
||||
if (myTo - myFrom == 1) {
|
||||
return myFrom + " or " + myTo;
|
||||
return JavaAnalysisBundle.message("long.range.set.presentation.two.values", myFrom, myTo);
|
||||
}
|
||||
return "in " + toString();
|
||||
return JavaAnalysisBundle.message("long.range.set.presentation.range", toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1690,7 +1692,7 @@ public abstract class LongRangeSet {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
public @NlsSafe String toString() {
|
||||
return "{" + toString(myFrom, myTo) + "}";
|
||||
}
|
||||
}
|
||||
@@ -1715,16 +1717,20 @@ public abstract class LongRangeSet {
|
||||
set = modRange(set.min(), set.max(), myMod, myBits);
|
||||
String prefix = null;
|
||||
if (set.min() == myFrom) {
|
||||
prefix = set.max() == myTo ? "" : "<= " + LongRangeSet.formatNumber(myTo) + "; ";
|
||||
prefix = set.max() == myTo ? "" : "<= " + LongRangeSet.formatNumber(myTo);
|
||||
}
|
||||
else if (set.max() == myTo) {
|
||||
prefix = ">= " + LongRangeSet.formatNumber(myFrom) + "; ";
|
||||
prefix = ">= " + LongRangeSet.formatNumber(myFrom);
|
||||
}
|
||||
if (prefix != null) {
|
||||
return prefix + getSuffix();
|
||||
if (prefix.isEmpty()) {
|
||||
return getSuffix();
|
||||
}
|
||||
return JavaAnalysisBundle.message("long.range.set.presentation.range.with.mod", prefix, getSuffix());
|
||||
}
|
||||
}
|
||||
return "in " + super.toString() + "; " + getSuffix();
|
||||
String rangeMessage = JavaAnalysisBundle.message("long.range.set.presentation.range", super.toString());
|
||||
return JavaAnalysisBundle.message("long.range.set.presentation.range.with.mod", rangeMessage, getSuffix());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1941,13 +1947,15 @@ public abstract class LongRangeSet {
|
||||
return super.toString() + ": " + getSuffix();
|
||||
}
|
||||
|
||||
private String getSuffix() {
|
||||
private @Nls String getSuffix() {
|
||||
String suffix;
|
||||
if (myMod == 2) {
|
||||
suffix = myBits == 1 ? "even" : "odd";
|
||||
suffix = myBits == 1 ?
|
||||
JavaAnalysisBundle.message("long.range.set.presentation.even") :
|
||||
JavaAnalysisBundle.message("long.range.set.presentation.odd");
|
||||
}
|
||||
else if (myBits == 1) {
|
||||
suffix = "divisible by " + myMod;
|
||||
suffix = JavaAnalysisBundle.message("long.range.set.presentation.divisible.by", myMod);
|
||||
}
|
||||
else {
|
||||
suffix = IntStreamEx.of(BitSet.valueOf(new long[]{myBits})).joining(", ", "<", "> mod " + myMod);
|
||||
@@ -2156,13 +2164,15 @@ public abstract class LongRangeSet {
|
||||
diff.min() == set.min() ? "" : diff.min() == set.min() + 1 ? formatNumber(set.min()) : "<= " + formatNumber(diff.min() - 1);
|
||||
String max =
|
||||
diff.max() == set.max() ? "" : diff.max() == set.max() - 1 ? formatNumber(set.max()) : ">= " + formatNumber(diff.max() + 1);
|
||||
return StreamEx.of(min, max).without("").joining(" or ");
|
||||
if (min.isEmpty()) return max;
|
||||
if (max.isEmpty()) return min;
|
||||
return JavaAnalysisBundle.message("long.range.set.presentation.two.values", min, max);
|
||||
}
|
||||
}
|
||||
if (myRanges.length == 4 && myRanges[0] == myRanges[1] && myRanges[2] == myRanges[3]) {
|
||||
return myRanges[0] + " or " + myRanges[2];
|
||||
return JavaAnalysisBundle.message("long.range.set.presentation.two.values", myRanges[0], myRanges[2]);
|
||||
}
|
||||
return "in " + toString();
|
||||
return JavaAnalysisBundle.message("long.range.set.presentation.range", toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+9
-6
@@ -19,21 +19,24 @@
|
||||
*/
|
||||
package org.jetbrains.java.generate.config;
|
||||
|
||||
import com.intellij.java.analysis.JavaAnalysisBundle;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public enum DuplicationPolicy {
|
||||
ASK("Ask"),
|
||||
REPLACE("Replace existing"),
|
||||
DUPLICATE("Generate duplicating method");
|
||||
ASK(JavaAnalysisBundle.messagePointer("duplication.policy.ask")),
|
||||
REPLACE(JavaAnalysisBundle.messagePointer("duplication.policy.replace")),
|
||||
DUPLICATE(JavaAnalysisBundle.messagePointer("duplication.policy.generate.duplicate"));
|
||||
|
||||
private final @Nls String displayName;
|
||||
private final Supplier<@Nls String> displayName;
|
||||
|
||||
DuplicationPolicy(@Nls String displayName) {
|
||||
DuplicationPolicy(Supplier<@Nls String> displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nls String toString() {
|
||||
return displayName;
|
||||
return displayName.get();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.intellij.refactoring.ui;
|
||||
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.psi.PsiMember;
|
||||
import com.intellij.refactoring.util.classMembers.MemberInfo;
|
||||
import com.intellij.ui.ScrollPaneFactory;
|
||||
@@ -31,7 +32,7 @@ public class MemberSelectionPanel extends AbstractMemberSelectionPanel<PsiMember
|
||||
/**
|
||||
* @param title if title contains 'm' - it would look and feel as mnemonic
|
||||
*/
|
||||
public MemberSelectionPanel(String title, List<MemberInfo> memberInfo, String abstractColumnHeader) {
|
||||
public MemberSelectionPanel(@NlsContexts.Separator String title, List<MemberInfo> memberInfo, String abstractColumnHeader) {
|
||||
super();
|
||||
setLayout(new BorderLayout());
|
||||
|
||||
|
||||
@@ -189,3 +189,4 @@ bad.return.type.in.lambda.expression1=Bad return type in lambda expression: {0}
|
||||
missing.return.value.lambda=Missing return value
|
||||
unexpected.return.value=Unexpected return value
|
||||
lambda.body.must.be.a.statement.expression=Lambda body must be a statement expression
|
||||
default.jre.name=Default
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// 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.openapi.projectRoots;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.util.lang.JavaVersion;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -43,7 +44,7 @@ public enum JavaSdkVersion {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getDescription() {
|
||||
public @NlsSafe String getDescription() {
|
||||
int feature = ordinal();
|
||||
return feature < 5 ? "1." + feature : String.valueOf(feature);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public enum LanguageLevel {
|
||||
public static final LanguageLevel HIGHEST = JDK_14;
|
||||
public static final Key<LanguageLevel> KEY = Key.create("LANGUAGE_LEVEL");
|
||||
|
||||
private final String myPresentableText;
|
||||
private final @Nls String myPresentableText;
|
||||
private final JavaVersion myVersion;
|
||||
private final boolean myPreview;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.intellij.lang.java.parser;
|
||||
import com.intellij.AbstractBundle;
|
||||
import com.intellij.core.JavaPsiBundle;
|
||||
import com.intellij.lang.PsiBuilder;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.psi.JavaTokenType;
|
||||
import com.intellij.psi.PsiKeyword;
|
||||
@@ -188,7 +189,7 @@ public class FileParser {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String error(@NotNull AbstractBundle bundle, @NotNull String errorMessageKey) {
|
||||
private static @NlsContexts.ParsingError String error(@NotNull AbstractBundle bundle, @NotNull String errorMessageKey) {
|
||||
return bundle.getMessage(errorMessageKey);
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import com.intellij.lexer.Lexer;
|
||||
import com.intellij.lexer.TokenList;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
@@ -229,11 +230,11 @@ public final class JavaParserUtil {
|
||||
}
|
||||
|
||||
// used instead of PsiBuilder.error() as it keeps all subsequent error messages
|
||||
public static void error(final PsiBuilder builder, @NotNull String message) {
|
||||
public static void error(final PsiBuilder builder, @NotNull @NlsContexts.ParsingError String message) {
|
||||
builder.mark().error(message);
|
||||
}
|
||||
|
||||
public static void error(final PsiBuilder builder, @NotNull String message, @Nullable final PsiBuilder.Marker before) {
|
||||
public static void error(final PsiBuilder builder, @NotNull @NlsContexts.ParsingError String message, @Nullable final PsiBuilder.Marker before) {
|
||||
if (before == null) {
|
||||
error(builder, message);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ package com.intellij.lang.java.parser;
|
||||
|
||||
import com.intellij.core.JavaPsiBundle;
|
||||
import com.intellij.lang.PsiBuilder;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.psi.JavaTokenType;
|
||||
import com.intellij.psi.PsiKeyword;
|
||||
import com.intellij.psi.impl.source.tree.ElementType;
|
||||
@@ -320,7 +321,7 @@ public class ModuleParser {
|
||||
builder.advanceLexer();
|
||||
}
|
||||
|
||||
private static void parseExtras(PsiBuilder builder, @NotNull String message) {
|
||||
private static void parseExtras(PsiBuilder builder, @NotNull @NlsContexts.ParsingError String message) {
|
||||
PsiBuilder.Marker extras = builder.mark();
|
||||
while (builder.getTokenType() != null) builder.advanceLexer();
|
||||
extras.error(message);
|
||||
|
||||
+5
-4
@@ -8,13 +8,14 @@ import com.intellij.psi.impl.java.stubs.FunctionalExpressionStub;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import com.intellij.psi.util.PsiExpressionTrimRenderer;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class ClassPresentationUtil {
|
||||
private ClassPresentationUtil() {
|
||||
}
|
||||
|
||||
public static String getNameForClass(@NotNull PsiClass aClass, boolean qualified) {
|
||||
public static @Nls String getNameForClass(@NotNull PsiClass aClass, boolean qualified) {
|
||||
if (aClass instanceof PsiAnonymousClass) {
|
||||
if (aClass instanceof PsiEnumConstantInitializer) {
|
||||
PsiEnumConstant enumConstant = ((PsiEnumConstantInitializer)aClass).getEnumConstant();
|
||||
@@ -74,10 +75,10 @@ public final class ClassPresentationUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static String getFunctionalExpressionPresentation(PsiFunctionalExpression functionalExpression, boolean qualified) {
|
||||
final StubElement stub = ((StubBasedPsiElementBase<?>)functionalExpression).getGreenStub();
|
||||
public static @Nls String getFunctionalExpressionPresentation(PsiFunctionalExpression functionalExpression, boolean qualified) {
|
||||
final StubElement<?> stub = ((StubBasedPsiElementBase<?>)functionalExpression).getGreenStub();
|
||||
final String lambdaText = stub instanceof FunctionalExpressionStub
|
||||
? ((FunctionalExpressionStub)stub).getPresentableText()
|
||||
? ((FunctionalExpressionStub<?>)stub).getPresentableText()
|
||||
: PsiExpressionTrimRenderer.render(functionalExpression);
|
||||
return JavaPsiBundle.message("class.context.display", lambdaText, getContextName(functionalExpression, qualified, false)) ;
|
||||
}
|
||||
|
||||
@@ -974,7 +974,7 @@ node.hierarchy.java.lang.object=All classes are derived from java.lang.Object
|
||||
notification.navigation.to.overriding.classes=Navigation to overriding classes is not possible during index update
|
||||
notification.navigation.to.overriding.methods=Navigation to overriding methods is not possible during index update
|
||||
notification.text.full.thread.dump.was.successfully.copied.to.clipboard=Full thread dump was successfully copied to clipboard
|
||||
nullable.notnull.annotations.panel.title={0} annotations
|
||||
nullable.notnull.annotations.panel.title={0} Annotations
|
||||
nullable.notnull.annotations.runtime.instrumentation.tooltip=Add runtime assertions for notnull-annotated methods and parameters
|
||||
nullable.notnull.configuration.dialog.title=Nullable/NotNull Configuration
|
||||
nullable.stuff.inspection.navigate.null.argument.usages.fix.family.name=Navigate to 'null' argument usages
|
||||
@@ -1286,4 +1286,5 @@ extracted.class.should.have.unique.name=Extracted class should have unique name.
|
||||
invalid.extracted.class.name=''{0}'' is invalid extracted class name
|
||||
extract.class.depends.on.0.from.1.tooltip=Depends on {0} from {1}
|
||||
extract.class.depends.on.0.from.new.class=Depends on {0} from new class {1}
|
||||
caller.chooser.referenced.code.title=Referenced Code
|
||||
caller.chooser.referenced.code.title=Referenced Code
|
||||
dialog.title.choose.annotation=Choose {0} Annotation
|
||||
@@ -186,7 +186,7 @@ public class AnnotationsPanel {
|
||||
|
||||
private void chooseAnnotation(String title) {
|
||||
final TreeClassChooser chooser = TreeClassChooserFactory.getInstance(myProject)
|
||||
.createNoInnerClassesScopeChooser("Choose " + title + " annotation", GlobalSearchScope.allScope(myProject), new ClassFilter() {
|
||||
.createNoInnerClassesScopeChooser(JavaBundle.message("dialog.title.choose.annotation", title), GlobalSearchScope.allScope(myProject), new ClassFilter() {
|
||||
@Override
|
||||
public boolean isAccepted(PsiClass aClass) {
|
||||
return aClass.isAnnotationType();
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.intellij.openapi.ui.MessageType;
|
||||
import com.intellij.openapi.ui.popup.Balloon;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -29,6 +30,7 @@ import com.intellij.ui.HyperlinkAdapter;
|
||||
import com.intellij.ui.awt.RelativePoint;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -469,8 +471,7 @@ public class ExceptionWorker {
|
||||
String actionName = Objects.requireNonNull(action.getTemplatePresentation().getDescription());
|
||||
Ref<Balloon> ref = Ref.create();
|
||||
Balloon balloon = JBPopupFactory.getInstance()
|
||||
.createHtmlTextBalloonBuilder(String.format("<a href=\"analyze\">%s</a>", StringUtil.escapeXmlEntities(actionName)),
|
||||
null, MessageType.INFO.getPopupBackground(), new HyperlinkAdapter() {
|
||||
.createHtmlTextBalloonBuilder(getActionLink(actionName), null, MessageType.INFO.getPopupBackground(), new HyperlinkAdapter() {
|
||||
@Override
|
||||
protected void hyperlinkActivated(HyperlinkEvent e) {
|
||||
if (e.getDescription().equals("analyze")) {
|
||||
@@ -493,6 +494,10 @@ public class ExceptionWorker {
|
||||
Disposer.dispose(balloon);
|
||||
}, balloon);
|
||||
}
|
||||
|
||||
private static @NlsSafe String getActionLink(@Nls String actionName) {
|
||||
return String.format("<a href=\"analyze\">%s</a>", StringUtil.escapeXmlEntities(actionName));
|
||||
}
|
||||
}
|
||||
|
||||
private static class FunctionCallMatcher implements ExceptionLineRefiner {
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.intellij.java.JavaBundle;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
@@ -46,14 +47,12 @@ import org.jetbrains.annotations.Nullable;
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.*;
|
||||
import java.awt.*;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText {
|
||||
private static final String IS_ACTIVE = "Is Active";
|
||||
protected JBTable myTable = null;
|
||||
protected FilterTableModel myTableModel = null;
|
||||
protected JBTable myTable;
|
||||
protected FilterTableModel myTableModel;
|
||||
protected final Project myProject;
|
||||
private final ClassFilter myChooserFilter;
|
||||
@Nullable
|
||||
@@ -199,13 +198,7 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
|
||||
}
|
||||
|
||||
public com.intellij.ui.classFilter.ClassFilter[] getFilters() {
|
||||
for (Iterator<com.intellij.ui.classFilter.ClassFilter> it = myFilters.iterator(); it.hasNext(); ) {
|
||||
com.intellij.ui.classFilter.ClassFilter filter = it.next();
|
||||
String pattern = filter.getPattern();
|
||||
if (pattern == null || "".equals(pattern)) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
myFilters.removeIf(filter -> StringUtil.isEmpty(filter.getPattern()));
|
||||
return myFilters.toArray(com.intellij.ui.classFilter.ClassFilter.EMPTY_ARRAY);
|
||||
}
|
||||
|
||||
@@ -238,7 +231,7 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
|
||||
if (column == FILTER) {
|
||||
return "Pattern";
|
||||
}
|
||||
return IS_ACTIVE;
|
||||
return "Is Active";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.jetbrains.jps.model.java.compiler;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -27,7 +28,7 @@ public interface ProcessorConfigProfile extends AnnotationProcessingConfiguratio
|
||||
|
||||
void initFrom(ProcessorConfigProfile other);
|
||||
|
||||
String getName();
|
||||
@NlsSafe String getName();
|
||||
|
||||
void setName(String name);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.components.ComponentManager;
|
||||
import com.intellij.openapi.extensions.AreaInstance;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import org.jetbrains.annotations.*;
|
||||
@@ -64,7 +65,7 @@ public interface Module extends ComponentManager, AreaInstance, Disposable {
|
||||
*
|
||||
* @return the module name.
|
||||
*/
|
||||
@NotNull String getName();
|
||||
@NotNull @NlsSafe String getName();
|
||||
|
||||
/**
|
||||
* Checks if the module instance has been disposed and unloaded.
|
||||
|
||||
@@ -106,7 +106,7 @@ public abstract class VirtualFile extends UserDataHolderBase implements Modifica
|
||||
*
|
||||
* @see #getNameSequence()
|
||||
*/
|
||||
public abstract @NotNull String getName();
|
||||
public abstract @NotNull @NlsSafe String getName();
|
||||
|
||||
public @NotNull CharSequence getNameSequence() {
|
||||
return getName();
|
||||
@@ -128,7 +128,7 @@ public abstract class VirtualFile extends UserDataHolderBase implements Modifica
|
||||
* @return the path
|
||||
* @see #toNioPath()
|
||||
*/
|
||||
public abstract @NotNull String getPath();
|
||||
public abstract @NotNull @NlsSafe String getPath();
|
||||
|
||||
/**
|
||||
* @return a related {@link Path} for a given virtual file where possible otherwise an
|
||||
|
||||
@@ -140,12 +140,13 @@ public final class Presentation implements Cloneable {
|
||||
|
||||
private static final Pattern MNEMONIC = Pattern.compile(" ?\\(_?[A-Z]\\)");
|
||||
|
||||
public String getText() {
|
||||
public @ActionText String getText() {
|
||||
TextWithMnemonic textWithMnemonic = myTextWithMnemonicSupplier.get();
|
||||
String text = textWithMnemonic == null ? null : textWithMnemonic.getText();
|
||||
|
||||
if (text != null && Boolean.TRUE.equals(getClientProperty(STRIP_MNEMONIC))) {
|
||||
Matcher matcher = MNEMONIC.matcher(text);
|
||||
//noinspection HardCodedStringLiteral
|
||||
return matcher.replaceAll("");
|
||||
}
|
||||
return text;
|
||||
@@ -255,7 +256,7 @@ public final class Presentation implements Cloneable {
|
||||
return textWithMnemonic.toString();
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
public @ActionDescription String getDescription() {
|
||||
return myDescriptionSupplier.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.ThrowableComputable;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -45,7 +46,7 @@ public class TestStateStorage implements Disposable {
|
||||
public final Date date;
|
||||
public int failedLine;
|
||||
public final String failedMethod;
|
||||
public final String errorMessage;
|
||||
public final @NlsSafe String errorMessage;
|
||||
public final String topStacktraceLine;
|
||||
|
||||
public Record(int magnitude, Date date, long configurationHash, int failLine, String method, String errorMessage, String topStacktraceLine) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.intellij.execution;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.JdkUtil;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -30,10 +31,10 @@ public enum ShortenCommandLine {
|
||||
}
|
||||
};
|
||||
|
||||
private final String myPresentableName;
|
||||
private final String myDescription;
|
||||
private final @NlsContexts.Label String myPresentableName;
|
||||
private final @NlsContexts.Label String myDescription;
|
||||
|
||||
ShortenCommandLine(String presentableName, String description) {
|
||||
ShortenCommandLine(@NlsContexts.Label String presentableName, @NlsContexts.Label String description) {
|
||||
myPresentableName = presentableName;
|
||||
myDescription = description;
|
||||
}
|
||||
@@ -42,11 +43,11 @@ public enum ShortenCommandLine {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
public @NlsContexts.Label String getDescription() {
|
||||
return myDescription;
|
||||
}
|
||||
|
||||
public String getPresentableName() {
|
||||
public @NlsContexts.Label String getPresentableName() {
|
||||
return myPresentableName;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.intellij.ui;
|
||||
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -13,7 +14,7 @@ public final class SeparatorFactory {
|
||||
private SeparatorFactory() {
|
||||
}
|
||||
|
||||
public static TitledSeparator createSeparator(String text, @Nullable JComponent labelFor) {
|
||||
public static TitledSeparator createSeparator(@NlsContexts.Separator String text, @Nullable JComponent labelFor) {
|
||||
return new TitledSeparator(text, labelFor);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.ui.GraphicsConfig;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -1154,7 +1155,7 @@ public class SimpleColoredComponent extends JComponent implements Accessible, Co
|
||||
}
|
||||
}
|
||||
|
||||
public interface ColoredIterator extends Iterator<String> {
|
||||
public interface ColoredIterator extends Iterator<@NlsSafe String> {
|
||||
int getOffset();
|
||||
|
||||
int getEndOffset();
|
||||
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2020 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.ui.components.fields;
|
||||
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.ui.scale.JBUIScale;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -53,15 +54,15 @@ public interface ExtendableTextComponent {
|
||||
return null;
|
||||
}
|
||||
|
||||
default String getTooltip() {
|
||||
default @NlsContexts.Tooltip String getTooltip() {
|
||||
return null;
|
||||
}
|
||||
|
||||
static Extension create(@NotNull Icon icon, String tooltip, Runnable action) {
|
||||
static Extension create(@NotNull Icon icon, @NlsContexts.Tooltip String tooltip, Runnable action) {
|
||||
return create(icon, icon, tooltip, action);
|
||||
}
|
||||
|
||||
static Extension create(@NotNull Icon defaultIcon, @NotNull Icon hoveredIcon, @Nls String tooltip, Runnable action) {
|
||||
static Extension create(@NotNull Icon defaultIcon, @NotNull Icon hoveredIcon, @NlsContexts.Tooltip String tooltip, Runnable action) {
|
||||
return new Extension() {
|
||||
@Override
|
||||
public Icon getIcon(boolean hovered) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.intellij.openapi.util.io;
|
||||
|
||||
import com.intellij.UtilBundle;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.util.text.Strings;
|
||||
@@ -564,7 +565,7 @@ public class FileUtil extends FileUtilRt {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String toSystemDependentName(@NotNull String aFileName) {
|
||||
public static @NlsSafe String toSystemDependentName(@NotNull String aFileName) {
|
||||
return FileUtilRt.toSystemDependentName(aFileName);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2020 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;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.util.ui.StartupUiUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -59,7 +60,7 @@ public final class FontUtil {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String spaceAndThinSpace() {
|
||||
public static @NlsSafe String spaceAndThinSpace() {
|
||||
return " " + thinSpace();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.intellij.xdebugger.frame;
|
||||
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface XValueCallback {
|
||||
@@ -7,5 +8,5 @@ public interface XValueCallback {
|
||||
* Indicate that an error occurs
|
||||
* @param errorMessage message describing the error
|
||||
*/
|
||||
void errorOccurred(@NotNull String errorMessage);
|
||||
void errorOccurred(@NotNull @NlsContexts.DialogMessage String errorMessage);
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.*;
|
||||
import com.intellij.openapi.util.DimensionService;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
@@ -435,7 +436,7 @@ public final class DebuggerUIUtil {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String getSelectionShortcutsAdText(String... actionNames) {
|
||||
public static @NlsContexts.PopupAdvertisement String getSelectionShortcutsAdText(String... actionNames) {
|
||||
return getShortcutsAdText("ad.extra.selection.shortcut", actionNames);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
package com.intellij.xdebugger.impl.ui;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.ui.DarculaColors;
|
||||
import com.intellij.ui.JBColor;
|
||||
import com.intellij.ui.SimpleTextAttributes;
|
||||
@@ -47,7 +48,7 @@ public final class XDebuggerUIConstants {
|
||||
private XDebuggerUIConstants() {
|
||||
}
|
||||
|
||||
public static String getCollectingDataMessage() {
|
||||
public static @NlsContexts.Label String getCollectingDataMessage() {
|
||||
return XDebuggerBundle.message("xdebugger.building.tree.node.message");
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user