com.cbse.jeasy
Class JEComboList

java.lang.Object
  extended by com.cbse.jeasy.JEObject
      extended by com.cbse.jeasy.JEComboList
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.util.EventListener

public class JEComboList
extends JEObject
implements java.awt.event.FocusListener, java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.ItemListener, java.awt.event.MouseListener

A class using a JLabel a JComboBox and a JButton. ComboList is like a ComboBox where all items are selected. It is not used to select one but showing all selected items. When it is transfered to a message, all items are put into the message. In a combobox only the selected item you see in the box will be transfered. You can use the button to get a callback for organizing the list of items.

Properties
name values comment
id * Id of the object. Let it begin with CL_
button true
false
Set true will set a button behind the field, which will send the id of the JEComboList as an ActionCommand to the callBack
XMLtag*The tagname used to serialize the item in xml format.
name   It is the name of the label.
labelConstraints   Constraints for JLabel
textfieldConstraints   Constraints for JTextField
width int value The width of the combobox in pixels.
height int value The height of the combobox in pixels.
visible true
false
Set to false will hide the label and the field in panels and tables.
editable true
false
Set true will make the box editable
mandatory true
false
Defines an entry as mandatory
E1
.
En
  Textelements to be shown in the ComboList
* = 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
JEComboList()
           
JEComboList(java.lang.String s)
          Reads the properties from a string.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void backupEntry()
          The current selected item will be stored internal to check against changes
 void clear()
          Removes all entries of the combobox
 void disableListeners()
          Removes the Key- Action- Item- and FocusListener
 void enableListeners()
          Adds the Key- Action- Item- and FocusListener after a previous disableListeners()
 int examine()
          Checks if an entry is mandatoy
 void focusGained(java.awt.event.FocusEvent e)
           
 void focusLost(java.awt.event.FocusEvent e)
           
 boolean getAntialiasing()
          Gets the anialialising flag
 javax.swing.DefaultListModel getBackupEntry()
          Gets the backuped selected item
 javax.swing.JComboBox getComboBox()
          Gets the jfc-Component JCombobox
 javax.swing.JComponent getComponent()
          Gets the JComponent based on this JEasy Object
 java.lang.String getElementAt(int n)
          Gets the component of element n
 int getElementSize()
          Gets the number of elements
 java.lang.Class getJClass()
          Get the JClass
 java.awt.GridBagConstraints getLabelConstraints()
           
 java.awt.Font getLabelFont()
           
 javax.swing.DefaultListModel getListModel()
          Gets the ListModel of the combobox
 java.lang.String getName()
          Gets the name of the label
 java.lang.String getText()
          Gets the selected item
 java.awt.GridBagConstraints getTextFieldConstraints()
           
 java.awt.Font getTextFieldFont()
           
 java.lang.String getXMLtag()
          Gets the XMLtag.
 boolean isEditable()
          See isEnabled()
 boolean isEnabled()
          False if the state of the ComboBox should not be changed in a Table or Panel
 boolean isMandatory()
          Return if an entry is mandatory
 boolean isVisible()
          False if the ComboBox should not be shown in a Table or Panel
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 void JEadd(java.awt.Container co, java.awt.LayoutManager lm)
          Adds the JEObject to the Container and the Containers LayoutManager
 void JEadd(java.lang.String border, java.awt.Container co)
          Adds the JEObject to a Container with a 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 remove()
          Removes all entries of the combobox
 void restoreEntry()
          Selects the item that was backuped before
 void setEditable(boolean b)
          setEditable of the combolist
 void setEnabled(boolean eb)
          Enables/disables the combobox and the button
 void setMandatory(boolean b)
          Sets the entry mandatory or not
 void setText(java.lang.String ts)
          Sets the selected item to ts
 void setVisible(boolean bv)
          setVisible of the ComboBox
 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
 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, getId, getJCallBack, getLabel, getMode, getNorth, getObjLocale, getParentId, getPreview, getProjectDirectory, getProperty, getRegisterText, getSouth, getStarted, getTitle, getType, getWest, isEnterprise, isProfessional, isStandard, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEaddTab, removeProperties, removeProperty, serializeValue, setApplet, setApplLocale, setEditable, setEnabled, setFocus, setJCallBack, setMarkable, 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

