Package com.inductiveautomation.snap.ui
Class UIHelper<T>
- java.lang.Object
-
- com.inductiveautomation.snap.ui.UIHelper<T>
-
- Direct Known Subclasses:
RMViewerOwnerHpr,SwingHelper
public abstract class UIHelper<T> extends java.lang.ObjectA class to provide utility methods for UI components.
-
-
Constructor Summary
Constructors Constructor Description UIHelper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddBinding(T anObj, Binding aBinding)Adds the individual binding at the given index to given UI node.voidenableEvents(T anObj, UIEvent.Type... theTypes)Called to enable events.java.lang.StringgetAction(T anObj)Returns the action for a node.BindinggetBinding(T anObj, int anIndex)Returns the individual binding at the given index for given UI node.BindinggetBinding(T anObj, java.lang.String aPropertyName)Returns the individual binding for the given property name.intgetBindingCount(T anObj)Returns the number of bindings associated with given UI node.abstract java.lang.ObjectgetChild(T anObj, int anIndex)Returns the individual child object for given object and index.java.lang.ObjectgetChild(T anObj, java.lang.String aName)Returns first child with matching name, recursively, depth first.abstract intgetChildCount(T anObj)Returns the number of children for given object.abstract UIHelpergetHelper(java.lang.Object anObj)Returns the Helper object for a given object.java.lang.StringgetItemDisplayKey(T anObj)Sets the display key for UI node item.java.util.ListgetItems(T anObj)Returns the items for an object.protected java.lang.ObjectgetKeyValue(java.lang.Object anObj, java.lang.String aKey)Returns a key value.abstract java.lang.StringgetName(T anObj)Returns the name of the given object.abstract UIOwnergetOwner(T anObj)Returns given component's owner.abstract java.lang.ObjectgetParent(T anObj)Returns the parent object for given object.java.lang.StringgetPropertyNameMapped(T anObj, java.lang.String aPropertyName)Returns a mapped property name name.java.util.List<java.lang.String>getPropertyNames(T anObj)Returns the property names for helper's instance class.protected java.util.List<java.lang.String>getPropertyNamesImpl(T anObj)Returns the property names for helper's instance class.intgetSelectedIndex(T anObj)Returns the selected index property of given object.int[]getSelectedIndexes(T anObj)int[]getSelectedIndexs(T anObj)Returns the selected index property of given object.java.lang.ObjectgetSelectedItem(T anObj)Returns the selected object property of given object.java.lang.StringgetText(T anObj)Returns the text property of given object.java.lang.ObjectgetValue(T anObj, java.lang.String aPropertyName)Returns an object's value for given property name.voidinitUI(T anObj, UIOwner anOwner)Initializes the given object to send Events to target.voidinitUIDeep(T anObj, UIOwner anOwner)Initializes the given object and its children to send Events to target.booleanisEnabled(T anObj)Returns whether given UI node is enabled.abstract booleanisEnabled(T anObj, UIEvent.Type aType)Returns whether given event is enabled.booleanisPropertyName(T anObj, java.lang.String aPropertyName)Returns whether a given property name is valid for given object.booleanisValueAdjusting(T anObj)Returns whether UI node value is adjusting.BindingremoveBinding(T anObj, int anIndex)Removes the binding at the given index from given UI node.booleanremoveBinding(T anObj, java.lang.String aPropertyName)Removes the binding with given property name from given UI node.voidsetAction(T anObj, java.lang.String anAction)Sets the action for a node.voidsetEnabled(T anObj, boolean aValue)Sets whether given UI node is enabled.abstract voidsetEnabled(T anObj, UIEvent.Type aType, boolean aValue)Returns whether given event is enabled.voidsetItemDisplayKey(T anObj, java.lang.String aKey)Sets the display key for UI node item.voidsetItems(T anObj, java.lang.Object[] theItems)Sets the items for an object.voidsetItems(T anObj, java.util.List theItems)Sets the items for an object.protected voidsetKeyValue(java.lang.Object anObj, java.lang.String aKey, java.lang.Object aValue)Sets a KeyValue.abstract voidsetOwner(T anObj, UIOwner anOwner)Sets given component's owner.voidsetSelectedIndex(T anObj, int anIndex)Sets the selected index property of given object to given value.voidsetSelectedIndexes(T anObj, int[] theIndexes)Sets the selected index property of given object to given value.voidsetSelectedItem(T anObj, java.lang.Object aValue)Sets the selected object property of given object to given value.voidsetText(T anObj, java.lang.String aString)Sets the text property of given object to given string.voidsetValue(T anObj, java.lang.String aPropertyName, java.lang.Object aValue)Sets an object's value for given property name.
-
-
-
Method Detail
-
getName
public abstract java.lang.String getName(T anObj)
Returns the name of the given object.
-
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 java.lang.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 java.lang.Object getChild(T anObj, int anIndex)
Returns the individual child object for given object and index.
-
getChild
public java.lang.Object getChild(T anObj, java.lang.String aName)
Returns first child with matching name, recursively, depth first.
-
isPropertyName
public boolean isPropertyName(T anObj, java.lang.String aPropertyName)
Returns whether a given property name is valid for given object.
-
getPropertyNames
public java.util.List<java.lang.String> getPropertyNames(T anObj)
Returns the property names for helper's instance class.
-
getPropertyNamesImpl
protected java.util.List<java.lang.String> getPropertyNamesImpl(T anObj)
Returns the property names for helper's instance class.
-
getPropertyNameMapped
public java.lang.String getPropertyNameMapped(T anObj, java.lang.String aPropertyName)
Returns a mapped property name name.
-
getAction
public java.lang.String getAction(T anObj)
Returns the action for a node.
-
setAction
public void setAction(T anObj, java.lang.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, java.lang.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, java.lang.String aPropertyName)
Removes the binding with given property name from given UI node.
-
getValue
public java.lang.Object getValue(T anObj, java.lang.String aPropertyName)
Returns an object's value for given property name.
-
setValue
public void setValue(T anObj, java.lang.String aPropertyName, java.lang.Object aValue)
Sets an object's value for given property name.
-
getText
public java.lang.String getText(T anObj)
Returns the text property of given object.
-
setText
public void setText(T anObj, java.lang.String aString)
Sets the text property of given object to given string.
-
getItems
public java.util.List getItems(T anObj)
Returns the items for an object.
-
setItems
public void setItems(T anObj, java.util.List theItems)
Sets the items for an object.
-
setItems
public void setItems(T anObj, java.lang.Object[] theItems)
Sets the items for an object.
-
getItemDisplayKey
public java.lang.String getItemDisplayKey(T anObj)
Sets the display key for UI node item.
-
setItemDisplayKey
public void setItemDisplayKey(T anObj, java.lang.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 java.lang.Object getSelectedItem(T anObj)
Returns the selected object property of given object.
-
setSelectedItem
public void setSelectedItem(T anObj, java.lang.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 java.lang.Object getKeyValue(java.lang.Object anObj, java.lang.String aKey)Returns a key value.
-
setKeyValue
protected void setKeyValue(java.lang.Object anObj, java.lang.String aKey, java.lang.Object aValue)Sets a KeyValue.
-
enableEvents
public void enableEvents(T anObj, UIEvent.Type... theTypes)
Called to enable events.
-
getHelper
public abstract UIHelper getHelper(java.lang.Object anObj)
Returns the Helper object for a given object.
-
-