Ontimize 5.2071EN

com.ontimize.gui
Class ApplicationManager

java.lang.Object
  extended bycom.ontimize.gui.ApplicationManager

public abstract class ApplicationManager
extends java.lang.Object

Abstract class that implements several utility methods to be in the development of clients.


Nested Class Summary
static class ApplicationManager.CancelExtendedOperationDialog
          Class that implements a dialog corresponding to a ExtendedOperationThread.
static class ApplicationManager.CancelOperationDialog
          This class implements a dialog to manage the OperatonThreads.
static class ApplicationManager.CustomBar
          A progress bar.
protected static class ApplicationManager.DatePrintStream
          Class that prints the current date to an OutputStream with a nice format.
static class ApplicationManager.ExtOpThreadsMonitor
          Class that represents a monitor for the Operation Threads.
static class ApplicationManager.ExtOpThreadsMonitorComponent
          Class that defines a graphical component to monitor the evolution of the threads.
protected static class ApplicationManager.HelpDialog
          Class that defines a dialog to show the Help to the application user.
static class ApplicationManager.OPThreadsMonitor
          This class defines a window to manage the threads that performs operations in the client.
protected static class ApplicationManager.TextStream
          An OutputStream configured for text.
 
Field Summary
protected static java.lang.String BUNDLE_AND_CACHE_MEMORY_SIZE_MESSAGE
           
protected static javax.swing.JButton bundleCacheMemorySizeButton
           
static java.lang.String CANCEL_DIALOG_TITLE
          Text property.
static java.lang.String CANCEL_DIALOG_TITLE_es_ES
          Text property.
protected static java.lang.String CHANGE_NETWORK_BITRATE_MESSAGE
           
static boolean CHECK_VISIBLE_PERMISSION_ON_TOOLBAR_COMPONENTS
          Variable that determines whether the visible permission must be checked in the toolbar components.
static boolean DEBUG
          Default debug variable for the application.
static boolean DEBUG_DETAILS
          Minor debug variable.
static boolean DEBUG_SECURITY
          Enables or disables the debugging of the security of the application.
static boolean DEBUG_TIMES
          Configures the application to debug the time related issues.
protected static java.lang.String FILE_MESSAGE
           
protected static java.lang.String GENERATE_BUNDLE_MESSAGE
           
protected static javax.swing.JButton generateBundleButton
           
protected static ApplicationManager.HelpDialog helpDialog
          The ApplicationManager HelpDialog
protected static javax.swing.JButton httpHTTPSTrafficButton
           
protected static java.lang.String IMPORT_MESSAGE
           
protected static java.lang.String INTERNACIONALIZED_TEXT_TITLE
           
protected static javax.swing.JButton networkBitrateButton
           
protected static java.lang.String SAVE_IN_PROPERTIES_MESSAGE
           
protected static java.lang.String SHOW_HTTP_HTTPS_TRAFFIC_MESSAGE
           
protected static java.lang.String SYSTEM_PROPERTIES_MESSAGE
           
protected static javax.swing.JButton systemPropertiesButton
           
static java.lang.String THREADS_MONITOR_TITLE
          Text property.
static java.lang.String THREADS_MONITOR_TITLE_es_ES
          Text property.
static boolean useOntimizePlaf
          Variable that denotes whether Ontimize Pluggable Look&Feel is used.
 
Constructor Summary
ApplicationManager()
          Creates an ApplicationManager instance, with several client application utilities.
 
Method Summary
static void center(java.awt.Window window)
          Centers the object in the screen.
static java.awt.Point checkAvailablePoint(java.awt.Point point)
          Checks if the point is available.
static void copyFile(java.io.File src, java.io.File dst)
          Copies a file.
static void copyToClipboard(java.awt.Image im)
          Copies an image to the clipboard.
static void copyToClipboard(java.lang.String text)
          Copies a text to the system clipboard.
protected static void createWindow()
          Creates the client debug window.
static void endedPrintingProcess(short processIndex)
          Removes a process from the printing processes list.
static void enqueueOperationThread(OperationThread thread)
          Enqueues a thread in the OperationThreadMonitor and starts the thread.
static java.lang.String format(java.util.Date date)
          Formats a date in the form 'dd/MM/yyyy'
static java.lang.String format(java.util.Date date, java.lang.String pattern)
          Formats a date accoding to the patter
static Application getApplication()
          Returns a reference to the Application managed by this class.
static java.util.ResourceBundle getApplicationBundle()
          Returns the application bundle, which contains the default translations for the application texts, corresponding to the current language selected for the application.
static java.lang.String getBusinessPropertiesFile()
          Deprecated.  
static ClientSecurityManager getClientSecurityManager()
          Provides a reference to the ClientSecurityManager of the client application.
static java.lang.String getCurrentThreadMethods(int lines)
          Returns a String containing the thread methods from the current execution point.
static java.lang.String getCurrentThreadMethods(java.lang.Throwable throwable, int lines)
          Returns a String containing the thread methods from the current execution point.
static javax.swing.ImageIcon getDefaultAttachIcon()
          Returns the default icon for the Attach File buttons.
static javax.swing.ImageIcon getDefaultCancelIcon()
          Returns the default icon for the Cancel buttons.
static javax.swing.ImageIcon getDefaultDeleteAttachmentIcon()
          Returns the default icon for the Delete File buttons.
static javax.swing.ImageIcon getDefaultDownloadAttachIcon()
          Returns the default icon for the Download buttons.
static javax.swing.ImageIcon getDefaultExtOpThreadsMonitorIcon()
          Returns the icon that defines the ExtOpThreadsMonitor window.
static javax.swing.ImageIcon getDefaultHelpIcon()
          Returns the default icon for the Help buttons.
static javax.swing.ImageIcon getDefaultOKIcon()
          Returns the default icon for the OK buttons.
static javax.swing.ImageIcon getDefaultRefreshTableIcon()
          Returns the default icon for the Refresh Table buttons.
