Module org.autogui
Package org.autogui.swing.table
Class GuiSwingTableColumnCollection.TableSelectionSourceDynamicForList
java.lang.Object
org.autogui.swing.table.GuiSwingTableColumnCollection.TableSelectionSourceDynamicBase
org.autogui.swing.table.GuiSwingTableColumnCollection.TableSelectionSourceDynamicForList
- All Implemented Interfaces:
GuiSwingTableColumnSet.TableSelectionSource
- Direct Known Subclasses:
GuiSwingTableColumnCollection.TableSelectionSourceDynamicForIndices
- Enclosing class:
GuiSwingTableColumnCollection
public static class GuiSwingTableColumnCollection.TableSelectionSourceDynamicForList
extends GuiSwingTableColumnCollection.TableSelectionSourceDynamicBase
implements GuiSwingTableColumnSet.TableSelectionSource
class T { List<List<E>> list; } class E { String n; List<Float> l; void act(List<Float> selected) {...} }the class T will be bound to a table like the following columns
# | n[0] | l[0,0] | l[0,1] | ... | n[1] | l[1,0] | l[1,1] | ... ----|------|----------|--------|-----|------|--------|--------|----- 0 | | a | b | ... | | c | | ...If a user selects the columns "a", "b", and "c", and runs the action "act", then the following code will be executed
T t = ...; t.list.get(0).get(0).act(asList( t.list.get(0).get(1).l.get(0), //a t.list.get(0).get(1).l.get(1))); //b t.list.get(0).get(1).act(asList( t.list.get(0).get(1).l.get(0))); //c
-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class org.autogui.swing.table.GuiSwingTableColumnCollection.TableSelectionSourceDynamicBase
model, selection, tableSource
-
Constructor Summary
ConstructorsConstructorDescriptionTableSelectionSourceDynamicForList
(GuiSwingTableColumnSet.TableColumnHost model, GuiReprCollectionTable.TableTargetCell selection, ObjectTableModelColumns.DynamicColumnFactory targetFactory, List<GuiSwingTableColumnCollection.DynamicColumnFactoryList> argumentFactories) -
Method Summary
Modifier and TypeMethodDescriptiongetIndexValue
(GuiSwingTableColumnCollection.DynamicColumnFactoryList argumentFactory, GuiSwingTableColumnCollection.TargetAndSpecifierMap t, List<GuiSwingTableColumn.SpecifierManagerIndex> cellSpecs) the name might be changed for argument factory, and thus it will be included in eachGuiSwingTableColumnCollection.TargetAndArgumentList
.boolean
toCellIndexSpecs
(List<GuiSwingTableColumn.SpecifierManagerIndex> targetSpecs, List<GuiSwingTableColumn.SpecifierManagerIndex> argSpecs) Methods inherited from class org.autogui.swing.table.GuiSwingTableColumnCollection.TableSelectionSourceDynamicBase
select, selectionActionFinished, selectionActionPrepare, selectSpecifierMapForCollectionWrapper, selectSpecifierMapForStaticColumn, setTableSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.autogui.swing.table.GuiSwingTableColumnSet.TableSelectionSource
selectionActionFinished, selectionActionPrepare
-
Field Details
-
targetFactory
-
argumentFactories
-
-
Constructor Details
-
TableSelectionSourceDynamicForList
public TableSelectionSourceDynamicForList(GuiSwingTableColumnSet.TableColumnHost model, GuiReprCollectionTable.TableTargetCell selection, ObjectTableModelColumns.DynamicColumnFactory targetFactory, List<GuiSwingTableColumnCollection.DynamicColumnFactoryList> argumentFactories)
-
-
Method Details
-
getTargetName
the name might be changed for argument factory, and thus it will be included in eachGuiSwingTableColumnCollection.TargetAndArgumentList
.class T { List<List<E>> list; } class E { List<Float> l1; List<Float> l1; void act(List<Float> l, String targetName) { if (targetName.equals("l1")) ... else ... } }
- Specified by:
getTargetName
in interfaceGuiSwingTableColumnSet.TableSelectionSource
- Returns:
- ""
-
isSelectionEmpty
public boolean isSelectionEmpty()- Specified by:
isSelectionEmpty
in interfaceGuiSwingTableColumnSet.TableSelectionSource
-
getSelectedItems
- Specified by:
getSelectedItems
in interfaceGuiSwingTableColumnSet.TableSelectionSource
-
getSelectionFactory
public ObjectTableModelColumns.DynamicColumnFactory getSelectionFactory(GuiSwingTableColumnCollection.DynamicColumnFactoryList argumentFactory) -
toCellIndexSpecs
public List<GuiSwingTableColumn.SpecifierManagerIndex> toCellIndexSpecs(List<GuiSwingTableColumn.SpecifierManagerIndex> targetSpecs, List<GuiSwingTableColumn.SpecifierManagerIndex> argSpecs) -
getIndexValue
public Object getIndexValue(GuiSwingTableColumnCollection.DynamicColumnFactoryList argumentFactory, GuiSwingTableColumnCollection.TargetAndSpecifierMap t, List<GuiSwingTableColumn.SpecifierManagerIndex> cellSpecs)
-