uk.apl.jxc.tools
Class SwingUtil

java.lang.Object
  extended by uk.apl.jxc.tools.SwingUtil

public final class SwingUtil
extends java.lang.Object

Swing utilites to support the XML Filter and Mapper UIs

Author:
Andrew Leigh

Nested Class Summary
static interface SwingUtil.ErrorDisplayer
          Implementations can be used as error displayers
 
Method Summary
static void displayError(java.awt.Component parentComponent, java.lang.String description, java.lang.Exception exception, java.util.logging.Logger logger)
          Displays an error message to the user.
static void setErrorDisplayer(SwingUtil.ErrorDisplayer errDisplayer)
          Sets the error displayer to be used when displaying error messages to the user.
static int showIntegerInputDialog(java.awt.Component parent, java.lang.String message, java.lang.String errorMessage, int initialValue)
          Prompts the user to enter an integer value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setErrorDisplayer

public static void setErrorDisplayer(SwingUtil.ErrorDisplayer errDisplayer)
Sets the error displayer to be used when displaying error messages to the user.

Parameters:
errDisplayer - the error displayer to be used

displayError

public static void displayError(java.awt.Component parentComponent,
                                java.lang.String description,
                                java.lang.Exception exception,
                                java.util.logging.Logger logger)
Displays an error message to the user.

Parameters:
parentComponent - component where the error occurred
description - a description of the error
exception - the causal exception
logger - logger to report the exception

showIntegerInputDialog

public static int showIntegerInputDialog(java.awt.Component parent,
                                         java.lang.String message,
                                         java.lang.String errorMessage,
                                         int initialValue)
Prompts the user to enter an integer value.

Parameters:
parent - component requesting the dialog
message - used to prompt the user for input
errorMessage - used indicate the input is not a valid integer
initialValue - an initial default value
Returns:
the integer entered by the user


Copyright 2010 Andrew Leigh. All Rights Reserved.