de.esprit.appsuite.database.dbgui.field

## Class EnumChoiceField<T>

- java.lang.Object
- - java.awt.Component
  - - java.awt.Container
    - - javax.swing.JComponent
      - - javax.swing.JComboBox
        - - de.esprit.common.gui.ZComboBox
          - - de.esprit.appsuite.database.dbgui.field.AbstractChoiceField<T>
            - - de.esprit.appsuite.database.dbgui.field.EnumChoiceField<T>

- All Implemented Interfaces:
    Field<T>, Clearable, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ListDataListener
  Direct Known Subclasses:
    CompressionLevelChoiceField, CountryChoiceField, FilterChoiceField, LanguageChoiceField, LogLevelChoiceField

      public class EnumChoiceField<T>
      extends AbstractChoiceField<T>

  This field presents the available enums for choice
  Author:
    Rainer Buesch
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class javax.swing.JComboBox

      `javax.swing.JComboBox.AccessibleJComboBox, javax.swing.JComboBox.KeySelectionManager`

    - ### Nested classes/interfaces inherited from class javax.swing.JComponent

      `javax.swing.JComponent.AccessibleJComponent`

    - ### Nested classes/interfaces inherited from class java.awt.Container

      `java.awt.Container.AccessibleAWTContainer`

    - ### Nested classes/interfaces inherited from class java.awt.Component

      `java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

  - ### Field Summary

    - ### Fields inherited from class javax.swing.JComboBox

      `actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, 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

    Constructors
    Constructor and Description
    `EnumChoiceField(NlsDatabaseKey nls, boolean isNotNull)` This constructor requires `createEnumValues()` to be overridden for creating the available values.
    `EnumChoiceField(NlsDatabaseKey nls, java.lang.Class enumClass)`
    `EnumChoiceField(NlsDatabaseKey nls, java.lang.Class enumClass, boolean isNotNull)`
    `EnumChoiceField(NlsDatabaseKey nls, java.util.EnumSet values)`
    `EnumChoiceField(NlsDatabaseKey nls, java.util.EnumSet values, boolean isNotNull)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.util.Collection<T>` | `createEnumValues()` Must be overridden if no values are passed via Constructor
    `protected T` | `getNullItem()`
    `T` | `getSelectedItem()`
    `java.lang.String` | `getStringValue()` Returns the field value as a String - or an empty String if the field is empty.
    `protected boolean` | `hasNullItem()` Defines whether this ChoiceField should have a NullItem.
    `protected void` | `loadItems()`

    - ### Methods inherited from class de.esprit.appsuite.database.dbgui.field.AbstractChoiceField

      `applyInsertDefaultValue, clear, clearItems, createNullItem, createValue, findItemByText, fire, getIntValue, getJLabel, getLabel, getName, getNlsKey, getUnitComponent, getValue, getWidget, inputEquals, inputEquals, inputEquals, inputEquals, isEmpty, isLocked, isNotNull, isNullSelected, isPrimaryKey, isRecordTypeField, isStretchableX, isStretchableY, loadItems, setColumnMaxChars, setInsertDefaultValue, setLocked, setModifyFlag, setNotNull, setPrimaryKey, setStretchableX, setStretchableY, setUnitComponent, setUnitString, setValue, setValueNumb, toString, toString, toValue`

    - ### Methods inherited from class de.esprit.common.gui.ZComboBox

      `actionPerformed, addItems, addItems, contains, fireActionEvent, fireItemStateChanged, indexOf, isNumb, replaceItem, setNumb`

    - ### Methods inherited from class javax.swing.JComboBox

      `actionPropertyChanged, addActionListener, addItem, addItemListener, addPopupMenuListener, configureEditor, configurePropertiesFromAction, contentsChanged, createActionPropertyChangeListener, createDefaultKeySelectionManager, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getAction, getActionCommand, getActionListeners, getEditor, getItemAt, getItemCount, getItemListeners, getKeySelectionManager, getMaximumRowCount, getModel, getPopupMenuListeners, getPrototypeDisplayValue, getRenderer, getSelectedIndex, getSelectedObjects, getUI, getUIClassID, hidePopup, insertItemAt, installAncestorListener, intervalAdded, intervalRemoved, isEditable, isLightWeightPopupEnabled, isPopupVisible, paramString, processKeyEvent, removeActionListener, removeAllItems, removeItem, removeItemAt, removeItemListener, removePopupMenuListener, selectedItemChanged, selectWithKeyChar, setAction, setActionCommand, setEditable, setEditor, setEnabled, setKeySelectionManager, setLightWeightPopupEnabled, setMaximumRowCount, setModel, setPopupVisible, setPrototypeDisplayValue, setRenderer, setSelectedIndex, setSelectedItem, setUI, showPopup, updateUI`

    - ### Methods inherited from class javax.swing.JComponent

      `addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update`

    - ### Methods inherited from class java.awt.Container

      `add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree`

    - ### Methods inherited from class java.awt.Component

      `action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### EnumChoiceField

          public EnumChoiceField(NlsDatabaseKey nls,
                         java.lang.Class enumClass)

    - #### EnumChoiceField

          public EnumChoiceField(NlsDatabaseKey nls,
                         java.lang.Class enumClass,
                         boolean isNotNull)

    - #### EnumChoiceField

          public EnumChoiceField(NlsDatabaseKey nls,
                         java.util.EnumSet values)

    - #### EnumChoiceField

          public EnumChoiceField(NlsDatabaseKey nls,
                         java.util.EnumSet values,
                         boolean isNotNull)

    - #### EnumChoiceField

          public EnumChoiceField(NlsDatabaseKey nls,
                         boolean isNotNull)

      This constructor requires `createEnumValues()` to be overridden for creating the available values.

  - ### Method Detail

    - #### getSelectedItem

          public T getSelectedItem()

      Overrides:
        `getSelectedItem` in class `javax.swing.JComboBox`

    - #### getNullItem

          protected T getNullItem()

      Overrides:
        `getNullItem` in class `AbstractChoiceField<T>`

    - #### createEnumValues

          protected java.util.Collection<T> createEnumValues()

      Must be overridden if no values are passed via Constructor

    - #### loadItems

          protected void loadItems()

      Overrides:
        `loadItems` in class `AbstractChoiceField<T>`

    - #### hasNullItem

          protected boolean hasNullItem()

      Description copied from class: `AbstractChoiceField`
      Defines whether this ChoiceField should have a NullItem. A NullItem is only created when this method returns true.
      Overrides:
        `hasNullItem` in class `AbstractChoiceField<T>`

    - #### getStringValue

          public java.lang.String getStringValue()

      Description copied from interface: `Field`
      Returns the field value as a String - or an empty String if the field is empty.
      Specified by:
        `getStringValue` in interface `Field<T>`
      Overrides:
        `getStringValue` in class `AbstractChoiceField<T>`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.