X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Fui%2FConfigItemBoolean.java;fp=src%2Fbe%2Fnikiroo%2Futils%2Fui%2FConfigItemBoolean.java;h=0000000000000000000000000000000000000000;hb=46add0670fdee4bd936a13fe2448c5e20a7ffd0a;hp=255ec1338f442eaa2f4c5802e1d54a570a035ce9;hpb=1b5197ed4ceec2025a9a40c417b37c646b756138;p=nikiroo-utils.git diff --git a/src/be/nikiroo/utils/ui/ConfigItemBoolean.java b/src/be/nikiroo/utils/ui/ConfigItemBoolean.java deleted file mode 100644 index 255ec13..0000000 --- a/src/be/nikiroo/utils/ui/ConfigItemBoolean.java +++ /dev/null @@ -1,66 +0,0 @@ -package be.nikiroo.utils.ui; - -import javax.swing.JCheckBox; -import javax.swing.JComponent; - -import be.nikiroo.utils.resources.MetaInfo; - -class ConfigItemBoolean> extends ConfigItem { - private static final long serialVersionUID = 1L; - - /** - * Create a new {@link ConfigItemBoolean} for the given {@link MetaInfo}. - * - * @param info - * the {@link MetaInfo} - */ - public ConfigItemBoolean(MetaInfo info) { - super(info, true); - } - - @Override - protected Object getFromField(int item) { - JCheckBox field = (JCheckBox) getField(item); - if (field != null) { - return field.isSelected(); - } - - return null; - } - - @Override - protected Object getFromInfo(int item) { - return info.getBoolean(item, true); - } - - @Override - protected void setToField(Object value, int item) { - JCheckBox field = (JCheckBox) getField(item); - if (field != null) { - // Should not happen if config enum is correct - // (but this is not enforced) - if (value == null) { - value = false; - } - - field.setSelected((Boolean) value); - } - } - - @Override - protected void setToInfo(Object value, int item) { - info.setBoolean((Boolean) value, item); - } - - @Override - protected JComponent createEmptyField(int item) { - // Should not happen! - if (getFromInfo(item) == null) { - System.err - .println("No default value given for BOOLEAN parameter \"" - + info.getName() + "\", we consider it is FALSE"); - } - - return new JCheckBox(); - } -}