static javax.swing.ImageIcon getDefaultSaveIcon()
          Returns the default icon for the Save buttons.
static java.awt.Cursor getDetailsCursor()
          Returns the default cursor to use when the mouse is over an element with details.
static java.awt.Cursor getDisabledLinkCursor()
          Returns the default cursor to use when the mouse is over a disabled link.
static ApplicationManager.ExtOpThreadsMonitor getExtOpThreadsMonitor(java.awt.Component component)
          Returns the ExtOpThreadsMonitor for the application.
static Form getFormAncestor(java.awt.Component component)
          Returns the Form that contains a determined component.
static java.awt.Cursor getHelpOnFieldCursor()
          Returns the default cursor to use when the help for the Field can be shown.
static java.awt.Cursor getHelpOnItemCursor()
          Returns the default cursor to use when the help for the Item can be shown.
static javax.swing.ImageIcon getIcon(java.lang.String icon)
           
static javax.swing.ImageIcon getImatiaIcon()
          Returns the default icon for the OK buttons.
static java.util.Locale getLocale()
          Returns the current application locale.
static ApplicationManager.OPThreadsMonitor getOPThreadsMonitor()
          Returns the class that monitors the execution of all the operation threads executed through the enqueueOperationThread(OperationThread) method.
static java.lang.Object getParameterValue(java.lang.String key, java.util.Hashtable prop)
          Checks if a parameter is contained by a Hashtable (or by an extended class as Properties)
static java.io.PrintStream getPrintStreamOnTextComponent(javax.swing.text.JTextComponent tc, int maxTextSize)
          Creates an Stream associated the the text component, so that all what is printed in the Stream will be printed in the text component as well.
static java.io.PrintStream getPrintStreamOnTextComponent(javax.swing.text.JTextComponent tc, int maxTextSize, int bufferSize)
          Creates an Stream associated the the text component, so that all what is printed in the Stream will be printed in the text component as well.
static RemoteUtilities.RemoteAdministrationWindow getRemoteAdminWindow(RemotelyManageable locator)
           
static javax.swing.JTable getSystemPropertiesComponent()
          Returns a JTable containing the System properties.
static long getTime()
          Returns the current time set to the application.
static java.util.Vector getTokensAt(java.lang.String s, java.lang.String separator)
          Splits a String into a vector, using the separator as delimiter
static java.util.Hashtable getTokensAt(java.lang.String sValue, java.lang.String separator1, java.lang.String separator2)
          Returns a Hashtable with key-value corresponding with result to apply two 'tokenizer' actions.
static java.lang.String getTranslation(java.lang.String text)
          Returns the text translation corresponding to the application's Resource Bundle.
static java.lang.String getTranslation(java.lang.String text, java.util.ResourceBundle bundle)
          Returns the text translation according to the bundle past as parameter.
static java.lang.String getTranslation(java.lang.String text, java.util.ResourceBundle bundle, java.lang.Object[] args)
          Returns a formated text which can have parameters, in the language determined by the bundle.
static java.awt.Cursor getZoomCursor()
          Returns the cursor to use in operations involving zoom.
static boolean isApplicationManagerWindowVisible()
          Checks whether the client debug window is visible.
static boolean isOSWindows()
           
static boolean jvmVersionHigherThan_1_3_0()
          Checks whether the JVM version is higher than the 1.3.0
static boolean jvmVersionHigherThan_1_4_0()
          Checks whether the JVM version is higher than the 1.4.0
static boolean jvmVersionHigherThan_1_5_0()
          Checks whether the JVM version is higher than the 1.5.0
static boolean jvmVersionHigherThan_1_6_0()
          Checks whether the JVM version is higher or equal than the 1.6.0
static void maximize(java.awt.Window window)
          Maximize the object in the screen.
static java.lang.String parseBooleanValue(boolean value)
          Converts the boolean in a string.
static java.util.Date parseDate(java.lang.String date)
          Parses a String to create a Date, if the String follows the pattern 'dd/MM/yyyy'
static java.util.Date parseDate(java.lang.String date, java.lang.String pattern)
          Creates a Date from the String if the String follow the patter.
static java.lang.String parseDimensionValue(java.awt.Dimension dimension)
          Converts the Dimension into a String, with the format dimension.width;dimension.height
static java.awt.Insets parseInsets(java.lang.String insets)
          Parses a String and converts it into a Insets class.
static java.lang.String parsePointValue(java.awt.Point point)
          Converts the Point into a String, with the format point.x;point.y
static java.awt.Dimension parseSize(java.lang.String size)
           
static boolean parseStringValue(java.lang.String value)
          Converts the string into a boolean.
static boolean parseStringValue(java.lang.String string, boolean defaultValue)
          Parses a String to convert it to a boolean.
static java.awt.Dimension parseStringValue(java.lang.String string, java.awt.Dimension defaultDimension)
          Converts a String value into a Dimension.
static java.awt.Point parseStringValue(java.lang.String string, java.awt.Point defaultPoint)
          Converts a String value into a Point.
static java.awt.Image pasteImageFromClipboard()
          Gets an image from the clipboard.
static void playSound(java.lang.String mediaFile)
          Plays a sound stored in a media file.
static void printCurrentThreadMethods(int lines)
          Debug method that prints the thread methods from the current execution point.
static void printCurrentThreadMethods(java.lang.Throwable thowable, int lines)
          Debug method that prints the thread methods from a determined Throwable object.
static boolean printingJobInProgress()
          Checks whether there are printing processes being executed.
static OperationThread proccessNotCancelableOperation(java.awt.Component source, OperationThread opThread, int milliseconds)
           
static OperationThread proccessNotCancelableOperation(java.awt.Dialog dialog, OperationThread opThread, int milliseconds)
          Executes a operation thread.
static OperationThread proccessNotCancelableOperation(java.awt.Frame frame, OperationThread opThread, int milliseconds)
          Executes a operation thread.
static ExtendedOperationThread proccessOperation(java.awt.Dialog dialog, ExtendedOperationThread opThread, int milliseconds)
          Starts an operation.
static ExtendedOperationThread proccessOperation(java.awt.Dialog dialog, ExtendedOperationThread opThread, int milliseconds, int timeUpdate)
          Executes the ExtendedOperationThread.
static OperationThread proccessOperation(java.awt.Dialog dialog, OperationThread opThread, int milliseconds)
          Starts an operation.
static OperationThread proccessOperation(java.awt.Dialog dialog, OperationThread opThread, int milliseconds, int updateTime)
          Starts an operation.
static ExtendedOperationThread proccessOperation(java.awt.Frame f, ExtendedOperationThread opThread, int milliseconds)
          Executes the ExtendedOperationThread.
static ExtendedOperationThread proccessOperation(java.awt.Frame f, ExtendedOperationThread opThread, int milliseconds, int timeUpdate)
          Executes the ExtendedOperationThread.
static OperationThread proccessOperation(java.awt.Frame frame, OperationThread opThread, int milliseconds)
          Starts an operation.
static OperationThread proccessOperation(java.awt.Frame frame, OperationThread opThread, int milliseconds, int dialogRefreshTime)
          Starts an operation.
static OperationThread proccessOperation(OperationThread opThread)
          Executes the ExtendedOperationThread.
static OperationThread proccessOperation(OperationThread opThread, int milliseconds)
          Executes the ExtendedOperationThread.
static void registerStatusComponent(StatusComponent component)
          Register the StatusComponent as current application StatusComponent
static java.lang.String replaceText(java.lang.String source, java.lang.String text, java.lang.String nexText)
          Replaces a piece of text for another
static java.lang.String replaceText(java.lang.String source, java.lang.String text, java.lang.String newText, boolean forceWord)
          Replaces a piece of text for another
static javax.swing.Icon rescaleIcon(javax.swing.ImageIcon imageIcon, int width, int heighth)
          Creates an Icon with a determined width and height
static void setApplication(Application application)
          Sets an Application to the Application
static void setApplicationManagerWindowVisible(boolean visible)
          Shows or hides the client debug window, in which the client variables can be check and the debug flags can be modified.
static void setCancelOperationDialogIcon(javax.swing.ImageIcon imageIcon)
          Sets a ImageIcon to display in the dialog windows for the operations related to the OperationTread and the ExtendedOperationThread.
static void setClientSecurityManager(ClientSecurityManager clientSecurityManager)
          Sets the ClientSecurityManager for the application.
static void setClientSecurityManager(ClientSecurityManager clientSecurityManager, java.util.Locale locale, java.lang.String businessPropertiesFile)
          Sets the ClientSecurityManager, the locale and the business file to the application.
static void setLocationNorthEast(java.awt.Window window)
          Sets a window location to be in the top-right corner of the screen.
static void setLocationNorthWest(java.awt.Window window)
          Sets a window location to be in the top-left corner of the screen.
static void setLocationShouthWest(java.awt.Window window)
          Sets a window location to be in the bottom-left corner of the screen.
static void setLocationSouthEast(java.awt.Window window)
          Sets a window location to be in the bottom-right corner of the screen.
static void setLookAndFeel(Application application, javax.swing.LookAndFeel lf)
          Sets the application Look&Feel.
static void setLookAndFeel(Application application, java.lang.String lfname)
          Sets a new look and feel to the application.
static void setMemoryMonitorWindowVisible(boolean visible)
          Sets the Memory Monitor Window visible or not.
static void setResourceBundle(java.util.ResourceBundle bundle)
           
static void setTime(long time)
          Sets the time used by the time based client permissions to perform the checking.
static void setVisibleWindowError(boolean visible)
          Shows or hides the error window.
static java.lang.String showHelpDialog(java.awt.Window owner, java.lang.String title, java.lang.String html, boolean showSave)
          Shows the help dialog.
static void showSystemInformation()
          Shows a dialog containing the System Information.
static short startedPrintingProcess()
          Creates an unique identifier for a printing process.
static void unregisterStatusComponent(StatusComponent component)
          Removes the component from the list of StatusComponents registered for the application.
static java.lang.String vectorToStringSeparateBy(java.util.List v, java.lang.String s)
          Creates a String with the elements contained by a Vector, separating the contents by the separator passed as parameter
static java.lang.String vectorToStringSeparateBySemicolon(java.util.List v)
          Creates a String with the elements contained by a Vector, separating the contents by ';'
static void viewInternacionalizedTexts(Application application)
          Displays a window with all the application texts that must be translated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHOW_HTTP_HTTPS_TRAFFIC_MESSAGE

protected static final java.lang.String SHOW_HTTP_HTTPS_TRAFFIC_MESSAGE
See Also:
Constant Field Values

BUNDLE_AND_CACHE_MEMORY_SIZE_MESSAGE

protected static final java.lang.String BUNDLE_AND_CACHE_MEMORY_SIZE_MESSAGE
See Also:
Constant Field Values

CHANGE_NETWORK_BITRATE_MESSAGE

protected static final java.lang.String CHANGE_NETWORK_BITRATE_MESSAGE
See Also:
Constant Field Values

SYSTEM_PROPERTIES_MESSAGE

protected static final java.lang.String SYSTEM_PROPERTIES_MESSAGE
See Also:
Constant Field Values

GENERATE_BUNDLE_MESSAGE

protected static final java.lang.String GENERATE_BUNDLE_MESSAGE
See Also:
Constant Field Values

IMPORT_MESSAGE

protected static final java.lang.String IMPORT_MESSAGE
See Also:
Constant Field Values

SAVE_IN_PROPERTIES_MESSAGE

protected static final java.lang.String SAVE_IN_PROPERTIES_MESSAGE
See Also:
Constant Field Values

FILE_MESSAGE

protected static final java.lang.String FILE_MESSAGE
See Also:
Constant Field Values

