|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfable.framework.toolbox.FableUtils
public class FableUtils
FableUtils is a class with error handling and possibly other methods that are specific to Fable and are designed for easy use and to provide a consistent user experience.
Field Summary | |
---|---|
static java.lang.String |
LS
|
Constructor Summary | |
---|---|
FableUtils()
|
Method Summary | |
---|---|
static java.lang.String |
changeFileExtension(java.lang.String fileName,
java.lang.String newExtension)
Changes the extension of a file name or adds the extension if the file name does not have one. |
static boolean |
confirmMsg(java.lang.Object id,
java.lang.String msg)
Displays an confirm MessageDialog. |
static void |
errMsg(java.lang.Object id,
java.lang.String msg)
Displays an error MessageDialog using asyncExec and writes an error entry to the Fable log. |
static void |
excMsg(java.lang.Object id,
java.lang.String msg,
java.lang.Throwable t)
Displays an error MessageDialog using asyncExec and writes an error entry to the Fable log using the throwable message and stack trace. |
static void |
excNoTraceMsg(java.lang.Object id,
java.lang.String msg,
java.lang.Throwable t)
Displays an error MessageDialog using asyncExec and writes an error entry to the Fable log using the throwable message but not the stack trace. |
static void |
excTraceMsg(java.lang.Object id,
java.lang.String msg,
java.lang.Throwable t)
Displays an ExceptionMessageDialog using asyncExec and writes an error entry to the Fable log using the throwable message and stack trace. |
static java.lang.String |
generateIDMessage(java.lang.Object object,
java.lang.String msg)
Generates a message with an ID based on the Object. |
static java.lang.String |
getExtension(java.io.File file)
Get the extension of a File. |
static java.lang.String |
getExtension(java.lang.String fileName)
Get the extension of a file name. |
static java.lang.String |
getShortName(java.lang.String fileName)
Get the short part of a full file name. |
static void |
infoMsg(java.lang.Object id,
java.lang.String msg)
Displays an information MessageDialog using asyncExec and writes an info entry to the Fable log. |
static int |
questionMsg(java.lang.String message)
Displays an question MessageDialog. |
static void |
warnMsg(java.lang.Object id,
java.lang.String msg)
Displays a warning MessageDialog using asyncExec and writes a warning entry to the Fable log. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LS
Constructor Detail |
---|
public FableUtils()
Method Detail |
---|
public static java.lang.String generateIDMessage(java.lang.Object object, java.lang.String msg)
object
- The Object from which the ID is generated. If the object is
null, then the msg is returned.msg
- The text part of the message. May be null in which case just
the ID is returned.
public static void excTraceMsg(java.lang.Object id, java.lang.String msg, java.lang.Throwable t)
id
- An object used to generate an ID for the logging message. Will
not be used in the MessageDialog. May be null for no ID.msg
- The message to display. Information from the throwable will be
appended.generateIDMessage(java.lang.Object, java.lang.String)
,
ExceptionMessageDialog
,
excMsg(java.lang.Object, java.lang.String, java.lang.Throwable)
,
excNoTraceMsg(java.lang.Object, java.lang.String, java.lang.Throwable)
public static void excMsg(java.lang.Object id, java.lang.String msg, java.lang.Throwable t)
id
- An object used to generate an ID for the logging message. Will
not be used in the MessageDialog. May be null for no ID.msg
- The message to display. Information from the throwable will be
appended.generateIDMessage(java.lang.Object, java.lang.String)
,
ExceptionMessageDialog
,
excTraceMsg(java.lang.Object, java.lang.String, java.lang.Throwable)
,
excNoTraceMsg(java.lang.Object, java.lang.String, java.lang.Throwable)
public static void excNoTraceMsg(java.lang.Object id, java.lang.String msg, java.lang.Throwable t)
id
- An object used to generate an ID for the logging message. Will
not be used in the MessageDialog. May be null for no ID.msg
- The message to display. Information from the throwable will be
appended.generateIDMessage(java.lang.Object, java.lang.String)
,
ExceptionMessageDialog
,
excMsg(java.lang.Object, java.lang.String, java.lang.Throwable)
,
excTraceMsg(java.lang.Object, java.lang.String, java.lang.Throwable)
public static void errMsg(java.lang.Object id, java.lang.String msg)
id
- An object used to generate an ID for the logging message. Will
not be used in the MessageDialog. May be null for no ID.msg
- The message to display.#generateID(Object)
public static void warnMsg(java.lang.Object id, java.lang.String msg)
id
- An object used to generate an ID for the logging message. Will
not be used in the MessageDialog. May be null for no ID.msg
- The message to display.generateIDMessage(java.lang.Object, java.lang.String)
public static void infoMsg(java.lang.Object id, java.lang.String msg)
id
- An object used to generate an ID for the logging message. Will
not be used in the MessageDialog. May be null for no ID.msg
- The message to display.generateIDMessage(java.lang.Object, java.lang.String)
public static boolean confirmMsg(java.lang.Object id, java.lang.String msg)
id
- An object used to generate an ID for the logging message. Will
not be used in the MessageDialog. May be null for no ID.msg
- The message to display.
generateIDMessage(java.lang.Object, java.lang.String)
,
ExceptionMessageDialog
public static java.lang.String getShortName(java.lang.String fileName)
fileName
- The name of the file.
public static java.lang.String getExtension(java.io.File file)
file
-
public static java.lang.String getExtension(java.lang.String fileName)
fileName
- The name of the file.
public static java.lang.String changeFileExtension(java.lang.String fileName, java.lang.String newExtension)
fileName
- newExtension
-
public static int questionMsg(java.lang.String message)
message
- The question to ask.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |