public abstract class ListButtonSkin extends ButtonSkin implements ListButton.Skin, ListButtonListener, ListButtonSelectionListener
ListButtonListener.Adapter
ListButtonSelectionListener.Adapter
ButtonListener.Adapter
ComponentListener.Adapter
ComponentStateListener.Adapter
ComponentMouseListener.Adapter
ComponentMouseButtonListener.Adapter
ComponentKeyListener.Adapter
Modifier and Type | Field and Description |
---|---|
protected ListView |
listView |
protected Window |
listViewPopup |
protected boolean |
pressed |
highlighted
Constructor and Description |
---|
ListButtonSkin() |
Modifier and Type | Method and Description |
---|---|
void |
disabledItemFilterChanged(ListButton listButton,
Filter<?> previousDisabledItemFilter)
Called when a list button's disabled item filter has changed.
|
void |
enabledChanged(Component component)
Called when a component's enabled state has changed.
|
void |
focusedChanged(Component component,
Component obverseComponent)
Called when a component's focused state has changed.
|
Window |
getListViewPopup() |
abstract Bounds |
getTriggerBounds() |
void |
install(Component component)
Associates a skin with a component.
|
void |
itemRendererChanged(ListButton listButton,
ListView.ItemRenderer previousItemRenderer)
Called when a list button's item renderer has changed.
|
boolean |
keyPressed(Component component,
int keyCode,
Keyboard.KeyLocation keyLocation)
SPACE Repaints the component to reflect the pressed
state and opens the popup. |
boolean |
keyReleased(Component component,
int keyCode,
Keyboard.KeyLocation keyLocation)
SPACE 'presses' the button. |
boolean |
keyTyped(Component component,
char character)
Select the next enabled list item where the first character of the
rendered text matches the typed key (case insensitive).
|
void |
listDataChanged(ListButton listButton,
List<?> previousListData)
Called when a list button's list data has changed.
|
void |
listSizeChanged(ListButton listButton,
int previousListSize)
Called when a list button's list size has changed.
|
boolean |
mouseClick(Component component,
Mouse.Button button,
int x,
int y,
int count)
Called when a mouse button is clicked over a component.
|
boolean |
mouseDown(Component component,
Mouse.Button button,
int x,
int y)
Called when a mouse button is pressed over a component.
|
void |
mouseOut(Component component)
Called when the mouse exits a component.
|
boolean |
mouseUp(Component component,
Mouse.Button button,
int x,
int y)
Called when a mouse button is released over a component.
|
void |
repeatableChanged(ListButton listButton)
Called when a list button's repeatable flag has changed.
|
void |
selectedIndexChanged(ListButton listButton,
int previousSelectedIndex)
Called when a list button's selected index has changed.
|
void |
selectedItemChanged(ListButton listButton,
Object previousSelectedItem)
Called when a list button's selected item has changed.
|
actionChanged, buttonDataChanged, buttonGroupChanged, buttonPressed, dataRendererChanged, layout, mouseOver, stateChanged, toggleButtonChanged, triStateChanged
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, getBaseline, getBaseline, getComponent, getHeight, getPreferredSize, getWidth, heightLimitsChanged, invalidateComponent, isFocusable, isOpaque, locationChanged, menuHandlerChanged, mouseMove, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPreferredHeight, getPreferredWidth
protected ListView listView
protected Window listViewPopup
protected boolean pressed
public void install(Component component)
Skin
install
in interface Skin
install
in class ButtonSkin
component
- The component to which the skin is being attached.public Window getListViewPopup()
getListViewPopup
in interface ListButton.Skin
public abstract Bounds getTriggerBounds()
public void enabledChanged(Component component)
ComponentStateListener
Called both when the component is enabled and when it is disabled.
The component's enabled
flag has already been set when this
method is called so the new state can be determined by calling the
Component.isEnabled()
method.
enabledChanged
in interface ComponentStateListener
enabledChanged
in class ButtonSkin
component
- The component whose enabled state is changing.public void focusedChanged(Component component, Component obverseComponent)
ComponentStateListener
This will be called both when a component gains focus and when it loses
focus. The currently focused component has already been set when this method
is called, so that the new state of the component can be determined by calling
the Component.isFocused()
method.
focusedChanged
in interface ComponentStateListener
focusedChanged
in class ButtonSkin
component
- The component that is either gaining focus or the one that
previously had focus and is now losing it.obverseComponent
- If the component is gaining focus, this is the component
that is losing focus. If the component is losing focus
this is the component that is gaining the focus instead.public void mouseOut(Component component)
ComponentMouseListener
mouseOut
in interface ComponentMouseListener
mouseOut
in class ButtonSkin
public boolean mouseDown(Component component, Mouse.Button button, int x, int y)
ComponentMouseButtonListener
mouseDown
in interface ComponentMouseButtonListener
mouseDown
in class ComponentSkin
public boolean mouseUp(Component component, Mouse.Button button, int x, int y)
ComponentMouseButtonListener
mouseUp
in interface ComponentMouseButtonListener
mouseUp
in class ComponentSkin
public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count)
ComponentMouseButtonListener
mouseClick
in interface ComponentMouseButtonListener
mouseClick
in class ComponentSkin
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
SPACE
Repaints the component to reflect the pressed
state and opens the popup.UP
Selects the previous enabled list item.DOWN
Selects the next enabled list item.keyPressed
in interface ComponentKeyListener
keyPressed
in class ComponentSkin
keyReleased(Component, int,
org.apache.pivot.wtk.Keyboard.KeyLocation)
public boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
SPACE
'presses' the button.keyReleased
in interface ComponentKeyListener
keyReleased
in class ComponentSkin
public boolean keyTyped(Component component, char character)
keyTyped
in interface ComponentKeyListener
keyTyped
in class ComponentSkin
public void listDataChanged(ListButton listButton, List<?> previousListData)
ListButtonListener
listDataChanged
in interface ListButtonListener
public void itemRendererChanged(ListButton listButton, ListView.ItemRenderer previousItemRenderer)
ListButtonListener
itemRendererChanged
in interface ListButtonListener
public void repeatableChanged(ListButton listButton)
ListButtonListener
repeatableChanged
in interface ListButtonListener
public void disabledItemFilterChanged(ListButton listButton, Filter<?> previousDisabledItemFilter)
ListButtonListener
disabledItemFilterChanged
in interface ListButtonListener
public void listSizeChanged(ListButton listButton, int previousListSize)
ListButtonListener
listSizeChanged
in interface ListButtonListener
public void selectedIndexChanged(ListButton listButton, int previousSelectedIndex)
ListButtonSelectionListener
selectedIndexChanged
in interface ListButtonSelectionListener
listButton
- The source of the event.previousSelectedIndex
- If the selection changed directly, contains the index that was previously
selected. Otherwise, contains the current selection.public void selectedItemChanged(ListButton listButton, Object previousSelectedItem)
ListButtonSelectionListener
selectedItemChanged
in interface ListButtonSelectionListener
listButton
- The source of the event.previousSelectedItem
- The item that was previously selected, or null if the previous selection
cannot be determined.