Ontimize 5.2072EN

com.ontimize.gui.field
Class ReferenceComboDataField

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
                          extended bycom.ontimize.gui.field.ReferenceComboDataField
All Implemented Interfaces:
AccessForm, javax.accessibility.Accessible, AdvancedDataComponent, ApplicationPreferencesListener, CachedComponent, CreateForms, DataComponent, java.util.EventListener, FormComponent, Freeable, HasHelpIdComponent, HasPreferenceComponent, IdentifiedElement, IFilterElement, java.awt.image.ImageObserver, Internationalization, ITemplateField, java.awt.MenuContainer, OpenDialog, ReferenceComponent, ReferenceDataComponent, SecureElement, java.io.Serializable, ValueChangeDataComponent
Direct Known Subclasses:
ComboReferenceCellEditor.ExtCampoComboRef, ComboReferenceCellRenderer

public class ReferenceComboDataField
extends ComboDataField
implements AdvancedDataComponent, ReferenceComponent, CachedComponent, IFilterElement, ReferenceDataComponent, ITemplateField

The main class to create a classic Reference Data Field except that the data deployment is implemented in the combo. This component also implements a data cache.

Author:
Imatia Innovation
See Also:
Serialized Form

Nested Class Summary
protected  class ReferenceComboDataField.CodeFieldListener
          The code field listener to manage the codeChange value in function of events.
protected  class ReferenceComboDataField.DeployedList
           
protected static class ReferenceComboDataField.ExtCustomComboBox
           
 class ReferenceComboDataField.MultiColumnComboRenderer
          Class for a multicolumn combo renderer.
 
Nested classes inherited from class com.ontimize.gui.field.ComboDataField
ComboDataField.CustomComboBox, ComboDataField.CustomComboBoxEditor, ComboDataField.DefaultCustomComboBoxRenderer, ComboDataField.ExtKeySelectionManager, ComboDataField.InnerListener
 
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
protected  javax.swing.JMenuItem advancedQuery
          A menu for an advanced query text.
protected  java.lang.String applyMask
          The mask to apply, by default, null.
protected  java.lang.String attrAux
          A reference for a possible auxiliary attribute.
protected  CacheManager cacheManager
          The reference to cache manager.
protected  int cacheTime
          The cache time.
protected  java.lang.String code
          The string code.
protected  javax.swing.JTextField codeField
          A reference to code field.
protected  ReferenceComboDataField.CodeFieldListener codeFieldListener
          A reference to code field listener.
protected  boolean codeNumber
          The condition about existence of code number.
protected  int codeNumberClass
          The code number class.
protected  java.lang.String codeQueryField
          The code query field key.
protected  boolean codVisible
          The condition about visible cod.
protected  java.util.Vector cols
          The columns vector.
protected  java.util.Hashtable dataCache
          The dataCache implementation.
protected  boolean dataCacheInitialized
          The condition about data cache initialization.
protected  boolean dataRecordListenerReady
          True when DataRecordListener is registered in the detail form
static boolean defaultDisableOnParentkeyNull
           
static boolean defaultIgnoreNullOnSetValueSet
           
static boolean defaultParentkeyListener
           
static java.lang.String defaultParentkeyListenerEvent
           
protected  ReferenceComboDataField.DeployedList deployedList
          A reference to deployed list.
protected  javax.swing.JButton detailButton
          A reference to detail button.
protected  java.awt.event.ActionListener detailButtonListener
          A reference for detail button listener.
static java.lang.String DISABLE_ON_PARENTKEY_NULL
           
protected  boolean disableonparentkeynull
          Indicates whether this field has disabled when parentkey field is null.
protected  java.lang.String entityName
          The entity name.
protected  java.lang.String formName
          The form name.
protected  java.util.Hashtable hOnSetValueSetEquivalences
          This object is used to store onsetvalueset attributes and equivalences (for these fields in entity) when structure of parameter onsetvalueset is: "fieldonset1:fieldentitypk1;fieldonset2:fieldentitypk2;...fieldonsetn:fieldentitypkn"
protected  java.util.Hashtable hParentkeyEquivalences
          This object is used to store parentkeys and equivalences (for these fields in entity) when structure of parameter parentkeys is: "fieldpk1:fieldentitypk1;fieldpk2:fieldentitypk2;...fieldpkn:fieldentitypkn"
static java.lang.String IGNORE_NULL_ONSETVALUESET
          Key used for xml parameter 'ignorenullonsetvalueset'
protected  boolean ignorenullonsetvalueset
          Indicates if fields contained into 'onsetvalueset' have to be deleted on null value of the field.
protected  boolean initCacheOnSetValue
          The condition about initialize cache on set value.
protected  boolean integerValue
          The condition of integer value.
