Module org.autogui
Package org.autogui.swing.table
Class GuiSwingTableColumnCollection.DynamicColumnFactoryBase
java.lang.Object
org.autogui.swing.table.GuiSwingTableColumnCollection.DynamicColumnFactoryBase
- Direct Known Subclasses:
GuiSwingTableColumnCollection.DynamicColumnFactoryComposite
,GuiSwingTableColumnCollection.DynamicColumnFactoryList
- Enclosing class:
GuiSwingTableColumnCollection
the base class for dynamic column factories:
the class provide implementations of methods defined in
ObjectTableModelColumns.DynamicColumnFactory
and GuiSwingTableColumnSet.DynamicColumnHost
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List
<GuiMappingContext> protected GuiMappingContext
protected List
<GuiSwingTableColumn.SpecifierManagerIndex> protected GuiSwingTableColumnSet.TableColumnHost
protected GuiSwingView.SpecifierManager
-
Constructor Summary
ConstructorsConstructorDescriptionDynamicColumnFactoryBase
(GuiMappingContext context, GuiSwingView.SpecifierManager specifierManager, GuiSwingTableColumnSet.TableColumnHost model, GuiSwingTableColumn.SpecifierManagerIndex elementIndex) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addActionContext
(GuiMappingContext context) protected void
collectListActions
(GuiMappingContext actionContext, ObjectTableModelColumns.DynamicColumnFactory childFactory) collect argument-factories from a child-factory.getActions
(ObjectTableModelColumns.DynamicColumnFactory sender, List<ObjectTableModelColumns.DynamicColumnFactory> children, GuiReprCollectionTable.TableTargetCell selection) getModel()
getValue
(Map<GuiSwingTableColumn.SpecifierManagerIndex, Integer> indexInjection) getValueAsMember
(Object parent) void
setContext
(GuiMappingContext context) void
setElementIndex
(GuiSwingTableColumn.SpecifierManagerIndex elementIndex) void
void
void
setSpecifierManager
(GuiSwingView.SpecifierManager specifierManager) toAction
(GuiMappingContext actionContext, ObjectTableModelColumns.DynamicColumnFactory sender, List<ObjectTableModelColumns.DynamicColumnFactory> children, GuiReprCollectionTable.TableTargetCell selection) toActionForList
(GuiMappingContext actionContext, ObjectTableModelColumns.DynamicColumnFactory sender, List<ObjectTableModelColumns.DynamicColumnFactory> children, GuiReprCollectionTable.TableTargetCell selection) collect sub-factories as arguments and create an aggregated action which takes all selection items of lists of collected factories.toActionForTarget
(GuiMappingContext actionContext, ObjectTableModelColumns.DynamicColumnFactory sender, List<ObjectTableModelColumns.DynamicColumnFactory> children, GuiReprCollectionTable.TableTargetCell selection)
-
Field Details
-
context
-
specifierManager
-
parentFactory
-
elementIndex
-
indexSet
-
actionContexts
-
model
-
-
Constructor Details
-
DynamicColumnFactoryBase
public DynamicColumnFactoryBase(GuiMappingContext context, GuiSwingView.SpecifierManager specifierManager, GuiSwingTableColumnSet.TableColumnHost model, GuiSwingTableColumn.SpecifierManagerIndex elementIndex)
-
-
Method Details
-
getContext
-
setContext
-
setSpecifierManager
-
getSpecifierManager
-
setParentFactory
-
getParentFactory
-
setModel
-
getModel
-
setElementIndex
-
getElementIndex
-
addActionContext
-
getActionContexts
-
getIndexSpecifiers
- Returns:
- compose parent's specifiers and
getElementIndex()
-
addIndexToList
-
getActions
public List<Action> getActions(ObjectTableModelColumns.DynamicColumnFactory sender, List<ObjectTableModelColumns.DynamicColumnFactory> children, GuiReprCollectionTable.TableTargetCell selection) - Parameters:
sender
- the self factorychildren
- children of the factoryselection
- a regular table selection which will be wrapped by a sub-list based selection such asGuiSwingTableColumnCollection.TableSelectionSourceDynamicForList
- Returns:
- created actions from
getActionContexts()
and aggregation of recursive results of children
-
toAction
public GuiSwingTableColumnSetDefault.TableSelectionListAction toAction(GuiMappingContext actionContext, ObjectTableModelColumns.DynamicColumnFactory sender, List<ObjectTableModelColumns.DynamicColumnFactory> children, GuiReprCollectionTable.TableTargetCell selection) -
toActionForTarget
public GuiSwingTableColumnSetDefault.TableSelectionListAction toActionForTarget(GuiMappingContext actionContext, ObjectTableModelColumns.DynamicColumnFactory sender, List<ObjectTableModelColumns.DynamicColumnFactory> children, GuiReprCollectionTable.TableTargetCell selection) -
toActionForList
public GuiSwingTableColumnSetDefault.TableSelectionListAction toActionForList(GuiMappingContext actionContext, ObjectTableModelColumns.DynamicColumnFactory sender, List<ObjectTableModelColumns.DynamicColumnFactory> children, GuiReprCollectionTable.TableTargetCell selection) collect sub-factories as arguments and create an aggregated action which takes all selection items of lists of collected factories. the result action executes the action method in multiple times for each list.List<E> a,b; //a click of the button of the action might cause 2 executions of the method with "a" and "b" void action(List<E> s, String n) { if (n.equals("a")) ... else ... }
- Parameters:
actionContext
- a context associated with an actionsender
- the self factorychildren
- children of the senderselection
- the regular section of a table- Returns:
- a created action or null
-
collectListActions
public List<GuiSwingTableColumnCollection.DynamicColumnFactoryList> collectListActions(GuiMappingContext actionContext, ObjectTableModelColumns.DynamicColumnFactory childFactory) collect argument-factories from a child-factory.class Tbl { List<C> table; } class C { //associated with a
GuiSwingTableColumnCollection.DynamicColumnFactoryList
List<E> a; //childFactory 1 : each property associated withGuiSwingTableColumnCollection.DynamicColumnFactoryComposite
List<E> b; //childFactory 2 void action(List<E> s, String name) {...} //associated with the actionContext }- Parameters:
actionContext
- a context associated with an actionchildFactory
- the tested factory whether elements can be the argument of the action- Returns:
- matched factories
-
getValue
- Parameters:
indexInjection
- indices for the value, including a row index- Returns:
- the column item with setting the indices. So, the specifier managers for the factory must be same instances contained in the indexInjection
-
getValueAsMember
- Parameters:
parent
- a parent object- Returns:
- obtains a value by the representation of the context. the representation will be a some property object (instead of a list). Then the upper index injections can be ignored because the upper value is supplied as parent.
-