|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent com.jidesoft.combobox.AbstractComboBox com.jidesoft.combobox.CalculatorComboBox
public class CalculatorComboBox
CalculatorComboBox is an AbstractComboBox that uses Calculator as popup panel. It is a ideal input field if you want to input a double value especially user might want to do some simple arithmetic calculation. For example, user can type in "10*24" directly in the text field of the combobox and get the result "240" displayed in the text field.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jidesoft.combobox.AbstractComboBox |
---|
AbstractComboBox.AccessibleJComboBox, AbstractComboBox.ComboBoxSpinner, AbstractComboBox.ComboBoxTextField, AbstractComboBox.DefaultRendererComponent, AbstractComboBox.DefaultTextFieldEditorComponent, AbstractComboBox.EditorComponent, AbstractComboBox.EnterLazyDelegateAction, AbstractComboBox.SpinnerEditorComponent |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class com.jidesoft.combobox.AbstractComboBox |
---|
_dialog, _editable, _editor, _listDataListener, _oldSelectedItemReminder, _popupButton, _popupPanel, _renderer, actionCommand, CLIENT_PROPERTY_HIDE_POPUP_ON_LIST_DATA_CHANGED, CLIENT_PROPERTY_TABLE_CELL_EDITOR, CLIENT_PROPERTY_TABLE_CELL_RENDERER, COMMIT, COMMIT_OR_RESET, COMMIT_OR_REVERT, dataModel, DIALOG, DROPDOWN, HIDE_POPUP_KEY, PERSIST, PROPERTY_SELECTED_ITEM, RESET, REVERT, selectedItemReminder |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
CalculatorComboBox()
|
|
CalculatorComboBox(Class<?> clazz)
|
Method Summary | |
---|---|
protected String |
convertElementToString(Object value)
|
protected Calculator |
createCalculator()
|
AbstractComboBox.EditorComponent |
createEditorComponent()
Subclass should implement this method to create the actual editor component. |
PopupPanel |
createPopupComponent()
Subclass should implement this method to create the actual popup component. |
protected JTextField |
createTextField()
Creates the text field for the editor component of this ComboBox. |
void |
focusGained(FocusEvent e)
|
Calculator |
getCalculator()
|
void |
popupMenuCanceled(PopupMenuEvent e)
|
void |
setSelectedItem(Object anObject,
boolean fireEvent)
Same as AbstractComboBox.setSelectedItem(Object) except you can choose to fire the ItemEvent or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CalculatorComboBox()
public CalculatorComboBox(Class<?> clazz)
Method Detail |
---|
protected Calculator createCalculator()
public AbstractComboBox.EditorComponent createEditorComponent()
AbstractComboBox
createEditorComponent
in class AbstractComboBox
protected JTextField createTextField()
AbstractComboBox
AbstractComboBox.ComboBoxTextField
to replace JTextField. So if you ever override this createTextField to create your own JTextField, use ComboBoxTextField instead. The only difference between JTextField and ComboBoxTextField is ComboBoxTextField implements ProcessKeyBinding
interface and make processKeyBinding(...) a public method so that we can use it to pass the key event to it. Otherwise, you hit a key to start cell editing and the first key will get lost.
createTextField
in class AbstractComboBox
public PopupPanel createPopupComponent()
AbstractComboBox
createPopupComponent
in class AbstractComboBox
public void focusGained(FocusEvent e)
focusGained
in interface FocusListener
focusGained
in class AbstractComboBox
public Calculator getCalculator()
public void setSelectedItem(Object anObject, boolean fireEvent)
AbstractComboBox
AbstractComboBox.setSelectedItem(Object)
except you can choose to fire the ItemEvent or not.
setSelectedItem
in class AbstractComboBox
anObject
- the new valuefireEvent
- true to fire event which is the same as AbstractComboBox.setSelectedItem(Object)
. False if you don't want to fire event.public void popupMenuCanceled(PopupMenuEvent e)
popupMenuCanceled
in interface PopupMenuListener
popupMenuCanceled
in class AbstractComboBox
protected String convertElementToString(Object value)
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |