com.cbse.jeasy
Class JEDataarea

java.lang.Object
  extended by com.cbse.jeasy.JEObject
      extended by com.cbse.jeasy.JEDataarea
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.util.EventListener, javax.swing.event.DocumentListener

public class JEDataarea
extends JEObject
implements java.awt.event.FocusListener, java.awt.event.KeyListener, javax.swing.event.DocumentListener, java.awt.event.MouseListener

A class using a JLabel a JTextArea and a JButton to build an inputarea in a component. A dataarea always references a dataclass.

Properties
name values comment
id * Id of the object. Let it begin with DA_
dataclass * Reference to JEDataclass
tooltip   Text in Tooltip
editable true
false
Set to false will change the field to an outputfield.
border Id of a border.
enabledtrue
false
Enables or disables the component.
XMLtag*The tagname used to serialize the item in xml format.
lineWrap true
false
Sets the line-wrapping policy of the text area.
WrapStyleWord true
false
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 (whitespace) if they are too long to fit within the allocated width. If set to false, the lines will be wrapped at character boundaries. By default this property is false.
button true
false
Set true will set a button behind the field, which will send the id of the JEDataarea as an ActionCommand to the callBack
fieldlength   It will overwrite the value of JEDataclass. It sets the length of the JTextArea. It can be overwritten by maxfieldlength in jeglobal.
rows   It sets the rows in the JTextArea.
markingBackgorund true
false
Set to true will use the global background color.
mandatory true
false
Defines an entry as mandatory
markable true
false
The field will get a focus even it is not editable and you can copy data from it
scrollpane true
false
When set to true, the textfield will be scrollable.
name   It will overwrite the name of the JEDataclass. It is the name of the label of the textfield.
labelConstraints   Constraints for JLabel
textfieldConstraints   Constraints for JTextArea
* = property you have to set; bold = default value

Version:
%I%, %G%
Author:
H.Pfohl

Field Summary
 
Fields inherited from class com.cbse.jeasy.JEObject
DEVELOPPING, INPUT_ERROR_DATE, INPUT_ERROR_LENGTH, INPUT_ERROR_MANDATORY, INPUT_ERROR_PARSE, INPUT_ERROR_RANGE, INPUT_ERROR_TIME, INPUT_ERRORS, NO_INPUT_ERROR, RUNNING
 
Constructor Summary
JEDataarea(java.lang.String s)
          Reads the properties from a string.
 
Method Summary
 void backupEntry()
          The current text will be stored internal to check against changes
 void changedUpdate(javax.swing.event.DocumentEvent e)
           
 void clear()
          Clears the JTextArea
 int examine()
           
 int examine(java.lang.String s)
           
 void focusGained(java.awt.event.FocusEvent e)
           
 void focusLost(java.awt.event.FocusEvent e)
           
 boolean getAntialiasing()
          Gets the anialialising flag
 java.lang.String getBackupEntry()
          Gets the backuped text
 javax.swing.border.Border getBorder()
          Get the border
 javax.swing.JComponent getComponent()
          Gets the JComponent based on this JEasy Object
 JEDataclass getDataclass()
          Get the JEDataclass
 java.lang.Class getJClass()
          Get the JClass
 javax.swing.JLabel getJLabel()
          Get the JLabel
 java.lang.String getName()
          Gets the name from JEDataarea or JEDataclass
 java.lang.String getText()
          The text from the JTextArea
 javax.swing.JTextArea getTextArea()
          Get the JTextarea
 java.util.Vector getTextVector()
          Get the text in the JTextarea as a Vector
 java.lang.String getToolTip()
          Gets the toolTipText
 java.lang.String getXMLtag()
          Gets the XMLtag.
 void insertUpdate(javax.swing.event.DocumentEvent e)
           
 boolean isEditable()
          False if the Datafield should not be edited in a Table or Panel
 boolean isMandatory()
          Return if an entry is mandatory
 boolean isMarkable()
          Return if an entry is markable
 boolean isVisible()
          False if the Datafield should not be shown in a Table or Panel
 void JEadd(java.awt.Container co, java.awt.LayoutManager lm)
          Adds the Component to a Container.
 void JEadd(java.lang.String border, java.awt.Container co)
          Adds the JTextArea to the Center of a Container using BorderLayout
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void removeUpdate(javax.swing.event.DocumentEvent e)
           
 void restoreEntry()
          Sets the entry of the component to the backuped value
 void setEditable(boolean eb)
          Enables/disables the textfield for input
 void setEnabled(boolean eb)
          Enables/disables the textfield and the button
 boolean setFocus()
          Sets the focus if editable
 void setMandatory(boolean b)
          Sets the entry mandatory or not
 void setMarkable(boolean eb)
          Enables or disables the inputfield for editing
 void setText(java.lang.String ts)
          Sets a String into the JTextArea
 void setVerified(boolean b)
           
 void setVisible(boolean bv)
          setVisible of the label textfield and the button
 void setXMLtag(java.lang.String s)
          Sets the XMLtag
 void start()
          Creates the jfc components using the properties
 void transferFocus()
          transfers the focus to the next field
 void verify()
          Activate the verifier as if the focus were lost Call this methode of you want to check the entry after you have set it by setText(...)
 boolean wasEntryChanged()
          The components compares the current entry with the data stored by backupEntry()
 
Methods inherited from class com.cbse.jeasy.JEObject
deserializeValue, getApplet, getApplLocale, getCenter, getEast, getElementAt, getElementSize, getId, getJCallBack, getLabel, getMode, getNorth, getObjLocale, getParentId, getPreview, getProjectDirectory, getProperty, getRegisterText, getSouth, getStarted, getTitle, getType, getWest, isEnabled, isEnterprise, isProfessional, isStandard, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEaddTab, removeProperties, removeProperty, serializeValue, setApplet, setApplLocale, setEditable, setEnabled, setJCallBack, setMarkable, setMode, setObjLocale, setParentId, setPreview, setProjectDirectory, setProperty, setStarted, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JEDataarea

public JEDataarea(java.lang.String s)
Reads the properties from a string.

Parameters:
s - contains properties and values
See Also:
JE#PropertyString
Method Detail

getDataclass

public JEDataclass getDataclass()
Get the JEDataclass

Returns:
JEDataclass

getJLabel

public javax.swing.JLabel getJLabel()
Get the JLabel

Returns:
JLabel

setMandatory

public void setMandatory(boolean b)
Sets the entry mandatory or not


isMandatory

public boolean isMandatory()
Return if an entry is mandatory


isMarkable

public boolean isMarkable()
Return if an entry is markable


setMarkable

public void setMarkable(boolean eb)
Description copied from class: JEObject
Enables or disables the inputfield for editing

Overrides:
setMarkable in class JEObject

getTextArea

public javax.swing.JTextArea getTextArea()
Get the JTextarea

Returns:
JTextArea

getBorder

public javax.swing.border.Border getBorder()
Get the border

Returns:
Border

getComponent

public javax.swing.JComponent getComponent()
Gets the JComponent based on this JEasy Object

Overrides:
getComponent in class JEObject
Returns:
JComponent

getAntialiasing

public boolean getAntialiasing()
Gets the anialialising flag


getJClass

public java.lang.Class getJClass()
Get the JClass

Overrides:
getJClass in class JEObject
Returns:

getName

public java.lang.String getName()
Gets the name from JEDataarea or JEDataclass

Overrides:
getName in class JEObject
Returns:
lable

getXMLtag

public java.lang.String getXMLtag()
Gets the XMLtag. Returns the id if no XMLtag is specified

Overrides:
getXMLtag in class JEObject
Returns:
String

setXMLtag

public void setXMLtag(java.lang.String s)
Sets the XMLtag


getToolTip

public java.lang.String getToolTip()
Gets the toolTipText

Returns:
String

getText

public java.lang.String getText()
The text from the JTextArea

Returns:
String

getTextVector

public java.util.Vector getTextVector()
Get the text in the JTextarea as a Vector

Returns:
Vector of strings

setText

public void setText(java.lang.String ts)
Sets a String into the JTextArea


verify

public void verify()
Activate the verifier as if the focus were lost Call this methode of you want to check the entry after you have set it by setText(...)


setEnabled

public void setEnabled(boolean eb)
Enables/disables the textfield and the button

Overrides:
setEnabled in class JEObject

setEditable

public void setEditable(boolean eb)
Enables/disables the textfield for input

Overrides:
setEditable in class JEObject

setVisible

public void setVisible(boolean bv)
setVisible of the label textfield and the button

Overrides:
setVisible in class JEObject

isVisible

public boolean isVisible()
False if the Datafield should not be shown in a Table or Panel

Overrides:
isVisible in class JEObject
Returns:
visible

isEditable

public boolean isEditable()
False if the Datafield should not be edited in a Table or Panel

Overrides:
isEditable in class JEObject
Returns:
editable

setFocus

public boolean setFocus()
Sets the focus if editable

Overrides:
setFocus in class JEObject

clear

public void clear()
Clears the JTextArea

Overrides:
clear in class JEObject

backupEntry

public void backupEntry()
The current text will be stored internal to check against changes

Overrides:
backupEntry in class JEObject

getBackupEntry

public java.lang.String getBackupEntry()
Gets the backuped text

Returns:
String

restoreEntry

public void restoreEntry()
Sets the entry of the component to the backuped value

Overrides:
restoreEntry in class JEObject

transferFocus

public void transferFocus()
transfers the focus to the next field


wasEntryChanged

public boolean wasEntryChanged()
The components compares the current entry with the data stored by backupEntry()

Overrides:
wasEntryChanged in class JEObject
Returns:
true data was changed false current data is equal backup data

start

public void start()
Creates the jfc components using the properties

Overrides:
start in class JEObject
See Also:
JE#start

JEadd

public void JEadd(java.awt.Container co,
                  java.awt.LayoutManager lm)
Adds the Component to a Container. Uses the constraints when the LayoutManager is a GridBagLayout.

Overrides:
JEadd in class JEObject

JEadd

public void JEadd(java.lang.String border,
                  java.awt.Container co)
Adds the JTextArea to the Center of a Container using BorderLayout

Overrides:
JEadd in class JEObject

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Specified by:
focusLost in interface java.awt.event.FocusListener

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent e)
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent e)
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent e)
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener

examine

public int examine()

examine

public int examine(java.lang.String s)

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

setVerified

public void setVerified(boolean b)