org.openpermis.editor.policy.gui.binding
Class ErrorBindingListener

java.lang.Object
  extended by org.jdesktop.beansbinding.AbstractBindingListener
      extended by org.openpermis.editor.policy.gui.binding.ErrorBindingListener
All Implemented Interfaces:
EventListener, org.jdesktop.beansbinding.BindingListener

public class ErrorBindingListener
extends org.jdesktop.beansbinding.AbstractBindingListener

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.

See Also:
hasError(JComponent), hasAnyError(JComponent)
Since:
0.1.0

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
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.
 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
 

Constructor Detail

ErrorBindingListener

public ErrorBindingListener(ErrorReporter reporter,
                            org.jdesktop.application.ResourceMap resourceMap,
                            JComponent component,
                            String errorKey)
Creates a new error binding listener for the specified component.

Parameters:
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.
Since:
0.1.0
Method Detail

getErrorMessage

public static String getErrorMessage(JComponent component)
Returns the error message of a component that has an error.

Parameters:
component - the component for wich to retrieve the error message.
Returns:
the error message or null if the component has no error.
Since:
0.1.0

hasAnyError

public static boolean hasAnyError(JComponent component)
Check if the specified or any child component has a synchronization error.

Parameters:
component - the component to check.
Returns:
true if at least one component has an error, false otherwise.
Since:
0.1.0

hasError

public static boolean hasError(JComponent component)
Check if the specified component has a synchronization error.

Parameters:
component - the component to check.
Returns:
true if it has an error, false otherwise.
Since:
0.1.0

synced

public void synced(org.jdesktop.beansbinding.Binding binding)
Specified by:
synced in interface org.jdesktop.beansbinding.BindingListener
Overrides:
synced in class org.jdesktop.beansbinding.AbstractBindingListener
Since:
0.1.0

syncFailed

public void syncFailed(org.jdesktop.beansbinding.Binding binding,
                       org.jdesktop.beansbinding.Binding.SyncFailure failure)
Specified by:
syncFailed in interface org.jdesktop.beansbinding.BindingListener
Overrides:
syncFailed in class org.jdesktop.beansbinding.AbstractBindingListener
Since:
0.1.0


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:17:21
Copyright (c) 2002-2007 Ergon Informatik AG