Ontimize 5.2072EN

com.ontimize.gui.field
Class ComboDataField

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.ontimize.gui.field.DataField
                      extended bycom.ontimize.gui.field.ComboDataField
All Implemented Interfaces:
AccessForm, javax.accessibility.Accessible, ApplicationPreferencesListener, DataComponent, java.util.EventListener, FormComponent, Freeable, HasHelpIdComponent, HasPreferenceComponent, IdentifiedElement, java.awt.image.ImageObserver, Internationalization, java.awt.MenuContainer, SecureElement, java.io.Serializable, ValueChangeDataComponent
Direct Known Subclasses:
BooleanComboDataField, ReferenceComboDataField, TextComboDataField

public abstract class ComboDataField
extends DataField
implements Freeable

This class implements a scrollable list. It is an abstract class to use for all data components showed in a scrollable list.

Author:
Imatia Innovation
See Also:
Serialized Form

Nested Class Summary
protected static class ComboDataField.CustomComboBox
          This class implements a custom combo box.
protected static class ComboDataField.CustomComboBoxEditor
          This class extends the editor component used for JComboBox components.
static class ComboDataField.DefaultCustomComboBoxRenderer
          This class implements the default custom combo box renderer.
static interface ComboDataField.ExtKeySelectionManager
          The interface that defines a KeySelectionManager to selection in the combo.
protected  class ComboDataField.InnerListener
          This class implements a inner listener for field.
 
Nested classes inherited from class com.ontimize.gui.field.DataField
DataField.AuxPanel, DataField.CopyActionListener, DataField.ELabel, DataField.FieldButton, DataField.FieldFocusListener, DataField.InfoMouseListener, DataField.ToggleButton
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String DATEFORMAT
          Date format pattern string key to convert the data field dates values.
static java.lang.String FORMAT
          Format pattern string key to convert the data field content value.
protected  FormatPattern formatPattern
          Pattern to format the field contents.
protected  ComboDataField.InnerListener innerListener
          The inner listener instance.
protected  java.util.Locale localeComponente
          The reference to locale.
static java.lang.String NULL_SELECTION
          The key for NULL selection.
protected  boolean nullSelection
           
protected  java.util.Vector values
          Reference to a vector.
 
Fields inherited from class com.ontimize.gui.field.DataField
advancedQueryMode, ALIGN, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, alignment, ASTERISK_REQUIRED_STYLE, ATTR, attribute, backgroundColor, BGCOLOR, bold, BOLD, BORDER, BORDER_REQUIRED_STYLE, borderText, BOTTOM, CENTER, CLIPBOARD_COPY, CLIPBOARD_COPY_es_ES, CLIPBOARD_CUT, CLIPBOARD_CUT_es_ES, CLIPBOARD_PASTE, CLIPBOARD_PASTE_es_ES, conditions, dataField, DEFAULT_BORDER, DEFAULT_BOTTOM_MARGIN, DEFAULT_FIELD_LEFT_MARGIN, DEFAULT_FIELD_RIGHT_MARGIN, DEFAULT_LABEL_LEFT_MARGIN, DEFAULT_LABEL_RIGHT_MARGIN, DEFAULT_PARENT_MARGIN, DEFAULT_PARENT_MARGIN_FOR_SCROLL, DEFAULT_TOP_MARGIN, defaultAsteriskColor, DEFAULTBORDER, defaultDisableBackgroundColor, defaultFieldButtonHigh, defaultPreferenceTextNotRetrievedFromPreferences, DEFINE_HELP_FIELD_PREFERENCE, dim, DIM, disabledbgcolor, DISABLEDBGCOLOR, empty, enabled, ENABLED, FIELD_HELP_TIP, fieldlistenerFocus, fieldSize, fireValueEvents, FOCUS_BACKGROUNDCOLOR, FONT, fontColor, FONTCOLOR, fontSize, FONTSIZE, height, HEIGHT, incrementalFont, initPreferenceHelpText, isEnabled, LABELALIGN, labelComponent, LABELFONT, LABELFONTCOLOR, labelPosition, LABELPOSITION, LABELSIZE, labelText, LABELVISIBLE, LEFT, locale, LOWERED, menuCopy, menuCut, menuDefineHelpPreference, menuHelpPreferences, menuPaste, modifiable, NO_STR, NONE, noRequiredBorder, OPAQUE, originalSize, OUTBORDER, panel, parentForm, permissionActivate, permissionVisible, popupMenu, RAISED, redimensionPanel, redimensJTextField, required, REQUIRED, requiredBorder, REQUIREDBORDER, requiredFieldBackgroundColor, resources, restricted, RIGHT, show, showLabel, SIZE, TEXT_STR, TEXTALIGN, textAlignment, textHelpPreference, TIP, tipKey, TOP, validData, VALIGN, Valignment, valueListener, valueSave, VISIBLE, VISUALIZE_HELP_FIELD_PREFERENCE, weightDataFieldH, weightPanelH, width, WIDTH, x, X, y, Y, YES_STR
 
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 com.ontimize.gui.field.DataComponent
COMP_FOCUS_YELLOW, GREEN_VERY_LIGHT, LIGHT_GRAY_BLUE, LIGHT_GREYISH_BLUE, VERY_LIGHT_BLUE, VERY_LIGHT_GRAY, VERY_LIGHT_PINK, VERY_LIGHT_RED, VERY_LIGHT_SKYBLUE, VERY_LIGHT_YELLOW, VERY_LIGHT_YELLOW_2
 
