com.extjs.gxt.ui.client.widget.form
クラス ComboBox<D extends ModelData>

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.form.Field<D>
                      extended by com.extjs.gxt.ui.client.widget.form.TextField<Data>
                          extended by com.extjs.gxt.ui.client.widget.form.TriggerField<D>
                              extended by com.extjs.gxt.ui.client.widget.form.ComboBox<D>
Type Parameters:
D - the model data type
すべての実装インターフェース:
Observable, SelectionProvider<D>, com.google.gwt.user.client.EventListener
Direct Known Subclasses:
ThemeSelector, TimeField

public class ComboBox<D extends ModelData>
extends TriggerField<D>
implements SelectionProvider<D>

A combobox control.

Events:
Expand : FieldEvent(field)
Fires when the dropdown list is expanded.
Collapse : FieldEvent(field)
Fires when the dropdown list is collapsed.
BeforeSelect : FieldEvent(field)
Fires before a list item is selected.
Select : FieldEvent(field)
Fires when a list item is selected.


入れ子クラス 概要
 class ComboBox.ComboBoxMessages
          ComboBox error messages.
 
クラス com.extjs.gxt.ui.client.widget.form.TextField から継承された 入れ子クラス/インターフェース
TextField.TextFieldMessages
 
クラス com.extjs.gxt.ui.client.widget.form.Field から継承された 入れ子クラス/インターフェース
Field.FieldMessages
 
クラス com.google.gwt.user.client.ui.UIObject から継承された 入れ子クラス/インターフェース
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field 概要
 
クラス com.google.gwt.user.client.ui.UIObject から継承されたフィールド(Fields)
DEBUG_ID_PREFIX
 
コンストラクタ 概要
ComboBox()
          Creates a combo box.
 
