|
||||||||||
| 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.text.JTextComponent
javax.swing.JTextField
tecgraf.javautils.gui.field.AbstractRegexField
public abstract class AbstractRegexField
Classe genérica para campos com máscara e validação. A máscara é formada por
uma expressão regular definida pelo método getMaskRegex. Possui opção de
trocar a cor de fundo caso o valor do campo não esteja válido. Pode-se
adicionar um objeto de complemento de texto. É aconselhável utilizar o método
init no construtor da classe filha.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JTextField |
|---|
JTextField.AccessibleJTextField |
| Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
|---|
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding |
| 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 | |
|---|---|
static String |
ANY_STRING_REGEX
expressão regular para representar qualquer texto |
| Fields inherited from class javax.swing.JTextField |
|---|
notifyAction |
| Fields inherited from class javax.swing.text.JTextComponent |
|---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
| 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 javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
AbstractRegexField()
Construtor. |
|
AbstractRegexField(boolean showValidation)
Construtor. |
|
| Method Summary | |
|---|---|
void |
enableBackgroundError(boolean showValidation)
Deprecated. replaced by setBackgroundError(showValidation). |
protected RegexDocument |
getRegexDocument()
|
abstract boolean |
isValidValue()
Verifica se o valor do campo é válido. |
void |
setBackgroundError(boolean showValidation)
Ativa a troca da cor do fundo caso o texto não esteja válido. |
void |
setBackgroundError(Color backgroundError)
Deprecated. replaced by setBackgroundErrorColor(backgroundError). |
void |
setBackgroundErrorColor(Color backgroundError)
Altera a cor de fundo em caso de erro na auto-validação do campo |
void |
setForegroundError(Color foregroundError)
Deprecated. replaced by setForegroundErrorColor(foregroundError). |
void |
setForegroundErrorColor(Color foregroundError)
Seta a cor da letra em caso de erro na auto-validação do campo |
void |
setText(String t)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ANY_STRING_REGEX
| Constructor Detail |
|---|
public AbstractRegexField()
public AbstractRegexField(boolean showValidation)
showValidation - Ativa a troca da cor do fundo caso o texto não esteja
válido.| Method Detail |
|---|
public void setText(String t)
setText in class JTextComponentpublic abstract boolean isValidValue()
protected RegexDocument getRegexDocument()
public void setBackgroundErrorColor(Color backgroundError)
backgroundError - @Deprecated public void setBackgroundError(Color backgroundError)
setBackgroundErrorColor(backgroundError).
backgroundError - public void setBackgroundError(boolean showValidation)
showValidation - @Deprecated public void enableBackgroundError(boolean showValidation)
setBackgroundError(showValidation).
showValidation - public void setForegroundErrorColor(Color foregroundError)
foregroundError - @Deprecated public void setForegroundError(Color foregroundError)
setForegroundErrorColor(foregroundError).
foregroundError -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||