|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.cbse.jeasy.JEObject
com.cbse.jeasy.JEComboBox
public class JEComboBox
A class using a JLabel a JComboBox and a JButton. In Swing you can addItems to a combobox. In JEasy the JECombobox can held an optional value you can set with addItemAndValue(..).
| Properties | ||
|---|---|---|
| name | values | comment |
| id | * | Id of the object. Let it begin with CB_ | button | true false |
Set true will set a button behind the field, which will send the id of the JEComboBox as an ActionCommand to the callBack |
| name |   | It is the name of the label of the ComboBox. |
| border |   | Id of a border. |
| background |   | Id of a color used as the background |
| tooltip |   | Text in Tooltip |
| XMLtag | * | The tagname used to serialize the item in xml format. |
| XMLValuetag | * | The tagname used to serialize the value in xml format. |
| mandatory | true false |
Defines an entry as mandatory |
| labelConstraints |   | Constraints for JLabel |
| textfieldConstraints |   | Constraints for JTextField |
| visible | true false |
Set to false will hide the label and the field in panels and tables. |
| numSelectionCharacters |   | Number of characters used to search matching entries of the combobox. It is used to select by typing the first characters. |
| editable | true false |
Set true will make the box editable |
| width | int value | The width of the combobox in pixels. |
| height | int value | The height of the combobox in pixels. |
| E1 . En |
  | Textelements to be shown in the ComboBox |
