Class RefreshToolItemProperties<V>
java.lang.Object
com.amalgamasimulation.desktop.ui.editor.sections.descriptors.toolitems.ToolItemProperties<RefreshToolItemProperties<V>>
com.amalgamasimulation.desktop.ui.editor.sections.descriptors.toolitems.RefreshToolItemProperties<V>
- Type Parameters:
V- the type of elements contained in the table
A builder class for configuring properties of a refresh tool item in table toolbars.
Provides methods to set refresh actions, icons, text, and tooltips for refreshing table content.
This class is designed to be used by end users to configure refresh 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 RefreshToolItemProperties instance with default values. -
Method Summary
Modifier and TypeMethodDescriptioncustomRefreshAction(Consumer<Table<V>> customRefreshAction) Sets a custom refresh action using a Consumer that includes table context.Enables the default refresh action for the table.Returns the custom refresh action consumer.booleanReturns whether the default refresh action is enabled.booleanChecks if a refresh 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
-
RefreshToolItemProperties
public RefreshToolItemProperties()Constructs a new RefreshToolItemProperties instance with default values. Sets default refresh icon, text, and tooltip from platform resources.
-
-
Method Details
-
isExistRefreshToolItem
public boolean isExistRefreshToolItem()Checks if a refresh action is configured for this tool item.- Returns:
- true if either a default or custom refresh action is configured, false otherwise
-
isDefaultRefreshAction
public boolean isDefaultRefreshAction()Returns whether the default refresh action is enabled.- Returns:
- true if the default refresh action is enabled, false otherwise
-
defaultRefreshAction
Enables the default refresh action for the table. This method is mutually exclusive with customRefreshAction().- Returns:
- this RefreshToolItemProperties instance for method chaining
-
getCustomRefreshAction
Returns the custom refresh action consumer.- Returns:
- a Consumer that refreshes the table content
-
customRefreshAction
Sets a custom refresh action using a Consumer that includes table context. This method is mutually exclusive with defaultRefreshAction().- Parameters:
customRefreshAction- a Consumer that refreshes the table content- Returns:
- this RefreshToolItemProperties instance for method chaining
-