Class SelectElementsFromGefProperties<V>
java.lang.Object
com.amalgamasimulation.desktop.ui.editor.sections.descriptors.toolitems.ToolItemProperties<SelectElementsFromGefProperties<V>>
com.amalgamasimulation.desktop.ui.editor.sections.descriptors.toolitems.SelectElementsFromGefProperties<V>
- Type Parameters:
V- the type of elements that can be selected from GEF editor
public class SelectElementsFromGefProperties<V>
extends ToolItemProperties<SelectElementsFromGefProperties<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> SelectElementsFromGefProperties<V> Creates a new SelectElementsFromGefProperties instance.Methods inherited from class com.amalgamasimulation.desktop.ui.editor.sections.descriptors.toolitems.ToolItemProperties
enabled, getIcon, getStyle, getText, getThis, getToolTip, icon, isEnabled, isShowTextAndIcon, showTextAndIcon, style, text, toolTip
-
Method Details
-
newInstance
Creates a new SelectElementsFromGefProperties instance.- Type Parameters:
V- the type of elements to select- Returns:
- a new SelectElementsFromGefProperties 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 SelectElementsFromGefProperties instance for method chaining
-
filter
public SelectElementsFromGefProperties<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 SelectElementsFromGefProperties 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 SelectElementsFromGefProperties instance for method chaining
-