* = property you have to set; bold = default value
| 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 | |
|---|---|
JEComboBox(java.lang.String s)
Reads the properties from a string |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
addItem(java.lang.String text)
Add an item to the combobox |
void |
addItemAndValue(java.lang.String text,
java.lang.Object value)
Add an item to the combobox and an corresponding value |
void |
backupEntry()
The current selected item will be stored internal to check against changes |
void |
clear()
Selection of the first item |
void |
disableListeners()
Removes the ItemListener and ActionListener |
void |
enableListeners()
Adds the ItemListener and ActionListener after a previous disableListeners() |
int |
examine()
Checks if an entry is mandatoy |
void |
focusGained(java.awt.event.FocusEvent fe)
|
void |
focusLost(java.awt.event.FocusEvent fe)
|
boolean |
getAntialiasing()
Gets the anialialising flag |
java.awt.Color |
getBackground()
|
java.lang.String |
getBackupEntry()
Gets the backuped selected item |
javax.swing.border.Border |
getBorder()
Get the border |
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 textelement of index n in the origin XML |
int |
getElementSize()
Gets the number of textelements defined in the origin XML |
javax.swing.plaf.ColorUIResource |
getErrorBackground()
|
java.lang.Integer |
getIndexByValue(java.lang.Object value)
Gets the index by the value that was added with addItemAndValue |
java.lang.Object |
getItemAt(int n)
Gets the textelement of index n JCombobox |
java.lang.Object |
getItemByValue(java.lang.Object o)
Gets the item that was added with this value by addItemAndValue |
int |
getItemCount()
Gets the number of entries in the JCombobox |
java.lang.Class |
getJClass()
Get the JClass |
javax.swing.JLabel |
getJLabel()
Get the JLabel |
java.awt.GridBagConstraints |
getLabelConstraints()
Gets the LabelConstraints (i.e. global.labelConstraints) |
java.awt.Font |
getLabelFont()
Gets the font of the label (i.e. global.labelFont) |
boolean |
getMarkingBackground()
|
java.lang.String |
getName()
Gets the name of the label |
int |
getNumSelectionCharacters()
Gets the number of characters used to select an item bei keystroke. |
java.lang.String |
getSelectedItem()
Gets the selected item Same as getText() |
java.lang.String |
getText()
Gets the selected item |
java.awt.GridBagConstraints |
getTextFieldConstraints()
Gets the TextFieldConstraints (i.e. global.textfieldConstraints) |
java.awt.Font |
getTextFieldFont()
Gets the font of the textelements (i.e. global.textFieldFont) |
java.lang.Object |
getValue()
Gets the value of the selected item. |
java.lang.Object |
getValueAt(int n)
Gets the value of index n JCombobox |
java.lang.String |
getXMLtag()
Gets the XMLtag. |
java.lang.String |
getXMLValuetag()
Gets the XMLValuetag. |
boolean |
isEditable()
True if the combobox can be edited |
boolean |
isEnabled()
False if the state of the ComboBox should not be changed in a Table or Panel |
boolean |
isListenEnabled()
True if Listeners are enabled |
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 JLabel the JComboBox and the JButton when it is set to true to the Container. |
void |
JEadd(java.lang.String border,
java.awt.Container co)
Adds the Components 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 |
restoreEntry()
Selects the item that was backuped before |
void |
setBackground(java.awt.Color c)
Sets the background of the combobox |
void |
setBackground(java.lang.String jeasyColor)
|
void |
setEditable(boolean b)
setEditable of the combobox |
void |
setEnabled(boolean eb)
Enables/disables the combobox and the button |
boolean |
setFocus()
Sets the focus |
void |
setMandatory(boolean b)
Sets the entry mandatory or not |
boolean |
setMatchingItem(java.lang.String s)
Select item that begins with the given String and return true or return false if no item matches If the given string is empty the item of index 0 is selected and true is returned |
void |
setNumSelectionCharacters(int i)
Sets the number of characters used to select an item bei keystroke. |
void |
setRemoveOnClear(boolean b)
Set to true will remove all items on clear() |
void |
setSelectedIndex(int i)
Select index |
void |
setSelectedItem(java.lang.Object o)
Set the selected item to o. |
void |
setSelectedItem(java.lang.Object o,
java.lang.String value)
Set the selected item and value. |
void |
setSelectedItemByValue(java.lang.Object o)
Set the selected item to the given vaule added ba addItemAndValue(...) |
void |
setText(java.lang.String text)
Sets the selected item to text |
void |
setVisible(boolean bv)
setVisible of the combobox |
void |
setXMLtag(java.lang.String s)
Sets the XMLtag |
void |
setXMLValuetag(java.lang.String s)
Sets the XMLValuetag |
void |
start()
Creates jfc-Objects with the given properties. |
void |
transferFocus()
transfers the focus to the next field |
void |
transferFocusBackward()
transfers the focus to the previuos 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, 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 |
|---|
public JEComboBox(java.lang.String s)
s - contains properties and valuesJE#PropertyString| Method Detail |
|---|
public int getElementSize()
getElementSize in class JEObjectpublic void setMandatory(boolean b)
public boolean isMandatory()
public java.awt.Color getBackground()
public void setBackground(java.lang.String jeasyColor)
public javax.swing.JLabel getJLabel()
public void setBackground(java.awt.Color c)
public javax.swing.plaf.ColorUIResource getErrorBackground()
public javax.swing.border.Border getBorder()
public java.lang.String getElementAt(int n)
getElementAt in class JEObjectn - index beginning by zero
public java.lang.Object getItemAt(int n)
n - index beginning by zero
public java.lang.Object getItemByValue(java.lang.Object o)
public java.lang.Integer getIndexByValue(java.lang.Object value)
public java.lang.Object getValueAt(int n)
n - index beginning by zero
public int getItemCount()
public java.lang.String getName()
getName in class JEObjectpublic int getNumSelectionCharacters()
public void setNumSelectionCharacters(int i)
public java.lang.String getXMLtag()
getXMLtag in class JEObjectpublic void setXMLtag(java.lang.String s)
public java.lang.String getXMLValuetag()
public void setXMLValuetag(java.lang.String s)
public javax.swing.JComponent getComponent()
getComponent in class JEObjectpublic void disableListeners()
public void enableListeners()
public boolean isListenEnabled()
public javax.swing.JComboBox getComboBox()
public java.lang.Class getJClass()
getJClass in class JEObjectpublic boolean getMarkingBackground()
public java.lang.String getText()
public java.lang.String getSelectedItem()
public java.lang.Object getValue()
public void setText(java.lang.String text)
text - the string to be setpublic boolean setFocus()
setFocus in class JEObjectpublic void setRemoveOnClear(boolean b)
boolean - public void addItem(java.lang.String text)
the - string to be set
public void addItemAndValue(java.lang.String text,
java.lang.Object value)
text - the string to be setvalue - the value you can give this entry. Get it by getValuepublic void setEnabled(boolean eb)
setEnabled in class JEObjectpublic void setVisible(boolean bv)
setVisible in class JEObjectpublic boolean isVisible()
isVisible in class JEObjectpublic boolean isEnabled()
isEnabled in class JEObjectpublic boolean isEditable()
isEditable in class JEObjectpublic void setEditable(boolean b)
setEditable in class JEObjectpublic void setSelectedItem(java.lang.Object o)
public void setSelectedItem(java.lang.Object o,
java.lang.String value)
public void setSelectedItemByValue(java.lang.Object o)
public void setSelectedIndex(int i)
public boolean setMatchingItem(java.lang.String s)
public void clear()
clear in class JEObjectpublic void remove()
public void backupEntry()
backupEntry in class JEObjectpublic java.lang.String getBackupEntry()
public void restoreEntry()
restoreEntry in class JEObjectpublic int examine()
public boolean wasEntryChanged()
wasEntryChanged in class JEObjectpublic boolean getAntialiasing()
public java.awt.Font getLabelFont()
public java.awt.Font getTextFieldFont()
public java.awt.GridBagConstraints getLabelConstraints()
public java.awt.GridBagConstraints getTextFieldConstraints()
public void transferFocus()
public void transferFocusBackward()
public void start()
start in class JEObject
public void JEadd(java.awt.Container co,
java.awt.LayoutManager lm)
JEadd in class JEObjectContainer - where the Components are added
public void JEadd(java.lang.String border,
java.awt.Container co)
JEadd in class JEObjectString - "North" "South" "West" "East" "Center"Container - where the Components are addedpublic void focusGained(java.awt.event.FocusEvent fe)
focusGained in interface java.awt.event.FocusListenerpublic void focusLost(java.awt.event.FocusEvent fe)
focusLost in interface java.awt.event.FocusListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenerpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged in interface java.awt.event.ItemListenerpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListener
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||