protected  long lastCacheTime
          The last cache time variable.
protected  EntityReferenceLocator locator
          The locator reference.
protected  ReferenceExtDataField.MultipleResultWindow multipleResultWindow
          The reference to multiple result window.
protected  java.util.Vector onsetvaluesetAttributes
          The vector with attributes to update when data field value changed.
protected  java.awt.Frame parentFrame
          The parent Frame.
static java.lang.String PARENTKEY_LISTENER
           
static java.lang.String PARENTKEY_LISTENER_EVENT
          Key used for xml parameter 'parentkeylistenerevent'
static java.lang.String PARENTKEY_LISTENER_EVENT_ALL
           
static java.lang.String PARENTKEY_LISTENER_EVENT_PROGRAMMATIC
           
static java.lang.String PARENTKEY_LISTENER_EVENT_USER
           
protected  boolean parentkeyCache
           
protected  boolean parentkeyListener
          Indicates whether this field has registered a listener for each parentkey fields to reset it when one of the values of these parentkeys change (when parentkey field that changes is null it is not reset).
protected  java.lang.String parentkeyListenerEvent
          Indicates the type of event that is taken into consideration on parentkey listener changes.
protected  java.util.Vector parentKeys
          The parent Keys vector.
protected  java.util.Vector queryValues
          A vector for query values.
protected  ReferenceComboDataField.MultiColumnComboRenderer renderer
          A multiple column combo renderer reference.
protected  java.lang.String separator
          The separator.
protected  boolean showErrorMessages
          The condition to show error messages.
static java.lang.String UPDATE_DATA
          The key to update data.
protected  javax.swing.JMenuItem updateData
          A menu with update data text.
protected  boolean useCacheManager
          The condition about cache manager use.
protected  boolean visibleArrowButton
          The condition about visible arrow button.
protected  boolean visibleCodeSearch
          The condition of code visibility of the code in the detail window.
protected  java.util.Vector visibleColumns
          The visible columns vector.
 
Fields inherited from class com.ontimize.gui.field.ComboDataField
DATEFORMAT, FORMAT, formatPattern, innerListener, localeComponente, NULL_SELECTION, nullSelection, values
 
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.AdvancedDataComponent
ADVANCED_QUERY
 
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 com.ontimize.util.templates.ITemplateField
DATA_TYPE_FIELD, DATA_TYPE_FIELD_ATTR, DATA_TYPE_IMAGE, DATA_TYPE_IMAGE_ATTR, DATA_TYPE_TABLE, DATA_TYPE_TABLE_ATTR, TEMPLATE_DATA_TYPE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, PROPERTIES, SOMEBITS
 
Constructor Summary
ReferenceComboDataField(java.util.Hashtable parameters)
          The constructor for component.
 
Method Summary
protected  void advancedQuery()
          Performs an advanced query.
protected  void createDataRecordListener(Form form)
          Adds a DataRecordListener listener to the detail form.
protected  void createMultipleResultsWindow(Table t)
          Creates the multiple result window.
protected  void createPopupMenu()
          Creates a pop-up menu.
 void deleteData()
          The method to delete data for component.
 void deleteUserData()
           
protected  boolean existFieldsToUpdate(java.util.Hashtable changes, java.util.Hashtable keys)
          Checks the keys and the record values in a register to establish if fields in onsetvaluesetAttributes must be updated
 java.util.Vector getAttributes()
           
 java.lang.String getCodeDescription(java.lang.Object c)
          Gets tje code description.
 javax.swing.JTextField getCodeField()
          Gets the code field.
 java.lang.String getCodeFieldName()
          The name of the code.
protected  java.lang.Object getCodeFieldValue()
          Gets the code field value.
 java.lang.String getCodeSearchField()
           
 java.lang.String getCodeSearchFieldName()
          Gets the code search field name.
 java.util.Hashtable getDataCache()
          Gets the data cache.
 java.lang.String getDebugInfo()
           
 java.awt.event.ActionListener getDetailButtonListener()
          Gets the detail button listener.
 java.lang.String getEntity()
           
protected  long getLastCacheTime()
          Gets the last cache time.
 Table getMultipleResultTable()
          Gets the reference to table with multiple results.
 java.util.List getOnSetValueSetAttributes()
           
 java.util.Hashtable getOnSetValueSetEquivalences()
           
 java.util.Hashtable getParentkeyEquivalences()
          Returns a Hashtable with key-value corresponding with result to apply two 'tokenizer' actions over parentkeys parameter.
 java.util.Vector getParentKeyList()
           
