only keep the sources
[fanfix.git] / src / be / nikiroo / utils / ui / ConfigItemCombobox.java
diff --git a/src/be/nikiroo/utils/ui/ConfigItemCombobox.java b/src/be/nikiroo/utils/ui/ConfigItemCombobox.java
deleted file mode 100644 (file)
index b77e0a8..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-package be.nikiroo.utils.ui;
-
-import javax.swing.JComboBox;
-import javax.swing.JComponent;
-
-import be.nikiroo.utils.resources.MetaInfo;
-
-class ConfigItemCombobox<E extends Enum<E>> extends ConfigItem<E> {
-       private static final long serialVersionUID = 1L;
-
-       private boolean editable;
-       private String[] allowedValues;
-
-       /**
-        * Create a new {@link ConfigItemCombobox} for the given {@link MetaInfo}.
-        * 
-        * @param info
-        *            the {@link MetaInfo}
-        * @param editable
-        *            allows the user to type in another value not in the list
-        */
-       public ConfigItemCombobox(MetaInfo<E> info, boolean editable) {
-               super(info, true);
-               this.editable = editable;
-               this.allowedValues = info.getAllowedValues();
-       }
-
-       @Override
-       protected Object getFromField(int item) {
-               // rawtypes for Java 1.6 (and 1.7 ?) support
-               @SuppressWarnings("rawtypes")
-               JComboBox field = (JComboBox) getField(item);
-               if (field != null) {
-                       return field.getSelectedItem();
-               }
-
-               return null;
-       }
-
-       @Override
-       protected Object getFromInfo(int item) {
-               return info.getString(item, false);
-       }
-
-       @Override
-       protected void setToField(Object value, int item) {
-               // rawtypes for Java 1.6 (and 1.7 ?) support
-               @SuppressWarnings("rawtypes")
-               JComboBox field = (JComboBox) getField(item);
-               if (field != null) {
-                       field.setSelectedItem(value);
-               }
-       }
-
-       @Override
-       protected void setToInfo(Object value, int item) {
-               info.setString((String) value, item);
-       }
-
-       // rawtypes for Java 1.6 (and 1.7 ?) support
-       @SuppressWarnings({ "unchecked", "rawtypes" })
-       @Override
-       protected JComponent createEmptyField(int item) {
-               JComboBox field = new JComboBox(allowedValues);
-               field.setEditable(editable);
-               return field;
-       }
-}