de.cbse.jeasy
Class JEDataField
java.lang.Object
de.cbse.jeasy.JEObject
de.cbse.jeasy.JEComponent
de.cbse.jeasy.JEDataField
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.awt.event.ComponentListener, java.awt.event.FocusListener, java.awt.event.InputMethodListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.event.WindowFocusListener, java.awt.event.WindowListener, java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.event.CaretListener, javax.swing.event.ChangeListener, javax.swing.event.DocumentListener, javax.swing.event.ListSelectionListener, javax.swing.event.MenuKeyListener, javax.swing.event.PopupMenuListener, javax.swing.event.TableModelListener, javax.swing.event.TreeExpansionListener, javax.swing.event.TreeModelListener, javax.swing.event.TreeSelectionListener
public class JEDataField
- extends JEComponent
Implements a JTextField and a JLabel.
If the number of rows is greater than one a JTextArea will be used instead of a JTextField.
For input validating and formating a JEDataType is used as a reference.
Properties :
- id
The unique id of the root object.
- XMLTag
The xml tag used when serializing or deserializing the component in a JEMessage.
- referenceId
A reference for this jeasy object used to identify this type of jeasy object even if it was cloned. It is used for locale properties of the object and may be used for identification in messages. If no reference is set, the jeasy id will be set as default.
- label
The label of this component.
- dataType (reference to JEDataType)
Id of a datatype to define the kind of entries the field may hold.
- passwordField
Sets whether or not this input field is a password field. In a password field all characters are shown as asterisks.
- rows
Sets the number of rows.
- columns
It sets the length of a field in characters. It can be overwritten by maxColumns in jeglobal.
- lineWrap
Sets the line-wrapping policy of the text area. If set to true the lines will be wrapped if they are too long to fit within the allocated width. If set to false, the lines will always be unwrapped.
- wrapStyleWord
Sets the style of wrapping used if the text area is wrapping lines. If set to true the lines will be wrapped at word boundaries (ie whitespace) if they are too long to fit within the allocated width. If set to false, the lines will be wrapped at character boundaries.
- scrollPane
Optional vertical and horizontal scroll bars.
- font (reference to JEFont)
The font for this component.
- labelFont (reference to JEFont)
The font for the label.
- mnemonic
Sets the keyboard mnemonic on the current model. The mnemonic is the key which when combined with the look and feel's mouseless modifier (usually Alt) will activate this button if focus is contained somewhere within this button's ancestor window.
- defaultText
The default text shown in an input field.
- toolTipText
The text to display in a tool tip. The text displays when the cursor lingers over the component.
- buttonBehind (reference to JEButton)
The id of a button behind the field. The button will send the id of the root component in front as an ActionCommand to the callBack.
- textBehind
Text behind an inputfield. Used for units (e.g. EUR, min, sec).
- horizontalAlignment (possible values [ , LEFT, CENTER, RIGHT, LEADING, TRAILING])
Sets the horizontal alignment of the icon and text.
- border (reference to JEBorder)
The border of this component.
- constraints (reference to JEConstraints)
The contraints for this component used for GridBagLayout Manager.
- labelConstraints (reference to JEConstraints)
The contraints for the label used for GridBagLayout Manager.
- width
The width of the component.
- height
The height of the component.
- foreground (reference to JEColor)
Id of a color used as the foreground of the component.
- background (reference to JEColor)
Id of a color used as the background of the component.
- labelForeground (reference to JEColor)
Id of a color used as the foreground of the components label.
- labelFocusForeground (reference to JEColor)
Id of a color used as the foreground of the components label if it has the focus.
- visible
Sets whether or not this component is visible.
- enabled
Sets whether or not this component is enabled.
- editable
Sets whether or not this component can be edited.
- mandatory
Sets whether or not this component is mandatory. A mandatory component must have a value before serializing.
- referenceButtonBehind
A reference for this jeasy object used to identify this type of jeasy object even if it was cloned. It is used for locale properties of the object and may be used for identification in messages. If no reference is set, the jeasy id will be set as default.
- serializeFormatter (reference to JEFormat)
The JEFormat used when serializing the entry. It is used by the method getMessage() of a JEMessage object.
- deserializeFormatter (reference to JEFormat)
The JEFormat used when deserializing the entry. It is used by the method putMessage(..) of a JEMessage object.
- animation (reference to JEAnimation)
The animation used for this object and, if it is defined for parentobjects, for all children.
- Author:
- Harry Pfohl
| Fields inherited from class de.cbse.jeasy.JEComponent |
animated, backup, buttonBehind, caretPosition, component, endMarkPosition, enterPressed, isPressed, jeButtonBehind, label, labelBehind, labelText, parentId, scrollPane, tree, treeNode, window |
| Fields inherited from class de.cbse.jeasy.JEObject |
aaa, ACTIVITYBAR, ANIMATION, BORDER, BUSINESSOBJECT_NAME, BUTTON, BUTTONGROUP, CHECKBOX, CHECKBOXMENUITEM, COLOR, COMBOBOX, ComboBoxButtonWidth, COMBOLIST, CONSTRAINTS, CONTEXT_HELP_FOCUS_GAINED, CONTEXT_HELP_FOCUS_LOST, CONTEXT_HELP_MOUSE_ENTERED, CONTEXT_HELP_MOUSE_EXITED, DATAFIELD, DATATYPE, DESKTOPPANE, DIALOG, EDITORPANE, FONT, FORMAT, FRAME, GANTTGRID, GLOBAL, GRADIENTPAINT, HELP, ICON, ID_JESTART, INPUT_ERROR_DATE, INPUT_ERROR_LENGTH, INPUT_ERROR_MANDATORY, INPUT_ERROR_PARSE, INPUT_ERROR_RANGE, INPUT_ERROR_REGULAREXPRESSION, INPUT_ERROR_TIME, INPUT_ERRORS, INSETS, INTERNALFRAME, intType, LABEL, LIST, LOCALE, MENU, MENUBAR, MENUITEM, MESSAGE, METHODINVOCATION, NO_CONSTANT, NO_INPUT_ERROR, OPTIONPANE, PANEL, POPUP, PROGRESSBAR, PROPERTIE_NAME, propertyHashMap, RADIOBUTTON, RADIOBUTTONMENUITEM, refresh, SPINNER, SPLITPANE, START, STORE, STRING, TABBEDPANE, TABLE, TASKPANE, TEXTUREPAINT, THEME, TIPS, TOOLBAR, TREE, TREENODE, type, WINDOW |
|
Method Summary |
void |
appendText(JENode node)
Appends a node to the JTextArea or JTextField regarding the locale property |
void |
appendText(java.lang.String s)
Appends a text to the JTextArea or JTextField |
void |
clear()
Clears the JTextfield |
java.lang.String |
deserialize(java.lang.String s)
Converts a String to the format of the datafield |
int |
getCaretPosition()
Gets the caret position of the JTextComponent |
int |
getColumns()
Gets the maximal width of the textfield in characters. |
javax.swing.JTextArea |
getJTextArea()
If the datafields JTextCompoent is a JTextArea this will be returned. |
java.util.Vector |
getLines()
Gets the text separated by \n as a vector. |
java.lang.String |
getText()
Gets the text of the JTextField |
protected void |
init()
Initialization of the SWING objects. |
void |
insertText(java.lang.String s)
Inserts a text at the caretPosition, if the field is a JTextArea. |
boolean |
isEditable()
Gets whether the component is editable or not |
void |
scrollToLastLine()
Sets the caret position of the text insertion caret to the beginning of the last line. |
java.lang.String |
serialize()
Gets the text of the textfield and converts using the serializeFormatter |
void |
setCaretPosition(int i)
Sets the position of the text insertion caret for the TextComponent. |
void |
setEditable(boolean b)
Makes the component editable or not |
void |
setupComponent()
Set the property values to the component. |
void |
setValues(java.util.Vector items)
Calls appendText for all elements of the vector. |
| Methods inherited from class de.cbse.jeasy.JEComponent |
actionPerformed, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addListeners, backupEntry, caretPositionChanged, caretUpdate, changedUpdate, componentHidden, componentMoved, componentResized, componentShown, examine, examine, focusGained, focusLost, getAddableComponent, getAnimation, getBackupEntry, getButtonBehind, getClosedIcon, getComponent, getDataType, getIcon, getJEButtonBehind, getJLabel, getJScrollpane, getLabel, getLabelBehind, getLabelText, getLeafIcon, getMandatory, getName, getOpenIcon, getParentId, getToolTipText, getTreeNode, getValue, getValueBeforeFocus, getValueNotNull, getValues, getWindow, inputMethodTextChanged, insertUpdate, isAnimated, isExiting, isListening, isShowing, isVerified, isVisible, itemStateChanged, jCallBackInputVerifier, keyPressed, keyReleased, keyTyped, menuKeyPressed, menuKeyReleased, menuKeyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, popupMenuCanceled, popupMenuWillBecomeInvisible, popupMenuWillBecomeVisible, propertyChange, refresh, remove, removeActionListeners, removeUpdate, repaint, restoreEntry, restoreValueBeforeFocus, setAnimated, setBackground, setBackground, setEnabled, setEnabled, setExiting, setFocus, setForeground, setForeground, setIcon, setListening, setMandatory, setParentId, setProperties, setText, setToolTipText, setTreeNode, setValue, setValueBeforeFocus, setVerified, setVisible, setVisible, stateChanged, tableChanged, textUpdate, timerTask, transferFocus, transferFocusBackward, treeCollapsed, treeExpanded, treeNodesChanged, treeNodesInserted, treeNodesRemoved, treeStructureChanged, valueChanged, valueChanged, wasEntryChanged, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened |
| Methods inherited from class de.cbse.jeasy.JEObject |
clearPreview, clone, getApplLocale, getBorderConstantProperty, getBorderProperty, getCharGProperty, getCharProperty, getColorProperty, getConstraintsProperty, getFontProperty, getGProperty, getGradientPaintProperty, getId, getImageConstantProperty, getImageIconProperty, getInsetsProperty, getJEGlobal, getJETexturePaintProperty, getLayoutProperty, getLocaleProperties, getObjectsHashMap, getObjectsNonPreviewHashMap, getPreviewHashMap, getPreviewObject, getProjectDirectory, getPropertieHashMap, getProperty, getProperty, getPropertyAsArray, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsInteger, getPropertyAsObject, getPropertyAsObject, getPropertyAsVector, getPropertyAsVector, getReferenceButtonBehind, getReferenceId, getRegisterText, getResourceUrl, getRootPane, getRootPaneId, getSwingConstantProperty, getTabbedPaneConstantProperty, getTexturePaintProperty, getType, getUniqueNumber, hasSuperclass, invoke, invoke, invoke, invoke, isApplet, isEnterprise, isGlobalAnimation, isGlobalListening, isInited, isPreview, isPreviewMember, isProfessional, isRefresh, isSetuped, isStandard, registerJEObject, removeProperties, removeProperty, removeProperty, setApplet, setApplLocale, setGlobalAnimation, setGlobalListening, setInited, setJeGlobal, setLocaleProperties, setPreview, setPreviewHashMap, setPreviewMember, setPreviewObject, setProjectDirectory, setPropertieHashMap, setProperties, setProperties, setProperty, setProperty, setRefresh, setRootPane, setRootPaneId, setSetuped, setType, show |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JEDataField
public JEDataField(JELocaleProperties hm)
- Reads the properties from a HashMap
- Parameters:
hm - HashMap
JEDataField
public JEDataField(JENode jen)
- Constructor based on a XML file parsed to a TreeNode.
- Parameters:
jen - - See Also:
JESaxParser
setEditable
public void setEditable(boolean b)
- Makes the component editable or not
isEditable
public boolean isEditable()
- Gets whether the component is editable or not
- Overrides:
isEditable in class JEComponent
setCaretPosition
public void setCaretPosition(int i)
- Sets the position of the text insertion caret for the TextComponent.
The position must be between 0 and the length of the component's text or else an exception is thrown.
scrollToLastLine
public void scrollToLastLine()
- Sets the caret position of the text insertion caret to the beginning of the last line.
The scrollpane will scroll down.
clear
public void clear()
- Clears the JTextfield
getColumns
public int getColumns()
- Gets the maximal width of the textfield in characters. It is the maximum
of the columns of the datafield or datatype and the field length definied as maxFieldLength in
global.
- Overrides:
getColumns in class JEComponent
- Returns:
setValues
public void setValues(java.util.Vector items)
- Calls appendText for all elements of the vector.
- Overrides:
setValues in class JEComponent
- Parameters:
itemVector -
init
protected void init()
- Initialization of the SWING objects.
- Overrides:
init in class JEComponent
setupComponent
public void setupComponent()
- Set the property values to the component.
- Overrides:
setupComponent in class JEComponent
getText
public java.lang.String getText()
- Gets the text of the JTextField
- Returns:
deserialize
public java.lang.String deserialize(java.lang.String s)
- Converts a String to the format of the datafield
- Returns:
- Object
serialize
public java.lang.String serialize()
- Gets the text of the textfield and converts using the serializeFormatter
- Returns:
- Object
appendText
public void appendText(java.lang.String s)
- Appends a text to the JTextArea or JTextField
insertText
public void insertText(java.lang.String s)
- Inserts a text at the caretPosition, if the field is a JTextArea.
In jeasy a JTextArea is used if more than one column is defined.
appendText
public void appendText(JENode node)
- Appends a node to the JTextArea or JTextField regarding the locale property
getLines
public java.util.Vector getLines()
- Gets the text separated by \n as a vector.
- Returns:
getJTextArea
public javax.swing.JTextArea getJTextArea()
- If the datafields JTextCompoent is a JTextArea this will be returned. Otherwise null.
- Returns:
getCaretPosition
public int getCaretPosition()
- Gets the caret position of the JTextComponent
- Returns: