Class UIHelper<T>

java.lang.Object
com.inductiveautomation.snap.ui.UIHelper<T>
Direct Known Subclasses:
RMViewerOwnerHpr, SwingHelper

public abstract class UIHelper<T> extends Object
A class to provide utility methods for UI components.
  • Constructor Details

    • UIHelper

      public UIHelper()
  • Method Details

    • getName

      public abstract String getName(T anObj)
      Returns the name of the given object.
    • getOwner

      public abstract UIOwner getOwner(T anObj)
      Returns given component's owner.
    • setOwner

      public abstract void setOwner(T anObj, UIOwner anOwner)
      Sets given component's owner.
    • initUI

      public void initUI(T anObj, UIOwner anOwner)
      Initializes the given object to send Events to target.
    • initUIDeep

      public void initUIDeep(T anObj, UIOwner anOwner)
      Initializes the given object and its children to send Events to target.
    • getParent

      public abstract Object getParent(T anObj)
      Returns the parent object for given object.
    • getChildCount

      public abstract int getChildCount(T anObj)
      Returns the number of children for given object.
    • getChild

      public abstract Object getChild(T anObj, int anIndex)
      Returns the individual child object for given object and index.
    • getChild

      public Object getChild(T anObj, String aName)
      Returns first child with matching name, recursively, depth first.
    • isPropertyName

      public boolean isPropertyName(T anObj, String aPropertyName)
      Returns whether a given property name is valid for given object.
    • getPropertyNames

      public List<String> getPropertyNames(T anObj)
      Returns the property names for helper's instance class.
    • getPropertyNamesImpl

      protected List<String> getPropertyNamesImpl(T anObj)
      Returns the property names for helper's instance class.
    • getPropertyNameMapped

      public String getPropertyNameMapped(T anObj, String aPropertyName)
      Returns a mapped property name name.
    • getAction

      public String getAction(T anObj)
      Returns the action for a node.
    • setAction

      public void setAction(T anObj, String anAction)
      Sets the action for a node.
    • getBindingCount

      public int getBindingCount(T anObj)
      Returns the number of bindings associated with given UI node.
    • getBinding

      public Binding getBinding(T anObj, int anIndex)
      Returns the individual binding at the given index for given UI node.
    • getBinding

      public Binding getBinding(T anObj, String aPropertyName)
      Returns the individual binding for the given property name.
    • addBinding

      public void addBinding(T anObj, Binding aBinding)
      Adds the individual binding at the given index to given UI node.
    • removeBinding

      public Binding removeBinding(T anObj, int anIndex)
      Removes the binding at the given index from given UI node.
    • removeBinding

      public boolean removeBinding(T anObj, String aPropertyName)
      Removes the binding with given property name from given UI node.
    • getValue

      public Object getValue(T anObj, String aPropertyName)
      Returns an object's value for given property name.
    • setValue

      public void setValue(T anObj, String aPropertyName, Object aValue)
      Sets an object's value for given property name.
    • getText

      public String getText(T anObj)
      Returns the text property of given object.
    • setText

      public void setText(T anObj, String aString)
      Sets the text property of given object to given string.
    • getItems

      public List getItems(T anObj)
      Returns the items for an object.
    • setItems

      public void setItems(T anObj, List theItems)
      Sets the items for an object.
    • setItems

      public void setItems(T anObj, Object[] theItems)
      Sets the items for an object.
    • getItemDisplayKey

      public String getItemDisplayKey(T anObj)
      Sets the display key for UI node item.
    • setItemDisplayKey

      public void setItemDisplayKey(T anObj, String aKey)
      Sets the display key for UI node item.
    • getSelectedIndex

      public int getSelectedIndex(T anObj)
      Returns the selected index property of given object.
    • setSelectedIndex

      public void setSelectedIndex(T anObj, int anIndex)
      Sets the selected index property of given object to given value.
    • getSelectedIndexs

      public int[] getSelectedIndexs(T anObj)
      Returns the selected index property of given object.

      Kept in case someone is using reflection with the misspelling

    • getSelectedIndexes

      public int[] getSelectedIndexes(T anObj)
    • setSelectedIndexes

      public void setSelectedIndexes(T anObj, int[] theIndexes)
      Sets the selected index property of given object to given value.
    • getSelectedItem

      public Object getSelectedItem(T anObj)
      Returns the selected object property of given object.
    • setSelectedItem

      public void setSelectedItem(T anObj, Object aValue)
      Sets the selected object property of given object to given value.
    • isValueAdjusting

      public boolean isValueAdjusting(T anObj)
      Returns whether UI node value is adjusting.
    • isEnabled

      public boolean isEnabled(T anObj)
      Returns whether given UI node is enabled.
    • setEnabled

      public void setEnabled(T anObj, boolean aValue)
      Sets whether given UI node is enabled.
    • isEnabled

      public abstract boolean isEnabled(T anObj, UIEvent.Type aType)
      Returns whether given event is enabled.
    • setEnabled

      public abstract void setEnabled(T anObj, UIEvent.Type aType, boolean aValue)
      Returns whether given event is enabled.
    • getKeyValue

      protected Object getKeyValue(Object anObj, String aKey)
      Returns a key value.
    • setKeyValue

      protected void setKeyValue(Object anObj, String aKey, Object aValue)
      Sets a KeyValue.
    • enableEvents

      public void enableEvents(T anObj, UIEvent.Type... theTypes)
      Called to enable events.
    • getHelper

      public abstract UIHelper getHelper(Object anObj)
      Returns the Helper object for a given object.