Class RemoveElementToolItemProperties<V>
java.lang.Object
com.amalgamasimulation.desktop.ui.editor.sections.descriptors.toolitems.ToolItemProperties<RemoveElementToolItemProperties<V>>
com.amalgamasimulation.desktop.ui.editor.sections.descriptors.toolitems.RemoveElementToolItemProperties<V>
- Type Parameters:
V- the type of elements that can be removed
public class RemoveElementToolItemProperties<V>
extends ToolItemProperties<RemoveElementToolItemProperties<V>>
A builder class for configuring properties of a remove element tool item in table toolbars.
Provides methods to set remove actions, icons, text, and tooltips for deleting elements from tables.
This class is designed to be used by end users to configure remove functionality
in table toolbars within their applications.
- Author:
- Ionov Ivan
-
Field Summary
Fields inherited from class com.amalgamasimulation.desktop.ui.editor.sections.descriptors.toolitems.ToolItemProperties
icon, style, text, tooltip -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new RemoveElementToolItemProperties instance with default values. -
Method Summary
Modifier and TypeMethodDescriptioncustomRemoveElementsAction(BiConsumer<Table<V>, List<V>> customRemoveElementsAction) Sets a custom remove elements action using a BiConsumer that includes table context.Enables the default remove action for elements.BiConsumer<Table<V>, List<V>> Returns the custom remove elements action consumer.booleanReturns whether the default remove action is enabled.booleanChecks if a remove element action is configured for this tool item.Methods inherited from class com.amalgamasimulation.desktop.ui.editor.sections.descriptors.toolitems.ToolItemProperties
getIcon, getStyle, getText, getThis, getTooltip, icon, isEnable, isShowTextAndIcon, setEnable, setStyle, showTextAndIcon, text, tooltip
-
Constructor Details
-
RemoveElementToolItemProperties
public RemoveElementToolItemProperties()Constructs a new RemoveElementToolItemProperties instance with default values. Sets default remove/delete icon, text, and tooltip from platform resources.
-
-
Method Details
-
isExistRemoveElementToolItem
public boolean isExistRemoveElementToolItem()Checks if a remove element action is configured for this tool item.- Returns:
- true if either a default or custom remove action is configured, false otherwise
-
getCustomRemoveElementsAction
Returns the custom remove elements action consumer.- Returns:
- a BiConsumer that removes elements with table context
-
customRemoveElementsAction
public RemoveElementToolItemProperties<V> customRemoveElementsAction(BiConsumer<Table<V>, List<V>> customRemoveElementsAction) Sets a custom remove elements action using a BiConsumer that includes table context. This method is mutually exclusive with defaultRemoveAction().- Parameters:
customRemoveElementsAction- a BiConsumer that removes elements with table context- Returns:
- this RemoveElementToolItemProperties instance for method chaining
-
isDefaultRemoveAction
public boolean isDefaultRemoveAction()Returns whether the default remove action is enabled.- Returns:
- true if the default remove action is enabled, false otherwise
-
defaultRemoveAction
Enables the default remove action for elements. This method is mutually exclusive with customRemoveElementsAction().- Returns:
- this RemoveElementToolItemProperties instance for method chaining
-