protected  java.lang.Object getParentKeyValue(java.lang.String parentkey)
          Gets the parent key value.
 java.util.Hashtable getParentKeyValues()
           
 ReferenceComboDataField.MultiColumnComboRenderer getRenderer()
          Gets the renderer.
 int getSQLDataType()
          Returns the sql data type according to java.sql.Types
 int getTemplateDataType()
          Returns the data type.
 java.lang.Object getTemplateDataValue()
          Gets the value to show in the template
 java.lang.String getText()
          Gets text.
 java.util.Vector getTextsToTranslate()
          Returns all the texts in the element suitable for being translated.
 java.lang.String getToolTipText(java.awt.event.MouseEvent e)
           
protected  java.lang.Object getTypedInnerValue(java.lang.Object s)
          Obtains the typed value from parameter.
 java.lang.Object getValue()
          Gets the value of a component.
 java.util.Hashtable getValuesToCode(java.lang.Object code)
          Returns the associated combo values for a code.
 boolean hasParentKeys()
           
 void init(java.util.Hashtable parameters)
          Initializes parameters.
 void initCache()
          Inits cache.
protected  void initDeployedList()
           
protected  void installInnerListener()
          Installs the inner listener.
protected  void installPopupMenuListener()
          Installs a pop-up menu listener.
 void invalidateCache()
          Invalidates the data cache.
 boolean isCacheManagerUsed()
          Returns whether cache manager is used.
 boolean isCodeFieldVisible()
          Checks whether the codefield is visible.
 boolean isCodeSearchVisible()
          Checks whether the code search is visible.
 boolean isEmpty()
          Checks the data existence in component.
 boolean isParentkeyListener()
           
protected  void listWillShow()
          Shows the pop-up combo.
protected  void popupWillHide()
          Hides the pop-up combo.
protected  void popupWillShow()
          Pops up the combo when pop-up button is pressed.
 EntityResult queryBy(java.lang.String column, java.lang.Object value)
          Establishes the query
protected  EntityResult queryByCod(java.lang.Object code)
          Performs a query by cod.
 void registerParentkeyValueChangeListeners()
           
 java.util.Hashtable replaceParentkeyByEquivalence(java.util.Hashtable hParentkeyEquivalences)
           
 void setAdvancedQueryMode(boolean enabled)
          This method must establish the advanced query state, to support advanced query conditions.
 void setCacheManager(CacheManager cm)
           
protected  void setCode(java.lang.Object codeValue, int valueEventType)
          Sets the code in function of event value.
 void setEnabled(boolean en)
          Description method to set enabled or not the component according the boolean condition in parameter.
 void setFormBuilder(FormBuilder builder)
           
protected  void setInnerListenerEnabled(boolean enabled)
          This method allows to enable/disable the ValueEvent events notifier.
 void setParentForm(Form f)
          Method declaration to set the form that contains the component.
 void setParentFrame(java.awt.Frame parentFrame)
          This method is called from Form for each component that implements this interface.
 void setParentkeyListener(boolean parentkeyListener)
           
 void setQueryValues(java.util.Vector v)
           
 void setReferenceLocator(EntityReferenceLocator busc)
          Establishes the reference locator that will be used by component.
 void setResourceBundle(java.util.ResourceBundle resources)
          Sets the language resource bundle.
 void setUseCacheManager(boolean cacheManager)
          Sets the cache manager.
 void setValue(java.lang.Object value)
          Sets the value for component.
 void setValue(java.lang.Object value, boolean inner)
          Establishes the field value.
protected  void showPopupMenu(java.awt.Component c, int x, int y)
          Shows the pop-up menu.
protected  void updateBackgroundColor()
          Updates the background color.
protected  void updateDataCache(java.util.Hashtable updateAttributes, java.util.Hashtable updateKeys)
          Updates the data cache with specified values
protected  void updateOnSetValueSetAttributes(java.util.Hashtable data)
          Parameters on this method are used to update the fields whose attributes are contained in onsetvaluesetAttributes
 
Methods inherited from class com.ontimize.gui.field.ComboDataField
free, getInnerValue, getValues, isInnerValueEqual, isModified, setComponentLocale, setInnerValue, setSelected, setValues, updateUI
 
