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.
|
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.
|
int[] |
getStaticWidgetIds()
Create an array of widgets in this frame that are static including possible header ones.
|
boolean |
isBatch()
Queries batching mode for frame modification.
|
boolean |
isShared()
Check if menu is shared.
|
(package private) void |
menuDelete()
Delete this menu, if it is not dynamic and its associated instantiating procedure
is no longer exists.
|
(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.
|
void |
removeWidget(GenericWidget<?> widget)
Remove the specified widget from this container.
|
(package private) void |
setShared(boolean shared)
Set shared flag for menu.
|
java.util.Collection<GenericWidget<?>> |
widgets()
Get all widgets stored in the container.
|
canSetPixelPositionInChui, changeFontWorker, getBgColor, getColumn, getDColor, getFgColor, getFont, getFrameColumn, getFrameRow, getFrameX, getFrameY, getHeightChars, getHeightPixels, getNextSibling, getParent, getParent, getPfColor, getPrevSibling, getRow, getTitle, getTooltip, getValidParentTypes, getWidthChars, getWidthPixels, getX, getY, isMovable, isResizable, isSelected, isTabStop, prepareSizeChars, prepareSizePixels, resetAutoResize, setAlign, setBgColor, setBgColor, setBgColor, setColon, setColon, setColumn, setColumn, setColumnOrRow, setColumnOrRowWorker, setDColor, setDColor, setDColor, setFgColor, setFgColor, setFgColor, 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, 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, disable, dynamic, enable, finishSetup, getColumnFont, getColumnLabel, getContextHelpId, getConvert3D, getCursorOffset, getDataType, getDbName, getFirstTabItem, getFormat, getFrame, getFrameHandle, getHelp, getHWND, getId, getLabel, getLabelFont, getLabelStr, getMaxHeightChars, getMaxWidthChars, getMenuKey, getMenuMouse, getMousePointer, getMousePosition, getNextTabItem, getNumColumns, getNumSelectedRows, getParentHandle, getPopupMenu, getPreviousTabItem, getQuery, getRetainShape, getScreenValue, getScreenValue, getSideLabelHandle, getStretchToFit, getTable, getTitleFont, getTransparent, getVirtHeight, getVirtHeightPixels, getVirtWidth, getVirtWidthPixels, getWidgetId, getWindow, hasNameReadOnly, hasParent, hide, hide, implicitDeletion, inputValue, isAutoResize, isChained, isChecked, isEntered, isFocusedRowSelected, isHidden, isKeepFrameZOrder, isManualHighlight, isModified, isMultiple, isNotEntered, isReadOnly, isScrollable, isSelectable, isSelected, isSelected, isSensitive, 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, notSettable, notWorker, preRealizeCheck, processSideLabel, readOnlyError, realize, refresh, resourceDelete, selectAll, selectFocusedRow, setAtFormatLength, setAutoResize, setAutoResize, setAutoReturn, setBlank, setChecked, setChecked, setColumnFont, setColumnFont, setColumnLabel, setColumnLabel, setContextHelpId, setContextHelpId, setConvert3D, setConvert3D, setCursorOffset, setCursorOffset, setDataType, setDataType, setDbname, setDeblank, setDisableAutoZap, setFirstTabItem, 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, setReadOnly, setRetainShape, setRetainShape, setScreenLock, setScreenValue, setScreenValue, setScrollable, setScrollable, setSelectable, setSelectable, setSensitive, 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, valid, validate, validateFields, validateFields, validateFields, validateFields, validateLayout, view, widgetName
delete, firstResource, firstResource, getHead, getNextSibling, getPrevSibling, getPrivateData, getTail, hasName, hasNextSibling, hasPrevSibling, hasPrivateData, interlink, lastResource, lastResource, 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
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.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>
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.void menuDelete()
public int[] getStaticWidgetIds()
public handle getFirstChild()
null
if no widgets are
contained.public handle getLastChild()
null
if no widgets are
contained.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.