public abstract class DropDown<O extends OutputManager<?>> extends OuterFrame<O>
| Modifier and Type | Field and Description |
|---|---|
private ComboBox<O> |
comboBox
Reference to parent combo-box.
|
protected ScrollableList<O> |
list
The list instance to represent the drop-down content.
|
protected ScrollPane<O> |
scrollpane
Wraps the list of items and handles scrolling.
|
listeners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
DropDown(ComboBox<O> parent)
Create a drop-down container based on the parent combo-box and it's
associated data model.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
fixVisibleRows(int visibleRows,
int listSize)
Get the combo-box visible row adjust depending on the current UI type in use.
|
void |
forceInitialSelection(ComboBoxModel<java.lang.String> model)
Enforce the current selection.
|
ComboBox<O> |
getComboBox()
Get the combo-box widget to which this drop-down belongs.
|
Widget<O> |
getLegacyWidget()
The method returns the legacy widget representing this widget.
|
ScrollableList<O> |
getList()
Get the drop-down's inner list.
|
ScrollPane<O> |
getScrollPane()
Get the drop-down's scroll pane.
|
int |
getSelectedIndex()
Get the index of the selected object from the drop-down list.
|
java.lang.String |
getSelectedItem()
Get the selected object from the drop-down list.
|
void |
hide()
Hide this widget and remove it.
|
void |
setHeightAndPos(ComboBox<O> parent,
ComboBoxModel<java.lang.String> model)
Calculate (and set) the height and position of the drop-down
container based on the parent combo-box and it's associated data
model.
|
draw, drawIntdestroy, destroyWidgets, findMouseSource, focusTraversable, getWorkspaceSize, getZOrderClass, hasFocus, hasTitle, hasTitlebar, isDisplayed, isModal, processEvent, processKeyEvent, screenLocation, setTitle, show, title, toStringadd, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, currentFocus, cycleFocus, defaultFocus, 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, 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, config, 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, hasFocus, hasTooltip, hidden, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, 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, postprocessConfig, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitwidgetsAsListacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, completeTrigger, config, defaultMousePtr, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getIdForTrigger, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, hasFocus, hasTooltip, hidden, highlighted, ignoreEnable, initialHeight, initialWidth, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDroppable, isEnabled, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, startTrigger, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unregisterWidgetListener, validateDisplayValue, windowprotected final ScrollableList<O extends OutputManager<?>> list
protected ScrollPane<O extends OutputManager<?>> scrollpane
private final ComboBox<O extends OutputManager<?>> comboBox
protected abstract int fixVisibleRows(int visibleRows,
int listSize)
visibleRows - The visible rows value to check and modify.listSize - The total size of the items in the list to handle.public void forceInitialSelection(ComboBoxModel<java.lang.String> model)
model - The data model to be used within this drop-down list.public ScrollPane<O> getScrollPane()
public ScrollableList<O> getList()
public java.lang.String getSelectedItem()
null if there is no selection.public int getSelectedIndex()
public void setHeightAndPos(ComboBox<O> parent, ComboBoxModel<java.lang.String> model)
Precedence order (in the following list the term "max-space" is the number of rows from the top of the containing combo-box's frame to the bottom of the screen) for vertical size:
1. If there is an inner-lines definition AND it is smaller than the
max-space, then it is honored.
2. If the number of elements in the data model is less than the
number of rows in the max-space, then the number of data model
elements will determine the vertical size.
3. max-space is used otherwise.
The drop-down box X coordinate is always the same as the X coordinate of the parent combo-box in absolute screen units. For the Y coordinate, the following positioning algorithm is used:
1. If the height of the drop-down is less than or equal to the space
between the bottom of the combo-box and the bottom of the screen,
then the drop-down T coordinate will be set to the combo-box Y +
1.
2. Otherwise, the drop-down Y coordinate will equal the Y coordinate
of the bottom of the screen minus the height of the drop-down.
This will result in the drop-down ending at the bottom of the
screen and starting at or above the combo-box Y coordinate BUT
never above the top of the frame containing the combo-box
(because of the previously constrained height calculation above).
parent - The combo-box object which calls this drop-down.model - The data model to be used within this drop-down list.public ComboBox<O> getComboBox()
public void hide()
hide in interface Widget<O extends OutputManager<?>>hide in class TitledWindow<O extends OutputManager<?>>