INTERNACIONALIZED_TEXT_TITLE

protected static final java.lang.String INTERNACIONALIZED_TEXT_TITLE
See Also:
Constant Field Values

CANCEL_DIALOG_TITLE

public static final java.lang.String CANCEL_DIALOG_TITLE
Text property.

See Also:
Constant Field Values

CANCEL_DIALOG_TITLE_es_ES

public static final java.lang.String CANCEL_DIALOG_TITLE_es_ES
Text property.

See Also:
Constant Field Values

THREADS_MONITOR_TITLE

public static final java.lang.String THREADS_MONITOR_TITLE
Text property.

See Also:
Constant Field Values

THREADS_MONITOR_TITLE_es_ES

public static final java.lang.String THREADS_MONITOR_TITLE_es_ES
Text property.

See Also:
Constant Field Values

CHECK_VISIBLE_PERMISSION_ON_TOOLBAR_COMPONENTS

public static boolean CHECK_VISIBLE_PERMISSION_ON_TOOLBAR_COMPONENTS
Variable that determines whether the visible permission must be checked in the toolbar components. If this variable is false, the permission that configures the toolbar components as not visible will be ignored.


DEBUG_SECURITY

public static boolean DEBUG_SECURITY
Enables or disables the debugging of the security of the application. With this variable turned on, the security messages will be printed.


DEBUG

public static boolean DEBUG
Default debug variable for the application. The main characteristics can be debugged turning this variable on.


DEBUG_DETAILS

public static boolean DEBUG_DETAILS
Minor debug variable.


DEBUG_TIMES

public static boolean DEBUG_TIMES
Configures the application to debug the time related issues.


useOntimizePlaf

public static boolean useOntimizePlaf
Variable that denotes whether Ontimize Pluggable Look&Feel is used.


networkBitrateButton

protected static javax.swing.JButton networkBitrateButton

bundleCacheMemorySizeButton

protected static javax.swing.JButton bundleCacheMemorySizeButton

generateBundleButton

protected static javax.swing.JButton generateBundleButton

systemPropertiesButton

protected static javax.swing.JButton systemPropertiesButton

httpHTTPSTrafficButton

protected static javax.swing.JButton httpHTTPSTrafficButton

helpDialog

protected static ApplicationManager.HelpDialog helpDialog
The ApplicationManager HelpDialog

Constructor Detail

ApplicationManager

public ApplicationManager()
Creates an ApplicationManager instance, with several client application utilities.

Method Detail

setVisibleWindowError

public static void setVisibleWindowError(boolean visible)
Shows or hides the error window.

Parameters:
visible -

startedPrintingProcess

public static short startedPrintingProcess()
Creates an unique identifier for a printing process. This identifier must be used to remove the process when finished.

Returns:
the process identifier

endedPrintingProcess

public static void endedPrintingProcess(short processIndex)
Removes a process from the printing processes list.

Parameters:
processIndex - the process index.

printingJobInProgress

public static boolean printingJobInProgress()
Checks whether there are printing processes being executed.

Returns:
true in case some printing process is being executed

getClientSecurityManager

public static ClientSecurityManager getClientSecurityManager()
Provides a reference to the ClientSecurityManager of the client application. Only one ClientSecurityManager is allowed in each client.

Returns:
the ClientSecurityManager

getLocale

public static java.util.Locale getLocale()
Returns the current application locale.

Returns:
the application locale.

getBusinessPropertiesFile

public static java.lang.String getBusinessPropertiesFile()
Deprecated.  

Returns the name of the business properties file, in which the business calendar is defined.

Returns:
the business calendar properties file

setClientSecurityManager

public static void setClientSecurityManager(ClientSecurityManager clientSecurityManager)
Sets the ClientSecurityManager for the application.

Parameters:
clientSecurityManager -

setClientSecurityManager

public static void setClientSecurityManager(ClientSecurityManager clientSecurityManager,
                                            java.util.Locale locale,
                                            java.lang.String businessPropertiesFile)
Sets the ClientSecurityManager, the locale and the business file to the application.

Parameters:
clientSecurityManager - the ClientSecurityManager
locale - the application locale
businessPropertiesFile - the business properties file

proccessNotCancelableOperation

public static OperationThread proccessNotCancelableOperation(java.awt.Component source,
                                                             OperationThread opThread,
                                                             int milliseconds)

proccessNotCancelableOperation

public static OperationThread proccessNotCancelableOperation(java.awt.Dialog dialog,
                                                             OperationThread opThread,
                                                             int milliseconds)
Executes a operation thread. If the operation takes more time to be executed that the time passed as parameter, a window to cancel the operation is showed.

Parameters:
opThread -
milliseconds - the time the thread waits before execution
Returns:

proccessNotCancelableOperation

public static OperationThread proccessNotCancelableOperation(java.awt.Frame frame,
                                                             OperationThread opThread,
                                                             int milliseconds)
Executes a operation thread. If the operation takes more time to be executed that the time passed as parameter, a window to cancel the operation is showed.

Parameters:
frame -
opThread -
milliseconds - the time the thread waits before execution
Returns:

proccessOperation

public static OperationThread proccessOperation(java.awt.Frame frame,
                                                OperationThread opThread,
                                                int milliseconds)
Starts an operation. In case the operation takes more than the specified milliseconds to end the execution, a window to cancel the operation is shown. After the execution the operation is returned, so the result and the execution status can be checked.

Parameters:
frame -
opThread -
milliseconds -
Returns:

proccessOperation

public static OperationThread proccessOperation(java.awt.Frame frame,
                                                OperationThread opThread,
                                                int milliseconds,
                                                int dialogRefreshTime)
Starts an operation. In case the operation takes more than the specified milliseconds to end the execution, a window to cancel the operation is shown. After the execution the operation is returned, so the result and the execution status can be checked.

Parameters:
frame -
opThread -
milliseconds -
dialogRefreshTime - refresh period of the dialog
Returns:

proccessOperation

public static OperationThread proccessOperation(java.awt.Dialog dialog,
                                                OperationThread opThread,
                                                int milliseconds)
Starts an operation. In case the operation takes more than the specified milliseconds to end the execution, a window to cancel the operation is shown. After the execution the operation is returned, so the result and the execution status can be checked.

Parameters:
dialog -
opThread -
milliseconds -
Returns:

proccessOperation

public static OperationThread proccessOperation(java.awt.Dialog dialog,
                                                OperationThread opThread,
                                                int milliseconds,
                                                int updateTime)
Starts an operation. In case the operation takes more than the specified milliseconds to end the execution, a window to cancel the operation is shown. After the execution the operation is returned, so the result and the execution status can be checked.

Parameters:
dialog -
opThread -
milliseconds -
updateTime -
Returns:

proccessOperation

public static ExtendedOperationThread proccessOperation(java.awt.Dialog dialog,
                                                        ExtendedOperationThread opThread,
                                                        int milliseconds)
Starts an operation. In case the operation takes more than the specified milliseconds to end the execution, a window to cancel the operation is shown. After the execution the operation is returned, so the result and the execution status can be checked.

Parameters:
dialog -
opThread -
milliseconds -
Returns:

proccessOperation

public static ExtendedOperationThread proccessOperation(java.awt.Dialog dialog,
                                                        ExtendedOperationThread opThread,
                                                        int milliseconds,
                                                        int timeUpdate)
Executes the ExtendedOperationThread. The dialog has a button to cancel the operation and shows the current process status.

Parameters:
dialog -
opThread -
milliseconds -
timeUpdate -
Returns:

proccessOperation

public static ExtendedOperationThread proccessOperation(java.awt.Frame f,
                                                        ExtendedOperationThread opThread,
                                                        int milliseconds)
Executes the ExtendedOperationThread. The dialog has a button to cancel the operation and shows the current process status.

Parameters:
f -
opThread -
milliseconds -
Returns:

proccessOperation

public static ExtendedOperationThread proccessOperation(java.awt.Frame f,
                                                        ExtendedOperationThread opThread,
                                                        int milliseconds,
                                                        int timeUpdate)
Executes the ExtendedOperationThread. The dialog has a button to cancel the operation and shows the current process status.

Parameters:
f -
opThread -
milliseconds -
timeUpdate -
Returns:

proccessOperation

public static OperationThread proccessOperation(OperationThread opThread,
                                                int milliseconds)
Executes the ExtendedOperationThread. The dialog has a button to cancel the operation and shows the current process status.


proccessOperation

public static OperationThread proccessOperation(OperationThread opThread)
Executes the ExtendedOperationThread. The dialog has a button to cancel the operation and shows the current process status. After 3000 milliseconds a cancel dialog will appear.


viewInternacionalizedTexts

public static void viewInternacionalizedTexts(Application application)
Displays a window with all the application texts that must be translated.

Parameters:
application -
See Also:
Internationalization

checkAvailablePoint

public static java.awt.Point checkAvailablePoint(java.awt.Point point)
Checks if the point is available.

Parameters:
point -
Returns:

center

public static void center(java.awt.Window window)
Centers the object in the screen. Useful when displaying new windows.

Parameters:
window -

maximize

public static void maximize(java.awt.Window window)
Maximize the object in the screen. Useful when displaying new windows.

Parameters:
window -

setLocationShouthWest

public static void setLocationShouthWest(java.awt.Window window)
Sets a window location to be in the bottom-left corner of the screen.

Parameters:
window -

setLocationSouthEast

public static void setLocationSouthEast(java.awt.Window window)
Sets a window location to be in the bottom-right corner of the screen.

Parameters:
window -

setLocationNorthWest

public static void setLocationNorthWest(java.awt.Window window)
Sets a window location to be in the top-left corner of the screen.

Parameters:
window -

setLocationNorthEast

public static void setLocationNorthEast(java.awt.Window window)
Sets a window location to be in the top-right corner of the screen.

Parameters:
window -

getHelpOnItemCursor

public static java.awt.Cursor getHelpOnItemCursor()
Returns the default cursor to use when the help for the Item can be shown.

Returns:
the help Cursor

getHelpOnFieldCursor

public static java.awt.Cursor getHelpOnFieldCursor()
Returns the default cursor to use when the help for the Field can be shown.

Returns:
the help Cursor

getDisabledLinkCursor

public static java.awt.Cursor getDisabledLinkCursor()
Returns the default cursor to use when the mouse is over a disabled link.

Returns:
the disabled link Cursor

getDetailsCursor

public static java.awt.Cursor getDetailsCursor()
Returns the default cursor to use when the mouse is over an element with details.

Returns:
the details Cursor

getZoomCursor

public static java.awt.Cursor getZoomCursor()
Returns the cursor to use in operations involving zoom.

Returns:
the cursor to use in operations involving zoom.

setLookAndFeel

public static void setLookAndFeel(Application application,
                                  javax.swing.LookAndFeel lf)
                           throws java.lang.Exception
Sets the application Look&Feel. It is not recommended to call this method once the application has been launched.

Parameters:
application - the application, to get the frame
lf - the new look and feel
Throws:
java.lang.Exception

setLookAndFeel

public static void setLookAndFeel(Application application,
                                  java.lang.String lfname)
                           throws java.lang.Exception
Sets a new look and feel to the application. The new l&f is referenced by its name.

Parameters:
application - the application to apply the lf
lfname - the look and feel name
Throws:
java.lang.Exception

enqueueOperationThread

public static void enqueueOperationThread(OperationThread thread)
Enqueues a thread in the OperationThreadMonitor and starts the thread. All threads executed in this way can be monitored

Parameters:
thread -
See Also:
ApplicationManager.OPThreadsMonitor

getOPThreadsMonitor