Methods inherited from class com.ontimize.gui.field.DataField
addFocusListener, addHelpMenuPopup, addValueChangeListener, changeButton, changeOpacity, checkDefineHelpPermission, checkEnabledPermission, checkVisiblePermission, configurePopupMenuHelp, createFocusListener, createInstanceConditionCombo, defineHelpField, finalize, fireValueChanged, getAttribute, getBorder, getConstraints, getDataField, getDisabledbgcolor, getFontColor, getHelpIdString, getHelpPreferenceKey, getLabelComponent, getLabelComponentText, getLabelFontColor, getLabelText, getParentForm, getPreferenceHelpText, getValueChangeListeners, hasHelpInPreferences, initPermissions, initPreferences, installFocusListener, installHelpId, installPreferenceHelpListener, isAdvancedQueryMode, isEnabled, isHidden, isLabelVisible, isModifiable, isRequired, isRestricted, parseBoolean, preferenceChanged, removeFocusListener, removeValueChangeListener, requestFocus, seeHelpField, setBold, setDisabledbgcolor, setFont, setFontColor, setFontSize, setLabelFontColor, setModifiable, setRequired, setRequiredFieldBackground, setVisible, 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, 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
getLabelComponentText, isHidden, isModifiable, isModified, isRequired, setModifiable, setRequired
 
Methods inherited from interface com.ontimize.gui.field.FormComponent
getConstraints, isEnabled, setVisible
 
Methods inherited from interface com.ontimize.gui.i18n.Internationalization
setComponentLocale
 
Methods inherited from interface com.ontimize.gui.field.IdentifiedElement
getAttribute
 
Methods inherited from interface com.ontimize.gui.SecureElement
initPermissions, isRestricted
 
Methods inherited from interface com.ontimize.gui.field.ReferenceDataComponent
getParentForm
 

Field Detail

PARENTKEY_LISTENER

public static final java.lang.String PARENTKEY_LISTENER
See Also:
Constant Field Values

DISABLE_ON_PARENTKEY_NULL

public static final java.lang.String DISABLE_ON_PARENTKEY_NULL
See Also:
Constant Field Values

PARENTKEY_LISTENER_EVENT

public static final java.lang.String PARENTKEY_LISTENER_EVENT
Key used for xml parameter 'parentkeylistenerevent'

Since:
Ontimize 5.2068-06EN
See Also:
Constant Field Values

PARENTKEY_LISTENER_EVENT_ALL

public static final java.lang.String PARENTKEY_LISTENER_EVENT_ALL
See Also:
Constant Field Values

PARENTKEY_LISTENER_EVENT_USER

public static final java.lang.String PARENTKEY_LISTENER_EVENT_USER
See Also:
Constant Field Values

PARENTKEY_LISTENER_EVENT_PROGRAMMATIC

public static final java.lang.String PARENTKEY_LISTENER_EVENT_PROGRAMMATIC
See Also:
Constant Field Values

defaultParentkeyListenerEvent

public static java.lang.String defaultParentkeyListenerEvent

defaultParentkeyListener

public static boolean defaultParentkeyListener

defaultDisableOnParentkeyNull

public static boolean defaultDisableOnParentkeyNull

IGNORE_NULL_ONSETVALUESET

public static final java.lang.String IGNORE_NULL_ONSETVALUESET
Key used for xml parameter 'ignorenullonsetvalueset'

Since:
Ontimize 5.2068-06EN
See Also:
Constant Field Values

defaultIgnoreNullOnSetValueSet

public static boolean defaultIgnoreNullOnSetValueSet

parentFrame

protected java.awt.Frame parentFrame
The parent Frame. By default, null.


multipleResultWindow

protected ReferenceExtDataField.MultipleResultWindow multipleResultWindow
The reference to multiple result window. By default, null.


visibleCodeSearch

protected boolean visibleCodeSearch
The condition of code visibility of the code in the detail window. By default, false.


hOnSetValueSetEquivalences

protected java.util.Hashtable hOnSetValueSetEquivalences
This object is used to store onsetvalueset attributes and equivalences (for these fields in entity) when structure of parameter onsetvalueset is: "fieldonset1:fieldentitypk1;fieldonset2:fieldentitypk2;...fieldonsetn:fieldentitypkn"


UPDATE_DATA

public static java.lang.String UPDATE_DATA
The key to update data.


codeQueryField

protected java.lang.String codeQueryField
The code query field key. By default, null.


deployedList

protected ReferenceComboDataField.DeployedList deployedList
A reference to deployed list. By default, null.


queryValues

protected java.util.Vector queryValues
A vector for query values. By default, null.


hParentkeyEquivalences

protected java.util.Hashtable hParentkeyEquivalences
This object is used to store parentkeys and equivalences (for these fields in entity) when structure of parameter parentkeys is: "fieldpk1:fieldentitypk1;fieldpk2:fieldentitypk2;...fieldpkn:fieldentitypkn"


showErrorMessages

protected boolean showErrorMessages
The condition to show error messages. By default, true.


detailButton

protected javax.swing.JButton detailButton
A reference to detail button. By default, null.


formName

protected java.lang.String formName
The form name. By default, null.


dataRecordListenerReady

protected boolean dataRecordListenerReady
True when DataRecordListener is registered in the detail form


onsetvaluesetAttributes

