org.openpermis.editor.policy.gui
Class ErrorStatusUpdater

java.lang.Object
  extended by org.openpermis.editor.policy.gui.ErrorStatusUpdater
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class ErrorStatusUpdater
extends Object
implements PropertyChangeListener

Since:
0.1.0

Field Summary
private  boolean active
          Indicates if listening for focus changes.
private static String ERROR_MESSAGE
          Status label client property used to indicate if an error is showing.
private  Icon errorIcon
          The error icon to use.
private static String FOCUS_OWNER
          Property for the focus owner changes.
private static String FOCUSED_WINDOW
          Property for the focused window changes.
private  Icon normalIcon
          The normal icon if no error is set.
private  JLabel statusLabel
          The status label to modify.
private  Window window
          The window watched.
 
Constructor Summary
ErrorStatusUpdater(org.jdesktop.application.ResourceMap resourceMap, Window window, JLabel statusLabel)
          Creates and registers this error status updater.
 
Method Summary
private  void clearError(JLabel label)
          Clears the error message showing on the given label.
 void dispose()
          Deregisters this error status updater.
 void propertyChange(PropertyChangeEvent event)
           
private  void showError(JLabel label, String errorMessage)
          Displays an error message on the given label.
 void showError(String message)
          Shows an error message.
private  boolean showingError(JLabel label)
          Check if the label shows an error.
private  void update(Component component)
          Updates the status label according to the error state of the specified component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FOCUSED_WINDOW

private static final String FOCUSED_WINDOW
Property for the focused window changes.

Constant Field Value:
"focusedWindow"
Since:
0.1.0

FOCUS_OWNER

private static final String FOCUS_OWNER
Property for the focus owner changes.

Constant Field Value:
"focusOwner"
Since:
0.1.0

ERROR_MESSAGE

private static final String ERROR_MESSAGE
Status label client property used to indicate if an error is showing.

Constant Field Value:
"errorStatusMessage"
Since:
0.1.0

window

private final Window window
The window watched.

Since:
0.1.0

statusLabel

private final JLabel statusLabel
The status label to modify.

Since:
0.1.0

errorIcon

private final Icon errorIcon
The error icon to use.

Since:
0.1.0

normalIcon

private final Icon normalIcon
The normal icon if no error is set.

Since:
0.1.0

active

private boolean active
Indicates if listening for focus changes.

Since:
0.1.0
Constructor Detail

ErrorStatusUpdater

public ErrorStatusUpdater(org.jdesktop.application.ResourceMap resourceMap,
                          Window window,
                          JLabel statusLabel)
Creates and registers this error status updater.

Parameters:
resourceMap - the resource map to use for configuration.
window - the window to watch.
statusLabel - the status label to use.
Since:
0.1.0
Method Detail

showingError

private boolean showingError(JLabel label)
Check if the label shows an error.

Parameters:
label - the label to check.
Returns:
true if it displays an error message.
Since:
0.1.0

showError

private void showError(JLabel label,
                       String errorMessage)
Displays an error message on the given label.

Parameters:
label - the label to use.
errorMessage - the message to display.
Since:
0.1.0

clearError

private void clearError(JLabel label)
Clears the error message showing on the given label.

Parameters:
label - the label to modify.
Since:
0.1.0

update

private void update(Component component)
Updates the status label according to the error state of the specified component.

Parameters:
component - the component to inspect.
Since:
0.1.0

dispose

public void dispose()
Deregisters this error status updater.

Since:
0.1.0

showError

public void showError(String message)
Shows an error message.

Parameters:
message - the message to show.
Since:
0.1.0

propertyChange

public void propertyChange(PropertyChangeEvent event)
Specified by:
propertyChange in interface PropertyChangeListener
Since:
0.1.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:22
Copyright (c) 2002-2007 Ergon Informatik AG