public static ApplicationManager.OPThreadsMonitor getOPThreadsMonitor()
Returns the class that monitors the execution of all the operation threads executed through the enqueueOperationThread(OperationThread) method.

Returns:
the class that monitor the thread execution

isApplicationManagerWindowVisible

public static boolean isApplicationManagerWindowVisible()
Checks whether the client debug window is visible.

Returns:
true if the debug window is visible, false otherwise.

setApplicationManagerWindowVisible

public static void setApplicationManagerWindowVisible(boolean visible)
Shows or hides the client debug window, in which the client variables can be check and the debug flags can be modified.

Parameters:
visible - if true, the window will be shown; if false, the window will be hide.

setResourceBundle

public static void setResourceBundle(java.util.ResourceBundle bundle)

createWindow

protected static void createWindow()
Creates the client debug window.


getImatiaIcon

public static javax.swing.ImageIcon getImatiaIcon()
Returns the default icon for the OK buttons.

Returns:
the OK button default icon

getDefaultOKIcon

public static javax.swing.ImageIcon getDefaultOKIcon()
Returns the default icon for the OK buttons.

Returns:
the OK button default icon

getDefaultRefreshTableIcon

public static javax.swing.ImageIcon getDefaultRefreshTableIcon()
Returns the default icon for the Refresh Table buttons.

Returns:
the Refresh Table button default icon

getDefaultSaveIcon

public static javax.swing.ImageIcon getDefaultSaveIcon()
Returns the default icon for the Save buttons.

Returns:
the Save button default icon

getDefaultCancelIcon

public static javax.swing.ImageIcon getDefaultCancelIcon()
Returns the default icon for the Cancel buttons.

Returns:
the Cancel button default icon

getDefaultAttachIcon

public static javax.swing.ImageIcon getDefaultAttachIcon()
Returns the default icon for the Attach File buttons.

Returns:
the Atach File button default icon

getDefaultDeleteAttachmentIcon

public static javax.swing.ImageIcon getDefaultDeleteAttachmentIcon()
Returns the default icon for the Delete File buttons.

Returns:
the Delete File button default icon

getDefaultHelpIcon

public static javax.swing.ImageIcon getDefaultHelpIcon()
Returns the default icon for the Help buttons.

Returns:
the Help button default icon

setApplication

public static void setApplication(Application application)
Sets an Application to the Application

Parameters:
application -

getApplication

public static Application getApplication()
Returns a reference to the Application managed by this class.

Returns:
the application or null in case the application is not set

parseBooleanValue

public static java.lang.String parseBooleanValue(boolean value)
Converts the boolean in a string.

Parameters:
value - the boolean to parse
Returns:
'yes' if the value is true, 'no' otherwise

parseStringValue

public static boolean parseStringValue(java.lang.String value)
Converts the string into a boolean.

Parameters:
value - the string to parse
Returns:
the boolean true if the value of the string is 'true' or 'yes', false otherwise

parseInsets

public static java.awt.Insets parseInsets(java.lang.String insets)
                                   throws java.lang.IllegalArgumentException
Parses a String and converts it into a Insets class. The String must be composed by 4 values separated by ';'. The order of the parsing is

top;left;bottom;right

Parameters:
insets - the String defining the insets as "top;left;bottom;right"
Returns:
the Insets class made from the parameter
Throws:
java.lang.IllegalArgumentException

parseSize

public static java.awt.Dimension parseSize(java.lang.String size)
                                    throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

parseStringValue

public static boolean parseStringValue(java.lang.String string,
                                       boolean defaultValue)
Parses a String to convert it to a boolean. If the String value is 'yes' or 'true' the boolean response will be true, and if the String value is 'no' or 'false' the result will be false. If the String is not one of the previous one specified previously, the defaultValue will be returned.

Parameters:
string - the string to parse
defaultValue - the default value to return if no coincidence found
Returns:

parseStringValue

public static java.awt.Point parseStringValue(java.lang.String string,
                                              java.awt.Point defaultPoint)
Converts a String value into a Point. The String must contain the point description as String separated by ; that is xcoor;ycoor

Parameters:
string - the string to parse
defaultPoint - the default point in case a null is past as parameter or an exception happens
Returns:
the Point equivalent to the String

parseStringValue

public static java.awt.Dimension parseStringValue(java.lang.String string,
                                                  java.awt.Dimension defaultDimension)
Converts a String value into a Dimension. The String must contain the dimension description as String separated by ; that is xcoor;ycoor

Parameters:
string - the String to parse
defaultDimension - the default dimension in case a null is past as parameter or an exception happens
Returns:
the Dimension equivalent to the String

parseDimensionValue

public static java.lang.String parseDimensionValue(java.awt.Dimension dimension)
Converts the Dimension into a String, with the format

dimension.width;dimension.height

Parameters:
dimension - the Dimension to convert to String
Returns:
a String that represents the Dimension

parsePointValue

public static java.lang.String parsePointValue(java.awt.Point point)
Converts the Point into a String, with the format

point.x;point.y

Parameters:
point - the point to converto to String
Returns:

getParameterValue

public static java.lang.Object getParameterValue(java.lang.String key,
                                                 java.util.Hashtable prop)
Checks if a parameter is contained by a Hashtable (or by an extended class as Properties)

Parameters:
key - the parameter to check
prop - the Hashtable that contains the properties
Returns:
the value of the property if it is contained by the prop, or null if the property is not in the Hashtable

getSystemPropertiesComponent

public static javax.swing.JTable getSystemPropertiesComponent()
Returns a JTable containing the System properties.

Returns:
a JTable containing the System properties

registerStatusComponent

public static void registerStatusComponent(StatusComponent component)
Register the StatusComponent as current application StatusComponent

Parameters:
component - the StatusComponent to be set

unregisterStatusComponent

public static void unregisterStatusComponent(StatusComponent component)
Removes the component from the list of StatusComponents registered for the application.

Parameters:
component - the StatusComponent to be removed

setCancelOperationDialogIcon

