mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-235533 introduce @ValidationInfo
GitOrigin-RevId: a13ec5e2bae9642245e5ea37a5f90c03261f9338
This commit is contained in:
committed by
intellij-monorepo-bot
parent
062ecb3f1f
commit
d4dc1ac3dd
@@ -2,6 +2,7 @@
|
||||
package com.intellij.openapi.ui;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.nls.NlsContexts;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -17,6 +18,7 @@ import javax.swing.*;
|
||||
*/
|
||||
public final class ValidationInfo {
|
||||
@Nls
|
||||
@NlsContexts.ValidationInfo
|
||||
@NotNull
|
||||
public final String message;
|
||||
|
||||
@@ -33,7 +35,7 @@ public final class ValidationInfo {
|
||||
* @param message the error message to display.
|
||||
* @param component the component containing the invalid data.
|
||||
*/
|
||||
public ValidationInfo(@Nls @NotNull String message, @Nullable JComponent component) {
|
||||
public ValidationInfo(@Nls @NlsContexts.ValidationInfo @NotNull String message, @Nullable JComponent component) {
|
||||
this.message = message;
|
||||
this.component = component;
|
||||
}
|
||||
@@ -43,7 +45,7 @@ public final class ValidationInfo {
|
||||
*
|
||||
* @param message the error message to display.
|
||||
*/
|
||||
public ValidationInfo(@Nls @NotNull String message) {
|
||||
public ValidationInfo(@Nls @NlsContexts.ValidationInfo @NotNull String message) {
|
||||
this(message, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -129,4 +129,10 @@ public class NlsContexts {
|
||||
@Target(ElementType.TYPE_USE)
|
||||
public @interface Configurable {
|
||||
}
|
||||
|
||||
@NlsContext(prefix = "validation.info")
|
||||
@Nls(capitalization = Nls.Capitalization.Sentence)
|
||||
@Target(ElementType.TYPE_USE)
|
||||
public @interface ValidationInfo {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user