protected java.util.Vector onsetvaluesetAttributes
The vector with attributes to update when data field value changed. By default, null.


ignorenullonsetvalueset

protected boolean ignorenullonsetvalueset
Indicates if fields contained into 'onsetvalueset' have to be deleted on null value of the field.

Since:
5.2068EN-0.6

parentkeyListener

protected boolean parentkeyListener
Indicates whether this field has registered a listener for each parentkey fields to reset it when one of the values of these parentkeys change (when parentkey field that changes is null it is not reset).

Since:
5.2057EN-1.4

parentkeyListenerEvent

protected java.lang.String parentkeyListenerEvent
Indicates the type of event that is taken into consideration on parentkey listener changes.

Since:
5.2068EN-0.6

disableonparentkeynull

protected boolean disableonparentkeynull
Indicates whether this field has disabled when parentkey field is null.

Since:
5.2057EN-1.4

codeFieldListener

protected ReferenceComboDataField.CodeFieldListener codeFieldListener
A reference to code field listener.


renderer

protected ReferenceComboDataField.MultiColumnComboRenderer renderer
A multiple column combo renderer reference. By default, null.


integerValue

protected boolean integerValue
The condition of integer value. By default, false.


codeNumber

protected boolean codeNumber
The condition about existence of code number. By default, false.


codeNumberClass

protected int codeNumberClass
The code number class. By default, it is referred to integer code.


code

protected java.lang.String code
The string code. By default, null.


locator

protected EntityReferenceLocator locator
The locator reference. By default, null.


codeField

protected javax.swing.JTextField codeField
A reference to code field. By default, null.


parentKeys

protected java.util.Vector parentKeys
The parent Keys vector. By default, null.


entityName

protected java.lang.String entityName
The entity name. By default, null.


attrAux

protected java.lang.String attrAux
A reference for a possible auxiliary attribute. By default, null.


cols

protected java.util.Vector cols
The columns vector. By default, null.


visibleColumns

protected java.util.Vector visibleColumns
The visible columns vector. By default, null.


codVisible

protected boolean codVisible
The condition about visible cod. By default, false.


applyMask

protected java.lang.String applyMask
The mask to apply, by default, null.


cacheTime

protected int cacheTime
The cache time. By default, 600000.


parentkeyCache

protected boolean parentkeyCache

lastCacheTime

protected long lastCacheTime
The last cache time variable. By default, 0 to perform a query always the first time that combo is deployed.


dataCache

protected java.util.Hashtable dataCache
The dataCache implementation.


separator

protected java.lang.String separator
The separator. By default, " ".


updateData

protected javax.swing.JMenuItem updateData
A menu with update data text.


advancedQuery

protected javax.swing.JMenuItem advancedQuery
A menu for an advanced query text.


visibleArrowButton

protected boolean visibleArrowButton
The condition about visible arrow button. By default, true.


cacheManager

protected CacheManager cacheManager
The reference to cache manager. By default, null.


useCacheManager

protected boolean useCacheManager
The condition about cache manager use. By default, true.


initCacheOnSetValue

protected boolean initCacheOnSetValue
The condition about initialize cache on set value. By default, false.


dataCacheInitialized

protected boolean dataCacheInitialized
The condition about data cache initialization. By default, false.


detailButtonListener

protected java.awt.event.ActionListener detailButtonListener
A reference for detail button listener. By default, null.

Constructor Detail

ReferenceComboDataField

public ReferenceComboDataField(java.util.Hashtable parameters)
The constructor for component. Calls to init(Hashtable).

Parameters:
parameters - the hashtable with parameters
Method Detail

getDebugInfo

public java.lang.String getDebugInfo()

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent e)

updateOnSetValueSetAttributes

protected void updateOnSetValueSetAttributes(java.util.Hashtable data)
Parameters on this method are used to update the fields whose attributes are contained in onsetvaluesetAttributes

Parameters:
data - Values to update

getOnSetValueSetAttributes

public java.util.List getOnSetValueSetAttributes()

getOnSetValueSetEquivalences

public java.util.Hashtable getOnSetValueSetEquivalences()

createDataRecordListener

protected void createDataRecordListener(Form form)
Adds a DataRecordListener listener to the detail form. This one checks when event is an update event and it is necessary to refresh the data cache and fields contained in onsetvaluesetAttributes

Parameters:
form - Form where event is fired

existFieldsToUpdate

protected boolean existFieldsToUpdate(java.util.Hashtable changes,
                                      java.util.Hashtable keys)
Checks the keys and the record values in a register to establish if fields in onsetvaluesetAttributes must be updated

Parameters:
changes - Changes to update
keys - Keys for record to update
Returns:

updateDataCache

protected void updateDataCache(java.util.Hashtable updateAttributes,
                               java.util.Hashtable updateKeys)
