Class SelectElementsFromGefToolItemProperties<V>
java.lang.Object
com.amalgamasimulation.desktop.ui.editor.sections.descriptors.toolitems.ToolItemProperties<SelectElementsFromGefToolItemProperties<V>>
com.amalgamasimulation.desktop.ui.editor.sections.descriptors.toolitems.SelectElementsFromGefToolItemProperties<V>
- Type Parameters:
V- the type of elements that can be selected from GEF editor
public class SelectElementsFromGefToolItemProperties<V>
extends ToolItemProperties<SelectElementsFromGefToolItemProperties<V>>
A builder class for configuring properties of a select elements from GEF editor tool item in table toolbars.
Provides methods to set selection filters, actions, icons, text, and tooltips for selecting elements
from graphical editor views and reflecting them in associated tables.
This class is designed to be used by end users to configure GEF integration 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 -
Method Summary
Modifier and TypeMethodDescriptionSets the action to be performed on elements selected from GEF editor.filter(BiFunction<org.eclipse.emf.ecore.EObject, Object, Boolean> filter) Sets an advanced filter using a BiFunction for GEF element selection.Sets a simple filter using a Predicate for GEF element selection.Returns the action to be performed on selected elements.BiFunction<org.eclipse.emf.ecore.EObject, Object, Boolean> Returns the filter function for GEF element selection.booleanChecks if a GEF selection filter is configured for this tool item.static <V> SelectElementsFromGefToolItemProperties<V> Creates a new SelectElementsFromGefToolItemProperties instance.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
-
Method Details
-
newInstance
Creates a new SelectElementsFromGefToolItemProperties instance.- Type Parameters:
V- the type of elements to select- Returns:
- a new SelectElementsFromGefToolItemProperties instance
-
isExistSelectFromGefToolItem
public boolean isExistSelectFromGefToolItem()Checks if a GEF selection filter is configured for this tool item.- Returns:
- true if a filter is configured, false otherwise
-
getFilter
Returns the filter function for GEF element selection.- Returns:
- a BiFunction that filters elements based on EObject context and the object itself
-
filter
Sets a simple filter using a Predicate for GEF element selection.- Parameters:
filter- a Predicate that tests whether an object should be selectable- Returns:
- this SelectElementsFromGefToolItemProperties instance for method chaining
-
filter
public SelectElementsFromGefToolItemProperties<V> filter(BiFunction<org.eclipse.emf.ecore.EObject, Object, Boolean> filter) Sets an advanced filter using a BiFunction for GEF element selection. The filter receives both the container EObject and the target object for more complex filtering logic.- Parameters:
filter- a BiFunction that determines if an object should be selectable based on its container context- Returns:
- this SelectElementsFromGefToolItemProperties instance for method chaining
-
getAction
Returns the action to be performed on selected elements.- Returns:
- a Consumer that processes selected elements
-
action
Sets the action to be performed on elements selected from GEF editor.- Parameters:
action- a Consumer that processes selected elements- Returns:
- this SelectElementsFromGefToolItemProperties instance for method chaining
-