com.cbse.jeasy
Class JEList

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

public class JEList
extends JEObject
implements java.awt.event.MouseListener, javax.swing.event.ListSelectionListener, java.awt.event.KeyListener, java.awt.event.FocusListener

A class using a JLabel a JList and JButton. A JList allows the user to select one or more objects from a list.

Properties
name values comment
id * Id of the object. Let it begin with LI_
name   It is the name of the label of the list.
button true
false
Set true will set a button behind the field, which will send the id of the JEList as an ActionCommand to the callBack
mandatory true
false
Defines an entry as mandatory
labelConstraints   Constraints for JLabel
textFieldConstraints   Constraints for JList
doubleclick   A command string send by a doubleclick on an item. You can fetch with callBack
singleclick   A command string send by a singleclick on an item. You can fetch with callBack
scrollpane true
false
When set to true, the list will be scrollable.
E1
.
En
  Elements to be added in the toolbar.
* = 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
JEList()
           
JEList(java.lang.String s)
          Reads the properties from a string.
 
Method Summary
 void addItem(java.lang.Object o)
          Adds an item to the list
 void backupEntry()
          The current selected item will be stored internal to check against changes
 void clear()
          Removes all items from the list
 void clearSelection()
          Clears the selection
 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.JComponent getComponent()
          Gets the JComponent based on this JEasy Object
 javax.swing.DefaultListModel getDefaultListModel()
          Returns the length of the ListModel
 int getElementSize()
          Gets the number of elements
 java.awt.GridBagConstraints getLabelConstraints()
           
 java.awt.Font getLabelFont()
           
 javax.swing.JList getList()
          Gets the JList component.
 java.lang.Object getListModelElementAt(int i)
          Gets the entry of index
 int getListModelSize()
          Returns the length of the ListModel
 javax.swing.ListModel getModel()
          Gets the model of the JList.
 java.lang.String getName()
          Gets the label of the JEObject
 int[] getSelectedIndices()
          Gets the selected indices.
 java.lang.Object[] getSelectedValues()
          Gets the selected values.
 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 jlist should not be changed in a Panel
 boolean isMandatory()
          Return if an entry is mandatory
 boolean isVisible()
          False if the jlist should not be shown in a Panel
 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
 void removeItem(java.lang.Object o)
          Adds an item to the list
 void restoreEntry()
          Selects the item that was backuped before
 void setEnabled(boolean eb)
          Enables/disables the combobox and the button
 void setListData(java.lang.Object[] oa)
          Sets the entrys out of an array
 void setListData(java.util.Vector v)
          Sets the entrys out of a vector
 void setMandatory(boolean b)
          Sets the entry mandatory or not
 void setModel(javax.swing.ListModel lm)
          Sets the ListModel
 void setSelectedIndex(int index)
          Selects a cell given by index
 void setSelectedValue(java.lang.Object obj, boolean scroll)
          Selects a cell given by value
 void setVisible(boolean bv)
          setVisible of the checkbox
 void setXMLtag(java.lang.String s)
          Sets the XMLtag
 void start()
          Creates the jfc components using the properties
 void valueChanged(javax.swing.event.ListSelectionEvent e)
          ListSelectionListener
 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, getId, getJCallBack, getJClass, 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, 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

JEList

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

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

JEList

public JEList()
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

setMandatory

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


isMandatory

public boolean isMandatory()
Return if an entry is mandatory


getListModelSize

public int getListModelSize()
Returns the length of the ListModel


getDefaultListModel

public javax.swing.DefaultListModel getDefaultListModel()
Returns the length of the ListModel


getListModelElementAt

public java.lang.Object getListModelElementAt(int i)
Gets the entry of index


clear

public void clear()
Removes all items from the list

Overrides:
clear in class JEObject

clearSelection

public void clearSelection()
Clears the selection


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

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


restoreEntry

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

Overrides:
restoreEntry in class JEObject

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

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

getName

public java.lang.String getName()
Description copied from class: JEObject
Gets the label of the JEObject

Overrides:
getName in class JEObject
Returns:
lable

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 checkbox

Overrides:
setVisible in class JEObject

isVisible

public boolean isVisible()
False if the jlist should not be shown in a Panel

Overrides:
isVisible in class JEObject
Returns:
visible

isEnabled

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

Overrides:
isEnabled in class JEObject
Returns:
enabled

isEditable

public boolean isEditable()
See isEnabled()

Overrides:
isEditable in class JEObject
Returns:
editable

remove

public void remove()
Removes all entries


setModel

public void setModel(javax.swing.ListModel lm)
Sets the ListModel


setListData

public void setListData(java.util.Vector v)
Sets the entrys out of a vector


setListData

public void setListData(java.lang.Object[] oa)
Sets the entrys out of an array


setSelectedIndex

public void setSelectedIndex(int index)
Selects a cell given by index


setSelectedValue

public void setSelectedValue(java.lang.Object obj,
                             boolean scroll)
Selects a cell given by value


getList

public javax.swing.JList getList()
Gets the JList component.

Returns:
the jfc component

getComponent

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

Overrides:
getComponent in class JEObject
Returns:
JComponent

getModel

public javax.swing.ListModel getModel()
Gets the model of the JList.

Returns:
the jfc component

getSelectedIndices

public int[] getSelectedIndices()
Gets the selected indices.

Returns:
an array of int with the indices

getSelectedValues

public java.lang.Object[] getSelectedValues()
Gets the selected values.

Returns:
the jfc component

getAntialiasing

public boolean getAntialiasing()
Gets the anialialising flag


addItem

public void addItem(java.lang.Object o)
Adds an item to the list


removeItem

public void removeItem(java.lang.Object o)
Adds an item to the list


getLabelFont

public java.awt.Font getLabelFont()

getTextFieldFont

public java.awt.Font getTextFieldFont()

getLabelConstraints

public java.awt.GridBagConstraints getLabelConstraints()

getTextFieldConstraints

public java.awt.GridBagConstraints getTextFieldConstraints()

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

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

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

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
ListSelectionListener

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener

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

keyTyped

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

keyReleased

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

keyPressed

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