Class JComponentHpr<T extends JComponent>

java.lang.Object
com.inductiveautomation.snap.ui.UIHelper<T>
com.inductiveautomation.snap.swing.SwingHelper<T>
com.inductiveautomation.snap.swing.helpers.JComponentHpr<T>
Direct Known Subclasses:
DragWell.Helper, JComboBoxHpr, JListHpr, JMenuItemHpr, JProgressBarHpr, JScrollPaneHpr, JSliderHpr, JSpinnerHpr, JSplitPaneHpr, JTabbedPaneHpr, JTableHpr, JTextComponentHpr, JTreeHpr, LabeledHpr, RJColorWellHpr, RJThumbWheelHpr, SpringsPaneHpr, SwitchPaneHpr

public class JComponentHpr<T extends JComponent> extends SwingHelper<T>
This class is used to provide Snap UI functionality to Swing JComponents.
  • Constructor Details

    • JComponentHpr

      public JComponentHpr()
  • Method Details

    • getName

      public String getName(T anObj)
      Returns the name of the given component.
      Specified by:
      getName in class UIHelper<T extends JComponent>
    • initUI

      public void initUI(T anObj, UIOwner anOwner)
      Initializes newly created object.
      Overrides:
      initUI in class UIHelper<T extends JComponent>
    • getParent

      public Object getParent(T anObj)
      Returns the parent object for given object.
      Specified by:
      getParent in class UIHelper<T extends JComponent>
    • getChildCount

      public int getChildCount(T aComp)
      Returns the number of children for given object.
      Specified by:
      getChildCount in class UIHelper<T extends JComponent>
    • getChild

      public Object getChild(T aComp, int anIndex)
      Returns the individual child object for given object and index.
      Specified by:
      getChild in class UIHelper<T extends JComponent>
    • getOwner

      public UIOwner getOwner(T anObj)
      Returns given component's owner.
      Specified by:
      getOwner in class UIHelper<T extends JComponent>
    • setOwner

      public void setOwner(T anObj, UIOwner anOwner)
      Sets given component's owner.
      Specified by:
      setOwner in class UIHelper<T extends JComponent>
    • getConstraints

      public Object getConstraints(T aComponent)
      Returns the constraints for component.
    • setConstraints

      public void setConstraints(T aComponent, Object theConstraints)
      Sets the constraints for component.
    • getAutosizing

      public String getAutosizing(T aComponent)
      Returns the autosizing for the given component.
    • getChangeListener

      protected ChangeListener getChangeListener()
      Returns a change listener suitable for some controls.
    • getSendActionOnFocusLost

      public boolean getSendActionOnFocusLost(T aComponent)
      Returns whether this component should send action when focus lost.
    • setSendActionOnFocusLost

      public void setSendActionOnFocusLost(T aComponent, Boolean aValue)
      Sets whether this component should sends action when it loses focus.
    • getSendActionOnFocusLostDefault

      public boolean getSendActionOnFocusLostDefault(T aComponent)
      Returns whether given component defaults to send action when it loses focus.
    • getBindingCount

      public int getBindingCount(T anObj)
      Returns the number of bindings associated with given component.
      Overrides:
      getBindingCount in class UIHelper<T extends JComponent>
    • getBinding

      public Binding getBinding(T anObj, int anIndex)
      Returns the individual binding at the given index for given component.
      Overrides:
      getBinding in class UIHelper<T extends JComponent>
    • getBindings

      public List<Binding> getBindings(T anObj, boolean doCreate)
      Returns the list of RibsBindings, with option to create, if missing.
    • addBinding

      public void addBinding(T anObj, Binding aBinding)
      Adds the individual binding at the given index to given component.
      Overrides:
      addBinding in class UIHelper<T extends JComponent>
    • removeBinding

      public Binding removeBinding(T anObj, int anIndex)
      Removes the binding at the given index from given component.
      Overrides:
      removeBinding in class UIHelper<T extends JComponent>
    • getPropertyNamesImpl

      protected List<String> getPropertyNamesImpl(T anObj)
      Returns the property names for JComponents.
      Overrides:
      getPropertyNamesImpl in class UIHelper<T extends JComponent>
    • isEnabled

      public boolean isEnabled(T anObj, UIEvent.Type aType)
      Returns whether given event is enabled.
      Specified by:
      isEnabled in class UIHelper<T extends JComponent>
    • setEnabled

      public void setEnabled(T anObj, UIEvent.Type aType, boolean aValue)
      Sets whether given event is enabled.
      Specified by:
      setEnabled in class UIHelper<T extends JComponent>
    • getEventAdapter

      public SwingEventAdapter getEventAdapter(T aComponent, boolean doCreate)
      Returns the SwingEventAdapter for component.
    • createEventAdapter

      protected SwingEventAdapter createEventAdapter(T aComponent)
      Creates the SwingEventAdapter for component.