|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JComboBox
verinec.gui.configurator.nodeeditor.EditorComboBox
public class EditorComboBox
The EditorComboBox works very similar to the EditorTextField, except that
there is no need for validation of the input data. It also changes color upon
modification and creates or removes XML attributes if necessary.
The array holding the strings to choose from is a constant in the InputValidator class and is passed as an argument on creation.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComboBox |
|---|
JComboBox.AccessibleJComboBox, JComboBox.KeySelectionManager |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected String |
attributeName
The Name of the XML attribute in which the value is stored. |
protected Element |
elem
A link to the XML Element which contains the XML attribute. |
private JLabel |
label
The label; is stored as an instance field and will be displayed next to the field. |
private Logger |
logger
|
private String |
previousInputValue
If the value of a field is changed, its original value is stored in this variable. |
| Fields inherited from class javax.swing.JComboBox |
|---|
actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, selectedItemReminder |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
EditorComboBox(String attributeName,
Element elem,
String[] inputValidatorMessage,
String labelString)
See the Field summary for detailed information about the different parameters. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
React on an action: call transferFocus. |
void |
checkInput()
If the value is empty, the Attribute is removed - unless the Attribute is necessary, in which case it is reset to its previous value (which obviously was correct). |
void |
discard()
Resets all the changed (i.e. green) values. |
void |
discardRed()
Should never happen and does nothing, a combobox value cannot be invalid. |
void |
focusGained(FocusEvent e)
Necessary for a class implementing FocusListener. |
void |
focusLost(FocusEvent e)
After the focus is lost, check the field input. |
JLabel |
getJLabel()
Get the label. |
void |
save()
Saves the current value of the field. |
boolean |
update()
Checks if there have been changes in the fields. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final String attributeName
private String previousInputValue
protected Element elem
private JLabel label
private Logger logger
| Constructor Detail |
|---|
public EditorComboBox(String attributeName,
Element elem,
String[] inputValidatorMessage,
String labelString)
attributeName - The Name of the XML attribute in which the value is stored.elem - The XML Element which contains the attribute controlled by this combo box.inputValidatorMessage - An array of strings which is passed on to the super constructor.labelString - Text to display for the value.| Method Detail |
|---|
public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListeneractionPerformed in class JComboBoxe - The action.public void focusGained(FocusEvent e)
focusGained in interface FocusListenere - The event.public void focusLost(FocusEvent e)
focusLost in interface FocusListenere - The event.public void checkInput()
public boolean update()
update in interface IEditorComponentpublic void save()
save in interface IEditorComponentpublic void discard()
previousInputValue.
discard in interface IEditorComponentpublic void discardRed()
discardRed in interface IEditorComponentpublic JLabel getJLabel()
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||