import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.List;
import javax.swing.BoxLayout;
main.setLayout(new BoxLayout(main, BoxLayout.PAGE_AXIS));
main.setBorder(new EmptyBorder(5, 5, 5, 5));
-
+
main.add(new JLabel(title));
- items = MetaInfo.getItems(type, bundle);
- for (MetaInfo<E> item : items) {
+ items = new ArrayList<MetaInfo<E>>();
+ List<MetaInfo<E>> groupedItems = MetaInfo.getItems(type, bundle);
+ for (MetaInfo<E> item : groupedItems) {
+ // will init this.items
addItem(main, item, 0);
}
bpane.add(pane, BorderLayout.CENTER);
main.add(bpane);
} else {
+ items.add(item);
main.add(new ConfigItem<E>(item, nhgap));
}
}
info.addSaveListener(new Runnable() {
@Override
public void run() {
- String value = field.getSelectedItem().toString();
+ Object item = field.getSelectedItem();
+ String value = item == null ? null : item.toString();
if (isChanged(value)) {
info.setString(value);
}