- // TODO: why must be last so to be able to draw over the rest
- // TODO: make it so we cannot add manual entries
- // TODO: how to select the item via keyboard? why double-click via
- // mouse?
- // TODO: how to change the values size on resize?
- // TODO: setWidth() does not impact the display width, only the control
- // and the down arrow on the right
- // TODO: width 1 +resize + click on down arrow = bad format exception
- select = addComboBox(0, 0, 10, selects, 0,
- Math.min(selects.size() + 1, getHeight() - 1 - 1),
- new TAction() {
- @Override
- public void DO() {
- // TODO: detect (show all)
- if (select.getText().equals("(show all)")) {
- setMode(mode, null);
- } else {
- setMode(mode, select.getText());
- }
+ TAction onSelect = new TAction() {
+ @Override
+ public void DO() {
+ String smode = selectBox.getText();
+ boolean showTarget;
+ if (smode == null || smode.equals("(show all)")) {
+ showTarget = false;
+ } else if (smode.equals("Sources")) {
+ selectTargets.clear();
+ selectTargets.add("(show all)");
+ for (String source : reader.getLibrary().getSources()) {
+ selectTargets.add(source);
+ }
+ showTarget = true;
+ } else {
+ selectTargets.clear();
+ selectTargets.add("(show all)");
+ for (String author : reader.getLibrary().getAuthors()) {
+ selectTargets.add(author);