Package org.apache.pivot.wtk.skin.terra
Class TerraSuggestionPopupSkin
- java.lang.Object
-
- org.apache.pivot.wtk.skin.ComponentSkin
-
- org.apache.pivot.wtk.skin.ContainerSkin
-
- org.apache.pivot.wtk.skin.WindowSkin
-
- org.apache.pivot.wtk.skin.terra.TerraSuggestionPopupSkin
-
- All Implemented Interfaces:
ComponentKeyListener
,ComponentListener
,ComponentMouseButtonListener
,ComponentMouseListener
,ComponentMouseWheelListener
,ComponentStateListener
,ComponentTooltipListener
,ConstrainedVisual
,ContainerListener
,ContainerMouseListener
,Skin
,SuggestionPopupCloseListener
,SuggestionPopupListener
,SuggestionPopupSelectionListener
,SuggestionPopupStateListener
,Visual
,Window.Skin
,WindowListener
,WindowStateListener
public class TerraSuggestionPopupSkin extends WindowSkin implements SuggestionPopupListener, SuggestionPopupSelectionListener, SuggestionPopupStateListener
Terra suggestion popup skin.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter, ComponentKeyListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter, ComponentListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter, ComponentMouseButtonListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter, ComponentMouseListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseWheelListener
ComponentMouseWheelListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter, ComponentStateListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentTooltipListener
ComponentTooltipListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerListener
ContainerListener.Adapter, ContainerListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerMouseListener
ContainerMouseListener.Adapter, ContainerMouseListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.SuggestionPopupListener
SuggestionPopupListener.Adapter, SuggestionPopupListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.SuggestionPopupSelectionListener
SuggestionPopupSelectionListener.Adapter, SuggestionPopupSelectionListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.SuggestionPopupStateListener
SuggestionPopupStateListener.Adapter, SuggestionPopupStateListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.WindowListener
WindowListener.Adapter, WindowListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.WindowStateListener
WindowStateListener.Adapter, WindowStateListener.Listeners
-
-
Constructor Summary
Constructors Constructor Description TerraSuggestionPopupSkin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Color
getBorderColor()
int
getCloseTransitionDuration()
int
getCloseTransitionRate()
java.awt.Color
getColor()
java.awt.Font
getFont()
void
install(Component component)
Must be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.boolean
isVariableItemHeight()
boolean
keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
void
listSizeChanged(SuggestionPopup suggestionPopup, int previousListSize)
Called when a suggestion popup'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.Vote
previewSuggestionPopupClose(SuggestionPopup suggestionPopup, boolean result)
Called to preview a suggestion popup close event.void
selectedIndexChanged(SuggestionPopup suggestionPopup, int previousSelectedIndex)
Called when a suggestion popup's selected index has changed.void
selectedSuggestionChanged(SuggestionPopup suggestionPopup, java.lang.Object previousSelectedSuggestion)
Called when a suggestion popup's selected suggestion has changed.void
setBorderColor(java.awt.Color borderColor)
void
setBorderColor(java.lang.String borderColor)
void
setCloseTransitionDuration(int closeTransitionDuration)
void
setCloseTransitionRate(int closeTransitionRate)
void
setColor(java.awt.Color color)
void
setColor(java.lang.String color)
void
setFont(java.awt.Font font)
void
setFont(java.lang.String font)
void
setFont(Dictionary<java.lang.String,?> font)
void
setVariableItemHeight(boolean variableItemHeight)
void
suggestionDataChanged(SuggestionPopup suggestionPopup, List<?> previousSuggestionData)
Called when a suggestion popup's suggestions have changed.void
suggestionPopupClosed(SuggestionPopup suggestionPopup)
Called when a suggestion popup has closed.void
suggestionPopupCloseVetoed(SuggestionPopup suggestionPopup, Vote reason)
Called when a suggestion popup close event has been vetoed.void
suggestionRendererChanged(SuggestionPopup suggestionPopup, ListView.ItemRenderer previousSuggestionRenderer)
Called when a suggestion popup's item renderer has changed.void
windowClosed(Window window, Display display, Window owner)
Called when a window has closed.void
windowCloseVetoed(Window window, Vote reason)
Called when a window close event has been vetoed.void
windowOpened(Window window)
Called when a window has opened.-
Methods inherited from class org.apache.pivot.wtk.skin.WindowSkin
contentChanged, getClientArea, getPreferredHeight, getPreferredSize, getPreferredWidth, layout, mouseDown
-
Methods inherited from class org.apache.pivot.wtk.skin.ContainerSkin
componentInserted, componentMoved, componentsRemoved, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, isOpaque, mouseMove, mouseUp, mouseWheel, paint, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint, setBackgroundPaint
-
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
colorFromObject, colorFromObject, colorFromObject, colorFromObject, currentTheme, cursorChanged, decodeFont, defaultBackgroundColor, defaultForegroundColor, dragSourceChanged, dropTargetChanged, enabledChanged, focusedChanged, fontFromObject, getBaseline, getBaseline, getColor, getComponent, getFocusRectangleStroke, getHeight, getSize, getTextInputMethodListener, getThemeFont, getWidth, heightLimitsChanged, invalidateComponent, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setDefaultStyles, setSize, sizeChanged, themeHasThickFocusRectangle, themeHasTransitionEnabled, themeIsDark, themeIsFlat, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pivot.wtk.ConstrainedVisual
getBaseline, setSize, setSize
-
Methods inherited from interface org.apache.pivot.wtk.Skin
getComponent, isFocusable, isOpaque
-
Methods inherited from interface org.apache.pivot.wtk.Visual
getBaseline, getHeight, getSize, getWidth, paint
-
Methods inherited from interface org.apache.pivot.wtk.WindowListener
activeChanged, iconAdded, iconInserted, iconsRemoved, maximizedChanged, titleChanged
-
Methods inherited from interface org.apache.pivot.wtk.WindowStateListener
previewWindowClose, previewWindowOpen, windowOpenVetoed
-
-
-
-
Method Detail
-
install
public void install(Component component)
Description copied from class:ComponentSkin
Must be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.- Specified by:
install
in interfaceSkin
- Overrides:
install
in classWindowSkin
- Parameters:
component
- The component to which the skin is being attached.
-
getFont
public java.awt.Font getFont()
-
setFont
public void setFont(java.awt.Font font)
-
setFont
public final void setFont(java.lang.String font)
-
setFont
public final void setFont(Dictionary<java.lang.String,?> font)
-
getColor
public java.awt.Color getColor()
-
setColor
public void setColor(java.awt.Color color)
-
setColor
public final void setColor(java.lang.String color)
-
getBorderColor
public java.awt.Color getBorderColor()
-
setBorderColor
public void setBorderColor(java.awt.Color borderColor)
-
setBorderColor
public final void setBorderColor(java.lang.String borderColor)
-
getCloseTransitionDuration
public int getCloseTransitionDuration()
-
setCloseTransitionDuration
public void setCloseTransitionDuration(int closeTransitionDuration)
-
getCloseTransitionRate
public int getCloseTransitionRate()
-
setCloseTransitionRate
public void setCloseTransitionRate(int closeTransitionRate)
-
isVariableItemHeight
public boolean isVariableItemHeight()
-
setVariableItemHeight
public void setVariableItemHeight(boolean variableItemHeight)
-
mouseClick
public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count)
Description copied from interface:ComponentMouseButtonListener
Called when a mouse button is clicked over a component.- Specified by:
mouseClick
in interfaceComponentMouseButtonListener
- Overrides:
mouseClick
in classComponentSkin
- Parameters:
component
- Component user the mouse pointer.button
- Which mouse button was clicked.x
- X position of the mouse.y
- Y position of the mouse.count
- Number of clicks (1 = single click, 2 = double click, etc.).- Returns:
true
to consume the event;false
to allow it to propagate (default).
-
keyPressed
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
ENTER
Close the suggestion popup with a 'result' of true.
ESCAPE
Close the suggestion popup with a 'result' of false.- Specified by:
keyPressed
in interfaceComponentKeyListener
- Overrides:
keyPressed
in classComponentSkin
- Parameters:
component
- Component that has the focus.keyCode
- The key code for the key that was pressed.keyLocation
- Location value for the key (left or right for shift keys, etc.).- Returns:
true
to consume the event;false
to allow it to propagate.
-
windowOpened
public void windowOpened(Window window)
Description copied from interface:WindowStateListener
Called when a window has opened.- Specified by:
windowOpened
in interfaceWindowStateListener
- Parameters:
window
- The newly opened window.
-
windowCloseVetoed
public void windowCloseVetoed(Window window, Vote reason)
Description copied from interface:WindowStateListener
Called when a window close event has been vetoed.- Specified by:
windowCloseVetoed
in interfaceWindowStateListener
- Parameters:
window
- The window that was to close, but now will not.reason
- The accumulated vote from all the listeners that vetoed this event.
-
windowClosed
public void windowClosed(Window window, Display display, Window owner)
Description copied from interface:WindowStateListener
Called when a window has closed.- Specified by:
windowClosed
in interfaceWindowStateListener
- Overrides:
windowClosed
in classWindowSkin
- Parameters:
window
- The window that is now closed.display
- The display in which the window was shown.owner
- The owner of this window (which could benull
).
-
suggestionDataChanged
public void suggestionDataChanged(SuggestionPopup suggestionPopup, List<?> previousSuggestionData)
Description copied from interface:SuggestionPopupListener
Called when a suggestion popup's suggestions have changed.- Specified by:
suggestionDataChanged
in interfaceSuggestionPopupListener
- Parameters:
suggestionPopup
- The source of this event.previousSuggestionData
- The previous data that was being shown.
-
suggestionRendererChanged
public void suggestionRendererChanged(SuggestionPopup suggestionPopup, ListView.ItemRenderer previousSuggestionRenderer)
Description copied from interface:SuggestionPopupListener
Called when a suggestion popup's item renderer has changed.- Specified by:
suggestionRendererChanged
in interfaceSuggestionPopupListener
- Parameters:
suggestionPopup
- The source of this event.previousSuggestionRenderer
- The previous item renderer.
-
listSizeChanged
public void listSizeChanged(SuggestionPopup suggestionPopup, int previousListSize)
Description copied from interface:SuggestionPopupListener
Called when a suggestion popup's list size has changed.- Specified by:
listSizeChanged
in interfaceSuggestionPopupListener
- Parameters:
suggestionPopup
- The source of this event.previousListSize
- The previous value of the visible window.
-
selectedIndexChanged
public void selectedIndexChanged(SuggestionPopup suggestionPopup, int previousSelectedIndex)
Description copied from interface:SuggestionPopupSelectionListener
Called when a suggestion popup's selected index has changed.- Specified by:
selectedIndexChanged
in interfaceSuggestionPopupSelectionListener
- Parameters:
suggestionPopup
- The source of this event.previousSelectedIndex
- What the selected index used to be.
-
selectedSuggestionChanged
public void selectedSuggestionChanged(SuggestionPopup suggestionPopup, java.lang.Object previousSelectedSuggestion)
Description copied from interface:SuggestionPopupSelectionListener
Called when a suggestion popup's selected suggestion has changed.- Specified by:
selectedSuggestionChanged
in interfaceSuggestionPopupSelectionListener
- Parameters:
suggestionPopup
- The source of the event.previousSelectedSuggestion
- The item that was previously selected, ornull
if the previous selection cannot be determined.
-
previewSuggestionPopupClose
public Vote previewSuggestionPopupClose(SuggestionPopup suggestionPopup, boolean result)
Description copied from interface:SuggestionPopupStateListener
Called to preview a suggestion popup close event.- Specified by:
previewSuggestionPopupClose
in interfaceSuggestionPopupStateListener
- Parameters:
suggestionPopup
- The source of this event.result
- What the result would be.- Returns:
- What this listener thinks about closing the popup with this result.
-
suggestionPopupCloseVetoed
public void suggestionPopupCloseVetoed(SuggestionPopup suggestionPopup, Vote reason)
Description copied from interface:SuggestionPopupStateListener
Called when a suggestion popup close event has been vetoed.- Specified by:
suggestionPopupCloseVetoed
in interfaceSuggestionPopupStateListener
- Parameters:
suggestionPopup
- The source of this event.reason
- The accumulated vote that forced the veto.
-
suggestionPopupClosed
public void suggestionPopupClosed(SuggestionPopup suggestionPopup)
Description copied from interface:SuggestionPopupCloseListener
Called when a suggestion popup has closed.- Specified by:
suggestionPopupClosed
in interfaceSuggestionPopupCloseListener
- Parameters:
suggestionPopup
- The suggestion popup that has closed.
-
-