Class UIOwner<EVENT extends UIEvent,UITYPE>

java.lang.Object
com.inductiveautomation.snap.ui.UIOwner<EVENT,UITYPE>
Direct Known Subclasses:
RMViewerOwner, SwingOwner

public abstract class UIOwner<EVENT extends UIEvent,UITYPE> extends Object
A base controller class class that manages a SwingPanel usually loaded from a rib file.
  • Field Details

  • Constructor Details

    • UIOwner

      public UIOwner()
  • Method Details

    • isUISet

      public boolean isUISet()
      Returns whether UI has been set.
    • getUI

      public UITYPE getUI()
      Returns the main UI node.
    • getUI

      public <T extends UITYPE> T getUI(Class<T> aClass)
      Returns the main UI node with the given name as the given class.
    • createUI

      protected abstract UITYPE createUI()
      Creates the UI panel.
    • initUI

      protected void initUI()
      Initializes the UI panel.
    • initUI

      protected void initUI(Object anObj)
      Initialize UI.
    • resetUI

      protected void resetUI()
      Reset UI controls.
    • respondUI

      protected void respondUI(EVENT anEvent)
      Respond to UI controls.
    • resetLater

      public void resetLater()
      Resets UI later.
    • processResetUI

      protected void processResetUI()
      Called to reset bindings and resetUI().
    • processRespondUI

      protected void processRespondUI(EVENT anEvent)
      Called to invoke respondUI().
    • getNode

      public UITYPE getNode(String aName)
      Returns the specific UI child node with the given name.
    • getNode

      protected UITYPE getNode(Object anObj)
      Returns the specific UI child node for given object (name, event or node).
    • getNode

      @Nullable public <T extends UITYPE> T getNode(String aName, Class<T> aClass)
      Returns the specific UI child node with the given name as the given class.
    • getNodeValue

      public Object getNodeValue(Object anObj)
      Returns the object value for a given name or UI node.
    • setNodeValue

      public void setNodeValue(Object anObj, Object aValue)
      Sets the object value for a given name or UI node.
    • getNodeStringValue

      public String getNodeStringValue(Object anObj)
      Returns the string value for a given name or UI node.
    • getNodeBoolValue

      public boolean getNodeBoolValue(Object anObj)
      Returns the boolean value for a given name or UI node.
    • getNodeIntValue

      public int getNodeIntValue(Object anObj)
      Returns the int value for a given name or UI node.
    • getNodeFloatValue

      public float getNodeFloatValue(Object anObj)
      Returns the float value for a given name or UI node.
    • getNodeText

      public String getNodeText(Object anObj)
      Returns the text value for a given name or UI node.
    • setNodeText

      public void setNodeText(Object anObj, String aValue)
      Sets the object value for a given name or UI node.
    • getNodeItems

      public List getNodeItems(Object anObj)
      Returns the items for a given name or UI node.
    • setNodeItems

      public void setNodeItems(Object anObj, List theItems)
      Sets the items for a given name or UI node.
    • setNodeItems

      public void setNodeItems(Object anObj, Object... theItems)
      Sets the items for a given name or UI node.
    • getNodeItemDisplayKey

      public String getNodeItemDisplayKey(Object anObj, String aKey)
      Returns the display key for given name or UI node.
    • setNodeItemDisplayKey

      public void setNodeItemDisplayKey(Object anObj, String aKey)
      Sets the display key for given name or UI node.
    • getNodeSelectedIndex

      public int getNodeSelectedIndex(Object anObj)
      Returns the selected index for given name or UI node.
    • setNodeSelectedIndex

      public void setNodeSelectedIndex(Object anObj, int aValue)
      Sets the selected index for given name or UI node.
    • getNodeSelectedItem

      public Object getNodeSelectedItem(Object anObj)
      Returns the selected item for given name or UI node.
    • setNodeSelectedItem

      public void setNodeSelectedItem(Object anObj, Object anItem)
      Sets the selected item for given name or UI node.
    • isNodeEnabled

      public void isNodeEnabled(Object anObj)
      Returns whether given name or UI node is enabled.
    • setNodeEnabled

      public void setNodeEnabled(Object anObj, boolean aValue)
      Sets whether given name or UI node is enabled.
    • isNodeValueAdjusting

      public boolean isNodeValueAdjusting(Object anObj)
      Returns whether given name or UI node is currently being modified.
    • getNodeHelper

      protected abstract UIHelper getNodeHelper(Object anObj)
      Returns the helper for a given UI node.
    • getNodeAction

      public String getNodeAction(Object anObj)
      Returns a node action.
    • setNodeAction

      public void setNodeAction(Object anObj, String anAction)
      Sets a node action.
    • sendNodeAction

      protected void sendNodeAction(Object anObj, String anAction)
      Sends a node action.
    • addNodeBinding

      public void addNodeBinding(Object anObj, String aPropertyName, String aKeyPath)
      Adds a binding to a UI node.
    • resetNodeBindings

      protected void resetNodeBindings(Object anObj)
      Reset bindings for UI node (recurses for children).
    • getBindingNodeValue

      protected Object getBindingNodeValue(Binding aBinding)
      Returns the UI node value for the given binding.
    • setBindingNodeValue

      protected void setBindingNodeValue(Binding aBinding)
      Sets the UI node value for the given binding from the key value.
    • getBindingModelValue

      protected Object getBindingModelValue(Binding aBinding)
      Returns the key value for a given binding.
    • setBindingModelValue

      protected void setBindingModelValue(Binding aBinding)
      Sets the key value for the given binding from the UI node.
    • getFirstFocus

      public Object getFirstFocus()
      Returns the first focus UI node for when window/dialog is made visible.
    • setFirstFocus

      public void setFirstFocus(Object anObj)
      Sets the first focus UI node.
    • requestFocus

      public abstract void requestFocus(Object anObj)
      Focuses given UI node (name or node).
    • getConversionMaps

      public Map<String,Map> getConversionMaps()
      Returns the map of maps, each of which is used to perform value conversions.
    • getConversionMap

      public Map<String,String> getConversionMap(String aName)
      Returns a named map to perform value conversions.
    • getConversionMapKey

      protected Object getConversionMapKey(String aConversionMapName, Object aValue)
      Converts a UI node value to binder object value using conversion key map.
    • getConversionMapValue

      public Object getConversionMapValue(String aConversionMapName, Object aKey)
      Converts a binder object value to UI node using conversion key map.
    • enableEvents

      public void enableEvents(Object anObj, UIEvent.Type... theTypes)
      Enables events on given object.
    • disableEvents

      public void disableEvents(Object anObj, UIEvent.Type... theTypes)
      Enables events on given object.
    • sendEvent

      public abstract void sendEvent(Object anObj)
      Sends an event for a UI node (name or node).
    • sendEvent

      public void sendEvent(EVENT anEvent)
      Sends an event for a UI node.
    • isSendEventDisabled

      public boolean isSendEventDisabled()
      Returns whether Ribs' send event facility is disabled (so controls can be updated without triggering response).
    • setSendEventDisabled

      public boolean setSendEventDisabled(boolean aFlag)
      Sets whether Ribs' send event facility is disabled (so controls can be updated without triggering response).
    • addKeyActionEvent

      public abstract void addKeyActionEvent(String aName, String aKey)
      Configures an ActionEvent to be sent to owner for given name and key description (in KeyStroke string format).
      See Also:
    • runLater

      public abstract void runLater(Runnable aRunnable)
      Runs the given runnable in the next event.
    • runLaterDelayed

      public void runLaterDelayed(int aDelay, Runnable aRunnable)
      Runs the runnable after the given delay in milliseconds.
    • runLaterOnce

      public void runLaterOnce(String aName, Runnable aRunnable)
      Invokes the given runnable for name once (cancels unexecuted previous runLater registered with same name).
    • isEventThread

      protected abstract boolean isEventThread()
      Returns whether current thread is event thread.
    • getUIHpr

      protected UIHelper getUIHpr()
      Returns the helper for a given object.
    • getModelValue

      public Object getModelValue(String aKey)
      Returns the model value for given key expression from this UIOwner.
    • setModelValue

      public void setModelValue(String aKey, Object aValue)
      Sets the model value for given key expression and value for this UIOwner.