mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: i18n - annotate with Nls
GitOrigin-RevId: 774c0759bce5a21f86a3b69567a5b08d0d13d79c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fb49d79a49
commit
918eddc194
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.intellij.openapi.ui;
|
||||
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
* The validator for input dialogs.
|
||||
*
|
||||
@@ -31,7 +33,7 @@ public interface InputValidator {
|
||||
* @param inputString the input to check
|
||||
* @return true if input string is valid
|
||||
*/
|
||||
boolean checkInput(String inputString);
|
||||
boolean checkInput(@NonNls String inputString);
|
||||
|
||||
/**
|
||||
* This method is invoked just before message dialog is closed with OK code.
|
||||
@@ -40,5 +42,5 @@ public interface InputValidator {
|
||||
* @param inputString the input to check
|
||||
* @return true if the dialog could be closed, false otherwise.
|
||||
*/
|
||||
boolean canClose(String inputString);
|
||||
boolean canClose(@NonNls String inputString);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
// 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.ui;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
|
||||
public interface TextAccessor {
|
||||
void setText(String text);
|
||||
|
||||
@NlsSafe
|
||||
String getText();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.intellij.dvcs.push;
|
||||
import com.intellij.dvcs.push.ui.PushTargetEditorListener;
|
||||
import com.intellij.openapi.ui.ValidationInfo;
|
||||
import com.intellij.ui.ColoredTreeCellRenderer;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -31,7 +32,7 @@ public abstract class PushTargetPanel<T extends PushTarget> extends JPanel {
|
||||
abstract public void render(@NotNull ColoredTreeCellRenderer renderer,
|
||||
boolean isSelected,
|
||||
boolean isActive,
|
||||
@Nullable String forceRenderedText);
|
||||
@Nullable @Nls String forceRenderedText);
|
||||
|
||||
@Nullable
|
||||
abstract public T getValue();
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
*/
|
||||
package com.intellij.dvcs.push.ui;
|
||||
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface PushTargetEditorListener {
|
||||
void onTargetInEditModeChanged(@NotNull String value);
|
||||
void onTargetInEditModeChanged(@NotNull @Nls String value);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public final class DvcsUtil {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static AccessToken workingTreeChangeStarted(@NotNull Project project, @Nullable String activityName) {
|
||||
public static AccessToken workingTreeChangeStarted(@NotNull Project project, @Nullable @Nls String activityName) {
|
||||
BackgroundTaskUtil.syncPublisher(BatchFileChangeListener.TOPIC).batchChangeStarted(project, activityName);
|
||||
return new AccessToken() {
|
||||
@Override
|
||||
|
||||
@@ -23,10 +23,7 @@ import com.intellij.util.concurrency.SequentialTaskExecutor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.progress.StepsProgressIndicator;
|
||||
import com.intellij.vcs.log.VcsFullCommitDetails;
|
||||
import org.jetbrains.annotations.CalledInAny;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
@@ -233,7 +230,7 @@ public final class PushController implements Disposable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTargetInEditMode(@NotNull String currentValue) {
|
||||
public void onTargetInEditMode(@NotNull @Nls String currentValue) {
|
||||
myPushLog.fireEditorUpdated(currentValue);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.dvcs.push;
|
||||
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface RepositoryNodeListener<T extends PushTarget> {
|
||||
@@ -23,5 +24,5 @@ public interface RepositoryNodeListener<T extends PushTarget> {
|
||||
|
||||
void onSelectionChanged(boolean isSelected);
|
||||
|
||||
void onTargetInEditMode(@NotNull String currentValue);
|
||||
void onTargetInEditMode(@NotNull @Nls String currentValue);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.intellij.vcs.log.ui.VcsLogActionPlaces;
|
||||
import com.intellij.vcs.log.ui.details.commit.CommitDetailsPanel;
|
||||
import kotlin.Unit;
|
||||
import one.util.streamex.StreamEx;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -70,7 +71,7 @@ public final class PushLog extends JPanel implements DataProvider {
|
||||
private final MyShowDetailsAction myShowDetailsAction;
|
||||
private boolean myShouldRepaint = false;
|
||||
private boolean mySyncStrategy;
|
||||
@Nullable private String mySyncRenderedText;
|
||||
@Nullable private @Nls String mySyncRenderedText;
|
||||
private final boolean myAllowSyncStrategy;
|
||||
|
||||
public PushLog(Project project, final CheckedTreeNode root, final boolean allowSyncStrategy) {
|
||||
@@ -574,11 +575,11 @@ public final class PushLog extends JPanel implements DataProvider {
|
||||
}
|
||||
}
|
||||
|
||||
private void setSyncText(String value) {
|
||||
private void setSyncText(@Nls String value) {
|
||||
mySyncRenderedText = value;
|
||||
}
|
||||
|
||||
public void fireEditorUpdated(@NotNull String currentText) {
|
||||
public void fireEditorUpdated(@NotNull @Nls String currentText) {
|
||||
if (mySyncStrategy) {
|
||||
//update ui model
|
||||
List<RepositoryNode> repositoryNodes =
|
||||
|
||||
@@ -58,7 +58,7 @@ public class RepositoryNode extends CheckedTreeNode implements EditableTreeNode,
|
||||
render(renderer, null);
|
||||
}
|
||||
|
||||
public void render(@NotNull ColoredTreeCellRenderer renderer, @Nullable String syncEditingText) {
|
||||
public void render(@NotNull ColoredTreeCellRenderer renderer, @Nullable @Nls String syncEditingText) {
|
||||
int repoFixedWidth = 120;
|
||||
SimpleTextAttributes repositoryDetailsTextAttributes = PushLogTreeUtil
|
||||
.addTransparencyIfNeeded(renderer, SimpleTextAttributes.REGULAR_ATTRIBUTES, isChecked());
|
||||
|
||||
@@ -144,7 +144,7 @@ public class RepositoryWithBranchPanel<T extends PushTarget> extends NonOpaquePa
|
||||
myDestPushTargetPanelComponent.addTargetEditorListener(new PushTargetEditorListener() {
|
||||
|
||||
@Override
|
||||
public void onTargetInEditModeChanged(@NotNull String value) {
|
||||
public void onTargetInEditModeChanged(@NotNull @Nls String value) {
|
||||
for (RepositoryNodeListener listener : myListeners) {
|
||||
listener.onTargetInEditMode(value);
|
||||
}
|
||||
|
||||
@@ -8,10 +8,7 @@ import com.intellij.openapi.util.NlsContexts.Tooltip;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.Border;
|
||||
@@ -59,6 +56,7 @@ public interface StatusBarWidget extends Disposable {
|
||||
@Tooltip
|
||||
String getTooltipText();
|
||||
|
||||
@Nls
|
||||
@Nullable
|
||||
default String getShortcutText() { return null; }
|
||||
|
||||
|
||||
@@ -17,12 +17,14 @@ package com.intellij.ui;
|
||||
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.event.DocumentListener;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
public interface EditorTextComponent {
|
||||
|
||||
@NlsSafe
|
||||
String getText();
|
||||
|
||||
JComponent getComponent();
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.intellij.ide.file;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.util.messages.Topic;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -19,7 +20,7 @@ public interface BatchFileChangeListener {
|
||||
* @param project Project where many file changes are expected to happen
|
||||
* @param activityName the name of the activity (a noun phrase) causing this file change
|
||||
*/
|
||||
default void batchChangeStarted(@NotNull Project project, @Nullable String activityName) {}
|
||||
default void batchChangeStarted(@NotNull Project project, @Nullable @Nls String activityName) {}
|
||||
|
||||
default void batchChangeCompleted(@NotNull Project project) {}
|
||||
}
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ public class IgnoreLanguage extends Language {
|
||||
this("IgnoreLang", "ignore");
|
||||
}
|
||||
|
||||
protected IgnoreLanguage(@NotNull String name, @NotNull String extension) {
|
||||
protected IgnoreLanguage(@NotNull @NonNls String name, @NotNull @NonNls String extension) {
|
||||
super(INSTANCE, name, ArrayUtilRt.EMPTY_STRING_ARRAY);
|
||||
myExtension = extension;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.ui.components.JBTextField;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.ui.components.BorderLayoutPanel;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -31,11 +32,11 @@ public class VcsExecutablePathSelector {
|
||||
@NotNull private String myAutoDetectedPath = "";
|
||||
|
||||
@Deprecated
|
||||
public VcsExecutablePathSelector(@NotNull String vcsName, @NotNull Consumer<String> executableTester) {
|
||||
public VcsExecutablePathSelector(@NotNull @Nls String vcsName, @NotNull Consumer<String> executableTester) {
|
||||
this(vcsName, null, (path) -> executableTester.accept(path));
|
||||
}
|
||||
|
||||
public VcsExecutablePathSelector(@NotNull String vcsName, @Nullable Disposable disposable, @NotNull ExecutableHandler handler) {
|
||||
public VcsExecutablePathSelector(@NotNull @Nls String vcsName, @Nullable Disposable disposable, @NotNull ExecutableHandler handler) {
|
||||
BorderLayoutPanel panel = JBUI.Panels.simplePanel(UIUtil.DEFAULT_HGAP, 0);
|
||||
|
||||
myPathSelector = new TextFieldWithBrowseButton(null, disposable);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
package com.intellij.vcs;
|
||||
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -10,11 +11,12 @@ import java.util.MissingResourceException;
|
||||
|
||||
public final class VcsLocaleHelper {
|
||||
|
||||
private static final String DEFAULT_EXECUTABLE_LOCALE_VALUE = "en_US.UTF-8";
|
||||
private static final String REGISTRY_KEY_SUFFIX = ".executable.locale";
|
||||
private static final @NonNls String DEFAULT_EXECUTABLE_LOCALE_VALUE = "en_US.UTF-8";
|
||||
private static final @NonNls String REGISTRY_KEY_SUFFIX = ".executable.locale";
|
||||
|
||||
@NonNls
|
||||
@NotNull
|
||||
public static String getDefaultLocaleFromRegistry(@NotNull String prefix) {
|
||||
public static String getDefaultLocaleFromRegistry(@NotNull @NonNls String prefix) {
|
||||
String registryKey = prefix + REGISTRY_KEY_SUFFIX;
|
||||
try {
|
||||
return Registry.stringValue(registryKey);
|
||||
@@ -25,7 +27,7 @@ public final class VcsLocaleHelper {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Map<String, String> getDefaultLocaleEnvironmentVars(@NotNull String prefix) {
|
||||
public static Map<String, String> getDefaultLocaleEnvironmentVars(@NotNull @NonNls String prefix) {
|
||||
Map<String, String> envMap = new LinkedHashMap<>();
|
||||
String defaultLocale = getDefaultLocaleFromRegistry(prefix);
|
||||
if (defaultLocale.isEmpty()) { // let skip locale definition if needed
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.intellij.util.containers.MultiMap;
|
||||
import com.intellij.vcs.log.RefGroup;
|
||||
import com.intellij.vcs.log.VcsRef;
|
||||
import com.intellij.vcs.log.VcsRefType;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.awt.*;
|
||||
@@ -13,15 +14,15 @@ import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
public class SimpleRefGroup implements RefGroup {
|
||||
@NotNull private final String myName;
|
||||
@NotNull private final @Nls String myName;
|
||||
@NotNull private final List<VcsRef> myRefs;
|
||||
private final boolean myExpanded;
|
||||
|
||||
public SimpleRefGroup(@NotNull String name, @NotNull List<VcsRef> refs) {
|
||||
public SimpleRefGroup(@NotNull @Nls String name, @NotNull List<VcsRef> refs) {
|
||||
this(name, refs, false);
|
||||
}
|
||||
|
||||
public SimpleRefGroup(@NotNull String name, @NotNull List<VcsRef> refs, boolean expanded) {
|
||||
public SimpleRefGroup(@NotNull @Nls String name, @NotNull List<VcsRef> refs, boolean expanded) {
|
||||
myName = name;
|
||||
myRefs = refs;
|
||||
myExpanded = expanded;
|
||||
|
||||
@@ -2,17 +2,18 @@
|
||||
package com.intellij.vcs.log.impl;
|
||||
|
||||
import com.intellij.vcs.log.VcsRefType;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Objects;
|
||||
|
||||
public class SimpleRefType implements VcsRefType {
|
||||
@NotNull private final String myName;
|
||||
@NotNull private final @NonNls String myName;
|
||||
private final boolean myIsBranch;
|
||||
@NotNull private final Color myColor;
|
||||
|
||||
public SimpleRefType(@NotNull String name, boolean isBranch, @NotNull Color color) {
|
||||
public SimpleRefType(@NotNull @NonNls String name, boolean isBranch, @NotNull Color color) {
|
||||
myName = name;
|
||||
myIsBranch = isBranch;
|
||||
myColor = color;
|
||||
|
||||
Reference in New Issue
Block a user