|
||||||||||
| 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
com.izforge.izpack.panels.userinput.gui.rule.RuleInputField
public class RuleInputField
This class assists the user in entering serial numbers.
Serial numbers, license number, CD keys and the like are often lenghty alpha-numerical numbers.
In many cases they are devided into multiple parts by dash or point separators. Entering these in
a single text field can be a frustrating experience for the user. This class provides a way of
presenting the user with an assembly of input fields that are arranged in the same way as the
key, with the separators already in place. Immideate testing for format compliance if performed
ans soon as each field is completed. In addition, the cursor is automatically advanced to make
entering numbers as painless as possible.
Formatting:
N:X:Y - numeric field, accepts digits only
H:X:Y - hex field, accepts only hexadecimal digits
A:X:Y - alpha field, accepts only letters, no digits
AN:X:Y- alpha-numeric field, accepts digits and letters
"N:4:4 - H:6:6 - AN:3:3 x A:5:5"
| Nested Class Summary |
|---|
| 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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| 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 | |
|---|---|
RuleInputField(RuleField field)
Constructs a RuleInputField. |
|
| Method Summary | |
|---|---|
void |
caretUpdate(CaretEvent event)
Called when the caret position is updated. |
void |
focusGained(FocusEvent event)
Invoked when a component gains the keyboard focus. |
void |
focusLost(FocusEvent event)
Invoked when a component loses the keyboard focus. |
List<JTextField> |
getInputFields()
|
String |
getText()
Returns the field contents, formatted according to its RuleFormat. |
String[] |
getValues()
Returns the field values. |
void |
keyPressed(KeyEvent event)
This method is invoked when a key has been pressed. |
void |
keyReleased(KeyEvent event)
This method is invoked when a key has been released. |
void |
keyTyped(KeyEvent event)
This method is invoked when a key has been typed. |
void |
setEnabled(boolean enabled)
|
void |
setValues(String[] values)
Sets the field values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RuleInputField(RuleField field)
RuleInputField.
field - the field| Method Detail |
|---|
public List<JTextField> getInputFields()
public String getText()
RuleFormat.
public String[] getValues()
public void setValues(String[] values)
values - the values to setpublic void setEnabled(boolean enabled)
setEnabled in class JComponentpublic void keyTyped(KeyEvent event)
keyTyped in interface KeyListenerevent - the key event forwarded by the system.public void keyPressed(KeyEvent event)
keyPressed in interface KeyListenerevent - the key event forwarded by the system.public void keyReleased(KeyEvent event)
keyReleased in interface KeyListenerevent - the key event forwarded by the system.public void focusGained(FocusEvent event)
focusGained in interface FocusListenerevent - the focus event forwardes by the sytem.public void focusLost(FocusEvent event)
focusLost in interface FocusListenerevent - the focus event forwardes by the sytem.public void caretUpdate(CaretEvent event)
caretUpdate in interface CaretListenerevent - the caret event received from the text field
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||