メソッド 概要
 void addSelectionChangedListener(SelectionChangedListener listener)
          Add a selection changed listener.
 void clearSelections()
          Clears any text/value currently set in the field.
 void collapse()
          Hides the dropdown list if it is currently expanded.
 void expand()
          Expands the dropdown list if it is currently hidden.
 DataView getDataView()
          Returns the combos data view.
 java.lang.String getDisplayField()
          Returns the display field.
 boolean getForceSelection()
          Returns true if the field's value is forced to one of the value in the list.
 java.lang.String getListAlign()
          Returns the list's list align value.
 int getMaxHeight()
          Returns the dropdown list's max height.
 ComboBox.ComboBoxMessages getMessages()
          Returns the field's messages.
 int getMinListWidth()
          Returns the dropdown list's min width.
 ModelStringProvider<D> getModelStringProvider()
          Returns the model string provider.
 ListModelPropertyEditor<D> getPropertyEditor()
          Retuns the field's property editor.
 java.lang.String getSelectedStyle()
          Returns the selected style.
 java.util.List<D> getSelection()
          Returns the current selection.
 ListStore<D> getStore()
          Returns the combo's store.
 Template getTemplate()
          Returns the custom template.
 D getValue()
          Returns the typed value of the field.
 java.lang.String getValueField()
          Returns the combo's value field.
 boolean isExpanded()
          Returns true if the panel is expanded.
 boolean isLazyRender()
          Returns true if lazy rendering is enabled.
 void removeSelectionListener(SelectionChangedListener listener)
          Removes a selection changed listener.
 void select(int index)
          Select an item in the dropdown list by its numeric index in the list.
 void setDisplayField(java.lang.String displayField)
          The underlying data field name to bind to this ComboBox (defaults to 'text').
 void setEditable(boolean value)
          Allow or prevent the user from directly editing the field text.
 void setExpanded(boolean expand)
          Sets the panel's expand state.
 void setForceSelection(boolean forceSelection)
          Sets whether the combo's value is restricted to one of the values in the list, false to allow the user to set arbitrary text into the field (defaults to false).
 void setLazyRender(boolean lazyRender)
          True to lazily render the combo's drop down list (default to false, pre-render).
 void setListAlign(java.lang.String listAlign)
          Sets a valid anchor position value.
 void setMaxHeight(int maxHeight)
          Sets the maximum height in pixels of the dropdown list before scrollbars are shown (defaults to 300).
 void setMinListWidth(int minListWidth)
          Sets the minimum width of the dropdown list in pixels (defaults to 70, will be ignored if listWidth has a higher value).
 void setModelStringProvider(ModelStringProvider<D> modelStringProvider)
          Sets the model string provider (defaults to BaseModelStringProvider.
 void setPropertyEditor(PropertyEditor<D> propertyEditor)
          Sets the field's property editor which is used to translate typed values to string, and string values back to typed values.
 void setRawValue(java.lang.String text)
          Sets the underlying DOM field's value directly, bypassing validation.
 void setSelectedStyle(java.lang.String selectedStyle)
          Sets the CSS style name to apply to the selected item in the dropdown list (defaults to 'x-combo-selected').
 void setSelection(java.util.List<D> selection)
          Sets the current selection for this selection provider.
 void setStore(ListStore<D> store)
          Sets the combo's store.
 void setTemplate(Template template)
          Sets the template to be used to render each item in the drop down.
 void setValue(D value)
          Sets a data value into the field and validates it.
 void setValueField(java.lang.String valueField)
          The underlying data value name to bind to this ComboBox.
 
クラス com.extjs.gxt.ui.client.widget.form.TriggerField から継承されたメソッド
getElement, getTriggerStyle, setTriggerStyle
 
クラス com.extjs.gxt.ui.client.widget.form.TextField から継承されたメソッド
getAllowBlank, getCursorPos, getMaxLength, getMinLength, getRegex, getSelectedText, getSelectionLength, getSelectOnFocus, getValidator, isPassword, select, selectAll, setAllowBlank, setCursorPos, setMaxLength, setMinLength, setPassword, setRegex, setSelectionRange, setSelectOnFocus, setValidator
 
クラス com.extjs.gxt.ui.client.widget.form.Field から継承されたメソッド
addKeyListener, clearInvalid, focus, getAutoValidate, getEmptyText, getFieldLabel, getLabelSeparator, getLabelStyle, getMessageTarget, getName, getRawValue, getValidateOnBlur, getValidationDelay, isDirty, isReadOnly, isValid, markInvalid, onComponentEvent, removeKeyListener, reset, setAutoValidate, setEmptyText, setFieldLabel, setLabelSeparator, setLabelStyle, setMessages, setMessageTarget, setName, setReadOnly, setTabIndex, setValidateOnBlur, setValidationDelay, validate
 
クラス com.extjs.gxt.ui.client.widget.BoxComponent から継承されたメソッド
getBounds, getHeight, getHeight, getPosition, getShadow, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShim, setSize, setSize, setWidth, setWidth
 
クラス com.extjs.gxt.ui.client.widget.Component から継承されたメソッド
addListener, addStyleName, addWidgetListener, disable, disableEvents, disableTextSelection, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, getBaseStyle, getBorders, getData, getData, getId, getItemId, getModel, getState, getToolTip, hide, hideToolTip, isEnabled, isRendered, isVisible, onBrowserEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeWidgetListener, render, render, saveState, setBorders, setData, setData, setElement, setEnabled, setEnableState, setId, setIntStyleAttribute, setItemId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, show, toString
 
クラス com.google.gwt.user.client.ui.Widget から継承されたメソッド
getParent, isAttached
 
クラス com.google.gwt.user.client.ui.UIObject から継承されたメソッド
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタ 詳細

ComboBox

public ComboBox()
Creates a combo box.

メソッド 詳細

addSelectionChangedListener

public void addSelectionChangedListener(SelectionChangedListener listener)
Description copied from interface: SelectionProvider
Add a selection changed listener.

Specified by:
addSelectionChangedListener in interface SelectionProvider<D extends ModelData>
パラメータ:
listener - a selection changed listener

clearSelections

public void clearSelections()
Clears any text/value currently set in the field.


collapse

public void collapse()
Hides the dropdown list if it is currently expanded. Fires the Collapse event on completion.


expand

public void expand()
Expands the dropdown list if it is currently hidden. Fires the expand event on completion.


getDataView

public DataView getDataView()
Returns the combos data view.

戻り値:
the view

getDisplayField

public java.lang.String getDisplayField()
Returns the display field.

戻り値:
the display field

getForceSelection

public boolean getForceSelection()
Returns true if the field's value is forced to one of the value in the list.

戻り値:
the force selection state

getListAlign

public java.lang.String getListAlign()
Returns the list's list align value.

戻り値:
the list align valu

getMaxHeight

public int getMaxHeight()
Returns the dropdown list's max height.

戻り値:
the max height

getMessages

public ComboBox.ComboBoxMessages getMessages()
Description copied from class: Field
Returns the field's messages.

オーバーライド:
getMessages in class TextField<D extends ModelData>
戻り値:
the messages

getMinListWidth

public int getMinListWidth()
Returns the dropdown list's min width.

戻り値:
the min width

getModelStringProvider

public ModelStringProvider<D> getModelStringProvider()
Returns the model string provider.

戻り値:
the model string provider

getPropertyEditor

public ListModelPropertyEditor<D> getPropertyEditor()
Description copied from class: Field
Retuns the field's property editor.

オーバーライド:
getPropertyEditor in class Field<D extends ModelData>
戻り値:
the property editor

getSelectedStyle

public java.lang.String getSelectedStyle()
Returns the selected style.

戻り値:
the selected style

getSelection

public java.util.List<D> getSelection()
Description copied from interface: SelectionProvider
Returns the current selection.

Specified by:
getSelection in interface SelectionProvider<D extends ModelData>
戻り値:
the current selection

getStore

public ListStore<D> getStore()
Returns the combo's store.

戻り値:
the store

getTemplate

public Template getTemplate()
Returns the custom template.

戻り値:
the template

getValue

public D getValue()
Description copied from class: Field
Returns the typed value of the field.

オーバーライド:
getValue in class Field<D extends ModelData>
戻り値:
the fields value

getValueField

public java.lang.String getValueField()
Returns the combo's value field.

戻り値:
the value field

isExpanded

public boolean isExpanded()
Returns true if the panel is expanded.

戻り値:
the expand state

isLazyRender

public boolean isLazyRender()
Returns true if lazy rendering is enabled.

戻り値:
true of lazy rendering

removeSelectionListener

public void removeSelectionListener(SelectionChangedListener listener)
Description copied from interface: SelectionProvider
Removes a selection changed listener.

Specified by:
removeSelectionListener in interface SelectionProvider<D extends ModelData>
パラメータ:
listener - a selection changed listener

select

public void select(int index)
Select an item in the dropdown list by its numeric index in the list. This function does NOT cause the select event to fire. The list must expanded for this function to work, otherwise use #setValue.

パラメータ:
index - the index of the item to select

setDisplayField

public void setDisplayField(java.lang.String displayField)
The underlying data field name to bind to this ComboBox (defaults to 'text').

パラメータ:
displayField - the display field

setEditable

public void setEditable(boolean value)
Allow or prevent the user from directly editing the field text. If false is passed, the user will only be able to select from the items defined in the dropdown list.

パラメータ:
value - true to allow the user to directly edit the field text

setExpanded

public void setExpanded(boolean expand)
Sets the panel's expand state.

パラメータ:
expand - true true to expand

setForceSelection

public void setForceSelection(boolean forceSelection)
Sets whether the combo's value is restricted to one of the values in the list, false to allow the user to set arbitrary text into the field (defaults to false).

パラメータ:
forceSelection - true to force selection

setLazyRender

public void setLazyRender(boolean lazyRender)
True to lazily render the combo's drop down list (default to false, pre-render).

パラメータ:
lazyRender - true to lazy render the drop down list

setListAlign

public void setListAlign(java.lang.String listAlign)
Sets a valid anchor position value. See El.alignTo(com.google.gwt.user.client.Element, java.lang.String, int[]) for details on supported anchor positions (defaults to 'tl-bl?').

パラメータ:
listAlign - the new list align value

setMaxHeight

public void setMaxHeight(int maxHeight)
Sets the maximum height in pixels of the dropdown list before scrollbars are shown (defaults to 300).

パラメータ:
maxHeight - the max hieght

setMinListWidth

public void setMinListWidth(int minListWidth)
Sets the minimum width of the dropdown list in pixels (defaults to 70, will be ignored if listWidth has a higher value).

パラメータ:
minListWidth - the min width

setModelStringProvider

public void setModelStringProvider(ModelStringProvider<D> modelStringProvider)
Sets the model string provider (defaults to BaseModelStringProvider.

パラメータ:
modelStringProvider - the string provider

setPropertyEditor

public void setPropertyEditor(PropertyEditor<D> propertyEditor)
Description copied from class: Field
Sets the field's property editor which is used to translate typed values to string, and string values back to typed values.

オーバーライド:
setPropertyEditor in class Field<D extends ModelData>
パラメータ:
propertyEditor - the property editor

setRawValue

public void setRawValue(java.lang.String text)
Description copied from class: Field
Sets the underlying DOM field's value directly, bypassing validation. To set the value with validation see Field.setValue(D).

オーバーライド:
setRawValue in class Field<D extends ModelData>
パラメータ:
text - the raw value

setSelectedStyle

public void setSelectedStyle(java.lang.String selectedStyle)
Sets the CSS style name to apply to the selected item in the dropdown list (defaults to 'x-combo-selected').

パラメータ:
selectedStyle - the selected style

setSelection

public void setSelection(java.util.List<D> selection)
Description copied from interface: SelectionProvider
Sets the current selection for this selection provider.

Specified by:
setSelection in interface SelectionProvider<D extends ModelData>
パラメータ:
selection - the new selection

setStore

public void setStore(ListStore<D> store)
Sets the combo's store.

パラメータ:
store - the store

setTemplate

public void setTemplate(Template template)
Sets the template to be used to render each item in the drop down.

パラメータ:
template - the template

setValue

public void setValue(D value)
Description copied from class: Field
Sets a data value into the field and validates it. If the field is rendered, To set the value directly without validation see Field.setRawValue(java.lang.String).

オーバーライド:
setValue in class TextField<D extends ModelData>
パラメータ:
value - the value to set

setValueField

public void setValueField(java.lang.String valueField)
The underlying data value name to bind to this ComboBox.

パラメータ:
valueField - the value field