public abstract class DropDown<O extends OutputManager<?>> extends OuterFrame<O>
Widget.ZOrderClass
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.
|
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, drawInt
destroy, destroyWidgets, findMouseSource, focusTraversable, getWorkspaceSize, getZOrderClass, hasFocus, hasTitle, hasTitlebar, isDisplayed, isModal, processEvent, processKeyEvent, screenLocation, setTitle, show, title, toString
add, add, add, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, currentFocus, currentFocus, cycleFocus, defaultFocus, detach, dimension, doLayout, endSizeChange, findMouseSource, firstFocus, focus, 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, 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, config, 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, hidden, highlighted, ignoreAction, isDirectManipulationCapable, isDirectManipulationRequired, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolveTitleFont, screen, screenDimension, screenHeight, screenPhysicalLocation, screenWidth, setBitmap, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, supportsCustomMousePointer, sync, topLevelWindow, translate, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, config, defaultMousePtr, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, hidden, highlighted, isDirectManipulable, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, requestSync, resizeTo, screen, screenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, supportsCustomMousePointer, topLevelWindow, window
protected 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<?>>