JEComboList

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

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

JEComboList

public JEComboList()
Method Detail

getElementSize

public int getElementSize()
Description copied from class: JEObject
Gets the number of elements

Overrides:
getElementSize in class JEObject
Returns:
id of the JEObject or null

getElementAt

public java.lang.String getElementAt(int n)
Description copied from class: JEObject
Gets the component of element n

Overrides:
getElementAt in class JEObject
Returns:
id of the JEObject or null

getName

public java.lang.String getName()
Gets the name of the label

Overrides:
getName in class JEObject
Returns:
String

setMandatory

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


isMandatory

public boolean isMandatory()
Return if an entry is mandatory


getComboBox

public javax.swing.JComboBox getComboBox()
Gets the jfc-Component JCombobox

Returns:
JComboBox

getComponent

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

Overrides:
getComponent in class JEObject
Returns:
JComponent

getListModel

public javax.swing.DefaultListModel getListModel()
Gets the ListModel of the combobox

Returns:
ListModel

getJClass

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

Overrides:
getJClass in class JEObject
Returns:

getText

public java.lang.String getText()
Gets the selected item

Returns:
Textelement of the ComboBox

setText

public void setText(java.lang.String ts)
Sets the selected item to ts

Parameters:
the - string to be set

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


setEditable

public void setEditable(boolean b)
setEditable of the combolist

Overrides:
setEditable in class JEObject

setEnabled

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

Overrides:
setEnabled in class JEObject

setVisible

public void setVisible(boolean bv)
setVisible of the ComboBox

Overrides:
setVisible in class JEObject

isVisible

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

Overrides:
isVisible in class JEObject
Returns:
visible

isEnabled

public boolean isEnabled()
False if the state of the ComboBox should not be changed in a Table or Panel

Overrides:
isEnabled in class JEObject
Returns:
enabled

isEditable

public boolean isEditable()
See isEnabled()

Overrides:
isEditable in class JEObject
Returns:
editable

examine

public int examine()
Checks if an entry is mandatoy

Returns:
0 if an entry is set or mandatory is false else JEObject.INPUT_ERROR_MANDATORY

getLabelFont

public java.awt.Font getLabelFont()

getTextFieldFont

public java.awt.Font getTextFieldFont()

getLabelConstraints

public java.awt.GridBagConstraints getLabelConstraints()

getTextFieldConstraints

public java.awt.GridBagConstraints getTextFieldConstraints()

disableListeners

public void disableListeners()
Removes the Key- Action- Item- and FocusListener


enableListeners

public void enableListeners()
Adds the Key- Action- Item- and FocusListener after a previous disableListeners()


getAntialiasing

public boolean getAntialiasing()
Gets the anialialising flag


clear

public void clear()
Removes all entries of the combobox

Overrides:
clear in class JEObject

remove

public void remove()
Removes all entries of the combobox


backupEntry

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

Overrides:
backupEntry in class JEObject

getBackupEntry

public javax.swing.DefaultListModel getBackupEntry()
Gets the backuped selected item

Returns:
String

restoreEntry

public void restoreEntry()
Selects the item that was backuped before

Overrides:
restoreEntry in class JEObject

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

transferFocus

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


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)
Description copied from class: JEObject
Adds the JEObject to the Container and the Containers LayoutManager

Overrides:
JEadd in class JEObject

JEadd

public void JEadd(java.lang.String border,
                  java.awt.Container co)
Description copied from class: JEObject
Adds the JEObject to a Container with a 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

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

keyReleased

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

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

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener