jap
Class JAPUtil

java.lang.Object
  extended by jap.JAPUtil

public final class JAPUtil
extends java.lang.Object

This class contains static utility functions for Jap


Field Summary
private static java.lang.String MSG_DATE_UNIT
           
 
Constructor Summary
JAPUtil()
           
 
Method Summary
static int applyJarDiff(java.io.File fileOldJAR, java.io.File fileNewJAR, byte[] diffJAR)
           
static JAPDialog.ILinkedInformation createDialogBrowserLink(java.lang.String a_strUrl)
           
static java.lang.String formatEuroCentValue(long centvalue)
          deprecated, since balances are not stored as centvalue
static java.lang.String formatTimestamp(java.sql.Timestamp date, boolean withTime)
          formats a timestamp in an easily readable format.
static java.lang.String formatTimestamp(java.sql.Timestamp date, boolean withTime, java.lang.String a_language)
          formatTimestamp
static java.lang.String getCurrencyDelimiter(java.lang.String language)
           
static java.lang.String getDuration(int duration, java.lang.String durationUnit)
           
static java.sql.Timestamp getEnddate(int duration, java.lang.String durationUnit)
          get the Enddate for a given duration
static JAPCertificate openCertificate(java.awt.Window jf)
          Shows a file open dialog and tries to read a certificate.
static void setMnemonic(javax.swing.AbstractButton bt, java.lang.String mn)
          Sets the mnemonic charcter of a component.
static void setPerfectTableSize(javax.swing.JTable table, java.awt.Dimension maxDimension)
           
static javax.swing.JFileChooser showFileDialog(java.awt.Window jf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_DATE_UNIT

private static final java.lang.String MSG_DATE_UNIT
Constructor Detail

JAPUtil

public JAPUtil()
Method Detail

createDialogBrowserLink

public static JAPDialog.ILinkedInformation createDialogBrowserLink(java.lang.String a_strUrl)

formatEuroCentValue

public static java.lang.String formatEuroCentValue(long centvalue)
deprecated, since balances are not stored as centvalue

Parameters:
long -
Returns:
String

getCurrencyDelimiter

public static java.lang.String getCurrencyDelimiter(java.lang.String language)

applyJarDiff

public static int applyJarDiff(java.io.File fileOldJAR,
                               java.io.File fileNewJAR,
                               byte[] diffJAR)

setMnemonic

public static void setMnemonic(javax.swing.AbstractButton bt,
                               java.lang.String mn)
Sets the mnemonic charcter of a component. The character must be set in the properties file under a name that is given in mnPropertyString.


setPerfectTableSize

public static void setPerfectTableSize(javax.swing.JTable table,
                                       java.awt.Dimension maxDimension)

showFileDialog

public static javax.swing.JFileChooser showFileDialog(java.awt.Window jf)

openCertificate

public static JAPCertificate openCertificate(java.awt.Window jf)
                                      throws java.io.IOException
Shows a file open dialog and tries to read a certificate. Returns null, if the user canceld the open request. Throws IOException if certificate could not be readed or decoded.

Throws:
java.io.IOException

formatTimestamp

public static java.lang.String formatTimestamp(java.sql.Timestamp date,
                                               boolean withTime)
formats a timestamp in an easily readable format.

Parameters:
date - Timestamp
withTime - boolean if true, the date+time is returned, otherwise date only.

formatTimestamp

public static java.lang.String formatTimestamp(java.sql.Timestamp date,
                                               boolean withTime,
                                               java.lang.String a_language)
formatTimestamp

Parameters:
date - Timestamp
withTime - boolean
a_language - String: 2-letter code
Returns:
String

getEnddate

public static java.sql.Timestamp getEnddate(int duration,
                                            java.lang.String durationUnit)
get the Enddate for a given duration

Parameters:
duration - int: e.g. 2
durationUnit - String: e.g. "months"
Returns:
Timestamp: now + (duration * unit)

getDuration

public static java.lang.String getDuration(int duration,
                                           java.lang.String durationUnit)