public static void setCancelOperationDialogIcon(javax.swing.ImageIcon imageIcon)
Sets a ImageIcon to display in the dialog windows for the operations related to the OperationTread and the ExtendedOperationThread.

Parameters:
imageIcon - the ImageIcon to show

setTime

public static void setTime(long time)
Sets the time used by the time based client permissions to perform the checking.

Parameters:
time - current time

getTime

public static long getTime()
Returns the current time set to the application.

Returns:
if the setTime(long) method set a value into the application, that value; the System.currentTimeMillis otherwise.

jvmVersionHigherThan_1_3_0

public static boolean jvmVersionHigherThan_1_3_0()
Checks whether the JVM version is higher than the 1.3.0

Returns:
if the JVM version is higher than the 1.3.0, false otherwise.

jvmVersionHigherThan_1_4_0

public static boolean jvmVersionHigherThan_1_4_0()
Checks whether the JVM version is higher than the 1.4.0

Returns:
if the JVM version is higher than the 1.4.0, false otherwise.

jvmVersionHigherThan_1_5_0

public static boolean jvmVersionHigherThan_1_5_0()
Checks whether the JVM version is higher than the 1.5.0

Returns:
if the JVM version is higher than the 1.5.0, false otherwise.

jvmVersionHigherThan_1_6_0

public static boolean jvmVersionHigherThan_1_6_0()
Checks whether the JVM version is higher or equal than the 1.6.0

Returns:
if the JVM version is higher than the 1.5.0, false otherwise.

isOSWindows

public static boolean isOSWindows()

printCurrentThreadMethods

public static void printCurrentThreadMethods(int lines)
Debug method that prints the thread methods from the current execution point. This allows the developer to know the call hierarchy in each point.

Parameters:
lines - the number of thread lines to print

printCurrentThreadMethods

public static void printCurrentThreadMethods(java.lang.Throwable thowable,
                                             int lines)
Debug method that prints the thread methods from a determined Throwable object. This allows the developer to know the call hierarchy in a determined point.

Parameters:
thowable - the object to inspect
lines - the number of thread lines to print

getCurrentThreadMethods

public static java.lang.String getCurrentThreadMethods(int lines)
Returns a String containing the thread methods from the current execution point. This allows the developer to know the call hierarchy in each point.

Parameters:
lines -
Returns:
a String containing the thread methods from the execution point

getCurrentThreadMethods

public static java.lang.String getCurrentThreadMethods(java.lang.Throwable throwable,
                                                       int lines)
Returns a String containing the thread methods from the current execution point. This allows the developer to know the call hierarchy in each point.

Parameters:
throwable -
lines -
Returns:
a String containing the thread methods from the execution point

getIcon

public static javax.swing.ImageIcon getIcon(java.lang.String icon)

playSound

public static void playSound(java.lang.String mediaFile)
Plays a sound stored in a media file. AudioClip

Parameters:
mediaFile - the URI to the media file, from the classpath; for example, 'com/ontimize/gui/images/beep.wav'

getApplicationBundle

public static java.util.ResourceBundle getApplicationBundle()
Returns the application bundle, which contains the default translations for the application texts, corresponding to the current language selected for the application.

Returns:
the application bundle, with the GUI texts translations

getTranslation

public static java.lang.String getTranslation(java.lang.String text)
Returns the text translation corresponding to the application's Resource Bundle. That is, returns the text to show in the GUI depending on the current configured locale.

Parameters:
text - the text to translate
Returns:
the translated text, according to the application current language

getTranslation

public static java.lang.String getTranslation(java.lang.String text,
                                              java.util.ResourceBundle bundle)
Returns the text translation according to the bundle past as parameter.

Parameters:
text - the text to translate
bundle - the translations to look up
Returns:

getTranslation

public static java.lang.String getTranslation(java.lang.String text,
                                              java.util.ResourceBundle bundle,
                                              java.lang.Object[] args)
Returns a formated text which can have parameters, in the language determined by the bundle.

Parameters:
text - the text to translated; for example, the text

form.find_?_templates = Find {0} templates

will replace the {0} (and {1}, {2}...etc., if any) by the values past in the param args

bundle - the object that contains the translations
args - the values to use to complete the text; if null, MessageFormat will be used to format the text.
Returns:
the formated text

getFormAncestor

public static Form getFormAncestor(java.awt.Component component)
Returns the Form that contains a determined component.

Parameters:
component -
Returns:
the form in the application that contains the component past as parameter

setMemoryMonitorWindowVisible

public static void setMemoryMonitorWindowVisible(boolean visible)
Sets the Memory Monitor Window visible or not.

Parameters:
visible - if true, the window will be visible; the window will be hide otherwise

getPrintStreamOnTextComponent

public static java.io.PrintStream getPrintStreamOnTextComponent(javax.swing.text.JTextComponent tc,
                                                                int maxTextSize)
Creates an Stream associated the the text component, so that all what is printed in the Stream will be printed in the text component as well.

Parameters:
tc - the text component that will print the stream
maxTextSize - the maximum size of the text in bytes
Returns:
a Stream with a JTextComponent associated

getPrintStreamOnTextComponent

public static java.io.PrintStream getPrintStreamOnTextComponent(javax.swing.text.JTextComponent tc,
                                                                int maxTextSize,
                                                                int bufferSize)
Creates an Stream associated the the text component, so that all what is printed in the Stream will be printed in the text component as well.

Parameters:
tc - the text component that will print the stream
maxTextSize - the maximum size of the text in bytes
bufferSize - the size of the buffer, in bytes; when the buffer is full, the contents will be written in the text component
Returns:
a Stream with a JTextComponent associated

format

public static java.lang.String format(java.util.Date date)
Formats a date in the form 'dd/MM/yyyy'

Parameters:
date -
Returns:
the formatted date

format

public static java.lang.String format(java.util.Date date,
                                      java.lang.String pattern)
Formats a date accoding to the patter