Updates the data cache with specified values

Parameters:
updateAttributes - Update values
updateKeys - Keys for records to update

init

public void init(java.util.Hashtable parameters)
Initializes parameters.

attribute values default required meaning
attr cod no The field attribute.
entity yes Associated entity.
dateformat A Java date pattern no Java Date pattern to use in format parameter.
format message;column_1;...;column_N no The field shows the translation with the given message and columns. Example:
-User has a reference combo field that queries an entity with three fields ID;INITIALDATE;ENDDATE. ID is the code of field.
-User wants to format description of this field to show: Period starts: INITIALDATE and ends: ENDDATE
-He only needs to store in bundle a key, e.g., refComboKey= Period starts: {0} and ends: {1}
-He must specify in parameter format="refComboKey;INITIALDATE;ENDDATE"
cod yes The entity column name that matches with the attr.
csize no The number of characters for code field.
parentkeys fieldpk1:fieldentitypk1;fieldpk2:fieldentitypk2;...fieldpkn :fieldentitypkn (since version 5.2057EN-1.4) yes The field that is parentkey and correspondent associated field in entity. It is accepted to indicate only the fieldpki when it is equal to fieldentitypki, e.g. : fieldpk1;fieldpk2:fieldentitypk2 ;...fieldpkn:fieldentitypkn
cols cols1;cols2;...;colsn yes Columns associated to the code. It forms the description field.
cachetime 10 minutes no The time data remains in cache.
separator " " no The separator character for columns.
usecachemanager yes/no yes no With "no" parameter, field will have its own cache.
visiblecols vcols1,vcols2,...,vcolsn The visible cols from cols. With empty parameter all columns are visible.
form no The form that is opened in detail. On init, update mode will be its state.
parentkeylistener yes/no no no Register a listener for each parentkey field to delete data of this field when one of the parentkey values changes (when new value of the parentkey field is null, field value is not reset, excepts if 'disableonparentkeynull' is true). If you use this parameter then you need to use the setvalueorder for the Form @see Form.init(Hashtable)
disableonparentkeynull yes/no no no Disable field when parentkey is null.
onsetvalueset fieldonset1:fieldentitypk1;fieldonset2:fieldentitypk2;...fieldonsetn :fieldentitypkn (since version 5.2057EN-1.4) no Field attributes whose value will be set when data on field change.
codsearch no It specifies the field name for searching when user introduces a search value.
parentkeylistenerevent user/programmatic both no The type of event that is taken into consideration on parentkey listener changes. E.g. if 'user' value is set, just the events generated by user changes are taken into consideration.
ignorenullonsetvalueset yes/no no no It specifies whether the fields included into 'onsetvalueset' are deleted when null value is set in this field. If value is true the fields contained into 'onsetvalueset' are not deleted on null value.

Specified by:
init in interface FormComponent
Overrides:
init in class ComboDataField

getLastCacheTime

protected long getLastCacheTime()
Gets the last cache time.

Returns:
the time from last access to cache data

setValue

public void setValue(java.lang.Object value)
Description copied from interface: DataComponent
Sets the value for component.

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

setValue

public void setValue(java.lang.Object value,
                     boolean inner)
Establishes the field value. An object that will be an hashtable, whose keys are the code field name and description columns. Values may be vectors, in this case the first element is selected.


setCode

protected void setCode(java.lang.Object codeValue,
                       int valueEventType)
Sets the code in function of event value.

Parameters:
codeValue - the value to set
valueEventType - the type of event
See Also:
setValue(Object, boolean)

getValue

public java.lang.Object getValue()
Description copied from interface: DataComponent
Gets the value of a component.

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

popupWillShow

protected void popupWillShow()
                      throws java.lang.Exception
Pops up the combo when pop-up button is pressed. Perfoms a database query only when cache is not present.

Throws:
java.lang.Exception - when a Exception occurs

listWillShow

protected void listWillShow()
                     throws java.lang.Exception
Shows the pop-up combo. Calls to popupWillShow()

Throws:
java.lang.Exception - when Exception occurs

initCache

public void initCache()
Inits cache. It uses cacheManager.


queryBy

public EntityResult queryBy(java.lang.String column,
                            java.lang.Object value)
Establishes the query

Specified by:
queryBy in interface ReferenceDataComponent
Parameters:
column - the col name
value - the value to add to keyvalues hashtable, with the form (col,value)
Returns:
the result of query

queryByCod

protected EntityResult queryByCod(java.lang.Object code)
Performs a query by cod.

Parameters:
code - the code to query
Returns:
the query result

popupWillHide

protected void popupWillHide()
Hides the pop-up combo. In this version is empty.


