public class CalculatedExpressionDataField extends JCalculatedExpression implements FormComponent, AccessForm, IdentifiedElement, DataComponent, ValueChangeDataComponent
| Modifier and Type | Class and Description |
|---|---|
protected class |
CalculatedExpressionDataField.FieldFocusListener
This class implements a field focus listener.
|
protected class |
CalculatedExpressionDataField.InnerDocumentListener
This class implements a inner listener for document.
|
JCalculatedExpression.ColumnPosition, JCalculatedExpression.CustomListModel, JCalculatedExpression.Expression, JCalculatedExpression.InsertSymbolListenerJPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected Object |
attribute
The reference to attribute.
|
protected List |
availableFields
List that contains the name of the available fields to use into the
editor of expressions.
|
static String |
AVAILABLEFIELDS_ATTR
Attribute key to assign the available fields of the component.
|
protected Color |
backgroundColor
The default background color.
|
protected String |
borderText
The reference for border text.
|
protected boolean |
enabled
The condition to indicate when field is active.
|
protected CalculatedExpressionDataField.FieldFocusListener |
fieldlistenerFocus
The reference for field focus listener.
|
protected boolean |
fireValueEvents
The condition to activate field events.
|
protected CalculatedExpressionDataField.InnerDocumentListener |
innerListener
The reference to inner listener.
|
protected boolean |
isEnabled |
protected boolean |
modifiable
The condition to indicate when field is modifiable.
|
protected Form |
parentForm
The reference to parent form.
|
protected FormPermission |
permissionActivate
The reference to activate permission.
|
protected FormPermission |
permissionVisible
The reference to visible permission in form.
|
static String |
REQUIREDFIELDS_ATTR
Attribute key to assign the required fields of the component.
|
protected ResourceBundle |
resources
The reference for resources file.
|
protected boolean |
restricted
The restricted condition.
|
protected SelectableItemListCellRenderer |
selItemRenderer
The renderer for elements of the list available fields.
|
protected boolean |
show
The condition to indicate whether must be shown.
|
protected Vector |
valueListener
The vector instance for a value listener.
|
protected Object |
valueSave
The variable to store the field value when
setValue() is
called. |
addButton, availableFieldsList, buttonPanel, closeParenthesisButton, componentList, divideButton, expressionPane, multiplyButton, openParenthesisButton, splitPane, substractButton, undoManageraccessibleContext, 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_2DEBUG_LANGUAGEDESACTIVATE_COMPONENT_BY_PERMISSION_TIPABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
CalculatedExpressionDataField(Hashtable parameters) |
| Modifier and Type | Method and Description |
|---|---|
void |
addValueChangeListener(ValueChangeListener l) |
protected boolean |
checkEnabledPermission()
Check enabled permission.
|
protected boolean |
checkVisiblePermission()
Return the visible permission condition.
|
protected CalculatedExpressionDataField.FieldFocusListener |
createFocusListener()
Creates a field focus listener.
|
protected JList |
createList(List values)
In addition to super method, this method adds renderers and listeners to
JList component.
|
void |
deleteData()
The method to delete data for component.
|
protected void |
enableInnerListener(boolean enable)
This method allows to enable/disable the ValueEvent events notifier.
|
protected void |
fireValueChanged(Object newValue,
Object oldValue,
int type)
Detects fire value events.
|
Object |
getAttribute()
Gets the object attribute.
|
List |
getAvailableFields()
Recovers the list of available fields to use into the mathematical
expression.
|
Object |
getConstraints(LayoutManager parentLayout)
Description method to return the
constraints component to
place correctly in parent container. |
protected String |
getFieldTranslation(String field)
This method obtains the translation of the element passed as parameter if
it exists, if not, it returns the same value.
|
String |
getLabelComponentText()
Returns the label text component.
|
Form |
getParentForm()
Gets the parent form.
|
Vector |
getRequiredFields()
This method returns a list of fields that are required into the
configuration of the 'expression'.
|
protected List |
getSelectableItemList(List fields)
This method returns a list of
objects
from a specified list of field names. |
Vector |
getSourceFields()
This method returns the fields(source fields) that are used into the
'mathematical expression' of the editor.
|
int |
getSQLDataType()
Returns the
sql data type according to
java.sql.Types
|
Vector |
getTextsToTranslate()
Returns all the texts in the element suitable for being translated.
|
Object |
getValue()
Gets the value of the component
|
void |
init(Hashtable parameters)
Inits parameters.
|
void |
initPermissions() |
protected void |
installFocusListener()
Adds the focus listener to the data field.
|
protected void |
installInnerListener()
Adds a inner listener for document.
|
boolean |
isCorrectExpression()
This method check if the current expression of the editor is well
defined.
|
boolean |
isEmpty()
Checks the data existence in component.
|
boolean |
isEnabled()
Returns true when field is enabled.
|
boolean |
isHidden()
Indicates to check the visibility condition for a component.
|
boolean |
isModifiable()
Checks the modifiable condition for a component.
|
boolean |
isModified()
This method should be return
true when data have been
modified. |
boolean |
isRequired()
Indicates the required condition for a component.
|
boolean |
isRestricted() |
void |
removeValueChangeListener(ValueChangeListener l) |
void |
setAvailableFields(List values)
Sets the list of fields that are going to be allowed to introduce into
the mathematical expression of the editor.
|
void |
setAvailableFields(String value)
Sets the list of fields that are going to be allowed to introduce into
the mathematical expression of the editor from a String separated by
semicolon.
|
void |
setComponentLocale(Locale l) |
void |
setEnabled(boolean enabled)
Enables the field to insert data.
|
void |
setModifiable(boolean modifiable)
Establishes the modifiable condition for a component.
|
void |
setParentForm(Form form)
Method declaration to set the form that contains the component.
|
void |
setRequired(boolean required)
Sets required a component according to condition.
|
void |
setRequiredFields(List requiredFields)
This method sets which fields are required into the available fields
list.
|
void |
setResourceBundle(ResourceBundle resourceBundle)
Sets the language resource bundle.
|
void |
setValue(Object value)
Sets the value of the component.
|
void |
setVisible(boolean visible)
Description method to set visible or not the component according the
boolean condition in parameter.
|
addAvailableFields, addColumnToExpression, checkExpression, createButton, createExpressionEditor, createList, createParser, getAvailableFields, getExpression, getExpressionIndexColName, init, installHighlight, registerUndoableListener, registerUndoRedoActions, removeAllAvailableFields, removeAvailableFields, removeAvailableFields, setBorder, setExpression, setExpressionText, updateSelectedCalculatedColumnExpressiongetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, 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, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, 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, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, 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, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static String AVAILABLEFIELDS_ATTR
public static String REQUIREDFIELDS_ATTR
protected boolean show
protected Object attribute
protected Object valueSave
setValue() is
called.protected boolean enabled
protected boolean isEnabled
protected boolean modifiable
protected boolean restricted
protected String borderText
protected Color backgroundColor
protected List availableFields
protected Vector valueListener
protected boolean fireValueEvents
protected CalculatedExpressionDataField.InnerDocumentListener innerListener
protected CalculatedExpressionDataField.FieldFocusListener fieldlistenerFocus
protected Form parentForm
protected FormPermission permissionVisible
protected FormPermission permissionActivate
protected ResourceBundle resources
protected SelectableItemListCellRenderer selItemRenderer
public CalculatedExpressionDataField(Hashtable parameters)
public Object getAttribute()
IdentifiedElementgetAttribute in interface IdentifiedElementpublic Object getConstraints(LayoutManager parentLayout)
FormComponentconstraints component to
place correctly in parent container.
getConstraints in interface FormComponentparentLayout - the parent container referencepublic void init(Hashtable parameters) throws Exception
init in interface FormComponentparameters - the Hashtable with parameters
| attribute | values | default | required | meaning |
| attr | yes | The attribute to manage the field. | ||
| visible | yes/no | yes | no | The visibility condition. |
| required | yes/no | no | no | The required condition. |
| bgcolor | no | The background color. | ||
| 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 | |
| enabled | yes/no | yes | no | The field activation. |
| availablefields | field1;field2;...;fieldn | no | no | The list of available fields to the mathematical expression. |
| requiredfields | field1;field2;...;fieldn | no | no | The list of required fields to the mathematical expression. |
Exception - when Exception occursprotected JList createList(List values)
protected String getFieldTranslation(String field)
getFieldTranslation in class JCalculatedExpressionprotected void installInnerListener()
protected CalculatedExpressionDataField.FieldFocusListener createFocusListener()
protected void installFocusListener()
public void setEnabled(boolean enabled)
setEnabled in interface FormComponentsetEnabled in class JCalculatedExpressionenabled - the condition to set enablepublic void setVisible(boolean visible)
FormComponentsetVisible in interface FormComponentsetVisible in class JComponentvisible - the visibility conditionpublic void deleteData()
deleteData in interface DataComponentpublic Object getValue()
getValue in interface DataComponentobject with value.public void setValue(Object value)
setValue in interface DataComponentvalue - the object with value to setpublic List getAvailableFields()
JCalculatedExpressiongetAvailableFields in class JCalculatedExpressionList of elements.public void setAvailableFields(String value)
value - public void setAvailableFields(List values)
JCalculatedExpressionsetAvailableFields in class JCalculatedExpressionvalues - A list with the values.protected List getSelectableItemList(List fields)
SelectableItem objects
from a specified list of field names. Each SelectableItem
includes the name of the available field and a check field used to
configure the component.fields - List of available fields names.SelectableItem objects.public Vector getSourceFields()
List with the source fields.public Vector getRequiredFields()
List with the required values.public void setRequiredFields(List requiredFields)
requiredFields - List with the fields to set required.public boolean isCorrectExpression()
public String getLabelComponentText()
DataComponentLocale.
getLabelComponentText in interface DataComponentpublic int getSQLDataType()
DataComponentsql data type according to
java.sql.Types
getSQLDataType in interface DataComponentInteger typepublic boolean isEmpty()
DataComponentisEmpty in interface DataComponenttrue when component is emptypublic boolean isHidden()
DataComponentisHidden in interface DataComponentpublic boolean isModifiable()
DataComponentisModifiable in interface DataComponenttrue when component is modifiablepublic boolean isModified()
DataComponenttrue when data have been
modified. The method setValue() should be change this
condition.
isModified in interface DataComponentpublic boolean isEnabled()
isEnabled in interface FormComponentisEnabled in class Componentpublic boolean isRequired()
DataComponentisRequired in interface DataComponentpublic void setModifiable(boolean modifiable)
DataComponentDeleteFields call.
setModifiable in interface DataComponentmodifiable - the boolean conditionpublic void setRequired(boolean required)
DataComponentsetRequired in interface DataComponentrequired - the required conditionpublic Vector getTextsToTranslate()
InternationalizationgetTextsToTranslate in interface Internationalizationpublic void setComponentLocale(Locale l)
setComponentLocale in interface Internationalizationpublic void setResourceBundle(ResourceBundle resourceBundle)
InternationalizationsetResourceBundle in interface InternationalizationresourceBundle - the new language bundle.public void setParentForm(Form form)
AccessFormsetParentForm in interface AccessFormform - the form referencepublic Form getParentForm()
public void initPermissions()
initPermissions in interface SecureElementprotected boolean checkVisiblePermission()
protected boolean checkEnabledPermission()
public boolean isRestricted()
isRestricted in interface SecureElementpublic void addValueChangeListener(ValueChangeListener l)
addValueChangeListener in interface ValueChangeDataComponentpublic void removeValueChangeListener(ValueChangeListener l)
removeValueChangeListener in interface ValueChangeDataComponentprotected void fireValueChanged(Object newValue, Object oldValue, int type)
newValue - the new valueoldValue - the previous valuetype - the type of value eventprotected void enableInnerListener(boolean enable)
enable - the condition to enable/disable the inner listener.Copyright © 2016 Imatia Innovation S.L.. All rights reserved.