Parameters:
date - the date to format
pattern - the pattern; see SimpleDateFormat.applyPattern(String)
Returns:
the formated date

parseDate

public static java.util.Date parseDate(java.lang.String date)
                                throws java.text.ParseException
Parses a String to create a Date, if the String follows the pattern 'dd/MM/yyyy'

Parameters:
date - the date in String format
Returns:
the object Date corresponding to the String
Throws:
java.text.ParseException - in case the String does not correspond to a Date

parseDate

public static java.util.Date parseDate(java.lang.String date,
                                       java.lang.String pattern)
                                throws java.text.ParseException
Creates a Date from the String if the String follow the patter.

Parameters:
date - the String that represents a Date
pattern - the patter the String must follows; SimpleDateFormat.applyPattern(String)
Returns:
Throws:
java.text.ParseException - in case the String does not correspond to a Date

copyToClipboard

public static void copyToClipboard(java.lang.String text)
                            throws java.lang.Exception
Copies a text to the system clipboard.

Parameters:
text -
Throws:
java.lang.Exception - in case the opperation cannot be done

copyFile

public static void copyFile(java.io.File src,
                            java.io.File dst)
Copies a file.

Parameters:
src - the source file
dst - the destiny file

getRemoteAdminWindow

public static RemoteUtilities.RemoteAdministrationWindow getRemoteAdminWindow(RemotelyManageable locator)

getExtOpThreadsMonitor

public static ApplicationManager.ExtOpThreadsMonitor getExtOpThreadsMonitor(java.awt.Component component)
Returns the ExtOpThreadsMonitor for the application. If no ExtOpThreadsMonitor has been set, the method creates one and sets it to the application.

Parameters:
component - any application component
Returns:
the ExtOpThreadsMonitor

getDefaultExtOpThreadsMonitorIcon

public static javax.swing.ImageIcon getDefaultExtOpThreadsMonitorIcon()
Returns the icon that defines the ExtOpThreadsMonitor window.

Returns:
the ExtOpThreadsMonitor icon

getDefaultDownloadAttachIcon

public static javax.swing.ImageIcon getDefaultDownloadAttachIcon()
Returns the default icon for the Download buttons.

Returns:
the Download button default icon

vectorToStringSeparateBySemicolon

public static java.lang.String vectorToStringSeparateBySemicolon(java.util.List v)
Creates a String with the elements contained by a Vector, separating the contents by ';'

Parameters:
v -
Returns:
the String with the Vector elements separated by ';'

vectorToStringSeparateBy

public static java.lang.String vectorToStringSeparateBy(java.util.List v,
                                                        java.lang.String s)
Creates a String with the elements contained by a Vector, separating the contents by the separator passed as parameter

Parameters:
v -
s - the separator to use
Returns:
the String with the Vector elements separated by the separator

getTokensAt

public static java.util.Vector getTokensAt(java.lang.String s,
                                           java.lang.String separator)
Splits a String into a vector, using the separator as delimiter

Parameters:
s - the String to split
separator - the string that separates the components
Returns:
a vector with the separated elements

replaceText

public static java.lang.String replaceText(java.lang.String source,
                                           java.lang.String text,
                                           java.lang.String newText,
                                           boolean forceWord)
Replaces a piece of text for another

Parameters:
source - the source
text - the text to change
newText - the text that will replace the match
forceWord - forces the substitution of the text
Returns:
the original text with the replacements

replaceText

public static java.lang.String replaceText(java.lang.String source,
                                           java.lang.String text,
                                           java.lang.String nexText)
Replaces a piece of text for another

Parameters:
source - the source
text - the text to change
Returns:
the original text with the replacements

rescaleIcon

public static javax.swing.Icon rescaleIcon(javax.swing.ImageIcon imageIcon,
                                           int width,
                                           int heighth)
Creates an Icon with a determined width and height

Parameters:
imageIcon - the source icon
width - the desired icon width
heighth - the desired icon height
Returns:
the icon with the new dimensions

getTokensAt

public static java.util.Hashtable getTokensAt(java.lang.String sValue,
                                              java.lang.String separator1,
                                              java.lang.String separator2)
Returns a Hashtable with key-value corresponding with result to apply two 'tokenizer' actions. For example,

s="field1:equivalentfield1;field2:equivalentfield2;...;fieldn:equivalententfieldn"
separator1=";"
separator2=":"

returns Hashtable:

{ field1 equivalentfield1}
{ field2 equivalentfield2}
{ ... ... }
{ fieldn equivalentfieldn}

Note: It also accepts : string ="formfieldpk1;formfieldpk2:equivalententityfieldpk2;formfieldpk3...;formfieldpkn:equivalententityfieldpkn"
returning:

{ field1 field1}
{ field2 equivalentfield2}
{ field3 field3}
{ ... ... }
{ fieldn equivalentfieldn}

Parameters:
sValue - The String with values
separator1 - Separator for first Tokenizer
separator2 - Separator for second Tokenizer for each token obtained previously
Returns:
Hashtable with key-value

showHelpDialog

public static java.lang.String showHelpDialog(java.awt.Window owner,
                                              java.lang.String title,
                                              java.lang.String html,
                                              boolean showSave)
Shows the help dialog.

Parameters:
owner -
title - the window title
html - the contents in HTML
showSave - allows to save the modifications
Returns:
the result if the showSave option has been chosen, null otherwise

showSystemInformation

public static void showSystemInformation()
Shows a dialog containing the System Information.


copyToClipboard

public static void copyToClipboard(java.awt.Image im)
                            throws java.lang.Exception
Copies an image to the clipboard.

Parameters:
im - the image to copy
Throws:
java.lang.Exception

pasteImageFromClipboard

public static java.awt.Image pasteImageFromClipboard()
                                              throws java.lang.Exception
Gets an image from the clipboard.

Returns:
The contents of the clipboard as image.
Throws:
java.lang.Exception

Ontimize