public abstract class UIOwner<EVENT extends UIEvent,UITYPE>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static UIEvent.Type |
DragDrop |
static UIEvent.Type |
DragEnter |
UIEvent.Type[] |
DragEvents |
static UIEvent.Type |
DragExit |
static UIEvent.Type |
DragOver |
UIEvent.Type[] |
KeyEvents |
static UIEvent.Type |
KeyFinished |
static UIEvent.Type |
KeyPressed |
static UIEvent.Type |
KeyReleased |
static UIEvent.Type |
KeyTyped |
static UIEvent.Type |
MouseClicked |
static UIEvent.Type |
MouseDragged |
static UIEvent.Type |
MouseEntered |
UIEvent.Type[] |
MouseEvents |
static UIEvent.Type |
MouseExited |
static UIEvent.Type |
MouseFinished |
static UIEvent.Type |
MouseMoved |
static UIEvent.Type |
MousePressed |
static UIEvent.Type |
MouseReleased |
Constructor and Description |
---|
UIOwner() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addKeyActionEvent(java.lang.String aName,
java.lang.String aKey)
Configures an ActionEvent to be sent to owner for given name and key description (in KeyStroke string format).
|
void |
addNodeBinding(java.lang.Object anObj,
java.lang.String aPropertyName,
java.lang.String aKeyPath)
Adds a binding to a UI node.
|
protected abstract UITYPE |
createUI()
Creates the UI panel.
|
void |
disableEvents(java.lang.Object anObj,
UIEvent.Type... theTypes)
Enables events on given object.
|
void |
enableEvents(java.lang.Object anObj,
UIEvent.Type... theTypes)
Enables events on given object.
|
protected java.lang.Object |
getBindingModelValue(Binding aBinding)
Returns the key value for a given binding.
|
protected java.lang.Object |
getBindingNodeValue(Binding aBinding)
Returns the UI node value for the given binding.
|
java.util.Map<java.lang.String,java.lang.String> |
getConversionMap(java.lang.String aName)
Returns a named map to perform value conversions.
|
protected java.lang.Object |
getConversionMapKey(java.lang.String aConversionMapName,
java.lang.Object aValue)
Converts a UI node value to binder object value using conversion key map.
|
java.util.Map<java.lang.String,java.util.Map> |
getConversionMaps()
Returns the map of maps, each of which is used to perform value conversions.
|
java.lang.Object |
getConversionMapValue(java.lang.String aConversionMapName,
java.lang.Object aKey)
Converts a binder object value to UI node using conversion key map.
|
java.lang.Object |
getFirstFocus()
Returns the first focus UI node for when window/dialog is made visible.
|
java.lang.Object |
getModelValue(java.lang.String aKey)
Returns the model value for given key expression from this UIOwner.
|
protected UITYPE |
getNode(java.lang.Object anObj)
Returns the specific UI child node for given object (name, event or node).
|
UITYPE |
getNode(java.lang.String aName)
Returns the specific UI child node with the given name.
|
<T extends UITYPE> |
getNode(java.lang.String aName,
java.lang.Class<T> aClass)
Returns the specific UI child node with the given name as the given class.
|
java.lang.String |
getNodeAction(java.lang.Object anObj)
Returns a node action.
|
boolean |
getNodeBoolValue(java.lang.Object anObj)
Returns the boolean value for a given name or UI node.
|
float |
getNodeFloatValue(java.lang.Object anObj)
Returns the float value for a given name or UI node.
|
protected abstract UIHelper |
getNodeHelper(java.lang.Object anObj)
Returns the helper for a given UI node.
|
int |
getNodeIntValue(java.lang.Object anObj)
Returns the int value for a given name or UI node.
|
java.lang.String |
getNodeItemDisplayKey(java.lang.Object anObj,
java.lang.String aKey)
Returns the display key for given name or UI node.
|
java.util.List |
getNodeItems(java.lang.Object anObj)
Returns the items for a given name or UI node.
|
int |
getNodeSelectedIndex(java.lang.Object anObj)
Returns the selected index for given name or UI node.
|
java.lang.Object |
getNodeSelectedItem(java.lang.Object anObj)
Returns the selected item for given name or UI node.
|
java.lang.String |
getNodeStringValue(java.lang.Object anObj)
Returns the string value for a given name or UI node.
|
java.lang.String |
getNodeText(java.lang.Object anObj)
Returns the text value for a given name or UI node.
|
java.lang.Object |
getNodeValue(java.lang.Object anObj)
Returns the object value for a given name or UI node.
|
UITYPE |
getUI()
Returns the main UI node.
|
<T extends UITYPE> |
getUI(java.lang.Class<T> aClass)
Returns the main UI node with the given name as the given class.
|
protected UIHelper |
getUIHpr()
Returns the helper for a given object.
|
protected void |
initUI()
Initializes the UI panel.
|
protected void |
initUI(java.lang.Object anObj)
Initialize UI.
|
protected abstract boolean |
isEventThread()
Returns whether current thread is event thread.
|
void |
isNodeEnabled(java.lang.Object anObj)
Returns whether given name or UI node is enabled.
|
boolean |
isNodeValueAdjusting(java.lang.Object anObj)
Returns whether given name or UI node is currently being modified.
|
boolean |
isSendEventDisabled()
Returns whether Ribs' send event facility is disabled (so controls can be updated without triggering response).
|
boolean |
isUISet()
Returns whether UI has been set.
|
protected void |
processResetUI()
Called to reset bindings and resetUI().
|
protected void |
processRespondUI(EVENT anEvent)
Called to invoke respondUI().
|
abstract void |
requestFocus(java.lang.Object anObj)
Focuses given UI node (name or node).
|
void |
resetLater()
Resets UI later.
|
protected void |
resetNodeBindings(java.lang.Object anObj)
Reset bindings for UI node (recurses for children).
|
protected void |
resetUI()
Reset UI controls.
|
protected void |
respondUI(EVENT anEvent)
Respond to UI controls.
|
abstract void |
runLater(java.lang.Runnable aRunnable)
Runs the given runnable in the next event.
|
void |
runLaterDelayed(int aDelay,
java.lang.Runnable aRunnable)
Runs the runnable after the given delay in milliseconds.
|
void |
runLaterOnce(java.lang.String aName,
java.lang.Runnable aRunnable)
Invokes the given runnable for name once (cancels unexecuted previous runLater registered with same name).
|
void |
sendEvent(EVENT anEvent)
Sends an event for a UI node.
|
abstract void |
sendEvent(java.lang.Object anObj)
Sends an event for a UI node (name or node).
|
protected void |
sendNodeAction(java.lang.Object anObj,
java.lang.String anAction)
Sends a node action.
|
protected void |
setBindingModelValue(Binding aBinding)
Sets the key value for the given binding from the UI node.
|
protected void |
setBindingNodeValue(Binding aBinding)
Sets the UI node value for the given binding from the key value.
|
void |
setFirstFocus(java.lang.Object anObj)
Sets the first focus UI node.
|
void |
setModelValue(java.lang.String aKey,
java.lang.Object aValue)
Sets the model value for given key expression and value for this UIOwner.
|
void |
setNodeAction(java.lang.Object anObj,
java.lang.String anAction)
Sets a node action.
|
void |
setNodeEnabled(java.lang.Object anObj,
boolean aValue)
Sets whether given name or UI node is enabled.
|
void |
setNodeItemDisplayKey(java.lang.Object anObj,
java.lang.String aKey)
Sets the display key for given name or UI node.
|
void |
setNodeItems(java.lang.Object anObj,
java.util.List theItems)
Sets the items for a given name or UI node.
|
void |
setNodeItems(java.lang.Object anObj,
java.lang.Object... theItems)
Sets the items for a given name or UI node.
|
void |
setNodeSelectedIndex(java.lang.Object anObj,
int aValue)
Sets the selected index for given name or UI node.
|
void |
setNodeSelectedItem(java.lang.Object anObj,
java.lang.Object anItem)
Sets the selected item for given name or UI node.
|
void |
setNodeText(java.lang.Object anObj,
java.lang.String aValue)
Sets the object value for a given name or UI node.
|
void |
setNodeValue(java.lang.Object anObj,
java.lang.Object aValue)
Sets the object value for a given name or UI node.
|
boolean |
setSendEventDisabled(boolean aFlag)
Sets whether Ribs' send event facility is disabled (so controls can be updated without triggering response).
|
public static final UIEvent.Type KeyPressed
public static final UIEvent.Type KeyReleased
public static final UIEvent.Type KeyTyped
public static final UIEvent.Type KeyFinished
public static final UIEvent.Type MousePressed
public static final UIEvent.Type MouseDragged
public static final UIEvent.Type MouseReleased
public static final UIEvent.Type MouseClicked
public static final UIEvent.Type MouseFinished
public static final UIEvent.Type MouseEntered
public static final UIEvent.Type MouseMoved
public static final UIEvent.Type MouseExited
public static final UIEvent.Type DragEnter
public static final UIEvent.Type DragOver
public static final UIEvent.Type DragExit
public static final UIEvent.Type DragDrop
public UIEvent.Type[] KeyEvents
public UIEvent.Type[] MouseEvents
public UIEvent.Type[] DragEvents
public boolean isUISet()
public UITYPE getUI()
public <T extends UITYPE> T getUI(java.lang.Class<T> aClass)
protected abstract UITYPE createUI()
protected void initUI()
protected void initUI(java.lang.Object anObj)
protected void resetUI()
protected void respondUI(EVENT anEvent)
public void resetLater()
protected void processResetUI()
protected void processRespondUI(EVENT anEvent)
public UITYPE getNode(java.lang.String aName)
protected UITYPE getNode(java.lang.Object anObj)
public <T extends UITYPE> T getNode(java.lang.String aName, java.lang.Class<T> aClass)
public java.lang.Object getNodeValue(java.lang.Object anObj)
public void setNodeValue(java.lang.Object anObj, java.lang.Object aValue)
public java.lang.String getNodeStringValue(java.lang.Object anObj)
public boolean getNodeBoolValue(java.lang.Object anObj)
public int getNodeIntValue(java.lang.Object anObj)
public float getNodeFloatValue(java.lang.Object anObj)
public java.lang.String getNodeText(java.lang.Object anObj)
public void setNodeText(java.lang.Object anObj, java.lang.String aValue)
public java.util.List getNodeItems(java.lang.Object anObj)
public void setNodeItems(java.lang.Object anObj, java.util.List theItems)
public void setNodeItems(java.lang.Object anObj, java.lang.Object... theItems)
public java.lang.String getNodeItemDisplayKey(java.lang.Object anObj, java.lang.String aKey)
public void setNodeItemDisplayKey(java.lang.Object anObj, java.lang.String aKey)
public int getNodeSelectedIndex(java.lang.Object anObj)
public void setNodeSelectedIndex(java.lang.Object anObj, int aValue)
public java.lang.Object getNodeSelectedItem(java.lang.Object anObj)
public void setNodeSelectedItem(java.lang.Object anObj, java.lang.Object anItem)
public void isNodeEnabled(java.lang.Object anObj)
public void setNodeEnabled(java.lang.Object anObj, boolean aValue)
public boolean isNodeValueAdjusting(java.lang.Object anObj)
protected abstract UIHelper getNodeHelper(java.lang.Object anObj)
public java.lang.String getNodeAction(java.lang.Object anObj)
public void setNodeAction(java.lang.Object anObj, java.lang.String anAction)
protected void sendNodeAction(java.lang.Object anObj, java.lang.String anAction)
public void addNodeBinding(java.lang.Object anObj, java.lang.String aPropertyName, java.lang.String aKeyPath)
protected void resetNodeBindings(java.lang.Object anObj)
protected java.lang.Object getBindingNodeValue(Binding aBinding)
protected void setBindingNodeValue(Binding aBinding)
protected java.lang.Object getBindingModelValue(Binding aBinding)
protected void setBindingModelValue(Binding aBinding)
public java.lang.Object getFirstFocus()
public void setFirstFocus(java.lang.Object anObj)
public abstract void requestFocus(java.lang.Object anObj)
public java.util.Map<java.lang.String,java.util.Map> getConversionMaps()
public java.util.Map<java.lang.String,java.lang.String> getConversionMap(java.lang.String aName)
protected java.lang.Object getConversionMapKey(java.lang.String aConversionMapName, java.lang.Object aValue)
public java.lang.Object getConversionMapValue(java.lang.String aConversionMapName, java.lang.Object aKey)
public void enableEvents(java.lang.Object anObj, UIEvent.Type... theTypes)
public void disableEvents(java.lang.Object anObj, UIEvent.Type... theTypes)
public abstract void sendEvent(java.lang.Object anObj)
public void sendEvent(EVENT anEvent)
public boolean isSendEventDisabled()
public boolean setSendEventDisabled(boolean aFlag)
public abstract void addKeyActionEvent(java.lang.String aName, java.lang.String aKey)
KeyStroke
public abstract void runLater(java.lang.Runnable aRunnable)
public void runLaterDelayed(int aDelay, java.lang.Runnable aRunnable)
public void runLaterOnce(java.lang.String aName, java.lang.Runnable aRunnable)
protected abstract boolean isEventThread()
protected UIHelper getUIHpr()
public java.lang.Object getModelValue(java.lang.String aKey)
public void setModelValue(java.lang.String aKey, java.lang.Object aValue)