Fields inherited from interface com.ontimize.gui.field.FormComponent
DEBUG
 
Fields inherited from interface com.ontimize.gui.i18n.Internationalization
DEBUG_LANGUAGE
 
Fields inherited from interface com.ontimize.gui.SecureElement
DESACTIVATE_COMPONENT_BY_PERMISSION_TIP
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, PROPERTIES, SOMEBITS
 
Constructor Summary
ComboDataField()
          Class constructor.
ComboDataField(javax.swing.JComboBox combo)
          Class constructor with combo parameter.
 
Method Summary
 void deleteData()
          The method to delete data for component.
 void free()
          Makes the object to release the resources.
protected  java.lang.Object getInnerValue()
          Gets the inner value.
 java.lang.Object getValue()
          Gets the value for combo.
 java.util.Vector getValues()
          Gets the value vector.
 void init(java.util.Hashtable parameters)
          Installs the inner listener and calls to super for initialize parameters.
protected  void installInnerListener()
          Installs the inner listener.
 boolean isEmpty()
          Checks the data existence in component.
protected  boolean isInnerValueEqual(java.lang.Object value)
          Compares the inner value with parameter value.
 boolean isModified()
          This method should be return true when data have been modified.
 void setComponentLocale(java.util.Locale l)
           
protected  void setInnerListenerEnabled(boolean enabled)
          This method allows to enable/disable the ValueEvent events notifier.
protected  void setInnerValue(java.lang.Object o)
          Sets the inner value
 void setResourceBundle(java.util.ResourceBundle resource)
          Sets the language resource bundle.
 void setSelected(int index)
          Sets selected an index.
 void setValue(java.lang.Object value)
          Establishes the combo values.
 void setValues(java.util.Vector values)
          Sets a fixed value vector to show in scrollable combo.
 void updateUI()
           
 
Methods inherited from class com.ontimize.gui.field.DataField
addFocusListener, addHelpMenuPopup, addValueChangeListener, changeButton, changeOpacity, checkDefineHelpPermission, checkEnabledPermission, checkVisiblePermission, configurePopupMenuHelp, createFocusListener, createInstanceConditionCombo, createPopupMenu, defineHelpField, finalize, fireValueChanged, getAttribute, getBorder, getConstraints, getDataField, getDisabledbgcolor, getFontColor, getHelpIdString, getHelpPreferenceKey, getLabelComponent, getLabelComponentText, getLabelFontColor, getLabelText, getParentForm, getPreferenceHelpText, getText, getTextsToTranslate, getValueChangeListeners, hasHelpInPreferences, initPermissions, initPreferences, installFocusListener, installHelpId, installPopupMenuListener, installPreferenceHelpListener, isAdvancedQueryMode, isEnabled, isHidden, isLabelVisible, isModifiable, isRequired, isRestricted, parseBoolean, preferenceChanged, removeFocusListener, removeValueChangeListener, requestFocus, seeHelpField, setBold, setDisabledbgcolor, setEnabled, setFont, setFontColor, setFontSize, setLabelFontColor, setModifiable, setParentForm, setRequired, setRequiredFieldBackground, setVisible, showPopupMenu, updateBackgroundColor, updateBackgroundColor, updateFont, updateTip, validateComponentPositions
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ontimize.gui.field.DataComponent
getSQLDataType
 

Field Detail

FORMAT

public static final java.lang.String FORMAT
Format pattern string key to convert the data field content value.

Since:
Ontimize 5.2059EN
See Also:
ReferenceExtDataField.DATEFORMAT, Constant Field Values

DATEFORMAT

public static final java.lang.String DATEFORMAT
Date format pattern string key to convert the data field dates values.

Since:
Ontimize 5.2059EN
See Also:
ReferenceExtDataField.FORMAT, Constant Field Values

localeComponente

protected java.util.Locale localeComponente
The reference to locale. By default, null.


values

protected java.util.Vector values
Reference to a vector. By default, null.


formatPattern

protected FormatPattern formatPattern
Pattern to format the field contents. Null if the format parameter is missing. Also wrappers the content of the dateformat parameter.

Since:
Ontimize 5.2059EN

innerListener

protected ComboDataField.InnerListener innerListener
The inner listener instance.


NULL_SELECTION

public static final java.lang.String NULL_SELECTION
The key for NULL selection.

