de.matthiasmann.twl
Class ListBox.ListBoxLabel

java.lang.Object
  extended by de.matthiasmann.twl.Widget
      extended by de.matthiasmann.twl.TextWidget
          extended by de.matthiasmann.twl.ListBox.ListBoxLabel
All Implemented Interfaces:
ListBoxDisplay
Enclosing class:
ListBox<T>

protected static class ListBox.ListBoxLabel
extends TextWidget
implements ListBoxDisplay


Nested Class Summary
 
Nested classes/interfaces inherited from class de.matthiasmann.twl.Widget
Widget.OffscreenMouseAdjustments, Widget.RenderOffscreen
 
Field Summary
static AnimationState.StateKey STATE_EMPTY
           
static AnimationState.StateKey STATE_SELECTED
           
 
Fields inherited from class de.matthiasmann.twl.TextWidget
STATE_HOVER, STATE_TEXT_CHANGED, STATE_TEXT_SELECTION
 
Fields inherited from class de.matthiasmann.twl.Widget
STATE_DISABLED, STATE_HAS_FOCUSED_CHILD, STATE_HAS_OPEN_POPUPS, STATE_KEYBOARD_FOCUS
 
Constructor Summary
ListBox.ListBoxLabel()
           
 
Method Summary
 void addListBoxCallback(CallbackWithReason<ListBox.CallbackReason> cb)
           
protected  void doListBoxCallback(ListBox.CallbackReason reason)
           
 Widget getWidget()
           
protected  boolean handleEvent(Event evt)
          Called when an event occurred that this widget could be interested in.
protected  boolean handleListBoxEvent(Event evt)
           
 boolean isFocused()
           
 boolean isSelected()
           
 void removeListBoxCallback(CallbackWithReason<ListBox.CallbackReason> cb)
           
 void setData(java.lang.Object data)
           
 void setFocused(boolean focused)
           
 void setSelected(boolean selected)
           
 
Methods inherited from class de.matthiasmann.twl.TextWidget
applyTheme, applyThemeTextWidget, computeRelativeCursorPositionX, computeRelativeCursorPositionX, computeTextHeight, computeTextWidth, computeTextX, computeTextY, destroy, getAlignment, getCharSequence, getFont, getNumTextLines, getPreferredInnerHeight, getPreferredInnerWidth, handleMouseHover, hasText, isCache, isMultilineText, paintLabelText, paintTextAt, paintWidget, paintWithSelection, paintWithSelection, setAlignment, setCache, setCharSequence, setFont
 
