public 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.Widget.ZOrderClass
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
|
config
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()
Adjust SelectionList size.
|
protected abstract void |
adjustSizeImpl()
Adjust SelectionList size UI specific part.
|
void |
afterConfigUpdate(SelectionListConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
Widget<O> |
currentFocus()
Returns the focused direct child Component.
|
abstract void |
draw()
Draw all the components in this container.
|
BaseDataType |
getScreenValue()
Get screen value.
|
int[] |
getSelection()
Request indexes of selected items.
|
java.lang.String |
getText()
Get text representation of the currently selected value.
|
BaseDataType |
getValue()
Getting the currently selected item.
|
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()
Forward call to list container.
|
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.
|
void |
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.
|
config, destroy, getColon, getColumnLabelText, getColumnMnemonic, getLabelInstance, getLabelText, getMnemonic, getTo, isForceLabel, isNoLabels, isRightAligned, postprocessConfig, setColumnMnemonic, setHidden, setLabelInstance, setMnemonic, setNoLabels, setWasVisible, wasVisible
add, add, add, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, currentFocus, cycleFocus, defaultFocus, detach, dimension, doLayout, endSizeChange, findMouseSource, firstFocus, focus, focusTraversable, focusWorker, get, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getWidgetsList, hasFocusable, height, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, prepareWidgets, prevFocus, processKeyEvent, remove, repaint, replace, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setSize, setWidth, startSizeChange, unrealize, updateSizeWorker, widgets, width
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, ignoreAction, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, prepParentLocation, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, defaultMousePtr, dimension, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, focusTraversable, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, height, hidden, hide, highlighted, insets, isDirectManipulable, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, minimumSize, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, repaint, requestFocus, requestSync, resizeTo, screen, screenLocation, screenPhysicalLocation, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, supportsCustomMousePointer, topLevelWindow, unrealize, width, window
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
createMnemonic, getMnemonicCharacter, getMnemonicKeyCode, getMnemonicLabel, isMnemonicSupported, updateMnemonic
protected 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 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 void onFocusGained(FocusEvent focusEvent)
onFocusGained
in interface FocusListener
focusEvent
- The focus event to be processed.public void onFocusLost(FocusEvent focusEvent)
onFocusLost
in interface FocusListener
focusEvent
- The focus event to be processed.public void refreshItems()
refreshItems
in interface ControlSetComponent
public int[] getSelection()
getSelection
in interface ControlSetComponent
public void setSelectionMode(int mode)
mode
- New selection mode.public void adjustSize()
public BaseDataType getValue()
getValue
in interface DataContainer
public boolean isModified()
isModified
in interface DataContainer
true
if the widget value was modified,
false
otherwise.public void setValue(BaseDataType value)
setValue
in interface DataContainer
value
- The value representing the current widget value.public java.lang.String getText()
getText
in interface DataContainer
public 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
- public boolean scrollToItem(int index)
index
- The 0-based index of an item to scroll.TRUE
in success, FALSE
otherwise.protected abstract void adjustSizeImpl()