Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed to the Apache Software Foundation (ASF) under one or more
   * contributor license agreements.  See the NOTICE file distributed with
   * this work for additional information regarding copyright ownership.
   * The ASF licenses this file to You under the Apache License, Version 2.0
   * (the "License"); you may not use this file except in compliance with
   * the License.  You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package org.apache.wicket.extensions.ajax.markup.html.autocomplete;
 
This class encapsulates various settings for AbstractAutoCompleteBehavior. See the documentation for the property accessors of this class for further information.

Default settings:

settingdefault value
preselectfalse
maxHeightInPx-1
showListOnEmptyInputfalse

Author(s):
Gerolf Seitz
 
 public final class AutoCompleteSettings implements IClusterable
 {
 	private static final long serialVersionUID = 1L;
 
 	private boolean preselect = false;
 
 	private int maxHeightInPx = -1;
 
 	private boolean showListOnEmptyInput = false;
 
 	private boolean useSmartPositioning = false;
 
 	private boolean useHideShowCoveredIEFix = true;
 
 	private String cssClassName = null;
 
 	private boolean adjustInputWidth = true;
 
 	private boolean showListOnFocusGain = false;
 
 	private boolean showCompleteListOnFocusGain = false;
 
 	private int throttleDelay = 300;

Indicates whether the first item in the list is automatically selected when the autocomplete list is shown.

Returns:
true if the first item of the autocomplete list should be preselected, false (default) otherwise
 
 	public boolean getPreselect()
 	{
 		return ;
 	}

Sets whether the first item in the autocomplete list should be selected when the autocomplete list is shown.

Parameters:
preselect the flag
Returns:
this AutoCompleteSettings
 
 	public AutoCompleteSettings setPreselect(boolean preselect)
 	{
 		this. = preselect;
 		return this;
 	}

set the throttle delay how long the browser will wait before sending a request to the browser after the user released a key.

Parameters:
throttleDelay The delay in milliseconds.
	public void setThrottleDelay(int throttleDelay)
	{
		this. = throttleDelay;
	}

get the throttle delay how long the browser will wait before sending a request to the browser after the user released a key.

Returns:
the throttle delay in milliseconds (default 300)
	public int getThrottleDelay()
	{
	}

Gets the maximum height of the autocomplete list in pixels. -1 indicates that the autocomplete list should have no maximum height.

Returns:
the maximum height in pixels
	public int getMaxHeightInPx()
	{
	}

Sets the maximum height in pixels of the autocomplete list.

The maximum height can also be specified via css (and by setting maxHeightInPx to -1):

 div.wicket-aa-container { maxHeight: 100px; }
 
Note that this does not work in IE6.

Parameters:
maxHeightInPx the maximum height in pixels
Returns:
this AutoCompleteSettings
	public AutoCompleteSettings setMaxHeightInPx(int maxHeightInPx)
	{
		this. = maxHeightInPx;
		return this;
	}

Indicates whether the popup positioning will take into account browser window visible area or not. (so always show popup bottom-right or not)

Returns:
true if popup smart positioning is used, false otherwise.
	public boolean getUseSmartPositioning()
	{
	}

Indicates whether in case of IE (and Opera), "select" "iframe" and "applet" tags should be hidden if covered by popup. (as they might appear on top)
By default this is true (before this flag was added).

Returns:
true if the fix/workaround should be used for IE and Opera, false otherwise.
	public boolean getUseHideShowCoveredIEFix()
	{
	}

Indicates whether the autocomplete list will be shown if the input is empty.

Returns:
true if the autocomlete list will be shown if the input string is empty, false otherwise
	public boolean getShowListOnEmptyInput()
	{
	}

Sets whether the list should be shown when the input is empty.

Parameters:
showListOnEmptyInput the flag
Returns:
this AutoCompleteSettings
	public AutoCompleteSettings setShowListOnEmptyInput(boolean showListOnEmptyInput)
	{
		this. = showListOnEmptyInput;
		return this;
	}

Get CSS class name to add to the autocompleter markup container

Returns:
CSS class name, or null if not used
	{
		return ;
	}

Sets an CSS class name to add to the autocompleter markup container

This makes it easier to have multiple autocompleters in your application with different style and layout.

Parameters:
cssClassName valid CSS class name
Returns:
this AutoCompleteSettings.
	public AutoCompleteSettings setCssClassName(final String cssClassName)
	{
		this. = cssClassName;
		return this;
	}

Tells if wicket should adjust the width of the autocompleter selection window to the width of the related input field.

Returns:
true if the autocompleter should have the same size as the input field, false for default browser behavior
	public boolean isAdjustInputWidth()
	{
	}

Adjust the width of the autocompleter selection window to the width of the related input field.

Otherwise the size will depend on the default browser behavior and CSS.

Parameters:
adjustInputWidth true if the autocompleter should have the same size as the input field, false for default browser behavior
Returns:
this AutoCompleteSettings.
	public AutoCompleteSettings setAdjustInputWidth(final boolean adjustInputWidth)
	{
		this. = adjustInputWidth;
		return this;
	}

Indicates whether the autocomplete list will be shown when the input field receives focus.

Returns:
true if the autocomplete list will be shown when the input field receives focus, false otherwise
	public boolean getShowListOnFocusGain()
	{
	}

Sets whether the list should be shown when the input field receives focus.

Parameters:
showListOnEmptyInput the flag
Returns:
this AutoCompleteSettings.
	public AutoCompleteSettings setShowCompleteListOnFocusGain(final boolean showCompleteListOnFocusGain)
	{
		this. = showCompleteListOnFocusGain;
		return this;
	}

Indicates whether the autocomplete list will be shown when the input field receives focus.

Returns:
true if the autocomplete list will be shown when the input field receives focus, false otherwise
	{
	}

Sets whether the list should be shown when the input field receives focus.

Parameters:
showListOnEmptyInput the flag
Returns:
this AutoCompleteSettings.
	public AutoCompleteSettings setShowListOnFocusGain(final boolean showListOnFocusGain)
	{
		this. = showListOnFocusGain;
		return this;
	}

Sets whether the popup positioning will take into account browser window visible area or not. (so always show popup bottom-right or not)
THIS WILL PRODUCE UNWANTED BEHAVIOR WITH IE versions < 8 (probably because of unreliable clientWidth/clientHeight browser element properties).

Parameters:
useSmartPositioning the flag
Returns:
this AutoCompleteSettings.
	public AutoCompleteSettings setUseSmartPositioning(final boolean useSmartPositioning)
	{
		this. = useSmartPositioning;
		return this;
	}

Indicates whether in case of IE (and Opera), "select" "iframe" and "applet" tags should be hidden if covered by popup. (as they might appear on top)
By default this is true (before this flag was added).

Parameters:
useHideShowCoveredIEFix the flag
Returns:
this AutoCompleteSettings.
	public AutoCompleteSettings setUseHideShowCoveredIEFix(final boolean useHideShowCoveredIEFix)
	{
		this. = useHideShowCoveredIEFix;
		return this;
	}
New to GrepCode? Check out our FAQ X