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.ColorgetBorderColor()intgetCloseTransitionDuration()intgetCloseTransitionRate()java.awt.ColorgetColor()java.awt.FontgetFont()voidinstall(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.booleanisVariableItemHeight()booleankeyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)voidlistSizeChanged(SuggestionPopup suggestionPopup, int previousListSize)Called when a suggestion popup's list size has changed.booleanmouseClick(Component component, Mouse.Button button, int x, int y, int count)Called when a mouse button is clicked over a component.VotepreviewSuggestionPopupClose(SuggestionPopup suggestionPopup, boolean result)Called to preview a suggestion popup close event.voidselectedIndexChanged(SuggestionPopup suggestionPopup, int previousSelectedIndex)Called when a suggestion popup's selected index has changed.voidselectedSuggestionChanged(SuggestionPopup suggestionPopup, java.lang.Object previousSelectedSuggestion)Called when a suggestion popup's selected suggestion has changed.voidsetBorderColor(java.awt.Color borderColor)voidsetBorderColor(java.lang.String borderColor)voidsetCloseTransitionDuration(int closeTransitionDuration)voidsetCloseTransitionRate(int closeTransitionRate)voidsetColor(java.awt.Color color)voidsetColor(java.lang.String color)voidsetFont(java.awt.Font font)voidsetFont(java.lang.String font)voidsetFont(Dictionary<java.lang.String,?> font)voidsetVariableItemHeight(boolean variableItemHeight)voidsuggestionDataChanged(SuggestionPopup suggestionPopup, List<?> previousSuggestionData)Called when a suggestion popup's suggestions have changed.voidsuggestionPopupClosed(SuggestionPopup suggestionPopup)Called when a suggestion popup has closed.voidsuggestionPopupCloseVetoed(SuggestionPopup suggestionPopup, Vote reason)Called when a suggestion popup close event has been vetoed.voidsuggestionRendererChanged(SuggestionPopup suggestionPopup, ListView.ItemRenderer previousSuggestionRenderer)Called when a suggestion popup's item renderer has changed.voidwindowClosed(Window window, Display display, Window owner)Called when a window has closed.voidwindowCloseVetoed(Window window, Vote reason)Called when a window close event has been vetoed.voidwindowOpened(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:ComponentSkinMust 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:
installin interfaceSkin- Overrides:
installin 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:ComponentMouseButtonListenerCalled when a mouse button is clicked over a component.- Specified by:
mouseClickin interfaceComponentMouseButtonListener- Overrides:
mouseClickin 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:
trueto consume the event;falseto allow it to propagate (default).
-
keyPressed
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
ENTERClose the suggestion popup with a 'result' of true.
ESCAPEClose the suggestion popup with a 'result' of false.- Specified by:
keyPressedin interfaceComponentKeyListener- Overrides:
keyPressedin 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:
trueto consume the event;falseto allow it to propagate.
-
windowOpened
public void windowOpened(Window window)
Description copied from interface:WindowStateListenerCalled when a window has opened.- Specified by:
windowOpenedin interfaceWindowStateListener- Parameters:
window- The newly opened window.
-
windowCloseVetoed
public void windowCloseVetoed(Window window, Vote reason)
Description copied from interface:WindowStateListenerCalled when a window close event has been vetoed.- Specified by:
windowCloseVetoedin 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:WindowStateListenerCalled when a window has closed.- Specified by:
windowClosedin interfaceWindowStateListener- Overrides:
windowClosedin 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:SuggestionPopupListenerCalled when a suggestion popup's suggestions have changed.- Specified by:
suggestionDataChangedin 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:SuggestionPopupListenerCalled when a suggestion popup's item renderer has changed.- Specified by:
suggestionRendererChangedin 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:SuggestionPopupListenerCalled when a suggestion popup's list size has changed.- Specified by:
listSizeChangedin 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:SuggestionPopupSelectionListenerCalled when a suggestion popup's selected index has changed.- Specified by:
selectedIndexChangedin 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:SuggestionPopupSelectionListenerCalled when a suggestion popup's selected suggestion has changed.- Specified by:
selectedSuggestionChangedin interfaceSuggestionPopupSelectionListener- Parameters:
suggestionPopup- The source of the event.previousSelectedSuggestion- The item that was previously selected, ornullif the previous selection cannot be determined.
-
previewSuggestionPopupClose
public Vote previewSuggestionPopupClose(SuggestionPopup suggestionPopup, boolean result)
Description copied from interface:SuggestionPopupStateListenerCalled to preview a suggestion popup close event.- Specified by:
previewSuggestionPopupClosein 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:SuggestionPopupStateListenerCalled when a suggestion popup close event has been vetoed.- Specified by:
suggestionPopupCloseVetoedin 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:SuggestionPopupCloseListenerCalled when a suggestion popup has closed.- Specified by:
suggestionPopupClosedin interfaceSuggestionPopupCloseListener- Parameters:
suggestionPopup- The suggestion popup that has closed.
-
-