repositorySelector.setForeground(nameRenderer.getForeground());\r
repositorySelector.addActionListener(new ActionListener() {\r
public void actionPerformed(ActionEvent event) {\r
+ // repopulate the author list based on repository selection\r
+ // preserve author selection, if possible\r
+ String selectedAuthor = null;\r
+ if (authorSelector.getSelectedIndex() > -1) {\r
+ selectedAuthor = authorSelector.getSelectedItem().toString();\r
+ }\r
+ updateAuthors();\r
+ if (selectedAuthor != null) {\r
+ if (authorChoices.getIndexOf(selectedAuthor) > -1) {\r
+ authorChoices.setSelectedItem(selectedAuthor);\r
+ }\r
+ }\r
filterFeeds();\r
}\r
});\r
if (pack) {\r
Utils.packColumns(table, Utils.MARGIN);\r
}\r
- // determine unique repositories and authors\r
+ // determine unique repositories\r
Set<String> uniqueRepositories = new HashSet<String>();\r
- Set<String> uniqueAuthors = new HashSet<String>();\r
for (SyndicatedEntryModel entry : tableModel.entries) {\r
uniqueRepositories.add(entry.repository);\r
- uniqueAuthors.add(entry.author);\r
}\r
\r
// repositories\r
for (String repo : sortedRespositories) {\r
repositoryChoices.addElement(repo);\r
}\r
+ }\r
\r
+ private void updateAuthors() {\r
+ String repository = repositorySelector.getSelectedItem().toString();\r
+\r
+ // determine unique repositories and authors\r
+ Set<String> uniqueAuthors = new HashSet<String>();\r
+ for (SyndicatedEntryModel entry : tableModel.entries) {\r
+ if (repository.equals(ALL) || entry.repository.equalsIgnoreCase(repository)) {\r
+ uniqueAuthors.add(entry.author);\r
+ }\r
+ }\r
// authors\r
List<String> sortedAuthors = new ArrayList<String>(uniqueAuthors);\r
Collections.sort(sortedAuthors);\r