Module org.autogui

Class GuiSwingTableColumnCollection.TableSelectionSourceDynamicForRowAndColumnIndices

All Implemented Interfaces:
GuiSwingTableColumnSet.TableSelectionSource
Enclosing class:
GuiSwingTableColumnCollection

public static class GuiSwingTableColumnCollection.TableSelectionSourceDynamicForRowAndColumnIndices extends GuiSwingTableColumnCollection.TableSelectionSourceDynamicForIndices
     class T { List<List<E>> list; }
     class E {
         String n;
         List<Float>  l1;
         List<String> l2;
         void act(List<int[]> selectedIndices, String targetName) {...}
     }
 
the class T will be bound to a table like the following columns
     #  | n[0] |  l1[0,0] | ... | l2[0,0] | ... | n[1] | l1[1,0] | l1[1,1] | ... | l2[1,0] | ...
    ----|------|----------|-----|---------|-----|------|---------|---------|-----|---------|-----
     0  |      |      a   | ... |    b    | ... |      |   c     |   d     | ... |         | ...
     1  |      |          | ... |    e    | ... |      |         |   f     | ... |    g    | ...
 
If a user selects the columns "a"..."g", and runs the action "act", then the following code will be executed
        T t = ...;
        t.list.get(0).get(0).act(asList({0}),      "l1"); //a
        t.list.get(0).get(0).act(asList({0}),      "l2"); //b
        t.list.get(0).get(1).act(asList({0},{1}),"l1"); //c,d

        t.list.get(1).get(0).act(asList({0}),      "l2"); //e
        t.list.get(1).get(1).act(asList({1}),      "l1"); //f
        t.list.get(1).get(1).act(asList({0}),      "l2"); //g
   
Both "l1" and "l2" has indexSpecs "[i][j][k]" (e.g. list.get(i).get(j).l1.get(k)), but "i" and "j" will be ignored for the action "act" in "E" and each element of the argument becomes {k}. This is intended to keep the int[] having {row,column,...} observed by the target of the action (here "E"). The user can distinguish "i" and "j" by the target instance of "E".