org.netbeans.validation.api.ui
Class ComponentDecorator
java.lang.Object
org.netbeans.validation.api.ui.ComponentDecorator
public class ComponentDecorator
- extends java.lang.Object
Class which can decorate a component when it has errors. Decoration
is done through providing a border that can be applied to a component.
- Author:
- Tim Boudreau
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ComponentDecorator
public ComponentDecorator()
createProblemBorder
public javax.swing.border.Border createProblemBorder(java.awt.Component c,
javax.swing.border.Border originalBorder,
Severity severity)
- Create a border to apply to the component which shows an error.
A useful way to create custom borders is to wrap the original border
and paint it, then paint over it. If the insets of the border returned
by this method are different than the insets of the original border,
then the UI layout will "jump".
Severity.color() and Severity.image() are handy here.
- Parameters:
c
- The componentoriginalBorder
- The original border of the componentseverity
- The severity of the problem
- Returns:
- A border. May not be null. To have no effect, simply return
the original border.
noOpComponentDecorator
public static final ComponentDecorator noOpComponentDecorator()