IDEA-235533 introduce @ConfigurationErrorMessage and @NlsContexts.ConfigurationErrorTitle

GitOrigin-RevId: ff16e0deaa9f3a078a0954068763b3c499abfab8
This commit is contained in:
Dmitry.Krasilschikov
2020-03-22 20:03:01 +00:00
committed by intellij-monorepo-bot
parent d4dc1ac3dd
commit a682dd14b6
2 changed files with 21 additions and 3 deletions
@@ -15,6 +15,9 @@
*/
package com.intellij.openapi.options;
import com.intellij.util.nls.NlsContexts;
import org.jetbrains.annotations.Nls;
/**
* Thrown to indicate that a configurable component cannot {@link UnnamedConfigurable#apply() apply} entered values.
*/
@@ -26,7 +29,7 @@ public class ConfigurationException extends Exception {
/**
* @param message the detail message describing the problem
*/
public ConfigurationException(String message) {
public ConfigurationException(@Nls @NlsContexts.ConfigurationErrorMessage String message) {
super(message);
}
@@ -34,12 +37,15 @@ public class ConfigurationException extends Exception {
* @param message the detailed message describing the problem
* @param title the title describing the problem in short
*/
public ConfigurationException(String message, String title) {
public ConfigurationException(@Nls @NlsContexts.ConfigurationErrorMessage String message,
@Nls @NlsContexts.ConfigurationErrorTitle String title) {
super(message);
myTitle = title;
}
public ConfigurationException(String message, Throwable cause, String title) {
public ConfigurationException(@Nls @NlsContexts.ConfigurationErrorMessage String message,
Throwable cause,
@Nls @NlsContexts.ConfigurationErrorTitle String title) {
super(message, cause);
myTitle = title;
}
@@ -135,4 +135,16 @@ public class NlsContexts {
@Target(ElementType.TYPE_USE)
public @interface ValidationInfo {
}
@NlsContext(prefix = "configuration.error.message")
@Nls(capitalization = Nls.Capitalization.Sentence)
@Target(ElementType.TYPE_USE)
public @interface ConfigurationErrorMessage {
}
@NlsContext(prefix = "configuration.error.title")
@Nls(capitalization = Nls.Capitalization.Sentence)
@Target(ElementType.TYPE_USE)
public @interface ConfigurationErrorTitle {
}
}