IDEA-235533 more annotate by @Checkbox

GitOrigin-RevId: 7683d0c32ffcf63dc765ad07742ddabab8a29e8e
This commit is contained in:
Dmitry.Krasilschikov
2020-03-22 19:31:25 +00:00
committed by intellij-monorepo-bot
parent a6e80d879e
commit a3962f23f7
@@ -2,6 +2,7 @@
package com.intellij.util.ui;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.intellij.openapi.util.NlsUI;
import com.intellij.util.ReflectionUtil;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
@@ -12,14 +13,14 @@ import java.awt.event.ItemEvent;
public class CheckBox extends JCheckBox {
public CheckBox(@NotNull @Nls String label, @NotNull InspectionProfileEntry owner, @NonNls String property) {
public CheckBox(@NotNull @Nls @NlsUI.Checkbox String label, @NotNull InspectionProfileEntry owner, @NonNls String property) {
this(label, (Object)owner, property);
}
/**
* @param property field must be non-private (or ensure that it won't be scrambled by other means)
*/
public CheckBox(@NotNull @Nls String label, @NotNull Object owner, @NonNls String property) {
public CheckBox(@NotNull @Nls @NlsUI.Checkbox String label, @NotNull Object owner, @NonNls String property) {
super(label, getPropertyValue(owner, property));
addItemListener(e -> ReflectionUtil.setField(owner.getClass(), owner, boolean.class, property, e.getStateChange() == ItemEvent.SELECTED));
}