O - the output manager typepublic abstract class SelectionList<O extends OutputManager<?>> extends LabeledPanel<O,SelectionListConfig> implements DataContainer, FocusListener, ControlSetComponent
SelectionListBody class which implements remaining
functionality. Another purpose of this class is to maintain its size and
adjust size of scroll pane and selection list.| Modifier and Type | Field and Description |
|---|---|
protected SelectionListBody<O> |
list
Component attribute container.
|
protected ScrollPane<O> |
scrollpane
ScrollPane which wraps the list of items and make scrolling.
|
protected boolean |
sizeAdjusted
adjustSize() was called
|
configlisteners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
SelectionList(WidgetId id,
SelectionListConfig cfg)
Special constructor used to restore component using given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
adjustSize(SelectionListConfig beforeUpdate)
Adjust SelectionList size.
|
protected abstract void |
adjustSizeImpl(SelectionListConfig beforeUpdate)
Adjust SelectionList size UI specific part.
|
void |
afterConfigUpdate(SelectionListConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
boolean |
canMovetoTop()
Flag indicating if this widget can be moved to top by a DISPLAY statement when WINDOW:KEEP-FRAME-Z-ORDER
flag is set.
|
Widget<O> |
currentFocus()
Returns the focused direct child Component.
|
Widget<O> |
defaultFocus()
Returns the focused direct child Component.
|
boolean |
deleteItem(int idx)
Delete item from SelectionList
|
abstract void |
draw()
Draw all the components in this container.
|
void |
fireDefaultAction()
Fires the DefaultAction event.
|
boolean |
focusTraversable()
Check if the widget is focus traversable
|
protected Frame<O> |
getFrame()
Gets its parent frame.
|
double |
getFrameBottomBorderHeight()
Gets the char height of its parent bottom border.
|
double |
getFrameTopBorderHeight()
Gets the char height of its parent top border.
|
Widget<O> |
getLegacyWidget()
The method returns the legacy widget representing this possibly virtual widget.
|
java.lang.String |
getName()
Returns its name as a string if it is given by its configuration.
|
BaseDataType |
getScreenValue()
Get screen value.
|
int[] |
getSelection()
Request indexes of selected items.
|
java.lang.String |
getText()
Get text representation of the currently selected value.
|
java.lang.String |
getType()
Returns its constant type as a string.
|
BaseDataType |
getValue()
Getting the currently selected item.
|
boolean |
hasFocus(boolean recurse)
Check if widget has focus.
|
void |
initialize(WidgetId id,
SelectionListConfig cfg)
Replacement API for the logic which should exist in the widget's c'tor, but the logic
can't be executed as it depends on the widget being registered into the official registry.
|
boolean |
isModified()
Getting the modification state of the widget.
|
boolean |
manageSystemActions()
Check if the current widget can manage non-global system actions on its own, and not via the
enclosing event loop.
|
void |
onFocusGained(FocusEvent focusEvent)
This is called when the selection-list takes the input focus.
|
void |
onFocusLost(FocusEvent focusEvent)
This is called when the selection-list looses the input focus.
|
void |
refreshItems()
This method is called when component items are changed in some way
(added, removed, sorted, etc).
|
boolean |
scrollToItem(int index)
Implements SCROLL-TO-ITEM() method for selection-list widget.
|
void |
setEnabled(boolean flag_)
Set the enabled flag for this selection list.
|
boolean |
setSelectionMode(int mode)
Forward call to list container.
|
void |
setValue(BaseDataType value)
Sets the BaseDataType instance representing the current value.
|
void |
setVisible(boolean visible)
Shows or hides the selection list and its label.
|
protected abstract void |
validateLayout(SelectionListConfig beforeUpdate)
Validate its own layout.
|
config, destroy, getColon, getColumnLabelText, getColumnMnemonic, getLabelInstance, getLabelText, getMnemonic, getTo, isForceLabel, isNoLabels, isRightAligned, postprocessConfig, setColumnMnemonic, setHidden, setLabelInstance, setMnemonic, setNoLabels, setWasVisible, wasVisibleadd, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, cycleFocus, deregisterSelectedWidget, detach, dimension, doLayout, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusWorker, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, hasFocusable, height, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prepareWidgets, prevFocus, processKeyEvent, reflectAncestorChange, reflectLocationChanged, registerSelectedWidget, remove, removeContainerStateListener, repaint, replace, requestFocus, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setPhysicalDimensionInt, setSize, setSize, setTabItemList, setWidth, startSizeChange, swap, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList, widgetStateChanged, width_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, createMouseHoverAction, deactivateDirectManipulation, debug, disable, disableTooltip, displayPhysicalLocation, drawCaret, enable, enableTooltip, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasTooltip, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setWindow, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChangedValueacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, completeTrigger, defaultMousePtr, dimension, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getIdForTrigger, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasTooltip, height, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, insets, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isDroppable, isEnabled, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, minimumSize, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setDirectManipulationActive, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setWindow, show, startTrigger, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unrealize, unregisterWidgetListener, validateDisplayValue, widgetStateChanged, width, windowmouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleasedcreateMnemonic, getMnemonicCharacter, getMnemonicKeyCode, getMnemonicLabel, isMnemonicSupported, updateMnemonicwidgetsAsListprotected ScrollPane<O extends OutputManager<?>> scrollpane
protected SelectionListBody<O extends OutputManager<?>> list
protected boolean sizeAdjusted
public SelectionList(WidgetId id, SelectionListConfig cfg)
Call initialize(com.goldencode.p2j.ui.WidgetId, com.goldencode.p2j.ui.SelectionListConfig) to finish the widget initialization.
id - The widget's ID.cfg - Configuration data.public boolean canMovetoTop()
canMovetoTop in interface Widget<O extends OutputManager<?>>true.public void initialize(WidgetId id, SelectionListConfig cfg)
This API is called after the widget is created and added to the registry.
initialize in interface WidgetWithConfig<SelectionListConfig>id - The widget's ID.cfg - The config used to initialize this widget.public Widget<O> currentFocus()
currentFocus in interface Container<O extends OutputManager<?>>currentFocus in class AbstractContainer<O extends OutputManager<?>>public Widget<O> defaultFocus()
defaultFocus in interface Container<O extends OutputManager<?>>defaultFocus in class AbstractContainer<O extends OutputManager<?>>public void onFocusGained(FocusEvent focusEvent)
onFocusGained in interface FocusListenerfocusEvent - The focus event to be processed.public void onFocusLost(FocusEvent focusEvent)
onFocusLost in interface FocusListenerfocusEvent - The focus event to be processed.public void refreshItems()
refreshItems in interface ControlSetComponentpublic int[] getSelection()
getSelection in interface ControlSetComponentpublic boolean deleteItem(int idx)
idx - index of the itemtrue if successfulpublic boolean setSelectionMode(int mode)
mode - New selection mode.true if selection mode was changed by this callpublic void adjustSize(SelectionListConfig beforeUpdate)
beforeUpdate - The previous configuration valuespublic BaseDataType getValue()
getValue in interface DataContainerpublic boolean isModified()
isModified in interface DataContainertrue if the widget value was modified,
false otherwise.public void setValue(BaseDataType value)
setValue in interface DataContainervalue - The value representing the current widget value.public java.lang.String getText()
getText in interface DataContainerpublic void setEnabled(boolean flag_)
setEnabled in interface Widget<O extends OutputManager<?>>setEnabled in class AbstractWidget<O extends OutputManager<?>>flag_ - The enabled status for this selection list.public abstract void draw()
draw in interface Widget<O extends OutputManager<?>>draw in class AbstractContainer<O extends OutputManager<?>>public void setVisible(boolean visible)
setVisible in interface Widget<O extends OutputManager<?>>setVisible in class LabeledPanel<O extends OutputManager<?>,SelectionListConfig>visible - true to make the widget visible,
false to hide the widget.public BaseDataType getScreenValue()
public boolean manageSystemActions()
manageSystemActions in class AbstractWidget<O extends OutputManager<?>>true as the widget has its own event management.public void afterConfigUpdate(SelectionListConfig beforeUpdate)
afterConfigUpdate in interface ConfigOwner<SelectionListConfig>afterConfigUpdate in class LabeledPanel<O extends OutputManager<?>,SelectionListConfig>beforeUpdate - Config reference capturing the config state before
the owner's config was modified.public boolean scrollToItem(int index)
index - The 0-based index of an item to scroll.TRUE in success, FALSE otherwise.public boolean focusTraversable()
focusTraversable in interface Widget<O extends OutputManager<?>>focusTraversable in class AbstractContainer<O extends OutputManager<?>>TRUE if it is focus traversable,
FALSE if not.public final java.lang.String getType()
public final java.lang.String getName()
public final double getFrameTopBorderHeight()
public final double getFrameBottomBorderHeight()
protected Frame<O> getFrame()
protected abstract void adjustSizeImpl(SelectionListConfig beforeUpdate)
beforeUpdate - The previous configuration valuesprotected abstract void validateLayout(SelectionListConfig beforeUpdate)
beforeUpdate - The previous configuration valuespublic boolean hasFocus(boolean recurse)
When true is passed as the argument the method considers this widget focused when all the
parent widgets up to the top-level window are current and the widget itself is a leaf node of the
widget tree. When false is passed as the argument the method considers this widget focused
when all the parent widgets up to the top-level window are current but the widget itself does not
have to be a leaf node.
hasFocus in interface Widget<O extends OutputManager<?>>hasFocus in class AbstractWidget<O extends OutputManager<?>>recurse - see abovetrue if widget has focus.public Widget<O> getLegacyWidget()
The default implementation walks up the widget tree starting at this. The first
enumerated widget returning false from WidgetId.virtualWidget(WidgetId)
is returned.
getLegacyWidget in interface Widget<O extends OutputManager<?>>null if none found.public void fireDefaultAction()