|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectswingwt.awt.Component
swingwt.awt.Container
swingwtx.swing.JComponent
swingwtx.swing.JPanel
swingwtx.custom.validation.ValidatableComponent
This is the superclass of all components that can be validated through
the ValidationGroup class. When a component fails validation,
an icon is shown next to the component with a tooltip stating why
the component failed validation.
| Nested Class Summary |
| Nested classes inherited from class swingwtx.swing.JComponent |
JComponent.InternalFrameSelectionListener |
| Field Summary | |
protected JComponent |
comp
The component we are holding |
protected java.lang.String |
errorMessage
|
protected JLabel |
errorOutput
The component that will display the icon/tooltip |
protected boolean |
isValid
whether the component currently matches it's validation rules |
protected ValidationGroup |
validationGroup
The validation group containing this component |
protected java.util.Vector |
validationListeners
Validation listeners |
| Fields inherited from class swingwtx.swing.JPanel |
opaque, ppeer |
| Fields inherited from class swingwtx.swing.JComponent |
accessibleContext, actionMap, ancestorInputMap, border, clientProperties, descendantHasPeer, focusInputMap, internalFrameAdapter, internalFrameParent, propertyChangeListeners, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW, windowInputMap |
| Fields inherited from class swingwt.awt.Container |
composite, comps, containerListeners, layout, queuedValidateRequest |
| Fields inherited from interface swingwt.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
ValidatableComponent()
|
|
| Method Summary | |
void |
addActionListener(ActionListener l)
Add an ActionListener to this component |
void |
addFocusListener(FocusListener l)
Add a KeyListener to this component |
void |
addKeyListener(KeyListener l)
Add a KeyListener to this component |
void |
addMouseListener(MouseListener l)
Add a MouseListener to this component |
void |
addValidationListener(ValidationListener l)
|
void |
dispose()
Destroys the component |
protected void |
fireValidation(boolean forcePass)
Sends the validation event to the component listeners. |
Color |
getBackground()
Returns the background colour of the component |
JComponent |
getComponent()
|
java.lang.String |
getErrorMessage()
|
Font |
getFont()
Returns the Font used on the component |
Color |
getForeground()
Returns the foreground colour of the component |
java.lang.String |
getToolTipText()
Returns the tooltip text used on the component |
ValidationGroup |
getValidationGroup()
Getter for property validationGroup. |
void |
grabFocus()
Forces keyboard focus to the component |
boolean |
isEnabled()
Returns true if the component is enabled |
boolean |
isValid()
|
boolean |
isVisible()
Returns true if the component is visible |
void |
removeActionListener(ActionListener l)
Remove an ActionListener from the component |
void |
removeFocusListener(FocusListener l)
Remove an KeyListener from the component |
void |
removeKeyListener(KeyListener l)
Remove an KeyListener from the component |
void |
removeMouseListener(MouseListener l)
Remove an MouseListener from the component |
void |
removeValidationListener(ValidationListener l)
|
void |
requestFocus()
Requests the component receives the focus |
void |
setBackground(Color c)
Sets the background colour of the component |
void |
setEnabled(boolean b)
Change the enabled state of the component |
void |
setErrorMessage(java.lang.String s)
|
void |
setFont(Font f)
Sets the font used by the component |
void |
setForeground(Color c)
Sets the foreground colour of the component |
void |
setIsValid(boolean b)
|
void |
setToolTipText(java.lang.String text)
Sets the tooltip text used on the component |
void |
setupComponent()
Should be called by subclasses after component creation |
void |
setValidationGroup(ValidationGroup validationGroup)
Setter for property validationGroup. |
void |
setVisible(boolean b)
Change the visibility of the component |
| Methods inherited from class swingwtx.swing.JPanel |
calculatePreferredSize, getHeight, getSize, getWidth, setBorder, setSwingWTParent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected JComponent comp
protected JLabel errorOutput
protected ValidationGroup validationGroup
protected boolean isValid
protected java.lang.String errorMessage
protected java.util.Vector validationListeners
| Constructor Detail |
public ValidatableComponent()
| Method Detail |
public void dispose()
JComponent
dispose in class JComponentpublic JComponent getComponent()
public void addValidationListener(ValidationListener l)
public void removeValidationListener(ValidationListener l)
public void setupComponent()
public void setIsValid(boolean b)
public boolean isValid()
public void setErrorMessage(java.lang.String s)
public java.lang.String getErrorMessage()
protected void fireValidation(boolean forcePass)
forcePass - If set to true, it is assumed that validation
passes - even if it wouldn't, and the event is not called.
This is used by the clearErrors() call to reset fields.public void setVisible(boolean b)
Component
setVisible in class Componentpublic boolean isVisible()
Component
isVisible in class Componentpublic void setEnabled(boolean b)
Component
setEnabled in class Componentpublic boolean isEnabled()
Component
isEnabled in class Componentpublic void requestFocus()
Component
requestFocus in class Componentpublic void grabFocus()
Component
grabFocus in class Componentpublic Color getBackground()
Component
getBackground in class Componentpublic void setBackground(Color c)
Component
setBackground in class Componentpublic Color getForeground()
Component
getForeground in class Componentpublic void setForeground(Color c)
Component
setForeground in class Componentpublic Font getFont()
Component
getFont in interface MenuContainergetFont in class Componentpublic void setFont(Font f)
Component
setFont in class Componentpublic java.lang.String getToolTipText()
Component
getToolTipText in class Componentpublic void setToolTipText(java.lang.String text)
Component
setToolTipText in class Componentpublic void addActionListener(ActionListener l)
ComponentActionListener to this component
addActionListener in class Componentpublic void removeActionListener(ActionListener l)
ComponentActionListener from the component
removeActionListener in class Componentpublic void addMouseListener(MouseListener l)
ComponentMouseListener to this component
addMouseListener in class Componentpublic void removeMouseListener(MouseListener l)
ComponentMouseListener from the component
removeMouseListener in class Componentpublic void addKeyListener(KeyListener l)
ComponentKeyListener to this component
addKeyListener in class Componentpublic void removeKeyListener(KeyListener l)
ComponentKeyListener from the component
removeKeyListener in class Componentpublic void addFocusListener(FocusListener l)
ComponentKeyListener to this component
addFocusListener in class Componentpublic void removeFocusListener(FocusListener l)
ComponentKeyListener from the component
removeFocusListener in class Componentpublic ValidationGroup getValidationGroup()
public void setValidationGroup(ValidationGroup validationGroup)
validationGroup - New value of property validationGroup.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||