Class UIOwner<EventT extends UIEvent, UiT>
java.lang.Object
com.inductiveautomation.snap.ui.UIOwner<EventT,UiT>
- Direct Known Subclasses:
RMViewerOwner, SwingOwner
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Typestatic final UIEvent.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddKeyActionEvent(String aName, String aKey) Configures an ActionEvent to be sent to owner for given name and key description (in KeyStroke string format).voidaddNodeBinding(Object anObj, String aPropertyName, String aKeyPath) Adds a binding to a UI node.protected abstract UiTcreateUI()Creates the UI panel.voiddisableEvents(Object anObj, UIEvent.Type... theTypes) Enables events on given object.voidenableEvents(Object anObj, UIEvent.Type... theTypes) Enables events on given object.protected ObjectgetBindingModelValue(Binding aBinding) Returns the key value for a given binding.protected ObjectgetBindingNodeValue(Binding aBinding) Returns the UI node value for the given binding.getConversionMap(String aName) Returns a named map to perform value conversions.protected ObjectgetConversionMapKey(String aConversionMapName, Object aValue) Converts a UI node value to binder object value using conversion key map.Returns the map of maps, each of which is used to perform value conversions.getConversionMapValue(String aConversionMapName, Object aKey) Converts a binder object value to UI node using conversion key map.Returns the first focus UI node for when window/dialog is made visible.getModelValue(String aKey) Returns the model value for given key expression from this UIOwner.protected UiTReturns the specific UI child node for given object (name, event or node).Returns the specific UI child node with the given name.<T extends UiT>
@Nullable TReturns the specific UI child node with the given name as the given class.getNodeAction(Object anObj) Returns a node action.booleangetNodeBoolValue(Object anObj) Returns the boolean value for a given name or UI node.floatgetNodeFloatValue(Object anObj) Returns the float value for a given name or UI node.protected abstract UIHelpergetNodeHelper(Object anObj) Returns the helper for a given UI node.intgetNodeIntValue(Object anObj) Returns the int value for a given name or UI node.getNodeItemDisplayKey(Object anObj, String aKey) Returns the display key for given name or UI node.getNodeItems(Object anObj) Returns the items for a given name or UI node.intgetNodeSelectedIndex(Object anObj) Returns the selected index for given name or UI node.getNodeSelectedItem(Object anObj) Returns the selected item for given name or UI node.getNodeStringValue(Object anObj) Returns the string value for a given name or UI node.getNodeText(Object anObj) Returns the text value for a given name or UI node.getNodeValue(Object anObj) Returns the object value for a given name or UI node.getUI()Returns the main UI node.<T extends UiT>
TReturns the main UI node with the given name as the given class.protected UIHelpergetUIHpr()Returns the helper for a given object.protected voidinitUI()Initializes the UI panel.protected voidInitialize UI.protected abstract booleanReturns whether current thread is event thread.voidisNodeEnabled(Object anObj) Returns whether given name or UI node is enabled.booleanisNodeValueAdjusting(Object anObj) Returns whether given name or UI node is currently being modified.booleanReturns whether Ribs' send event facility is disabled (so controls can be updated without triggering response).booleanisUISet()Returns whether UI has been set.protected voidCalled to reset bindings and resetUI().protected voidprocessRespondUI(EventT anEvent) Called to invoke respondUI().abstract voidrequestFocus(Object anObj) Focuses given UI node (name or node).voidResets UI later.protected voidresetNodeBindings(Object anObj) Reset bindings for UI node (recurses for children).protected voidresetUI()Reset UI controls.protected voidRespond to UI controls.abstract voidRuns the given runnable in the next event.voidrunLaterDelayed(int aDelay, Runnable aRunnable) Runs the runnable after the given delay in milliseconds.voidrunLaterOnce(String aName, Runnable aRunnable) Invokes the given runnable for name once (cancels unexecuted previous runLater registered with same name).voidSends an event for a UI node.abstract voidSends an event for a UI node (name or node).protected voidsendNodeAction(Object anObj, String anAction) Sends a node action.protected voidsetBindingModelValue(Binding aBinding) Sets the key value for the given binding from the UI node.protected voidsetBindingNodeValue(Binding aBinding) Sets the UI node value for the given binding from the key value.voidsetFirstFocus(Object anObj) Sets the first focus UI node.voidsetModelValue(String aKey, Object aValue) Sets the model value for given key expression and value for this UIOwner.voidsetNodeAction(Object anObj, String anAction) Sets a node action.voidsetNodeEnabled(Object anObj, boolean aValue) Sets whether given name or UI node is enabled.voidsetNodeItemDisplayKey(Object anObj, String aKey) Sets the display key for given name or UI node.voidsetNodeItems(Object anObj, Object... theItems) Sets the items for a given name or UI node.voidsetNodeItems(Object anObj, List theItems) Sets the items for a given name or UI node.voidsetNodeSelectedIndex(Object anObj, int aValue) Sets the selected index for given name or UI node.voidsetNodeSelectedItem(Object anObj, Object anItem) Sets the selected item for given name or UI node.voidsetNodeText(Object anObj, String aValue) Sets the object value for a given name or UI node.voidsetNodeValue(Object anObj, Object aValue) Sets the object value for a given name or UI node.booleansetSendEventDisabled(boolean aFlag) Sets whether Ribs' send event facility is disabled (so controls can be updated without triggering response).
-
Field Details
-
KeyPressed
-
KeyReleased
-
KeyTyped
-
KeyFinished
-
MousePressed
-
MouseDragged
-
MouseReleased
-
MouseClicked
-
MouseFinished
-
MouseEntered
-
MouseMoved
-
MouseExited
-
DragEnter
-
DragOver
-
DragExit
-
DragDrop
-
KeyEvents
-
MouseEvents
-
DragEvents
-
-
Constructor Details
-
UIOwner
public UIOwner()
-
-
Method Details
-
isUISet
public boolean isUISet()Returns whether UI has been set. -
getUI
Returns the main UI node. -
getUI
-
createUI
Creates the UI panel. -
initUI
protected void initUI()Initializes the UI panel. -
initUI
Initialize UI. -
resetUI
protected void resetUI()Reset UI controls. -
respondUI
Respond to UI controls. -
resetLater
public void resetLater()Resets UI later. -
processResetUI
protected void processResetUI()Called to reset bindings and resetUI(). -
processRespondUI
Called to invoke respondUI(). -
getNode
-
getNode
-
getNode
-
getNodeValue
-
setNodeValue
-
getNodeStringValue
-
getNodeBoolValue
Returns the boolean value for a given name or UI node. -
getNodeIntValue
Returns the int value for a given name or UI node. -
getNodeFloatValue
Returns the float value for a given name or UI node. -
getNodeText
-
setNodeText
-
getNodeItems
-
setNodeItems
-
setNodeItems
-
getNodeItemDisplayKey
-
setNodeItemDisplayKey
-
getNodeSelectedIndex
Returns the selected index for given name or UI node. -
setNodeSelectedIndex
Sets the selected index for given name or UI node. -
getNodeSelectedItem
-
setNodeSelectedItem
-
isNodeEnabled
Returns whether given name or UI node is enabled. -
setNodeEnabled
Sets whether given name or UI node is enabled. -
isNodeValueAdjusting
Returns whether given name or UI node is currently being modified. -
getNodeHelper
-
getNodeAction
-
setNodeAction
-
sendNodeAction
-
addNodeBinding
-
resetNodeBindings
Reset bindings for UI node (recurses for children). -
getBindingNodeValue
-
setBindingNodeValue
Sets the UI node value for the given binding from the key value. -
getBindingModelValue
-
setBindingModelValue
Sets the key value for the given binding from the UI node. -
getFirstFocus
Returns the first focus UI node for when window/dialog is made visible. -
setFirstFocus
Sets the first focus UI node. -
requestFocus
Focuses given UI node (name or node). -
getConversionMaps
-
getConversionMap
-
getConversionMapKey
-
getConversionMapValue
-
enableEvents
Enables events on given object. -
disableEvents
Enables events on given object. -
sendEvent
Sends an event for a UI node (name or node). -
sendEvent
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
-
runLater
Runs the given runnable in the next event. -
runLaterDelayed
Runs the runnable after the given delay in milliseconds. -
runLaterOnce
-
isEventThread
protected abstract boolean isEventThread()Returns whether current thread is event thread. -
getUIHpr
Returns the helper for a given object. -
getModelValue
-
setModelValue
-