setReferenceLocator

public void setReferenceLocator(EntityReferenceLocator busc)
Description copied from interface: ReferenceComponent
Establishes the reference locator that will be used by component. This method is automatically called by Form when it is being loaded.

Specified by:
setReferenceLocator in interface ReferenceComponent
Parameters:
busc - a reference locator to set in component

getSQLDataType

public int getSQLDataType()
Description copied from interface: DataComponent
Returns the sql data type according to java.sql.Types

Specified by:
getSQLDataType in interface DataComponent
Returns:
the Integer type

setEnabled

public void setEnabled(boolean en)
Description copied from interface: FormComponent
Description method to set enabled or not the component according the boolean condition in parameter.

Specified by:
setEnabled in interface FormComponent
Overrides:
setEnabled in class DataField
Parameters:
en - the condition to set enable

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle resources)
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 ComboDataField

invalidateCache

public void invalidateCache()
Invalidates the data cache.


initDeployedList

protected void initDeployedList()

advancedQuery

protected void advancedQuery()
                      throws java.lang.Exception
Performs an advanced query.

Throws:
java.lang.Exception - when Exception occurs

createPopupMenu

protected void createPopupMenu()
Description copied from class: DataField
Creates a pop-up menu.

Overrides:
createPopupMenu in class DataField

installPopupMenuListener

protected void installPopupMenuListener()
Description copied from class: DataField
Installs a pop-up menu listener.

Overrides:
installPopupMenuListener in class DataField

showPopupMenu

protected void showPopupMenu(java.awt.Component c,
                             int x,
                             int y)
Description copied from class: DataField
Shows the pop-up menu.

Overrides:
showPopupMenu in class DataField
Parameters:
c - the component
x - the x coordinate
y - the y coordinate

getValuesToCode

public java.util.Hashtable getValuesToCode(java.lang.Object code)
Returns the associated combo values for a code.

Parameters:
code - the object where code are specified
Returns:
the key-value pairs

isCacheManagerUsed

public boolean isCacheManagerUsed()
Returns whether cache manager is used.

Returns:
the useCacheManager condition

setUseCacheManager

public void setUseCacheManager(boolean cacheManager)
Sets the cache manager.

Parameters:
cacheManager - the cache manager condition

getTextsToTranslate

public java.util.Vector getTextsToTranslate()
Description copied from interface: Internationalization
Returns all the texts in the element suitable for being translated.

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

isEmpty

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

Specified by:
isEmpty in interface DataComponent
Overrides:
isEmpty in class ComboDataField

deleteData

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

Specified by:
deleteData in interface DataComponent
Overrides:
deleteData in class ComboDataField

deleteUserData

public void deleteUserData()

setAdvancedQueryMode

public void setAdvancedQueryMode(boolean enabled)
Description copied from interface: AdvancedDataComponent
This method must establish the advanced query state, to support advanced query conditions.

Specified by:
setAdvancedQueryMode in interface AdvancedDataComponent
Parameters:
enabled - the condition to enable this state

getEntity

public java.lang.String getEntity()
Specified by:
getEntity in interface CachedComponent

getAttributes

public java.util.Vector getAttributes()
Specified by:
getAttributes in interface CachedComponent

setCacheManager

public void setCacheManager(CacheManager cm)
Specified by:
setCacheManager in interface CachedComponent

setQueryValues

public void setQueryValues(java.util.Vector v)

getCodeDescription

public java.lang.String getCodeDescription(java.lang.Object c)
Gets tje code description.

Parameters:
c - the object to get the description
Returns:
the description

getText

public java.lang.String getText()
Description copied from class: DataField
Gets text.

Overrides:
getText in class DataField
Returns:
the text in this implementation returns null.

getDetailButtonListener

public java.awt.event.ActionListener getDetailButtonListener()
Gets the detail button listener.

Returns:
the detail button listener

getParentKeyValue

protected java.lang.Object getParentKeyValue(java.lang.String parentkey)
Gets the parent key value.

Parameters:
parentkey - the parent key name
Returns:
the parent key value

getRenderer

public ReferenceComboDataField.MultiColumnComboRenderer getRenderer()
Gets the renderer.

Returns:
the renderer

getDataCache

public java.util.Hashtable getDataCache()
Gets the data cache.

Returns:
the data cache

hasParentKeys

public boolean hasParentKeys()
Specified by:
hasParentKeys in interface IFilterElement

getParentKeyValues

public java.util.Hashtable getParentKeyValues()
Specified by:
getParentKeyValues in interface IFilterElement

getParentKeyList

public java.util.Vector getParentKeyList()
Specified by:
getParentKeyList in interface IFilterElement

getParentkeyEquivalences