See Also:
Constant Field Values

nullSelection

protected boolean nullSelection
Constructor Detail

ComboDataField

public ComboDataField()
Class constructor. Creates the component, sets the selected index and adds a renderer.


ComboDataField

public ComboDataField(javax.swing.JComboBox combo)
Class constructor with combo parameter. Only sets the renderer and fix the dataField variable.

Parameters:
combo - the combo
Method Detail

init

public void init(java.util.Hashtable parameters)
Installs the inner listener and calls to super for initialize parameters.

Specified by:
init in interface FormComponent
Overrides:
init in class DataField
Parameters:
parameters - the Hashtable with parameters

attribute values default required meaning
attr yes The attribute to manage the field.
dim no/text/yes no no The resize possibilities (no resize, resize the insertion space, resize the space between label and text ).
size 10 no The size of text in number of characters.
align center/left/right center no The alignment for field.
visible yes/no yes no The visibility condition.
required yes/no no no The required condition.
fontsize no The font size.
fontcolor no The font color.
bgcolor no The background color.
labelsize no The label size in number of characters.
labelvisible yes/no yes The label visibility.
border default/none/raised/lowered or a color defined in ColorConstants. Moreover, it is also allowed a border defined in #BorderManager no The border for datafield
tip no The tip for data field.
textalign center/right/left no The text alignment.
labelposition top/bottom/right/left no The label position.
outborder default/none/raised/lowered or a color defined in ColorConstants no The out border.
enabled yes/no yes no The field activation.
text attr no Alternative for attr text.
labelalign left/right/center left no The label alignment.
labelfontcolor black no The font color for label in field
font A string like : 'Arial-BOLD-18' (See #Font.decode()) The default font for system no Font for data field.
opaque yes/no no no Data field opacity condition
labelfont no The type of font for label of data field
requiredborder yes/no no no The border requirement condition. If it is specified to 'yes', it will be fixed to #BorderManager.DEFAULT_DATA_FIELD_REQUIRED_BORDE
disabledbgcolor no The background color when data field is disabled.

updateUI

public void updateUI()
Overrides:
updateUI in class DataField

isEmpty

public boolean isEmpty()
Description copied from interface: DataComponent
Checks the data existence in component.

Specified by:
isEmpty in interface DataComponent
Returns:
true when component is empty

deleteData

public void deleteData()
Description copied from interface: DataComponent
The method to delete data for component.

Specified by:
deleteData in interface DataComponent

setValues

public void setValues(java.util.Vector values)
Sets a fixed value vector to show in scrollable combo.

Parameters:
values - the vector with values.

getValues

public java.util.Vector getValues()
Gets the value vector.

Returns:
the value vector

setValue

public void setValue(java.lang.Object value)
Establishes the combo values. If value parameter is a string array or a vector, values are added to combo one by one. If value is null, data are deleted.

Specified by:
setValue in interface DataComponent
Parameters:
value - the object to set the value.

getValue

public java.lang.Object getValue()
Gets the value for combo.

Specified by:
getValue in interface DataComponent
Returns:
the value
See Also:
JComboBox.getSelectedItem()

setComponentLocale

public void setComponentLocale(java.util.Locale l)
Specified by:
setComponentLocale in interface Internationalization
Overrides:
setComponentLocale in class DataField

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle resource)
Description copied from interface: Internationalization
Sets the language resource bundle. When the application changes the configured language, for all the objects that implement this interface this method must be called with the new file.
The method must translate all the elements that have texts in the GUI

Specified by:
setResourceBundle in interface Internationalization
Overrides:
setResourceBundle in class DataField

setSelected

public void setSelected(int index)
Sets selected an index.

Parameters:
index - the index to select

installInnerListener

protected void installInnerListener()
Installs the inner listener.


getInnerValue

protected java.lang.Object getInnerValue()
Gets the inner value.

Returns:
the inner value

setInnerValue

protected void setInnerValue(java.lang.Object o)
Sets the inner value

Parameters:
o - the object to set the inner value

isInnerValueEqual

protected boolean isInnerValueEqual(java.lang.Object value)
Compares the inner value with parameter value.

Parameters:
value - the value
Returns:
the true or false comparation

setInnerListenerEnabled

protected void setInnerListenerEnabled(boolean enabled)
This method allows to enable/disable the ValueEvent events notifier. So, inner events will be not triggered when inner listener is disabled. It is advisable disabling the listener only when content is inserted by program.

Parameters:
enabled - the condition to enable/disable the inner listener.

isModified

public boolean isModified()
Description copied from interface: DataComponent
This method should be return true when data have been modified. The method setValue() should be change this condition.

Specified by:
isModified in interface DataComponent
Overrides:
isModified in class DataField

free

public void free()
          throws java.lang.Exception
Description copied from interface: Freeable
Makes the object to release the resources.

Specified by:
free in interface Freeable
Throws:
java.lang.Exception

Ontimize