Methods inherited from class de.matthiasmann.twl.Widget
add, addActionMapping, addPropertyChangeListener, addPropertyChangeListener, adjustSize, afterAddToGUI, allChildrenRemoved, applyThemeBackground, applyThemeBorder, applyThemeInputMap, applyThemeMaxSize, applyThemeMinSize, applyThemeMouseCursor, applyThemeOffscreenExtra, applyThemeOverlay, applyThemeTooltip, beforeRemoveFromGUI, borderChanged, canAcceptKeyboardFocus, childAdded, childInvalidateLayout, childRemoved, childVisibilityChanged, computeSize, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, focusFirstChild, focusLastChild, focusNextChild, focusPrevChild, getActionMap, getAnimationState, getBackground, getBorderBottom, getBorderHorizontal, getBorderLeft, getBorderRight, getBorderTop, getBorderVertical, getBottom, getChild, getChildAt, getChildIndex, getGUI, getHeight, getInnerBottom, getInnerHeight, getInnerRight, getInnerWidth, getInnerX, getInnerY, getInputMap, getKeyboardFocusOrder, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getMouseCursor, getMouseCursor, getNumChildren, getOffscreenExtraBottom, getOffscreenExtraLeft, getOffscreenExtraRight, getOffscreenExtraTop, getOrCreateActionMap, getOverlay, getParent, getPreferredHeight, getPreferredWidth, getRenderOffscreen, getRight, getRootWidget, getTheme, getThemePath, getThemeTooltipContent, getTintAnimator, getTooltipContent, getTooltipContentAt, getWidgetAt, getWidth, getX, getY, giveupKeyboardFocus, handleKeyStrokeAction, hasKeyboardFocus, hasOpenPopups, hasSharedAnimationState, insertChild, invalidateLayout, invalidateLayoutLocally, isAbsoluteTheme, isClip, isDepthFocusTraversal, isEnabled, isFocusKeyEnabled, isInside, isLocallyEnabled, isMouseInside, isVisible, keyboardFocusChildChanged, keyboardFocusGained, keyboardFocusGained, keyboardFocusLost, layout, layoutChildFullInnerArea, layoutChildrenFullInnerArea, moveChild, paint, paintBackground, paintChild, paintChildren, paintDragOverlay, paintOverlay, positionChanged, reapplyTheme, removeAllChildren, removeChild, removeChild, removePropertyChangeListener, removePropertyChangeListener, requestKeyboardFocus, requestKeyboardFocus, resetTooltip, setActionMap, setBackground, setBorderSize, setBorderSize, setBorderSize, setBorderSize, setCanAcceptKeyboardFocus, setClip, setDepthFocusTraversal, setEnabled, setFocusKeyEnabled, setInnerSize, setInputMap, setMaxSize, setMinSize, setMouseCursor, setOffscreenExtra, setOffscreenExtra, setOverlay, setPosition, setRenderOffscreen, setSize, setTheme, setTintAnimator, setTooltipContent, setVisible, sizeChanged, updateTintAnimation, updateTooltip, validateLayout, widgetDisabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.matthiasmann.twl.ListBoxDisplay
setTooltipContent
 

Field Detail

STATE_SELECTED

public static final AnimationState.StateKey STATE_SELECTED

STATE_EMPTY

public static final AnimationState.StateKey STATE_EMPTY
Constructor Detail

ListBox.ListBoxLabel

public ListBox.ListBoxLabel()
Method Detail

isSelected

public boolean isSelected()
Specified by:
isSelected in interface ListBoxDisplay

setSelected

public void setSelected(boolean selected)
Specified by:
setSelected in interface ListBoxDisplay

isFocused

public boolean isFocused()
Specified by:
isFocused in interface ListBoxDisplay

setFocused

public void setFocused(boolean focused)
Specified by:
setFocused in interface ListBoxDisplay

setData

public void setData(java.lang.Object data)
Specified by:
setData in interface ListBoxDisplay

getWidget

public Widget getWidget()
Specified by:
getWidget in interface ListBoxDisplay

addListBoxCallback

public void addListBoxCallback(CallbackWithReason<ListBox.CallbackReason> cb)
Specified by:
addListBoxCallback in interface ListBoxDisplay

removeListBoxCallback

public void removeListBoxCallback(CallbackWithReason<ListBox.CallbackReason> cb)
Specified by:
removeListBoxCallback in interface ListBoxDisplay

doListBoxCallback

protected void doListBoxCallback(ListBox.CallbackReason reason)

handleListBoxEvent

protected boolean handleListBoxEvent(Event evt)

handleEvent

protected boolean handleEvent(Event evt)
Description copied from class: Widget
Called when an event occurred that this widget could be interested in.

The default implementation handles only keyboard events and delegates them to the child widget which has keyboard focus. If focusKey handling is enabled then this widget cycles the keyboard focus through it's children. If the key was not consumed by a child or focusKey and an inputMap is specified then the event is translated by the InputMap and handleKeyStrokeAction is called when a mapping was found.

If the widget wants to receive mouse events then it must return true for all mouse events except for MOUSE_WHEEL (which is optional) event. Otherwise the following mouse event are not send. Before mouse movement or button events are send a MOUSE_ENTERED event is send first.

Overrides:
handleEvent in class Widget
Parameters:
evt - The event - do not store this object - it may be reused
Returns:
true if the widget handled this event
See Also:
Widget.setFocusKeyEnabled(boolean), Widget.handleKeyStrokeAction(java.lang.String, de.matthiasmann.twl.Event), Widget.setInputMap(de.matthiasmann.twl.InputMap)