public abstract class AbstractMultipleReferenceDataField extends DataField implements DataComponent, ReferenceComponent, OpenDialog, CreateForms, CachedComponent
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractMultipleReferenceDataField.CEJTextField
The main class to create the EJTextField
|
protected class |
AbstractMultipleReferenceDataField.CodFieldListener
The main class to create a listener in a cod.
|
protected static interface |
AbstractMultipleReferenceDataField.InnerListener
Interface to implement inner listener methods.
|
DataField.AuxPanel, DataField.CopyActionListener, DataField.ELabel, DataField.FieldButton, DataField.FieldFocusListener, DataField.InfoMouseListener, DataField.ToggleButtonJPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected CacheManager |
cacheManager
A reference to cache manager.
|
protected int |
cacheTime
Defines the cache time.
|
static String |
CACHETIME
Cachetime property.
|
protected AbstractMultipleReferenceDataField.CodFieldListener |
codListener
An instance of cod field listener.
|
protected ArrayList |
cods
An ArrayList where will be inserted the data field names of codes
|
static String |
CODS
Cods property.
|
protected ArrayList |
cols |
static String |
COLS
Cols property.
|
protected Hashtable |
dataCache
A data cache.
|
protected boolean |
dataCacheInitialized
The condition about data cache initialization.
|
protected String |
entity |
static String |
ENTITY
Entity property
|
protected Hashtable |
formatColumn
The format column.
|
protected boolean |
initCacheOnSetValue
The condition to initialize cache on setValue.
|
protected AbstractMultipleReferenceDataField.InnerListener |
innerListener
A reference to inner Listener.
|
protected Hashtable |
jVisibleCods
An hashtable to put the visible key-component pairs.
|
protected ArrayList |
keys
The reference to keys.
|
static String |
KEYS
Keys property.
|
protected long |
lastCacheTime
The last cache time.
|
protected EntityReferenceLocator |
locator
The Entity reference Locator that provides a locator to this entity
|
protected boolean |
multilanguage
The condition to disable cache
|
static String |
MULTILANGUAGE |
static String |
ONSETVALUESET
Typecods property.
|
protected List |
onsetvaluesetAttributes
The vector with attributes to update when data field value changed.
|
static String |
PARENT_CODS
Parentcods property.
|
static String |
PARENT_KEYS
Parentkeys property.
|
protected ArrayList |
parentCods
The reference to parent cods.
|
protected boolean |
parentkeyCache |
static String |
PARENTKEYCACHE |
protected ArrayList |
parentkeys
The reference to parent keys.
|
protected String |
separator
A separator reference.
|
protected ArrayList |
typecods
An ArrayList where the possible types of codes will be inserted.
|
static String |
TYPECODS
Typecods property.
|
protected boolean |
useCacheManager
The condition to use cache manager.
|
protected Object |
value
A reference to a value object.
|
protected boolean |
valueEventDisabled
The condition to disable events.
|
protected ArrayList |
visibleCods
An ArrayList where the visible column codes will be inserted .
|
static String |
VISIBLECODS
Visiblecods property.
|
protected Hashtable |
visiblesize
An hashtable to put the visible parameters-position in multiple data
field
|
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, EXPAND, FIELD_HELP_TIP, fieldlistenerFocus, fieldSize, fireValueEvents, FOCUS_BACKGROUNDCOLOR, FONT, fontColor, FONTCOLOR, fontSize, FONTSIZE, height, HEIGHT, incrementalFont, initPreferenceHelpText, INSETS, 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, PREF_WIDTH, prefWidth, RAISED, redimensionPanel, redimensJTextField, required, REQUIRED, requiredBorder, REQUIREDBORDER, requiredFieldBackgroundColor, requiredFieldForegroundColor, 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_STRaccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTCOMP_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_2DESACTIVATE_COMPONENT_BY_PERMISSION_TIPDEBUG_LANGUAGEABORT, ALLBITS, ERROR, FRAMEBITS, PROPERTIES, SOMEBITS| Constructor and Description |
|---|
AbstractMultipleReferenceDataField() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addFormat(String column,
Format format)
Adds the format to columns.
|
static boolean |
compareMultipleValue(Object v1,
Object v2,
List keys)
Compares multiple values from key list.
|
protected void |
createCodeComponents()
Creates a code component.
|
protected void |
createComponent()
Creates component.
|
void |
deleteData()
Deletes data.
|
void |
deleteUserData()
Deletes the user data.
|
protected void |
deleteUserData(boolean withcods)
Deletes the user data.
|
protected void |
enableInnerListener(boolean enable)
Enables the inner listener.
|
void |
free() |
Vector |
getAttributes()
Gets the vector with all columns and keys.
|
protected Object |
getCodData(Integer type,
String value)
Gets the cod data to check type.
|
protected String |
getDescription(Object value)
Gets the description for all columns in multiple value object.
|
String |
getEntity() |
protected Format |
getFormat(String column)
Gets the format to column.
|
protected Object |
getInnerValue()
Gets the inner value.
|
protected long |
getLastCacheTime() |
Hashtable |
getParentKeyValues() |
int |
getSQLDataType()
Returns the
sql data type according to
java.sql.Types
|
protected Integer |
getSQLType(String s)
Checks whether data are integer, string or float, in other case returns
an integer.
|
Object |
getValue()
Gets the value of a component.
|
Hashtable |
getValuesToCode(Object code)
Returns the associated values for a code to set in onsetvalueset
attributes.
|
boolean |
hasParentKeys() |
void |
init(Hashtable parameters)
Initializes parameters and throws
IllegalArgumentException when
required parameters are not present. |
void |
initCache()
Initializes cache.
|
void |
invalidateCache()
Invalidates the cache.
|
boolean |
isEmpty()
Checks the data existence in component.
|
protected EntityResult |
queryByCode(Object value)
Prepares the object value to perform a query by code.
|
void |
setCacheManager(CacheManager c) |
protected void |
setCode(Object codeValue,
int valueEventType)
Sets a code to object.
|
void |
setFormatCods(Object value)
Sets the format to visible cods.
|
protected abstract void |
setFormatValue(Object originalValue) |
void |
setFormBuilder(FormBuilder constructor) |
protected void |
setInnerValue(Object o)
Sets the inner value.
|
void |
setParentFrame(Frame parentFrame)
This method is called from Form for each component that implements this
interface.
|
void |
setReferenceLocator(EntityReferenceLocator referenceLocator)
Establishes the reference locator that will be used by component.
|
void |
setResourceBundle(ResourceBundle resource)
Sets the language resource bundle.
|
void |
setValue(Object originalValue)
Sets the value for component.
|
void |
setValue(Object originalValue,
boolean intern)
Sets the value to object.
|
protected void |
updateOnSetValueSetAttributes(Hashtable data)
Parameters on this method are used to update the fields whose attributes
are contained in
onsetvaluesetAttributes |
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, getPreferredSize, getText, getTextsToTranslate, getValueChangeListeners, hasHelpInPreferences, initPermissions, initPreferences, installFocusListener, installHelpId, installPopupMenuListener, installPreferenceHelpListener, isAdvancedQueryMode, isEnabled, isHidden, isLabelVisible, isModifiable, isModified, isRequired, isRestricted, parseBoolean, preferenceChanged, removeFocusListener, removeValueChangeListener, requestFocus, seeHelpField, setBold, setComponentLocale, setDisabledbgcolor, setEnabled, setFont, setFontColor, setFontSize, setLabelFontColor, setModifiable, setParentForm, setRequired, setRequiredFieldBackground, setVisible, showPopupMenu, updateBackgroundColor, updateBackgroundColor, updateFont, updateTip, updateUI, validateComponentPositionsgetAccessibleContext, getUI, getUIClassID, paramString, setUIaddAncestorListener, 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateadd, 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, validateTreeaction, add, addComponentListener, 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, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, 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, 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, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetLabelComponentText, isHidden, isModifiable, isModified, isRequired, setModifiable, setRequiredgetAttributeinitPermissions, isRestrictedgetConstraints, isEnabled, setEnabled, setVisiblegetTextsToTranslate, setComponentLocalepublic static final String CODS
public static final String TYPECODS
public static final String ONSETVALUESET
public static final String PARENT_CODS
public static final String VISIBLECODS
public static final String KEYS
public static final String PARENT_KEYS
public static final String COLS
public static final String ENTITY
public static final String CACHETIME
public static final String PARENTKEYCACHE
public static final String MULTILANGUAGE
protected boolean parentkeyCache
protected EntityReferenceLocator locator
protected List onsetvaluesetAttributes
protected ArrayList cods
protected ArrayList typecods
Arraylist cods.protected ArrayList visibleCods
protected Hashtable jVisibleCods
protected Hashtable visiblesize
protected ArrayList parentCods
protected ArrayList keys
protected ArrayList parentkeys
protected ArrayList cols
protected String separator
protected Object value
protected String entity
protected int cacheTime
Integer.MAX_VALUEprotected long lastCacheTime
protected boolean dataCacheInitialized
protected Hashtable dataCache
protected boolean initCacheOnSetValue
protected boolean useCacheManager
protected CacheManager cacheManager
protected Hashtable formatColumn
protected boolean valueEventDisabled
protected boolean multilanguage
protected AbstractMultipleReferenceDataField.InnerListener innerListener
protected AbstractMultipleReferenceDataField.CodFieldListener codListener
protected void createComponent()
protected void createCodeComponents()
visibleCods,visiblesize
and adds listeners.public void init(Hashtable parameters)
IllegalArgumentException when
required parameters are not present.
init in interface FormComponentinit in class DataFieldparameters - the Hashtable with parameters
| attribute | values | default | required | meaning |
| attr | yes | An AbstractMultipleReferenceDataField object. It
is used to get a reference for field |
||
| keys | key1;key2;...;keyn | yes | This attribute contains columns that are keys in entity of current form. | |
| cods | cod1;cod2;...;codn | keys | yes | This parameter refers to the keys of entity that is queried. We need keys and cods because, keys in entity and form accept different names. |
| visiblecods | vcod1;vcod2;...;vcodn | no | The number of boxes showed on the left of description field. Each visible cods is used to select an individual cod. | |
| typecods | vtcod1;vtcod2;...;vtcodn | Integer | no | The class type of cods. To indicate other types for cods,
they should be ordered like cods |
| parentkeys | pk1;pk2;...;pkn | parentcods | no | Attribute used to filter MultipleReferenceDataField. It will contain all attributes whose values will be extracted of current form to filter the field. |
| parentcods | pcod1;pcod2;...;pcodn | parentkeys | no | This parameter refers to the parentkeys of entity that is queried. Sometimes, we need parentkeys and parentcods because columns in entity and form accept different names. This parameter must be ordered in same manner that parentkeys, to establish the correspondence position by position. |
| entity | yes | The entity to obtain the data | ||
| cols | col1;col2;...;coln | yes | The cols to show both in description of field and in table to select records. | |
| onsetvalueset | Field attributes whose value will be set when field data change. | |||
| multilanguage | yes/no | no | no | If yes, invalidate the cache data. |
protected Integer getSQLType(String s)
s - the data typeprotected void updateOnSetValueSetAttributes(Hashtable data)
onsetvaluesetAttributesdata - Values to updatepublic Hashtable getValuesToCode(Object code)
code - the object where code are specifiedprotected Object getCodData(Integer type, String value) throws Exception
public int getSQLDataType()
DataComponentsql data type according to
java.sql.Types
getSQLDataType in interface DataComponentInteger typeprotected long getLastCacheTime()
public Object getValue()
DataComponentgetValue in interface DataComponentobject with value.public void setValue(Object originalValue)
DataComponentsetValue in interface DataComponentoriginalValue - the object with value to setpublic void setValue(Object originalValue, boolean intern)
originalValue - the object to set valueintern - the condition about intern listener state.protected abstract void setFormatValue(Object originalValue)
public void setFormatCods(Object value)
value - the object to set the cods.public void setReferenceLocator(EntityReferenceLocator referenceLocator)
ReferenceComponentsetReferenceLocator in interface ReferenceComponentreferenceLocator - a reference locator to set in componentpublic void setParentFrame(Frame parentFrame)
OpenDialogsetParentFrame in interface OpenDialogparentFrame - the framepublic void setFormBuilder(FormBuilder constructor)
setFormBuilder in interface CreateFormspublic String getEntity()
getEntity in interface CachedComponentpublic void setCacheManager(CacheManager c)
setCacheManager in interface CachedComponentpublic boolean isEmpty()
DataComponentisEmpty in interface DataComponenttrue when component is emptypublic Vector getAttributes()
getAttributes in interface CachedComponentpublic void initCache()
public void invalidateCache()
dataCacheInitialized to false.protected EntityResult queryByCode(Object value)
value - the object to querypublic void deleteData()
null in all formats (value and cods).deleteData in interface DataComponentpublic void deleteUserData()
deleteUserData(boolean) with
true parameter.protected void deleteUserData(boolean withcods)
withcods - the cods or no cods presenceprotected String getDescription(Object value)
value - the multiple value object to get descriptionprotected Format getFormat(String column)
column - the name of columnprotected void addFormat(String column, Format format)
column - the columnformat - the format to applyprotected void enableInnerListener(boolean enable)
enable - the condition to enable the listenerprotected Object getInnerValue()
protected void setInnerValue(Object o)
o - the object to set the inner value.protected void setCode(Object codeValue, int valueEventType)
setValue(Object) after
looking the data cache or the queryByCode(Object).
codeValue - the hashtable to set the multiple valuevalueEventType - the value event typepublic static boolean compareMultipleValue(Object v1, Object v2, List keys)
v1 - the object 1v2 - the object 2keys - the list of keyspublic boolean hasParentKeys()
public Hashtable getParentKeyValues()
public void setResourceBundle(ResourceBundle resource)
InternationalizationsetResourceBundle in interface InternationalizationsetResourceBundle in class DataFieldresource - the new language bundle.Copyright © 2016 Imatia Innovation S.L.. All rights reserved.