public class

QuickSearchInputField

extends InputField
implements QuickSearchSupport
java.lang.Object
   ↳ com.google.gwt.user.client.ui.UIObject
     ↳ com.google.gwt.user.client.ui.Widget
       ↳ com.google.gwt.user.client.ui.Composite
         ↳ com.atlassian.gwt.InputField
           ↳ com.atlassian.gwt.QuickSearchInputField

Class Overview

The is a widget that extends InputField to include a quick search drop down. This relies on the existing quick search js that lives inside of Confluence. After creating the widget, it's necessary to call bindDropDown to add the default query parameters and a drop down handler that handles js events called from the user interacting with the quick search results.

Summary

[Expand]
Inherited Constants
From class com.google.gwt.user.client.ui.UIObject
Fields
protected final FlowPanel dropDownPanel Hidden div that the quick search results drop down attaches to.
[Expand]
Inherited Fields
From class com.atlassian.gwt.InputField
Public Constructors
QuickSearchInputField(String fieldName, int size)
Public Methods
void bindDropDown(DropDownHandler handler)
Sets the default query parameters for the quick search and adds a listener for js events called by the quick search.
void cancelDropDown()
Prevents the down down from showing, if any.
void clearSearchCache()
Clears the search cache used by the quick search dropdown.
boolean dropDownHasFocus()
String getSearchForText()
void hideDropDown()
Hides the current drop down, if any.
boolean isDropDownOpen()
void setLabelClassName(String className)
void setSearchForText(String searchForText)
[Expand]
Inherited Methods
From class com.atlassian.gwt.InputField
From class com.google.gwt.user.client.ui.Composite
From class com.google.gwt.user.client.ui.Widget
From class com.google.gwt.user.client.ui.UIObject
From class java.lang.Object
From interface com.atlassian.gwt.QuickSearchSupport
From interface com.google.gwt.event.dom.client.HasBlurHandlers
From interface com.google.gwt.event.dom.client.HasFocusHandlers
From interface com.google.gwt.event.dom.client.HasKeyDownHandlers
From interface com.google.gwt.event.dom.client.HasKeyUpHandlers
From interface com.google.gwt.event.shared.HasHandlers
From interface com.google.gwt.user.client.EventListener

Fields

protected final FlowPanel dropDownPanel

Hidden div that the quick search results drop down attaches to.

Public Constructors

public QuickSearchInputField (String fieldName, int size)

Parameters
fieldName The name attribute for the text input field.
size The visible size of the text input field.

Public Methods

public void bindDropDown (DropDownHandler handler)

Sets the default query parameters for the quick search and adds a listener for js events called by the quick search.

Parameters
handler This is the event handler that does something when a user makes a selection from the quick search results.

public void cancelDropDown ()

Prevents the down down from showing, if any.

public void clearSearchCache ()

Clears the search cache used by the quick search dropdown. The cache is only based on the search query text so this needs to be cleared when any other search parameter changes (like the space key)

public boolean dropDownHasFocus ()

public String getSearchForText ()

public void hideDropDown ()

Hides the current drop down, if any.

public boolean isDropDownOpen ()

public void setLabelClassName (String className)

public void setSearchForText (String searchForText)