fixed bugs introduced by refactoring

This commit is contained in:
hneemann 2016-04-17 08:53:06 +02:00
parent 730910c1fb
commit 10d6b6c352
2 changed files with 5 additions and 2 deletions

View File

@ -97,15 +97,18 @@ public final class EditorFactory {
}
private final static class IntegerEditor extends LabelEditor<Integer> {
private static final Integer[] DEFAULTS = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
private final JComboBox<Integer> comboBox;
private final Key<Integer> key;
public IntegerEditor(Integer value, Key<Integer> key) {
this.key = key;
Integer[] selects = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
Integer[] selects = null;
if (key instanceof Key.KeyInteger) {
selects = ((Key.KeyInteger) key).getComboBoxValues();
}
if (selects == null)
selects = DEFAULTS;
comboBox = new JComboBox<>(selects);
comboBox.setEditable(true);
comboBox.setSelectedItem(value);

View File

@ -19,7 +19,7 @@ public class DummyElement implements Element {
/**
* The DataElement description
*/
public static final ElementTypeDescription DATADESCRIPTION = new ElementTypeDescription("DATA", DummyElement.class)
public static final ElementTypeDescription DATADESCRIPTION = new ElementTypeDescription("Data", DummyElement.class)
.addAttribute(Keys.MICRO_STEP)
.addAttribute(Keys.MAX_STEP_COUNT);