mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] i18n: add Nls/NlsSafe annotations
GitOrigin-RevId: c9c382fbc8c4e539faa788404a349004fb2f0e26
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d31f6110db
commit
9d1e05efcd
@@ -13,6 +13,7 @@
|
||||
// limitations under the License.
|
||||
package com.intellij.vcs.log;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -21,8 +22,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
public interface VcsUser {
|
||||
|
||||
@NotNull
|
||||
@NlsSafe
|
||||
String getName();
|
||||
|
||||
@NotNull
|
||||
@NlsSafe
|
||||
String getEmail();
|
||||
}
|
||||
|
||||
+3
-1
@@ -20,6 +20,7 @@ import com.intellij.openapi.vcs.changes.actions.diff.ChangeDiffRequestProducer;
|
||||
import com.intellij.openapi.vcs.changes.actions.diff.ChangeDiffRequestProvider;
|
||||
import com.intellij.openapi.vcs.changes.ui.ChangeDiffRequestChain;
|
||||
import com.intellij.util.ThreeState;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -66,10 +67,11 @@ public class MergedChangeDiffRequestProvider implements ChangeDiffRequestProvide
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Nls
|
||||
private static String getRevisionTitle(@NotNull Map<Key<?>, Object> context,
|
||||
@NotNull Key<String> key,
|
||||
@Nullable ContentRevision revision,
|
||||
@NotNull String defaultTitle) {
|
||||
@NotNull @Nls String defaultTitle) {
|
||||
String titleFromContext = (String)context.get(key);
|
||||
if (titleFromContext != null) return titleFromContext;
|
||||
return ChangeDiffRequestProducer.getRevisionTitle(revision, defaultTitle);
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.intellij.vcs.log.ui.VcsLogPanel;
|
||||
import com.intellij.vcs.log.ui.editor.DefaultVcsLogFile;
|
||||
import com.intellij.vcs.log.visible.filters.VcsLogFiltersKt;
|
||||
import org.jetbrains.annotations.CalledInAwt;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -132,6 +133,7 @@ public class VcsLogTabsManager {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@NonNls
|
||||
private static String generateTabId(@NotNull Project project) {
|
||||
Set<String> existingIds = ContainerUtil.union(VcsLogContentUtil.getExistingLogIds(project),
|
||||
VcsLogEditorUtilKt.getExistingLogIds(project));
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ abstract class MultipleValueFilterPopupComponent<Filter, Model extends FilterMod
|
||||
protected abstract List<String> parseLocalizedValues(@NotNull Collection<String> values);
|
||||
|
||||
@NotNull
|
||||
protected abstract List<String> getLocalizedValues(@NotNull Collection<String> values);
|
||||
protected abstract List<@Nls String> getLocalizedValues(@NotNull Collection<String> values);
|
||||
|
||||
@NotNull
|
||||
protected AnAction createSelectMultipleValuesAction() {
|
||||
|
||||
+3
-1
@@ -8,6 +8,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.JBPopup;
|
||||
import com.intellij.openapi.ui.popup.JBPopupListener;
|
||||
import com.intellij.openapi.ui.popup.LightweightWindowEvent;
|
||||
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;
|
||||
@@ -122,7 +123,7 @@ public class StructureFilterPopupComponent
|
||||
private static <F> String getText(@NotNull Collection<? extends F> files,
|
||||
@Nls @NotNull String categoryText,
|
||||
@NotNull Comparator<? super F> comparator,
|
||||
@NotNull NotNullFunction<? super F, String> getText,
|
||||
@NotNull NotNullFunction<? super F, @Nls String> getText,
|
||||
boolean full) {
|
||||
if (full) {
|
||||
return ALL.get();
|
||||
@@ -262,6 +263,7 @@ public class StructureFilterPopupComponent
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@NlsSafe
|
||||
private String path2Text(@NotNull FilePath filePath, boolean systemDependent) {
|
||||
VirtualFile commonAncestor = VfsUtil.getCommonAncestor(getAllRoots());
|
||||
String path;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
package com.intellij.vcs.log.ui.frame;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.text.HtmlBuilder;
|
||||
import com.intellij.openapi.util.text.HtmlChunk;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -19,7 +20,6 @@ import com.intellij.vcs.log.*;
|
||||
import com.intellij.vcs.log.util.VcsUserUtil;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -61,7 +61,8 @@ public final class CommitPresentationUtil {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String escapeMultipleSpaces(@NotNull String text) {
|
||||
@Nls
|
||||
private static String escapeMultipleSpaces(@NotNull @Nls String text) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
if (text.charAt(i) == ' ') {
|
||||
@@ -227,6 +228,7 @@ public final class CommitPresentationUtil {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@NlsSafe
|
||||
private static String getAuthorName(@NotNull VcsUser user) {
|
||||
String username = VcsUserUtil.getShortPresentation(user);
|
||||
return user.getEmail().isEmpty() ? username : username + " " + getEmailLink(user);
|
||||
@@ -257,7 +259,7 @@ public final class CommitPresentationUtil {
|
||||
|
||||
@NotNull
|
||||
@Nls
|
||||
public static String getBranchesText(@Nullable List<String> branches, boolean expanded, int availableWidth,
|
||||
public static String getBranchesText(@Nullable List<@NlsSafe String> branches, boolean expanded, int availableWidth,
|
||||
@NotNull FontMetrics metrics) {
|
||||
if (branches == null) {
|
||||
return VcsLogBundle.message("vcs.log.details.in.branches.loading");
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
package com.intellij.vcs.log.ui.render;
|
||||
|
||||
import com.intellij.openapi.ui.GraphicsConfig;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.changes.ui.CurrentBranchComponent;
|
||||
@@ -264,7 +265,7 @@ public class LabelPainter {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String shortenRefName(@NotNull String refName, @NotNull FontMetrics fontMetrics, int availableWidth) {
|
||||
private static String shortenRefName(@NotNull @NlsSafe String refName, @NotNull FontMetrics fontMetrics, int availableWidth) {
|
||||
if (fontMetrics.stringWidth(refName) > availableWidth && refName.length() > MAX_LENGTH) {
|
||||
int separatorIndex = refName.indexOf(SEPARATOR);
|
||||
if (separatorIndex > TWO_DOTS.length()) {
|
||||
|
||||
@@ -152,7 +152,8 @@ public final class VcsLogUiUtil {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String shortenTextToFit(@NotNull String text, @NotNull FontMetrics fontMetrics, int availableWidth, int maxLength,
|
||||
@Nls
|
||||
public static String shortenTextToFit(@NotNull @Nls String text, @NotNull FontMetrics fontMetrics, int availableWidth, int maxLength,
|
||||
@NotNull String symbol) {
|
||||
if (fontMetrics.stringWidth(text) <= availableWidth) return text;
|
||||
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
package com.intellij.vcs.log.visible.filters
|
||||
|
||||
import com.intellij.openapi.util.Comparing
|
||||
import com.intellij.openapi.util.NlsSafe
|
||||
import com.intellij.vcs.log.VcsLogRangeFilter
|
||||
import com.intellij.vcs.log.VcsLogRangeFilter.RefRange
|
||||
import com.intellij.vcs.log.util.VcsLogUtil
|
||||
@@ -12,6 +13,7 @@ internal class VcsLogRangeFilterImpl(override val ranges: List<RefRange>) : VcsL
|
||||
return ranges.map { (before, after) -> "$before..$after" }
|
||||
}
|
||||
|
||||
@NlsSafe
|
||||
override fun getDisplayText(): String {
|
||||
return ranges.joinToString(", ") { (before, after) ->
|
||||
"${VcsLogUtil.getShortHash(before)}..${VcsLogUtil.getShortHash(after)}"
|
||||
|
||||
Reference in New Issue
Block a user