|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| GuiUtil.java | 0% | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
package baseCode.gui;
|
|
| 2 |
|
|
| 3 |
import javax.swing.JOptionPane;
|
|
| 4 |
|
|
| 5 |
import org.apache.commons.logging.Log;
|
|
| 6 |
import org.apache.commons.logging.LogFactory;
|
|
| 7 |
|
|
| 8 |
import baseCode.util.FileTools;
|
|
| 9 |
|
|
| 10 |
/**
|
|
| 11 |
* Little oft-used functions.
|
|
| 12 |
*
|
|
| 13 |
* @version $Id: GuiUtil.java,v 1.11 2005/04/07 20:43:08 pavlidis Exp $
|
|
| 14 |
*/
|
|
| 15 |
|
|
| 16 |
public class GuiUtil { |
|
| 17 |
|
|
| 18 |
protected static final Log log = LogFactory.getLog( GuiUtil.class ); |
|
| 19 |
|
|
| 20 |
/**
|
|
| 21 |
* @param message
|
|
| 22 |
* @param e
|
|
| 23 |
*/
|
|
| 24 | 0 |
public static void error( String message, Exception e ) { |
| 25 | 0 |
JOptionPane.showMessageDialog( null, "Error: " + message + "\n" + e, "Error", JOptionPane.ERROR_MESSAGE ); |
| 26 | 0 |
log.error( e ); |
| 27 | 0 |
e.printStackTrace(); |
| 28 |
} |
|
| 29 |
|
|
| 30 |
/**
|
|
| 31 |
* @param message
|
|
| 32 |
*/
|
|
| 33 | 0 |
public static void error( String message ) { |
| 34 | 0 |
JOptionPane.showMessageDialog( null, "Error: " + message + "\n", "Error", JOptionPane.ERROR_MESSAGE ); |
| 35 | 0 |
log.error( message ); |
| 36 |
} |
|
| 37 |
|
|
| 38 |
/**
|
|
| 39 |
* @param filename
|
|
| 40 |
* @return
|
|
| 41 |
* @see baseCode.util.FileTools#checkPathIsReadableFile(String)
|
|
| 42 |
*/
|
|
| 43 | 0 |
public static boolean testFile( String filename ) { |
| 44 | 0 |
if ( !FileTools.testFile( filename ) ) {
|
| 45 | 0 |
error( "A required file field is not valid." );
|
| 46 | 0 |
return false; |
| 47 |
} |
|
| 48 | 0 |
return false; |
| 49 |
} |
|
| 50 |
|
|
| 51 |
/**
|
|
| 52 |
* @param text
|
|
| 53 |
* @return
|
|
| 54 |
*/
|
|
| 55 | 0 |
public static boolean testDir( String filename ) { |
| 56 | 0 |
if ( !FileTools.testDir( filename ) ) {
|
| 57 | 0 |
error( "A required directory field is not valid." );
|
| 58 | 0 |
return false; |
| 59 |
} |
|
| 60 | 0 |
return true; |
| 61 |
} |
|
| 62 |
|
|
| 63 |
} |
|
||||||||||