Class ActionButtonModel

All Implemented Interfaces:
IPVWidgetModel, ITextModel, IAdaptable, IPropertySource
Direct Known Subclasses:
NativeButtonModel

public class ActionButtonModel extends AbstractPVWidgetModel implements ITextModel
An action button widget model.
  • Field Details

    • PROP_STYLE

      public static final String PROP_STYLE
      Button Style
      See Also:
    • PROP_TEXT

      public static final String PROP_TEXT
      Text on the button.
      See Also:
    • PROP_IMAGE

      public static final String PROP_IMAGE
      Image on the button.
      See Also:
    • PROP_ACTION_INDEX

      public static final String PROP_ACTION_INDEX
      The index of the action to be executed when button is pushed. It is corresponding to the action sort index in actions property.
      See Also:
    • PROP_RELEASED_ACTION_INDEX

      public static final String PROP_RELEASED_ACTION_INDEX
      The index of the action to be executed when released. It is corresponding to the action sort index in actions property.
      See Also:
    • PROP_TOGGLE_BUTTON

      public static final String PROP_TOGGLE_BUTTON
      If yes, the button will not bounce up when clicked.
      See Also:
    • ID

      public static final String ID
      The ID of this widget model.
      See Also:
  • Constructor Details

    • ActionButtonModel

      public ActionButtonModel()
  • Method Details

    • getTypeID

      public String getTypeID()
      Specified by:
      getTypeID in class AbstractWidgetModel
      Returns:
      the unique typeID of the model.
    • configureProperties

      protected void configureProperties()
      Description copied from class: AbstractWidgetModel
      Configure the properties of the widget. Subclass should add new properties in this method.
      Specified by:
      configureProperties in class AbstractWidgetModel
    • getActionIndex

      public int getActionIndex()
      Return the index of the selected WidgetAction from the ActionData. The Action is running when the button is released.
    • getReleasedActionIndex

      public int getReleasedActionIndex()
      Return the index of the selected WidgetAction from the ActionData. The Action is running when the button is released.
    • getText

      public String getText()
      Return the label text.
      Specified by:
      getText in interface ITextModel
    • setText

      public void setText(String text)
      Specified by:
      setText in interface ITextModel
    • getImagePath

      public String getImagePath()
    • isToggleButton

      public boolean isToggleButton()
      Returns whether the button is a toggle button.
    • getStyle

      public ActionButtonModel.Style getStyle()
    • getVersion

      public org.osgi.framework.Version getVersion()
      Overrides:
      getVersion in class AbstractWidgetModel
      Returns:
      version of this widget model.
    • setStyle

      public void setStyle(ActionButtonModel.Style style)