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

public abstract class ToolItemProperties<R extends ToolItemProperties<?>> extends Object
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
    Modifier and Type
    Field
    Description
    protected org.eclipse.swt.graphics.Image
     
    protected int
     
    protected String
     
    protected String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructs a new ToolItemProperties instance with the specified class reference.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.eclipse.swt.graphics.Image
    Returns the icon image of the toolbar item.
    int
    Returns the SWT style bits of the toolbar item.
    Returns the text label of the toolbar item.
    protected R
    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.
    boolean
    Returns the enablement state of the toolbar item.
    boolean
    Returns 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.
    text(String text)
    Sets the text label of the toolbar item.
    tooltip(String tooltip)
    Sets the tooltip text of the toolbar item.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • style

      protected int style
    • icon

      protected org.eclipse.swt.graphics.Image icon
    • text

      protected String text
    • tooltip

      protected String tooltip
  • Constructor Details

    • ToolItemProperties

      protected ToolItemProperties(Class<R> cl)
      Constructs a new ToolItemProperties instance with the specified class reference.
      Parameters:
      cl - the class reference for the concrete subclass
  • Method Details

    • getThis

      protected R getThis()
      Returns the current instance cast to the concrete subclass type.
      Returns:
      the current instance as type R
    • getText

      public String getText()
      Returns the text label of the toolbar item.
      Returns:
      the text label
    • text

      public R text(String 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

      public R icon(org.eclipse.swt.graphics.Image 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

      public R setStyle(int style)
      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

      public String getTooltip()
      Returns the tooltip text of the toolbar item.
      Returns:
      the tooltip text, or null if no tooltip is set
    • tooltip

      public R tooltip(String tooltip)
      Sets the tooltip text of the toolbar item.
      Parameters:
      tooltip - the tooltip text to display
      Returns:
      this ToolItemProperties instance for method chaining
    • setEnable

      public R setEnable(boolean enable)
      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

      public R showTextAndIcon(boolean 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.