- for (final String type : groupedSources.keySet()) {
- List<String> list = groupedSources.get(type);
- if (list.size() == 1 && list.get(0).isEmpty()) {
- item = new JMenuItem(type);
- item.addActionListener(getActionOpenSource(type));
- sources.add(item);
+ return bar;
+ }
+
+ // "" = [unknown]
+ private void populateMenuSA(JMenu menu,
+ Map<String, List<String>> groupedValues, boolean type) {
+
+ // "All" and "Listing" special items
+ JMenuItem item = new JMenuItem("All");
+ item.addActionListener(getActionOpenList(type, false));
+ menu.add(item);
+ item = new JMenuItem("Listing");
+ item.addActionListener(getActionOpenList(type, true));
+ menu.add(item);
+ menu.addSeparator();
+
+ for (final String value : groupedValues.keySet()) {
+ List<String> list = groupedValues.get(value);
+ if (type && list.size() == 1 && list.get(0).isEmpty()) {
+ // leaf item source/type
+ item = new JMenuItem(value.isEmpty() ? "[unknown]" : value);
+ item.addActionListener(getActionOpen(value, type));
+ menu.add(item);