Class ToolItemProperties<R extends ToolItemProperties<?>>
java.lang.Object
com.amalgamasimulation.desktop.ui.editor.sections.descriptors.toolitems.ToolItemProperties<R>
- Type Parameters:
R- the concrete subclass type for method chaining (self-referential generic)
- Direct Known Subclasses:
CopyElementToolItemProperties,CreateElementToolItemProperties,MoveDownElementToolItemProperties,MoveUpElementToolItemProperties,RefreshToolItemProperties,RemoveElementToolItemProperties,SelectElementsFromGefToolItemProperties,SelectElementsFromTableToolItemProperties,TableCustomToolItemProperties
An abstract base class for configuring properties of toolbar items in table toolbars.
Provides common properties and methods for all types of toolbar items including
style, icon, text, tooltip, and enablement settings.
This class is designed to be extended by specific toolbar item property classes
and used by end users to configure toolbar functionality within their applications.
- Author:
- Ionov Ivan
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedToolItemProperties(Class<R> cl) Constructs a new ToolItemProperties instance with the specified class reference. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.swt.graphics.ImagegetIcon()Returns the icon image of the toolbar item.intgetStyle()Returns the SWT style bits of the toolbar item.getText()Returns the text label of the toolbar item.protected RgetThis()Returns the current instance cast to the concrete subclass type.Returns the tooltip text of the toolbar item.icon(org.eclipse.swt.graphics.Image icon) Sets the icon image of the toolbar item.booleanisEnable()Returns the enablement state of the toolbar item.booleanReturns the show text state of the toolbar item.setEnable(boolean enable) Sets the enablement state of the toolbar item.setStyle(int style) Sets the SWT style bits of the toolbar item.showTextAndIcon(boolean showTextAndIcon) Sets the status of displaying the text of the toolbar element.Sets the text label of the toolbar item.Sets the tooltip text of the toolbar item.
-
Field Details
-
style
protected int style -
icon
protected org.eclipse.swt.graphics.Image icon -
text
-
tooltip
-
-
Constructor Details
-
ToolItemProperties
Constructs a new ToolItemProperties instance with the specified class reference.- Parameters:
cl- the class reference for the concrete subclass
-
-
Method Details
-
getThis
Returns the current instance cast to the concrete subclass type.- Returns:
- the current instance as type R
-
getText
Returns the text label of the toolbar item.- Returns:
- the text label
-
text
Sets the text label of the toolbar item.- Parameters:
text- the text label to display- Returns:
- this ToolItemProperties instance for method chaining
-
getIcon
public org.eclipse.swt.graphics.Image getIcon()Returns the icon image of the toolbar item.- Returns:
- the icon image, or null if no icon is set
-
icon
Sets the icon image of the toolbar item.- Parameters:
icon- the icon image to display- Returns:
- this ToolItemProperties instance for method chaining
-
getStyle
public int getStyle()Returns the SWT style bits of the toolbar item.- Returns:
- the SWT style bits
-
setStyle
Sets the SWT style bits of the toolbar item.- Parameters:
style- the SWT style bits to apply- Returns:
- this ToolItemProperties instance for method chaining
-
getTooltip
Returns the tooltip text of the toolbar item.- Returns:
- the tooltip text, or null if no tooltip is set
-
tooltip
Sets the tooltip text of the toolbar item.- Parameters:
tooltip- the tooltip text to display- Returns:
- this ToolItemProperties instance for method chaining
-
setEnable
Sets the enablement state of the toolbar item.- Parameters:
enable- true to enable the item, false to disable it- Returns:
- this ToolItemProperties instance for method chaining
-
isEnable
public boolean isEnable()Returns the enablement state of the toolbar item.- Returns:
- true if the item is enabled, false otherwise
-
showTextAndIcon
Sets the status of displaying the text of the toolbar element.- Returns:
- true if the item is enabled, false otherwise
-
isShowTextAndIcon
public boolean isShowTextAndIcon()Returns the show text state of the toolbar item.
-