mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add test annotation + more informative exception message
This commit is contained in:
+3
-1
@@ -14,6 +14,7 @@ import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
@@ -236,11 +237,12 @@ public abstract class TextFieldWithPopupHandlerUI extends BasicTextFieldUI imple
|
||||
POPUP, CLEAR, NEWLINE
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
@NotNull
|
||||
public Point getExtensionIconLocation(@NotNull final Extension extension) {
|
||||
final IconHolder iconHolder = icons.get(extension.toString());
|
||||
if (iconHolder == null) {
|
||||
throw new IllegalArgumentException("Unknown extension");
|
||||
throw new IllegalArgumentException("The " + extension + " extension does not exist in this text field");
|
||||
}
|
||||
return iconHolder.bounds.getLocation();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user