|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.beansbinding.AbstractBindingListener
org.openpermis.editor.policy.gui.binding.ErrorBindingListener
public class ErrorBindingListener
Binding listener that updates the background of a component if a sync fails.
Also sets a component property to indicate that there was an error.
hasError(JComponent)
,
hasAnyError(JComponent)
Field Summary | |
---|---|
private Color |
backgroundColor
The original background color of the component. |
private JComponent |
component
The component this error binding listener modifies. |
private static String |
ERROR_MESSAGE_PROPERTY_KEY
Property of type String set at components if they have an error. |
private static String |
ERROR_STATE_PROPERTY_KEY
Property of type Boolean set at components to indicate an error. |
private Color |
errorColor
The error color to use. |
private String |
errorMessage
The error message in case of a failure. |
private ErrorReporter |
errorReporter
The error reporter to use. |
Constructor Summary | |
---|---|
ErrorBindingListener(ErrorReporter reporter,
org.jdesktop.application.ResourceMap resourceMap,
JComponent component,
String errorKey)
Creates a new error binding listener for the specified component. |
Method Summary | |
---|---|
private static void |
clearError(JComponent component)
Clears the synchronization error state of a component. |
static String |
getErrorMessage(JComponent component)
Returns the error message of a component that has an error. |
static boolean |
hasAnyError(JComponent component)
Check if the specified or any child component has a synchronization error. |
static boolean |
hasError(JComponent component)
Check if the specified component has a synchronization error. |
private static void |
markError(JComponent component,
String message)
Marks the component with a synchronization error state. |
private static boolean |
primHasAnyError(Container container)
Primitive to traverse the child list of the specified container and check for errors. |
void |
synced(org.jdesktop.beansbinding.Binding binding)
|
void |
syncFailed(org.jdesktop.beansbinding.Binding binding,
org.jdesktop.beansbinding.Binding.SyncFailure failure)
|
Methods inherited from class org.jdesktop.beansbinding.AbstractBindingListener |
---|
bindingBecameBound, bindingBecameUnbound, sourceChanged, sourceEdited, targetChanged, targetEdited |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String ERROR_STATE_PROPERTY_KEY
Boolean
set at components to indicate an error.
"bindingSyncErrorState"
private static final String ERROR_MESSAGE_PROPERTY_KEY
String
set at components if they have an error.
"bindingSyncErrorMessage"
private final JComponent component
private final Color errorColor
private final String errorMessage
private final ErrorReporter errorReporter
private Color backgroundColor
Constructor Detail |
---|
public ErrorBindingListener(ErrorReporter reporter, org.jdesktop.application.ResourceMap resourceMap, JComponent component, String errorKey)
reporter
- the error reporter to use if not null
.resourceMap
- resource map used to configure display properties.component
- the component this error binding listener modifies.errorKey
- key in the resource map to a translation of the error type,
may be null
for a generic error message.Method Detail |
---|
public static String getErrorMessage(JComponent component)
component
- the component for wich to retrieve the error message.
null
if the component has no error.public static boolean hasAnyError(JComponent component)
component
- the component to check.
true
if at least one component has an error, false
otherwise.private static boolean primHasAnyError(Container container)
container
- the container to traverse.
true
if at least one component has an error, false
otherwise.public static boolean hasError(JComponent component)
component
- the component to check.
true
if it has an error, false
otherwise.private static void markError(JComponent component, String message)
component
- the component to set the state for.message
- the message describing the error.private static void clearError(JComponent component)
component
- the component to clear the state for.public void synced(org.jdesktop.beansbinding.Binding binding)
synced
in interface org.jdesktop.beansbinding.BindingListener
synced
in class org.jdesktop.beansbinding.AbstractBindingListener
public void syncFailed(org.jdesktop.beansbinding.Binding binding, org.jdesktop.beansbinding.Binding.SyncFailure failure)
syncFailed
in interface org.jdesktop.beansbinding.BindingListener
syncFailed
in class org.jdesktop.beansbinding.AbstractBindingListener
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:22
Copyright (c) 2002-2007 Ergon Informatik AG