public java.util.Hashtable getParentkeyEquivalences()
Returns a Hashtable with key-value corresponding with result to apply two 'tokenizer' actions over parentkeys parameter. For example,

string="formfieldpk1:equivalententityfieldpk1;formfieldpk2:equivalententityfieldpk2;...;formfieldpkn:equivalententityfieldpkn"

returns Hashtable:

{ formfieldpk1 equivalententityfieldpk1}
{ formfieldpk2 equivalententityfieldpk2}
{ ... ... }
{ formfieldpkn equivalententityfieldpkn}

Returns:
Hashtable with key-value

replaceParentkeyByEquivalence

public java.util.Hashtable replaceParentkeyByEquivalence(java.util.Hashtable hParentkeyEquivalences)

updateBackgroundColor

protected void updateBackgroundColor()
Description copied from class: DataField
Updates the background color.

Overrides:
updateBackgroundColor in class DataField

getCodeFieldValue

protected java.lang.Object getCodeFieldValue()
Gets the code field value.

Returns:
the object with code field value

getTypedInnerValue

protected java.lang.Object getTypedInnerValue(java.lang.Object s)
Obtains the typed value from parameter.

Parameters:
s - the object to obtain the type
Returns:
the typed inner value

getCodeField

public javax.swing.JTextField getCodeField()
Description copied from interface: ReferenceDataComponent
Gets the code field.

Specified by:
getCodeField in interface ReferenceDataComponent
Returns:
a JTextField with the code field.

getCodeSearchField

public java.lang.String getCodeSearchField()

isCodeFieldVisible

public boolean isCodeFieldVisible()
Description copied from interface: ReferenceDataComponent
Checks whether the codefield is visible.

Specified by:
isCodeFieldVisible in interface ReferenceDataComponent
Returns:
a boolean

isCodeSearchVisible

public boolean isCodeSearchVisible()
Description copied from interface: ReferenceDataComponent
Checks whether the code search is visible.

Specified by:
isCodeSearchVisible in interface ReferenceDataComponent
Returns:
true if the code search is visible.

getCodeFieldName

public java.lang.String getCodeFieldName()
Description copied from interface: ReferenceDataComponent
The name of the code.

Specified by:
getCodeFieldName in interface ReferenceDataComponent
Returns:
a String with the code name.

getCodeSearchFieldName

public java.lang.String getCodeSearchFieldName()
Description copied from interface: ReferenceDataComponent
Gets the code search field name.

Specified by:
getCodeSearchFieldName in interface ReferenceDataComponent
Returns:
a String with the search field name.

createMultipleResultsWindow

protected void createMultipleResultsWindow(Table t)
Creates the multiple result window.

Parameters:
t - the table

getMultipleResultTable

public Table getMultipleResultTable()
Gets the reference to table with multiple results.


setFormBuilder

public void setFormBuilder(FormBuilder builder)
Specified by:
setFormBuilder in interface CreateForms

setParentForm

public void setParentForm(Form f)
Description copied from interface: AccessForm
Method declaration to set the form that contains the component. This method must be called automatically during the form building.

Specified by:
setParentForm in interface AccessForm
Overrides:
setParentForm in class DataField

registerParentkeyValueChangeListeners

public void registerParentkeyValueChangeListeners()

isParentkeyListener

public boolean isParentkeyListener()

setParentkeyListener

public void setParentkeyListener(boolean parentkeyListener)

setParentFrame

public void setParentFrame(java.awt.Frame parentFrame)
Description copied from interface: OpenDialog
This method is called from Form for each component that implements this interface. It fixes the parent frame for element. This frame is needed to open the modal dialog.

Specified by:
setParentFrame in interface OpenDialog
Parameters:
parentFrame - the frame

setInnerListenerEnabled

protected void setInnerListenerEnabled(boolean enabled)
Description copied from class: ComboDataField
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.

Overrides:
setInnerListenerEnabled in class ComboDataField
Parameters:
enabled - the condition to enable/disable the inner listener.

installInnerListener

protected void installInnerListener()
Description copied from class: ComboDataField
Installs the inner listener.

Overrides:
installInnerListener in class ComboDataField

getTemplateDataType

public int getTemplateDataType()
Description copied from interface: ITemplateField
Returns the data type. The values that can return are: ITemplateField.DATA_TYPE_FIELD ITemplateField.DATA_TYPE_IMAGE ITemplateField.DATA_TYPE_TABLE

Specified by:
getTemplateDataType in interface ITemplateField
Returns:
a int with the data type.

getTemplateDataValue

public java.lang.Object getTemplateDataValue()
Description copied from interface: ITemplateField
Gets the value to show in the template

Specified by:
getTemplateDataValue in interface ITemplateField
Returns:

Ontimize