abstract class MenuContainerWidget<T extends BaseConfig> extends BaseEntity<T> implements CommonHandleTree, WidgetContainer
BaseEntity.CharsPixels
Modifier and Type | Field and Description |
---|---|
private boolean |
batch
batch modifications flag
|
private MenuDescription |
menuDef
menu definition
|
private java.util.Map<java.lang.String,GenericWidget<?>> |
n2w
Maps widget names to widget instances (from the menu definition).
|
private boolean |
shared
Shared menu flag.
|
private java.util.List<GenericWidget<?>> |
widgets
List of widgets in ID order.
|
group
config, deleted, frame
name, nextSibling, prevSibling
instProc
Constructor and Description |
---|
MenuContainerWidget(boolean dynamic,
T menuConfig)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addWidget(GenericWidget<?> widget)
Add the specified widget to this container.
|
void |
batch(boolean on)
Sets batching mode for frame modification.
|
void |
batch(boolean on,
boolean force)
Sets batching mode for frame modification and optionally pushes the
screen definition to the client.
|
protected void |
coreInitialize(java.lang.Class<?> defClass,
java.lang.Object defInstance,
boolean dynamic)
Core initialization processing.
|
protected MenuItemWidget |
findMenuItemInt(java.lang.String name)
Recursively finds menu-item in this menu tree.
|
(package private) static <V extends BaseConfig> |
findRootMenu(BaseEntity<V> menu)
Find the root menu for the specified menu element.
|
protected SubMenuWidget |
findSubMenuInt(java.lang.String name)
Finds sub-menu in this menu tree.
|
protected void |
finishConfigProcessing()
Finish the config processing for this frame.
|
handle |
getFirstChild()
Accesses the first widget in the list of contained widgets.
|
handle |
getLastChild()
Accesses the last widget in the list of contained widgets.
|
handle |
getNextSibling()
Get the
next-sibling attribute for this widget. |
handle |
getNextSibling(HandleChain child)
Get the
next-sibling attribute for the specified child |
handle |
getPrevSibling()
Get the
prev-sibling attribute for this widget. |
handle |
getPrevSibling(HandleChain child)
Get the
prev-sibling attribute for the specified child |
(package private) static <V extends BaseConfig> |
isAttachedMenu(BaseEntity<V> menu)
Check if the specified menu is attached to a widget.
|
boolean |
isBatch()
Queries batching mode for frame modification.
|
boolean |
isShared()
Check if menu is shared.
|
(package private) void |
listMenuTree(java.util.List<GenericWidget<?>> result)
Execute a DFS walk of the menu tree and collect all menu components rooted at this sub-tree.
|
(package private) void |
pushMenuDescription(boolean force)
Conditionally pushes the screen definition instance down to the client.
|
private void |
pushMenuDescriptionImpl(boolean force)
Conditionally pushes the screen definition instance down to the client.
|
protected void |
pushScreenDefinition()
Conditionally pushes the screen definition instance down to the client.
|
protected void |
pushWidgetAttr(java.lang.String[] fnames,
java.lang.Object[] values)
Push the specified widget attribute changes to the client-side.
|
protected void |
pushWidgetAttr(java.lang.String fname,
java.lang.Object value)
Push the specified widget attribute change to the client-side.
|
void |
removeWidget(GenericWidget<?> widget)
Remove the specified widget from this container.
|
protected boolean |
resourceDelete()
Delete the resource.
|
void |
setSensitive(boolean s)
Sets new value of SENSITIVE attribute.
|
(package private) void |
setShared(boolean shared)
Set shared flag for menu.
|
boolean |
valid()
Reports if this widget object is valid for use.
|
java.util.Collection<GenericWidget<?>> |
widgets()
Get all widgets stored in the container.
|
_getHeightChars, _getHeightPixels, _getWidthChars, _getWidthPixels, canSetPixelPositionInChui, changeFontWorker, getBgColor, getBgColorRgb, getColumn, getDColor, getFgColor, getFgColorRgb, getFont, getFrameColumn, getFrameRow, getFrameX, getFrameY, getHeightChars, getHeightPixels, getParent, getParent, getPfColor, getRow, getSizeAttrs, getTitle, getTooltip, getValidParentTypes, getWidthChars, getWidthPixels, getX, getY, isMovable, isResizable, isSelected, isTabStop, prepareSizeChars, prepareSizePixels, pushLocAttrs, pushSizeAttrs, resetAutoResize, setAlign, setBgColor, setBgColor, setBgColor, setBgColorRgb, setBgColorRgb, setBgColorRgb, setColon, setColon, setColumn, setColumn, setColumnOrRow, setColumnOrRowWorker, setDColor, setDColor, setDColor, setFgColor, setFgColor, setFgColor, setFgColorRgb, setFgColorRgb, setFgColorRgb, setFont, setGroup, setHeightChars, setHeightChars, setHeightCharsWorker, setHeightPixels, setHeightPixels, setHeightPixelsWorker, setMaxHeightCharsWorker, setMaxHeightPixelsWorker, setMaxWidthCharsWorker, setMaxWidthPixelsWorker, setMinHeightCharsWorker, setMinHeightPixelsWorker, setMinWidthCharsWorker, setMinWidthPixelsWorker, setMovable, setMovable, setParent, setPfColor, setPfColor, setPfColor, setResizable, setResizable, setRow, setRow, setSelected, setSelected, setSizeChars, setSizePixels, setTabStop, setTabStop, setTitle, setTitle, setTooltip, setTooltip, setVirtHeightCharsWorker, setVirtHeightPixelsWorker, setVirtWidthCharsWorker, setVirtWidthPixelsWorker, setWidthChars, setWidthChars, setWidthCharsWorker, setWidthPixels, setWidthPixels, setWidthPixelsWorker, setX, setX, setXorY, setXOrYWorker, setY, setY, useHandleChainSiblings, validateParent, validateSize, validColumnOrRow
_dynamic, _getDbName, _getFormat, _getTable, _isEntered, _isHidden, _isNotEntered, _isRealized, _isVisible, _setDynamic, _setVisible, afterConfigUpdate, apply, apply, apply, apply, asWidgetHandle, canAccess, canDelete, cleanup, colorDisplay, colorPrompt, config, deselectRows, detachMenu, disable, dynamic, enable, finishSetup, getColumnFont, getColumnLabel, getContextHelpId, getConvert3D, getCursorOffset, getDataType, getDbName, getFormat, getFrame, getFrameHandle, getHelp, getHWND, getId, getImage, getLabel, getLabelFont, getLabelStr, getMaxHeightChars, getMaxWidthChars, getMenuKey, getMenuMouse, getMousePointer, getMousePosition, getNextTabItem, getNumColumns, getNumSelectedRows, getParentHandle, getPopupMenu, getPreviousTabItem, getQuery, getRetainShape, getScreenValue, getScreenValue, getSideLabelHandle, getStretchToFit, getTable, getTabPosition, getTitleFont, getTransparent, getValidationExpression, getValidationMessage, getVirtHeight, getVirtHeightPixels, getVirtWidth, getVirtWidthPixels, getWidgetId, getWindow, getZOrderClass, hasFormat, hasNameReadOnly, hasParent, hide, hide, implicitDeletion, inputValue, isAutoResize, isAutoReturn, isChained, isChecked, isDisableRedraw, isEntered, isFocusedRowSelected, isHidden, isKeepFrameZOrder, isManualHighlight, isModified, isMultiple, isNotEntered, isScrollable, isSelectable, isSelected, isSelected, isSensitive, isTabWidget, isTextSelected, isThreeD, isValidatable, isVisible, labelSizeCheck, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadMousePointer, loadMousePointer, moveAfterTab, moveAfterTab, moveBeforeTabItem, moveBeforeTabItem, moveToBottom, moveToTop, moveToWorker, name, notQueryable, notQueryable, notSettable, notSettable, notWorker, preRealizeCheck, processSideLabel, readOnlyError, realize, refresh, restoreSharedState, saveSharedState, selectAll, selectFocusedRow, setAtFormatLength, setAutoResize, setAutoResize, setAutoReturn, setAutoReturn, setBlank, setChecked, setChecked, setColumnFont, setColumnFont, setColumnLabel, setColumnLabel, setContextHelpId, setContextHelpId, setConvert3D, setConvert3D, setCursorOffset, setCursorOffset, setDataType, setDataType, setDbname, setDeblank, setDisableAutoZap, setDisableRedraw, setFont, setFormat, setFormat, setFrame, setFrame, setFrame, setFrameHandle, setFrameHandle, setFrameHandle, setHeader, setHelp, setHelp, setHelpDefault, setHelpStatic, setHidden, setHidden, setId, setKeepFrameZOrder, setKeepFrameZOrder, setLabel, setLabel, setLabelFont, setLabelFont, setLabelInt, setManualHighlight, setManualHighlight, setMaxHeightChars, setMaxWidthChars, setMenuKey, setMenuKey, setMenuMouse, setMenuMouse, setModified, setModified, setMultiple, setMultiple, setNextTabItem, setNoAutoValidate, setNumSelectedRows, setParentHandle, setParentHandle, setPopupMenu, setPopupMenu, setQuery, setRetainShape, setRetainShape, setScreenLock, setScreenValue, setScreenValue, setScrollable, setScrollable, setSelectable, setSelectable, setSensitive, setSensitive, setSensitive, setSideLabelHandle, setStretchToFit, setStretchToFit, setTable, setThreeD, setThreeD, setTitleFont, setTitleFont, setTransparent, setTransparent, setValidation, setValidation, setVertical, setVirtHeight, setVirtHeightPixels, setVirtWidth, setVirtWidthPixels, setVisible, setVisible, setWidgetId, setWidgetId, truncatePixelSize, underline, underline, validate, validateFields, validateFields, validateFields, validateFields, view, widgetName
delete, firstResource, firstResource, getHead, getPrivateData, getTail, hasName, hasNextSibling, hasPrevSibling, hasPrivateData, interlink, lastResource, lastResource, moveInChain, name, name, setHead, setNextSibling, setNextSibling, setPrevSibling, setPrevSibling, setPrivateData, setPrivateData, setPrivateData
getResourceType, id, id, instantiatingProcedure, invalidAttribute, setInstantiatingProcedure, type, unknown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
firstChild, lastChild
setScreenValue
getPrivateData, setPrivateData, setPrivateData
getResourceType
id, id, unknown
setDisableRedraw
private java.util.Map<java.lang.String,GenericWidget<?>> n2w
private java.util.List<GenericWidget<?>> widgets
private MenuDescription menuDef
private boolean shared
private boolean batch
public MenuContainerWidget(boolean dynamic, T menuConfig)
dynamic
- Flag indicating if this is a static or dynamic resource.menuConfig
- The menu config instance.static <V extends BaseConfig> MenuContainerWidget<V> findRootMenu(BaseEntity<V> menu)
menu
- The menu element. Either a MenuContainerWidget
or a
MenuItemWidget
.static <V extends BaseConfig> boolean isAttachedMenu(BaseEntity<V> menu)
MenuConfig.ownerId
set to a value other than 0.menu
- The menu to check. Either a MenuContainerWidget
or a
MenuItemWidget
.true
if the menu is attached.public void setSensitive(boolean s)
GenericWidget
logic
(that enables widget in its frame).setSensitive
in interface Sensitive
setSensitive
in class GenericWidget<T extends BaseConfig>
s
- The new value of the SENSITIVE attribute.public handle getNextSibling(HandleChain child)
next-sibling
attribute for the specified childgetNextSibling
in class HandleChain
child
- The child for which the next-sibling is needed, in this widgets
.public handle getPrevSibling(HandleChain child)
prev-sibling
attribute for the specified childgetPrevSibling
in class HandleChain
child
- The child for which the prev-sibling is needed, in this widgets
.public handle getNextSibling()
next-sibling
attribute for this widget.getNextSibling
in interface CommonHandleChain
getNextSibling
in class BaseEntity<T extends BaseConfig>
public handle getPrevSibling()
prev-sibling
attribute for this widget.getPrevSibling
in interface CommonHandleChain
getPrevSibling
in class BaseEntity<T extends BaseConfig>
public boolean isShared()
true
if menu is shared.void setShared(boolean shared)
shared
- true
if menu is shared.public void batch(boolean on)
on
- true
sets batching modepublic boolean isBatch()
true
if batching mode is in effectpublic void batch(boolean on, boolean force)
on
- true
sets batching modeforce
- true
to ensure that the screen definition will be
synchronously pushed to the client. false
to
defer the push. This is only honored when on
is
false
.public java.util.Collection<GenericWidget<?>> widgets()
public void addWidget(GenericWidget<?> widget)
addWidget
in interface WidgetContainer
widget
- The widget to be added.public void removeWidget(GenericWidget<?> widget)
removeWidget
in interface WidgetContainer
widget
- The widget to be removed.protected void coreInitialize(java.lang.Class<?> defClass, java.lang.Object defInstance, boolean dynamic)
defClass
- The class of the definition implementation class.defInstance
- The instance of the definition implementation class.dynamic
- true
If this menu is dynamic, false
otherwise.protected void pushScreenDefinition()
When the screen definition is built, a method of
LogicalTerminal
is called to send it down to the client.
Overrides GenericWidget.pushScreenDefinition()
behavior.
pushScreenDefinition
in class GenericWidget<T extends BaseConfig>
protected void pushWidgetAttr(java.lang.String fname, java.lang.Object value)
pushWidgetAttr
in class GenericWidget<T extends BaseConfig>
fname
- The config field name.value
- The new config field value.protected void pushWidgetAttr(java.lang.String[] fnames, java.lang.Object[] values)
pushWidgetAttr
in class GenericWidget<T extends BaseConfig>
fnames
- The list of config field names.values
- The list of new config field values.void pushMenuDescription(boolean force)
When the screen definition is built, a method of
LogicalTerminal
is called to send it down to the client.
force
- true
to ensure that the screen definition will be
synchronously pushed to the client. false
to
defer the push.protected void finishConfigProcessing()
finishConfigProcessing
in class GenericWidget<T extends BaseConfig>
protected MenuItemWidget findMenuItemInt(java.lang.String name)
1. Lets assume that cur is the current node in a MENU tree. Initial value is a DEFINE_MENU node. 2. First we are searching the given MENU-ITEM in all immediate child MENU-ITEMs. 3. If we've found the match than return success. 4. If we've not found the match we are going into the all SUB-MENUs and for each of them we are repeating steps from the step 2. 5. If we've searched all tree and didn't find a match - just return null.
name
- MENU-ITEM name.MenuItemWidget
or null if not found.protected SubMenuWidget findSubMenuInt(java.lang.String name)
name
- Sub-menu name.SubMenuWidget
or null if not found.protected boolean resourceDelete()
resourceDelete
in class GenericWidget<T extends BaseConfig>
true
if the resource was deleted.void listMenuTree(java.util.List<GenericWidget<?>> result)
result
- The list where to collect the menu components.public handle getFirstChild()
null
if no widgets are
contained.public handle getLastChild()
null
if no widgets are
contained.public boolean valid()
The validity of the widget object is determined solely by the scope of the containing frame.
valid
in interface CommonWidget
valid
in interface WrappedResource
valid
in class GenericWidget<T extends BaseConfig>
true
if we are valid (can be used).private void pushMenuDescriptionImpl(boolean force)
When the screen definition is built, a method of
LogicalTerminal
is called to send it down to the client.
force
- true
to ensure that the screen definition will be
synchronously pushed to the client. false
to
defer the push.