SparseWare

System Functions

System functions are a set of Sage specific convenient functions for manipulating and/or converting data. System functions are available within the scripting environment via the "sage" object and can also be embedded within configuration strings by prefixing the function name with a dollar sign ($).

Below is an example of embedding the date system function to create table column titles:
Table {
  titleLocation: "top_left"
  columns {
    {title: "{$date('T-3')}"}
    {title: "{$date('T-2')}"}
    {title: "{$date('T-1')}"}
  }
}
The table below describes the available system functions.

static String aesDecrypt (String val, String password, String salt, int iteration)
 Decrypts the specified value using AES 128 bit encryption.
static String applicationURL (iWidget context)
 Returns a string representing the application's main URL.
static String applicationURL ()
 Returns a string representing the application's main URL.
static List asList (Object o)
 Returns the specified object as a list.
static String base64 (String val)
 Base64 encodes the specified string.
static String base85 (String val)
 Base85/ascii85 encodes the specified string.
static boolean booleanValue (Object o)
 Returns the boolean representation of the specified object.
static void cacheData (String name, String data)
 Caches data using the file system.
static void cacheData (String name, InputStream in)
 Caches data using the file system.
static String charToString (char c)
 Converts a character to a string.
static String chop (String val, int size)
 Chops the specified amount of characters for the specified string.
static void clearBrowserSessionCookies ()
 Clears session cookies for embedded browser widgets.
static void clearResponseCache ()
 Clears an installed disk based cache for HTTP responses.
static String codeBase (iWidget context)
 Returns a string representing the codebase for an application launched via webstart.
static String codeBase ()
 Returns a string representing the codebase for an application launched via webstart.
static String colorToHexString (Color c)
 Converts a color to its hex string representation.
static String colorToRGBString (Color c)
 Converts a color to its RGB string representation.
static String convertDate (iWidget context, Object date, String inputFormat, String outputFormat) throws ParseException
 Converts a date string from one format to another.
static String convertDate (iWidget context, Object date, String outputFormat) throws ParseException
 Converts a date string in the default item format to the specified format.
static String convertDate (iWidget context, Object date, boolean display) throws ParseException
 Converts a date string in the default item format to the default display format.
static String convertDate (iWidget context, Object date) throws ParseException
 Converts a date string in the default item format to the default display format.
static String convertDateTime (iWidget context, Object date, boolean display) throws ParseException
 Converts a date/time string in the default item format to the default display format.
static String convertDateTime (iWidget context, Object date) throws ParseException
 Converts a date/time string in the default item format to the default display format.
static ActionEx createAction (String name, String text, Icon icon, String code)
 Creates a new action.
static File createAppFile (String appName, String fileName)
 Creates a file with the given name/path in the .sage directory of the users home directory.
static iBackgroundPainter createBackgroundPainter (Color bg)
 Creates a new background painter.
static Border createBorder (iWidget context, String borderString)
 Creates a border from a configuration string.
static Icon createBorderIcon (Border border, Icon icon)
 Creates an icon that has a border around it.
static PushButtonWidget createButton (iWidget context, Object o)
 Convenience method for creating a button.
static PushButtonWidget createButton (iWidget context)
 Convenience method for creating a button.
static File createCacheFile (String name) throws IOException
 Creates a file in the file caching directory.
static ObjectCache createCacheMap (int len, int maxSize)
 Creates an object cache that can be bounded and will automatically release memory as needed.
static Calendar createCalendar (String spec)
 Creates a Calendar object from a relative date/time specification.
static Icon createColorIcon (final Color color, final int width, final int height, final Border border)
 Creates an icon that fills the specified width and height with the specified color.
static CompoundBorderEx createCompoundBorder (Border firstBorder, Border secondBorder)
 Creates a compound border from the two specified borders.
static CompoundIcon createCompoundIcon (Icon firstIcon, Icon secondIcon)
 Creates a compound icon from the two specified icons.
static CompoundPainter createCompoundPainter (iPainter firstPainter, iPainter secondPainter)
 Creates a compound painter from the two specified painters.
static Map createConcurrentHashMap (int len)
 Creates a hash map that is thread-safe.
static ContainsFilter createContainsFilter (String value, boolean startsWith)
 Creates a filter that test for contains.
static Date createDate (String spec)
 Convenience method for creating a date/time from a relative time specification.
static Icon createEmptyIcon (final int width, final int height, final Color borderColor)
 Creates an empty icon that can be used as a spacer.
static EqualityFilter createEqualityFilter (String value, boolean ignorecase)
 Creates a filter to test for equality.
static FileMutex createFileMutex (String file)
 Convenience method for creating a file-based mutex object.
static FileMutex createFileMutex (File file)
 Convenience method for creating a file-based mutex object.
static Grouper createGrouper ()
 Creates a grouper that can be use to grow table-based data.
static Map createHashMap (int len)
 Creates a hash map that maintains its insertion order.
static Box createHorizontalBox ()
 Creates a Box that displays its components from left to right.
static Component createHorizontalStrut (int width)
 Creates an invisible, fixed-width component.
static Icon createIcon (URL url)
 Creates an icon from the specified url.
static Icon createIcon (Image image)
 Creates an icon from the specified image.
static IconSeries createIconSeries (boolean horizontal, List icons)
 Creates an icon series object that is an icon that paints a series of icons.
static IconSeries createIconSeries (boolean horizontal, Icon...icons)
 Creates an icon series object that is an icon that paints a series of icons.
static Image createImage (URL url) throws IOException
 Creates an image from the specified url.
static BufferedImage createImage (JComponent comp)
 Creates an image of the specified component.
static iImagePainter createImagePainter (iWidget context, String painter)
 Creates an image painter that will paint the specified image.
static iImagePainter createImagePainter (Image image)
 Creates an image painter that will paint the specified image.
static JSONArray createJSONArray (Object o)
 Creates a new JSON array.
static JSONObject createJSONObject (Object o)
 Creates a new JSON object.
static KeyEvent createKeyEvent (iWidget w, String keystroke)
 Creates a key event for the given keystroke string The event can then be passed to the widget's dispatchKeyEvent method.
static LabelWidget createLabel (iWidget context)
 Convenience method for creating a label.
static Stroke createLineStroke (String style, float thickness)
 Creates a line stroke.
static List createList (Object obj)
 Creates a list object to use to hold items.
static ListBoxViewer createListBox (iWidget context, List< RenderableDataItem > rows)
 Creates a new list box viewer.
static UtilityPanel createPanel ()
 Convenience method for creating a panel.
static ImageIconEx createPunchedIcon (Image image, int unblurredShadowSize_pixels)
 Create an icon representing a punched out version of the specified image.
static RegularExpressionFilter createRegExFilter (String value, boolean parse)
 Creates a filter that uses regular expressions.
static TableViewer createTable (iWidget context, List< Column > columns, List< RenderableDataItem > rows)
 Creates a new table viewer.
static TableViewer createTable (iWidget context, iDataCollection dc, int skip)
 Creates a new table viewer.
static TextIcon createTextIcon (String text, Font font)
 Creates an icon that will display the specified text.
static BufferedImage createTextImage (String text, Font font, Color fg, Color bg, Border b, boolean square)
 Creates an image that will display the specified text.
static BufferedImage createTextImage (String text, Font font)
 Creates an image that will display the specified text.
static TextIcon createTextPainter (String text)
 Creates an painter that will display the specified text.
static JideToggleButtonEx createToggleButton ()
 Convenience method for creating a toggle button.
static iStringConverter
< RenderableDataItem
createToStringConverter (int col)
 Creates a filtering converter for a multi-column list that will cause a the filter to use the toString() of the particular column as the representative value for the row when rows are being filtered via the filter() method.
static TreeViewer createTree (iWidget context, RenderableDataItem root, List< RenderableDataItem > rows)
 Creates a new tree viewer.
static TreeMap createTreeMap ()
 Creates a tree map.
static Box createVerticalBox ()
 Creates a Box that displays its components from top to bottom.
static Component createVerticalStrut (int height)
 Creates an invisible, fixed-height component.
static Writer createWriter (OutputStream out, String charset, boolean buffered) throws UnsupportedEncodingException
 Creates a writer for the specified output stream.
static String currentDate (iWidget context, String format)
 Returns the current date as a string.
static String currentDate (String format)
 Returns the current date as a string.
static String currentTime (iWidget context, String format)
 Returns the current time as a string.
static String currentTime (String format)
 Returns the current time as a string.
static long currentTime ()
 Returns a string representing the current time in milliseconds.
static String date (String spec, String format)
 Convenience method for creating a date string from a relative time specification.
static String date (iWidget context, String spec)
 Convenience method for creating a date string from a relative time specification.
static String date (String spec)
 Convenience method for creating a date/time string from a relative time specification.
static String dateTime (iWidget context, String spec, String format)
 Convenience method for creating a date string from a relative time specification.
static String dateTime (String spec, String format)
 Convenience method for creating a date string from a relative time specification.
static String dateTime (iWidget context, String spec)
 Convenience method for creating a date string from a relative time specification.
static String dateTime (String spec)
 Convenience method for creating a date string from a relative time specification.
static String decode (String str)
 Decodes a string that was encoded using the encode function.
static String decodeBase64 (String val)
 Base64 decodes the specified string.
static String decrypt (String val, String key, String algorithm, boolean base64)
 Decrypts the specified value.
static void deleteFile (File file)
 Deletes a file.
static String digest (String val, String algorithm)
 Digests the specified value.
static void disableDebugLogging ()
 Disables debug logging.
static String documentBase (iWidget context)
 Returns a string representing the documentbase for an applet or the codebase for an application launched via webstart.
static String documentBase ()
 Returns a string representing the documentbase for an applet or the codebase for an application launched via webstart.
static void dprintln (Object o)
 Prints the string representation of the specified object to standard error If the engine is running with debug enabled or debug logging has been explicitly enabled.
static void enableDebugLogging (OutputStream out)
 Enables debug logging When enabled, all output from the dprintln() method will be written to standard err (or the specified stream).
static String encode (String str)
 Encodes the specified string for use as part of a url.
static String encodeFull (String str)
 Encodes the specified string for use as part of a url The only non alpha-numeric characters that are not escaped are '.
static String encrypt (String val, String key, String algorithm, boolean base64)
 Encrypts the specified value.
static void eprintln (Object o)
 Prints the string representation of the specified object to standard error.
static String escape (String val)
 Escapes a string, converting characters larger than 7bit to uincode representation and escapes linefeeds,tabs, etc.
static String escapeHTML (String str, boolean whitespace, boolean addHTMLTag)
 Encodes the specified string for use as part of an HTML document.
static String expand (String pattern, String...args)
 Expand a string using the specified pattern and arguments Unlike format, all the argument values have to be strings and only "%s" format specified is supported.
static Widget findWidget (Widget w, String name, boolean useNameMap)
 Finds a widget within the specified widget that has the given name If the name is a path then recursion is performed in order to find the widget that represents the last path component.
static float floatValue (String s)
 Returns the float representation of the specified string.
static void focusLater (final iWidget widget)
 Cause a focus request to be dispatched to the specified widget after all current events are processed and the invoking script finishes execution.
static String format (String pattern, Object...args) throws ParseException
 Formats a string using the specified pattern and arguments.
static String generateKey (String password, String salt, int iteration)
 Generates a password-based key.
static String generateSalt (int bytes)
 Generates a set of random bytes that can be use a salt for cryptographic purposes.
static List< WindowViewergetAllPopupWindowViewers ()
 Gets a list of all the popup WindowViewer objects.
static ImageIconEx getAnimatedSpinner ()
 Gets the default animated spinner.
static iPainter getAnimatedSpinnerPainter ()
 Gets the default animated spinner painter.
static iPainter getAnimatedSpinnerPainterSmall ()
 Gets the default small animated spinner painter.
static ImageIconEx getAnimatedSpinnerSmall ()
 Gets the default small animated spinner.
static String getBrowserSessionCookie (String url, String name)
 Gets a session cookie for all embedded browser widgets.
static Object getCachedData (String name, boolean asString)
 Returns previously cached data.
static Border getDefaultLineBorder ()
 Returns a the default line border.
static Image getImage (JComponent comp, Icon icon)
 Get the image of the specified icon.
static String getInheritanceTree (Object o)
 Gets the inheritance tree for a specified object.
DOXYGEN_SKIP static String getJavaVersion ()
 Returns the java version.
static String getLastDomainName ()
 Returns the last domain name that was entered during basic authentication.
static String getLastPasswordHash ()
 Returns an SHA1 hash of the last password that was entered during basic authentication.
static String getLastUserName ()
 Returns the last username that was entered during basic authentication.
static int getLineHeight (Component c)
 Gets the line height for text in the specified component.
static String getLines (String s, int lines)
 Gets the number of lines from the specified string.
static Rectangle getMonitorBounds (Component c)
 Get the bounds of the monitor that the specified component is displayed on.
static List< String > getMonths ()
 Gets the months of the year for the current locale.
static List< String > getMonthsShortNames ()
 Gets the short names for the months of the year for the current locale.
static String getOs ()
 Returns the OS.
static String getOsVersion ()
 Returns the OS version.
static List< Window > getPopupAllWindow ()
 Gets a list of all the popup java.awt.Window objects.
static Preferences getPreferences (String appKey)
 Returns a java preference for the specified sage application key.
static float getRelativeFontSize ()
 Gets the relative font size for the application.
static Dimension getScreenSize ()
 Get the logical size of the screen.
static ImageIconEx getToolkitIcon (URL url)
 Gets an icon via Toolkit.getDefaultToolkit().createImage() Images created in this fashion support animated gifs.
static Image getToolkitImage (URL url)
 Gets an image via Toolkit.getDefaultToolkit().createImage() Images created in this fashion support animated gifs.
static UIDefaults getUIDefaults ()
 Returns the UIDefaults map.
static String getURLQueryParameter (String url, String param)
 Gets a parameter value from a url query string.
static String hmacMD5 (String val, String key, boolean hexout)
 Computes a Hash-based Message Authentication Code (HMAC) using the MD5 hash function.
static String hmacSHA (String val, String key, boolean hexout)
 Computes a Hash-based Message Authentication Code (HMAC) using the SHA hash function.
static String htmlReplace (String s, Pattern urlPattern, String replacement, boolean escape, String tag)
 Replaces text within an html string (i.e.
static String htmlWordWrap (String s, final int width, final boolean html_tag)
 Wraps the specified string so that each line is no longer than the specified width.
static void installResponseCache (String name, int mbMaxSize, boolean deleteOnExit)
 Manually installs a disk based cache for HTTP responses.
static int intValue (Object o)
 Returns the integer representation of the specified object.
static boolean isJava6OrAbove ()
 Returns whether or not the JDK version is 6 and above.
static boolean isJava6Update10OrAbove ()
 Returns whether or not the JDK version is 6 and above.
static boolean isJava7OrAbove ()
 Returns whether or not the JDK version is 1.7 and above.
static boolean isLinux ()
 Returns whether the desktop OS is a version of Linux.
static boolean isMac ()
 Returns whether the desktop OS is a Mac OS.
static boolean isOptimizationEnabled ()
 Gets whether optimizations are enabled.
static boolean isPrintableChar (char c)
 Printable character.
static boolean isRunningInBackground ()
 Returns whether the current thread is running in the background.
static boolean isStrictScriptingMode ()
 Returns if strict mode is enabled for the scripting environment.
static boolean isUnix ()
 Returns whether the desktop OS is a version of UNIX.
static boolean isWindows ()
 Returns whether the desktop OS is a version of windows.
static boolean isWindows7OrAbove ()
 Returns whether the desktop OS is a version of windows 7 or greater.
static String join (Object[] array, String sep)
 Returns a string representing the specified array of objects.
static String join (List list, String sep)
 Returns a string representing the specified array of objects.
static String length (String val, String tok)
 Returns the length of tokenized segments in the specified string.
static String length (String val)
 Returns the length of the specified string.
static String linefeedToHTMLBreak (String s, boolean html)
 Replaces the linefeeds in the specified string with HTML line breaks (<BR>).
static String linefeedToHTMLBreak (String s)
 Replaces the linefeeds in the specified string with HTML line breaks (<BR>).
static Map< String, ActionExloadActions (iWidget context, ActionLink link) throws Exception
 Loads a set of actions from a configuration file.
static Map< String, ImageIconExloadResourceIcons (iWidget context, ActionLink link) throws IOException
 Loads icon resources from a properties files.
static Map< String, String > loadResourceStrings (iWidget context, ActionLink link) throws IOException
 Loads string resources from a properties file.
static void loadTemplate (iWidget context, ActionLink link, String name) throws IOException
 Loads a template that will be cached.
static long longValue (Object o)
 Returns the long integer representation of the specified object.
static String lowerCase (String val)
 Returns the lowercase representation of the specified string.
static String mac (String val, String key, String algorithm, boolean hexout)
 Computes the Message Authentication Code for the specified value.
static String makeHyperlinks (String s, boolean escape, String tag)
 Processes a string looking for text patterns that match valid URLs and converts them to hyperlinks.
static Component makeResizable (iWidget w, boolean createCorner, Icon cornerIcon)
 Makes a widget resizable using the widget's border and an optional corner resizer.
static Component makeResizable (Component comp, boolean createCorner, Icon cornerIcon)
 Makes a component resizable using the widget's border and an optional corner resizer.
static String md5 (String val, boolean hexout)
 Computes the MD5 hash of the specified value.
static String md5 (String val)
 Computes the MD5 hash of the specified value.
static long nanoTime ()
 Returns a string representing the number nanoseconds of elapsed time.
static void notifyWaiter (Object object, boolean all)
 Notifies waiters of the specified object to wakeup.
static Date parseDateString (iWidget context, String date, String inputFormat) throws ParseException
 Converts a date string from one format to another.
static Date parseDateString (iWidget context, String date) throws ParseException
 Converts a date string in the default item format to a date object.
static Date parseDateTimeString (iWidget context, String date) throws ParseException
 Converts a date/time string in the default item format to a date object.
static Map< String, String > parseOptionsString (String options, char delimiter, boolean unquote)
 Parses a string for options.
static Map< String, String > parseOptionsString (String options)
 Parses a string for options.
static String piece (String val, String tok, int start, int end)
 Returns a portion of a token delimited string.
static String piece (String val, String tok, int start)
 Returns a portion of a token delimited string.
static String piece (String val, String tok)
 Returns a portion of a token delimited string.
static void populateViewerWdgetValues (iWidget context, Viewer viewer, Map values)
 Populates a the values for widgets contained in the specified viewer's configuration This method is useful for populating a viewer’s configuration using data from an external source.
static void populateViewerWdgetValues (iFormViewer fv, Map values)
 Populates a the values for widgets belonging to the specified from viewer This method is useful for populating a forms configuration using data from an external source.
static void print (Object...o)
 Prints the string representation of the specified object to standard output.
static void printDocument (iWidget context, String url) throws IOException, PrintException
 Prints the document associated with the specified URL using the java printing system.
static void println (Object...o)
 Prints the string representation of the specified object to standard output.
static String property (iWidget context, String name, String def)
 Returns the system property with the specified name.
static String property (String name, String def)
 Returns the system property with the specified name.
static String quote (String str)
 Produce a string in double quotes with backslash sequences in all the right places.
static String random (String val)
 Returns a string representing a random number that is greater than or equal to zero and less than the specified value.
static String random ()
 Returns a string representing a random number.
static long randomLong (long max)
 Returns a string representing a random number that is greater than or equal to zero and less than the specified value.
static long randomLong ()
 Returns a random number.
static String read (iWidget context, Object entity) throws IOException
 Reads the data for the specified entity.
static MouseKeyStrokeTimeoutHandler registerMouseKeyStrokeTimeoutHandler (AppContext app, int seconds, String code)
 Adds a timeout handler that will execute the specified code if no mouse or keyboard events have occurred during the specified amount of seconds.
static Map removeAll (Map main, Map remove)
 Removes all of the shared elements between the main and remove map from the main map.
static void removeCachedData (String name)
 Removed previously cached data.
static String removeHTMLMarkup (String text)
 Removes HTML markup from a string of text.
static void removeMouseKeyStrokeTimeoutHandler (MouseKeyStrokeTimeoutHandler handler)
 Removes a previously added mouse/keystroke handler.
static void removeRange (List list, int fromIndex, int toIndex)
 Removes from the specified list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive.
static void removeResponseCache ()
 Clears an installed disk based cache for HTTP responses.
static String replacePiece (String val, String tok, int tlen, int pos, int pos2, String rval)
 Replaces a portion of a token delimited string with a specified value.
static String resolve (iWidget context, String str)
 Convenience method for resolving embedded functions and attributes within the specified string.
static String resolve (String str)
 Convenience method for resolving embedded functions and attributes within the specified string.
static Object resolveUIProperty (iWidget context, String value)
 The value specified in the that same format as would be specified in the lookAndFeelPropertiesURL data.
static void restoreAntialiasHint (Graphics2D g, Object oldHint)
 Restores an old anti-alias value.
static void retargetKeyEvent (KeyEvent e, Component target)
 Re-targets a key event.
static void retargetMouseEvent (MouseEvent e, Component target)
 Re-targets a mouse event.
static String rformat (iWidget context, String resource_string, Object...args)
 Formats a string using the specified pattern and arguments.
static Image scaleImage (BufferedImage img, int width, int height, ScalingType type, boolean proportional)
 Scales the specified image.
static String script (iWidget context, String code)
 Evaluates the specified code within the specified widget context and returns the result.
static String script (String code)
 Evaluates the specified code within the specified widget context and returns the result.
static String scriptVar (iWidget context, String name)
 Returns the string representation of the specified script variable.
static String scriptVar (String name)
 Returns the string representation of the specified script variable.
static String serverBase (iWidget context)
 Returns a string representing the server's base for an application.
static String serverBase ()
 Returns a string representing the server's base for an application.
static void setAnimatedSpinner (ImageIconEx icon)
 sets the default animated spinner
static void setAnimatedSpinnerSmall (ImageIconEx icon)
 sets the default small animated spinner
static void setBackgroundOverlayPainter (JComponent c, iPainter p)
 Sets the background overlay painter This painter paints over the background right after the background is painted and before the contents are painted.
static void setBackgroundPainter (JComponent c, iBackgroundPainter bp)
 Sets the painter that will paint the component's background (if the component supports such painters).
static void setBrowserSessionCookie (String url, String value)
 Sets a session cookie for all embedded browser widgets.
static void setBrowserSessionCookies (List< Cookie > cookies)
 Sets a set of session cookies for all embedded browser widgets.
static void setOptimizationEnabled (boolean enabled)
 Sets whether optimizations are enabled.
static void setOverlayPainter (JComponent c, iPainter p)
 Sets the overlay painter or a component (if the component supports such painters) This painter paints after the component's contents have been painted.
static void setRelativeFontSize (float size)
 Sets the relative font size for the application.
static void setSelectionState (iWidget w, boolean hasSelection)
 Sets the selection state for a widget.
static void setStrictScriptingMode (boolean strict)
 Sets the strict mode for the scripting environment.
static Object setupAntialiasPainting (Graphics2D g)
 Setups up anti-alias painting.
static String sha1 (String val, boolean hexout)
 Computes the SHA hash of the specified value.
static String sha1 (byte[] val, boolean hexout)
 Computes the SHA hash of the specified value.
static String sha1 (String val)
 Computes the SHA hash of the specified value.
static String sound (iWidget context, String sound)
 Plays a predefined sound.
static String sound (String sound)
 Plays a predefined sound.
static String stringValue (Object obj)
 Returns the string representation for the specified object.
static String stringValue (long number)
 Returns the string representation for an integer.
static String stringValue (int number)
 Returns the string representation for an integer.
static String stripMnemonic (String text)
 Strips the ampersand designating a mnemonic from a string.
static String substring (String val, int start, int end)
 Returns a new string that is a substring of the specified string.
static void systemPrintDocument (iWidget context, String url) throws IOException
 Prints the document associated with the specified URL using the OS printing system.
static String timeExecution (String code, int iteration) throws ScriptException
 Returns the amount of time the specified code took to execute.
static String titleCase (String val, String wordSeparators)
 Returns the titlecase representation of the specified string.
static String titleCase (String val)
 Returns the title case representation of the specified string.
static String toExternalForm (URL url)
 Returns the string representation of the specified url.
static String tokenReplacement (String s, String what, String with, boolean html, String prefix, String suffix, int maxLineCount)
 Replaces the specified token in the specified string with another token Also optionally adds a prefix and or suffix to the string.
static String tokenToHTMLBreak (String s, String tok, boolean html, String prefix, String suffix, int maxLineCount)
 Replaces the linefeeds in the specified string with HTML line breaks (<BR>) Also optionally adds a prefix and or suffix to the string.
static String tokenToHTMLBreak (String s, String tok, boolean html)
 Replaces the linefeeds in the specified string with HTML line breaks (<BR>) Also optionally adds a prefix and or suffix to the string.
static String trim (String val)
 Trims leading an trailing whitespace from the specified string.
static String unescape (String val)
 Cleans a string removing backslash encode sequences.
static String unescapeQuotedString (String val)
 Cleans a quoted string, removing the quotes and backslash encode sequences.
static List< RenderableDataItemungroup (List< RenderableDataItem > list, int groupings, List< RenderableDataItem > out)
 Un-groups a grouped lists.
static void updateAllPopupWindows ()
 Calls the update method on all the popup window viewers.
static void updateUIColor (iWidget context, String name, Object value)
 Updates a color defined in the UI properties.
static String upperCase (String val)
 Returns the lowercase representation of the specified string.
static String utf8String (String value)
 Converts a string to a utf-8 encoded set of bytes and then converts those bytes to an iso-8859-1 encoded string.
static void waitFor (Object object, long timeout) throws InterruptedException
 Causes the current thread to waits for the specified object to be notified to wakeup (by another thread) or the specified timeout to occur.

Static Public Attributes

static ImageIconEx _animatedSpinner
 animated spinner icon
static ImageIconEx _animatedSpinnerSmall
 small animated spinner icon

Detailed Description

Author:
Don DeCoteau

Member Function Documentation

static String aesDecrypt ( String  val,
String  password,
String  salt,
int  iteration 
) [static]

Parameters:
val the value to be decrypted
password the decryption key
salt the salt
iteration the number of iterations
Returns:
the decrypted value

static String applicationURL ( iWidget  context  )  [static]

Parameters:
context the widget context
Returns:
a string representing the application's main URL

static String applicationURL (  )  [static]

Returns:
a string representing the application's main URL

static List asList ( Object  o  )  [static]

If the object is already it is simply returned If it is an array a new is created that is backed by the array other a list with the specified item as it's only value is returned

Parameters:
o the object
Returns:
the list

static String base64 ( String  val  )  [static]

Parameters:
val the value to be encoded
Returns:
the base64 encoding of the specified string

static String base85 ( String  val  )  [static]

Parameters:
val the value to be encoded
Returns:
the base85/ascii85 encoding of the specified string

static boolean booleanValue ( Object  o  )  [static]

Parameters:
o the object
Returns:
the boolean representing the object

static void cacheData ( String  name,
String  data 
) [static]

Parameters:
name the name to cache the item under (must be a valid file name)
data the data to cache

static void cacheData ( String  name,
InputStream  in 
) [static]

Parameters:
name the name to cache the item under (must be a valid file name)
in the input stream to cache

static String charToString ( char  c  )  [static]

Parameters:
c the character
Returns:
the string representation

static String chop ( String  val,
int  size 
) [static]

Parameters:
val the value to chop
size the amount of characters to chop
Returns:
the chopped string

static String codeBase ( iWidget  context  )  [static]

Parameters:
context the widget context
Returns:
a string representing the codebase or null if the app was not launched via webstart

static String codeBase (  )  [static]

Returns:
a string representing the codebase or null if the app was not launched via webstart

static String colorToHexString ( Color  c  )  [static]

Parameters:
c the color
Returns:
the hex string representation

static String colorToRGBString ( Color  c  )  [static]

Parameters:
c the color
Returns:
the RGB string representation

static String convertDate ( iWidget  context,
Object  date,
String  inputFormat,
String  outputFormat 
) throws ParseException [static]

Parameters:
context the context
date the date string or date /calendar object in the default item format
inputFormat the input format
outputFormat the output format
Returns:
the date string in the output format
Exceptions:
java.text.ParseException 

static String convertDate ( iWidget  context,
Object  date,
String  outputFormat 
) throws ParseException [static]

Parameters:
context the context
date the date string or date /calendar object in the default item format
outputFormat the output format
Returns:
the date string in the output format
Exceptions:
java.text.ParseException 

static String convertDate ( iWidget  context,
Object  date,
boolean  display 
) throws ParseException [static]

Parameters:
context the context
date the date string or date /calendar object in the default item format
display true to convert the date for display; false to convert the date to the item (server) format
Returns:
the date string in the default display format
Exceptions:
java.text.ParseException 

static String convertDate ( iWidget  context,
Object  date 
) throws ParseException [static]

Parameters:
context the context
date the date string or date /calendar object in the default item format
Returns:
the date string in the default display format
Exceptions:
java.text.ParseException 

static String convertDateTime ( iWidget  context,
Object  date,
boolean  display 
) throws ParseException [static]

Parameters:
context the context
date the date string or date /calendar object in the default item format
display true to convert the date for display; false to convert the date to the item (server) format
Returns:
the date/time string in the default display format
Exceptions:
java.text.ParseException 

static String convertDateTime ( iWidget  context,
Object  date 
) throws ParseException [static]

Parameters:
context the context
date the date string or date /calendar object in the default item format
Returns:
the date/time string in the default display format
Exceptions:
java.text.ParseException 

static ActionEx createAction ( String  name,
String  text,
Icon  icon,
String  code 
) [static]

Parameters:
name the name of the action
text the text for the action
icon the icon
code the code to execute for the action
Returns:
a string representing the codebase or null if the app was not launched via webstart

static File createAppFile ( String  appName,
String  fileName 
) [static]

Parameters:
appName the name of the app
fileName the name of the file
Returns:
the file

static iBackgroundPainter createBackgroundPainter ( Color  bg  )  [static]

Parameters:
bg the background color
Returns:
a new background painter

static Border createBorder ( iWidget  context,
String  borderString 
) [static]

Parameters:
context the widget context
borderString the border string
Returns:
the border instance

static Icon createBorderIcon ( Border  border,
Icon  icon 
) [static]

Parameters:
border the border
icon the icon to place the border around
Returns:
the border icon instance

static PushButtonWidget createButton ( iWidget  context,
Object  o 
) [static]

Parameters:
context the context
o a parameter for the button (can be a string, icon, or action)
Returns:
the new button widget

static PushButtonWidget createButton ( iWidget  context  )  [static]

Parameters:
context the context
Returns:
the new button widget

static File createCacheFile ( String  name  )  throws IOException [static]

Parameters:
name the name of the file
Returns:
the new file

static ObjectCache createCacheMap ( int  len,
int  maxSize 
) [static]

The put(key,value) and get(key) methods can be used work with the cache

Parameters:
len the initial capacity for the map;
maxSize the maximum size the cache can grow (use -1 for a cache that only get purges when additional memory is needed)
Returns:
the object cache

static Calendar createCalendar ( String  spec  )  [static]

Examples of valid data/time specifiers are:

  • T (for today)
  • T+1 (tomorrow at 8AM)
  • T+3 (for 3 days from now at 6pm)
  • W+3 (for 3 weeks in the future)
  • M+3 (for 3 months in the future)
  • T (for TODAY), T+1 (for TOMORROW), T+2, T+7, etc.
  • T-1 (for YESTERDAY), T-3W (for 3 WEEKS AGO), etc.
  • N (for NOW)
  • N+3 (for 3 minutes from now)
  • N+3H (for 3 hours from now)

Parameters:
spec the date/time specification
Returns:
a Calendar object representing the date/time specification

static Icon createColorIcon ( final Color  color,
final int  width,
final int  height,
final Border  border 
) [static]

Parameters:
color the color
width the width
height the height
border optional border
Returns:
the icon

static CompoundBorderEx createCompoundBorder ( Border  firstBorder,
Border  secondBorder 
) [static]

Parameters:
firstBorder the first border
secondBorder the second border
Returns:
the new compound border

static CompoundIcon createCompoundIcon ( Icon  firstIcon,
Icon  secondIcon 
) [static]

Parameters:
firstIcon the first icon
secondIcon the second icon
Returns:
the new compound icon

static CompoundPainter createCompoundPainter ( iPainter  firstPainter,
iPainter  secondPainter 
) [static]

Parameters:
firstPainter the first painter
secondPainter the second painter
Returns:
the new compound painter

static Map createConcurrentHashMap ( int  len  )  [static]

Parameters:
len the initial capacity for the map;
Returns:
the hash map

static ContainsFilter createContainsFilter ( String  value,
boolean  startsWith 
) [static]

Parameters:
value the value for the filter
startsWith whether to check only if the value being tested starts with the filter value
Returns:
a filter

static Date createDate ( String  spec  )  [static]

Examples of valid data/time specifiers are:

  • T (for today)
  • T+1 (tomorrow at 8AM)
  • T+3 (for 3 days from now at 6pm)
  • W+3 (for 3 weeks in the future)
  • M+3 (for 3 months in the future)
  • T (for TODAY), T+1 (for TOMORROW), T+2, T+7, etc.
  • T-1 (for YESTERDAY), T-3W (for 3 WEEKS AGO), etc.
  • N (for NOW)
  • N+3 (for 3 minutes from now)
  • N+3H (for 3 hours from now)

Parameters:
spec the date/time specification
Returns:
a date object

static Icon createEmptyIcon ( final int  width,
final int  height,
final Color  borderColor 
) [static]

Parameters:
width the width for the icon
height the height for the icon
borderColor optional line border color
Returns:
the icon

static EqualityFilter createEqualityFilter ( String  value,
boolean  ignorecase 
) [static]

Parameters:
value the value to test for
ignorecase true if case should be ignored; false otherwise
Returns:
a filter

static FileMutex createFileMutex ( String  file  )  [static]

Parameters:
file the file that backs the mutex
Returns:
a new FileMutex object

static FileMutex createFileMutex ( File  file  )  [static]

Parameters:
file the file that backs the mutex
Returns:
a new FileMutex object

static Grouper createGrouper (  )  [static]

Returns:
the grouper

static Map createHashMap ( int  len  )  [static]

Parameters:
len the initial capacity for the map;
Returns:
the hash map

static Box createHorizontalBox (  )  [static]

If you want a Box that respects the component orientation you should create the Box using the constructor and pass in BoxLayout.LINE_AXIS, eg:

   Box lineBox = new Box(BoxLayout.LINE_AXIS);
 

Returns:
the box

static Component createHorizontalStrut ( int  width  )  [static]

In a horizontal box, you typically use this method to force a certain amount of space between two components. In a vertical box, you might use this method to force the box to be at least the specified width. The invisible component has no height unless excess space is available, in which case it takes its share of available space, just like any other component that has no maximum height.

Parameters:
width the width of the invisible component, in pixels >= 0
Returns:
the component

static Icon createIcon ( URL  url  )  [static]

Parameters:
url the url
Returns:
the new icon

static Icon createIcon ( Image  image  )  [static]

Parameters:
image the image
Returns:
the new icon

static IconSeries createIconSeries ( boolean  horizontal,
List  icons 
) [static]

Parameters:
horizontal true for a horizontal series; false for a vertical
icons the set of icons
Returns:
the icon series

static IconSeries createIconSeries ( boolean  horizontal,
Icon...  icons 
) [static]

Parameters:
horizontal true for a horizontal series; false for a vertical
icons the set of icons
Returns:
the icon series

static Image createImage ( URL  url  )  throws IOException [static]

Parameters:
url the url
Returns:
the new icon

static BufferedImage createImage ( JComponent  comp  )  [static]

Parameters:
comp the component
Returns:
the image representing the component

static iImagePainter createImagePainter ( iWidget  context,
String  painter 
) [static]

Parameters:
context the context
painter the painter string
Returns:
the image painter

static iImagePainter createImagePainter ( Image  image  )  [static]

Parameters:
image the image for the painter
Returns:
the image painter

static JSONArray createJSONArray ( Object  o  )  [static]

Parameters:
o a List,an array, a String or null
Returns:
the JSON array

static JSONObject createJSONObject ( Object  o  )  [static]

Parameters:
o the object to use to populate the JSON object (can be null)
Returns:
the JSON object

static KeyEvent createKeyEvent ( iWidget  w,
String  keystroke 
) [static]

Parameters:
w the widget the event is targeted for
keystroke the keystroke string. The string must have the following syntax:
 <modifiers>* (<typedID> | <pressedReleasedID>)
 modifiers := shift | control | ctrl | meta | alt | altGraph
 typedID := typed <typedKey>
 typedKey := string of length 1 giving Unicode character.
 pressedReleasedID := (pressed | released) key
 key := KeyEvent key code name, i.e. the name following "VK_".
 
Returns:
See also:
iWidget.dispatchKeyEvent(java.awt.event.KeyEvent)

static LabelWidget createLabel ( iWidget  context  )  [static]

Parameters:
context the context
Returns:
the new label widget

static Stroke createLineStroke ( String  style,
float  thickness 
) [static]

Parameters:
style the style of the stroke ('solid', 'dotted', 'dashed')
thickness the thickness of the stroke
Returns:

static List createList ( Object  obj  )  [static]

Parameters:
obj the initial capacity for the list or an array to populate the list with;
Returns:
the list

static ListBoxViewer createListBox ( iWidget  context,
List< RenderableDataItem rows 
) [static]

Parameters:
context the widget context
rows the rows for the list (can be null)
Returns:
the viewer

static UtilityPanel createPanel (  )  [static]

By default the panel has a border layout

Returns:
the new panel

static ImageIconEx createPunchedIcon ( Image  image,
int  unblurredShadowSize_pixels 
) [static]

Parameters:
image the image
unblurredShadowSize_pixels the number of pixels to use for an un-blurred shadow
Returns:
the punched out icon
Author:
Ken Orr (http://explodingpixels.wordpress.com)

static RegularExpressionFilter createRegExFilter ( String  value,
boolean  parse 
) [static]

Parameters:
value the value for the filter
parse true if the value is a wildcard expression that should be parsed to create the regular expression; false if the value represents a valid regular expression
Returns:
a filter

static TableViewer createTable ( iWidget  context,
List< Column >  columns,
List< RenderableDataItem rows 
) [static]

Parameters:
context the widget context
columns the columns for the table (can be null)
rows the rows for the table (can be null)
Returns:
the viewer

static TableViewer createTable ( iWidget  context,
iDataCollection  dc,
int  skip 
) [static]

Parameters:
context the widget context
dc the data collection
skip the number of initial items top skip
Returns:
the viewer

static TextIcon createTextIcon ( String  text,
Font  font 
) [static]

Parameters:
text the text for the icon (html is not supported)
font optional font for the text
Returns:
the icon

static BufferedImage createTextImage ( String  text,
Font  font,
Color  fg,
Color  bg,
Border  b,
boolean  square 
) [static]

Parameters:
text the text for the image (html is supported)
font optional font for the text
fg optional foreground color
bg optional background color
b optional border
square true to create a square image; false otherwise
Returns:
the image

static BufferedImage createTextImage ( String  text,
Font  font 
) [static]

Parameters:
text the text for the image (html is supported)
font optional font for the text
Returns:
the image

static TextIcon createTextPainter ( String  text  )  [static]

Parameters:
text the text for the painter (html is not supported)
Returns:
the painter

static JideToggleButtonEx createToggleButton (  )  [static]

Returns:
the new toggle button

static iStringConverter<RenderableDataItem> createToStringConverter ( int  col  )  [static]

Parameters:
col the column
Returns:
the converter

static TreeViewer createTree ( iWidget  context,
RenderableDataItem  root,
List< RenderableDataItem rows 
) [static]

Parameters:
context the widget context
root the root node for the tree (can be null)
rows the rows for the tree (can be null)
Returns:
the viewer

static TreeMap createTreeMap (  )  [static]

Returns:
the tree map

static Box createVerticalBox (  )  [static]

If you want a Box that respects the component orientation you should create the Box using the constructor and pass in BoxLayout.PAGE_AXIS, eg:

   Box lineBox = new Box(BoxLayout.PAGE_AXIS);
 

Returns:
the box

static Component createVerticalStrut ( int  height  )  [static]

In a vertical box, you typically use this method to force a certain amount of space between two components. In a horizontal box, you might use this method to force the box to be at least the specified height. The invisible component has no width unless excess space is available, in which case it takes its share of available space, just like any other component that has no maximum width.

Parameters:
height the height of the invisible component, in pixels >= 0
Returns:
the component

static Writer createWriter ( OutputStream  out,
String  charset,
boolean  buffered 
) throws UnsupportedEncodingException [static]

Parameters:
out the output stream to use
charset the character set to use (use null for ISO-8859-1)
buffered to to buffer the output; false otherwise
Returns:
the new writer
Exceptions:
UnsupportedEncodingException 

static String currentDate ( iWidget  context,
String  format 
) [static]

Parameters:
context the widget context
format a format specified for the date output
Returns:
a string object representing the current date

static String currentDate ( String  format  )  [static]

Parameters:
format a format specified for the date output (null for the default format)
Returns:
a string object representing the current date

static String currentTime ( iWidget  context,
String  format 
) [static]

Parameters:
context the widget context
format a format specified for the time output
Returns:
a string object representing the current time

static String currentTime ( String  format  )  [static]

Parameters:
format a format specified for the time output (null for the default format)
Returns:
a string object representing the current time

static long currentTime (  )  [static]

Returns:
a string representing the current time in milliseconds

static String date ( String  spec,
String  format 
) [static]

Parameters:
spec the date specification
format the date format string
Returns:
a string object representing the date/time specification

static String date ( iWidget  context,
String  spec 
) [static]

Parameters:
context the widget context
spec the date specification
Returns:
a string object representing the time specification

static String date ( String  spec  )  [static]

Examples of valid data/time specifiers are:

  • T (for today)
  • T+1 (tomorrow at 8AM)
  • T+3 (for 3 days from now at 6pm)
  • W+3 (for 3 weeks in the future)
  • M+3 (for 3 months in the future)
  • T (for TODAY), T+1 (for TOMORROW), T+2, T+7, etc.
  • T-1 (for YESTERDAY), T-3W (for 3 WEEKS AGO), etc.
  • N (for NOW)
  • N+3 (for 3 minutes from now)
  • N+3H (for 3 hours from now)

Parameters:
spec the date/time specification
Returns:
a string object representing the date/time specification

static String dateTime ( iWidget  context,
String  spec,
String  format 
) [static]

Parameters:
context the widget context
spec the date/time specification
format a format specified for the data output
Returns:
a string object representing the date/time specification

static String dateTime ( String  spec,
String  format 
) [static]

Parameters:
spec the date/time specification
format a format specified for the data output
Returns:
a string object representing the date/time specification

static String dateTime ( iWidget  context,
String  spec 
) [static]

Parameters:
context the widget context
spec the date/time specification
Returns:
a string object representing the date/time specification

static String dateTime ( String  spec  )  [static]

Parameters:
spec the date/time specification
Returns:
a string object representing the date/time specification

static String decode ( String  str  )  [static]

Parameters:
str the string to encode
See also:
encode(java.lang.String)
Returns:
the escaped string

static String decodeBase64 ( String  val  )  [static]

Parameters:
val the value to be decoded
Returns:
the decoded string

static String decrypt ( String  val,
String  key,
String  algorithm,
boolean  base64 
) [static]

Parameters:
val the value to be decrypted
key the decryption key
algorithm the decryption algorithm
base64 true if input data is base 64 encoded; false otherwise
Returns:
the decrypted value

static void deleteFile ( File  file  )  [static]

Parameters:
file the file to delete

static String digest ( String  val,
String  algorithm 
) [static]

Parameters:
val the value to be digested
algorithm the digest algorithm
Returns:
the digested value

static String documentBase ( iWidget  context  )  [static]

Parameters:
context the widget context
Returns:
a string representing the document base or codebase or null

static String documentBase (  )  [static]

Returns:
a string representing the document base or codebase or null

static void dprintln ( Object  o  )  [static]

Parameters:
o the object to print
See also:
enableDebugLogging

static void enableDebugLogging ( OutputStream  out  )  [static]

By default this only happens when the engine is running in debug mode

Parameters:
out and optional stream to send the output to

static String encode ( String  str  )  [static]

Parameters:
str the string to encode
See also:
decode
Returns:
the encoded url string

static String encodeFull ( String  str  )  [static]

' and '_'

Parameters:
str the string to encode
See also:
decode
Returns:
the encoded url string

static String encrypt ( String  val,
String  key,
String  algorithm,
boolean  base64 
) [static]

Parameters:
val the value to be encrypted
key the encryption key
algorithm the encryption algorithm
base64 true to encode the data as base 64; false otherwise
Returns:
the encrypted value

static void eprintln ( Object  o  )  [static]

Parameters:
o the object to print

static String escape ( String  val  )  [static]

Parameters:
val the value to encode
Returns:
the encoded value

static String escapeHTML ( String  str,
boolean  whitespace,
boolean  addHTMLTag 
) [static]

Parameters:
str the string to encode
whitespace true to handle whitespace; false otherwise
addHTMLTag true to add the surrounding HTML tags; false otherwise
Returns:
the escaped string

static String expand ( String  pattern,
String...  args 
) [static]

This method should be faster than format

Parameters:
pattern the printf-style pattern
args the arguments
Returns:
the expanded string
See also:
format

static Widget findWidget ( Widget  w,
String  name,
boolean  useNameMap 
) [static]

Parameters:
w the widget to search
name the name of the widget to find
useNameMap true to use a name map to improve future search performance; false otherwise
Returns:
the found widget

static float floatValue ( String  s  )  [static]

String that don't start with a numeric sequence always return zero

Parameters:
s the string
Returns:
the float representation of the string

static void focusLater ( final iWidget  widget  )  [static]

Parameters:
widget the widget to request focus for

static String format ( String  pattern,
Object...  args 
) throws ParseException [static]

Parameters:
pattern If the object is a number then a number format pattern, if the object is a Date or Calendar then a date format pattern otherwise a printf-style pattern
args the arguments
Returns:
the formatted string

static String generateKey ( String  password,
String  salt,
int  iteration 
) [static]

Parameters:
password the password
salt the salt
iteration the iteration
Returns:
the key as a ISO-88591 string

static String generateSalt ( int  bytes  )  [static]

Parameters:
bytes the number of bytes to generate
Returns:
the salt as a ISO-88591 string

static List<WindowViewer> getAllPopupWindowViewers (  )  [static]

Returns:
a list of all WindowViewer objects

static ImageIconEx getAnimatedSpinner (  )  [static]

Returns:
the default animated spinner

static iPainter getAnimatedSpinnerPainter (  )  [static]

Returns:
the default animated spinner

static iPainter getAnimatedSpinnerPainterSmall (  )  [static]

Returns:
the default small animated spinner

static ImageIconEx getAnimatedSpinnerSmall (  )  [static]

Returns:
the default small animated spinner

static String getBrowserSessionCookie ( String  url,
String  name 
) [static]

Parameters:
url the url for the cookie
name the name of the cookie
Returns:
the value of the cookie of null

static Object getCachedData ( String  name,
boolean  asString 
) [static]

Parameters:
name the name used to cache the data
asString true to return the data as a string; false to return the InputStream
Returns:
the cached data or null

static Border getDefaultLineBorder (  )  [static]

Returns:
a the default line border

static Image getImage ( JComponent  comp,
Icon  icon 
) [static]

Parameters:
comp the component to use if the icon needs to be rendered
icon the icon
Returns:
the image representing the icon

static String getInheritanceTree ( Object  o  )  [static]

Parameters:
o the object
Returns:
the inheritance tree for a specified object

DOXYGEN_SKIP static String getJavaVersion (  )  [static]

Returns:
the java version

static String getLastDomainName (  )  [static]

Returns:
the last username that was entered

static String getLastPasswordHash (  )  [static]

Returns:
a hex-encoded SHA1 hash of the last password that was entered

static String getLastUserName (  )  [static]

Returns:
the last username that was entered

static int getLineHeight ( Component  c  )  [static]

Parameters:
c the component
Returns:
the line height

static String getLines ( String  s,
int  lines 
) [static]

The string is parsed for linefeeds and the specified number of lines are returned.

Parameters:
s the string to parse
lines the number of lines to return
Returns:
the starting specified number of lines from the string

static Rectangle getMonitorBounds ( Component  c  )  [static]

Parameters:
c the component
Returns:
the bounds of the monitor that the specified component is displayed on

static List<String> getMonths (  )  [static]

Returns:
the months of the year for the current locale

static List<String> getMonthsShortNames (  )  [static]

Returns:
the months of the year for the current locale

static String getOs (  )  [static]

Returns:
the OS

static String getOsVersion (  )  [static]

Returns:
the OS version

static List<Window> getPopupAllWindow (  )  [static]

Returns:
a list of all java.awt.Window objects

static Preferences getPreferences ( String  appKey  )  [static]

Parameters:
appKey the name for the preferences. This is the unique name for the application
Returns:
the preferences object

static float getRelativeFontSize (  )  [static]

Returns:
the relative size (1.0 = normal size)

static Dimension getScreenSize (  )  [static]

Returns:
the logical size of the screen

static ImageIconEx getToolkitIcon ( URL  url  )  [static]

Parameters:
url the url for the icon
Returns:
the icon

static Image getToolkitImage ( URL  url  )  [static]

Parameters:
url the url for the image
Returns:
the image

static UIDefaults getUIDefaults (  )  [static]

Returns:
the UIDefaults map

static String getURLQueryParameter ( String  url,
String  param 
) [static]

Parameters:
url the url
param the name of the parameter
Returns:
the value or null

static String hmacMD5 ( String  val,
String  key,
boolean  hexout 
) [static]

Parameters:
val the value
key the key
hexout true to return the value as a hex string; false otherwise
Returns:
the results of the computation

static String hmacSHA ( String  val,
String  key,
boolean  hexout 
) [static]

Parameters:
val the value
key the key
hexout true to return the value as a hex string; false otherwise
Returns:
the results of the computation

static String htmlReplace ( String  s,
Pattern  urlPattern,
String  replacement,
boolean  escape,
String  tag 
) [static]

string not contained within < >

Parameters:
s the string
urlPattern the regular expression to use to test if a string segment matches what you want to replace
replacement the replacement string
escape true to escape the special html characters; false otherwise
tag optional html tag to surround the text with (e.g. 'html' or 'div')
Returns:
the replaced string

static String htmlWordWrap ( String  s,
final int  width,
final boolean  html_tag 
) [static]

Parameters:
s the string to wrap
width the maximum line width
html_tag true to add the surround the text with the html tags
Returns:
the wrapped string

static void installResponseCache ( String  name,
int  mbMaxSize,
boolean  deleteOnExit 
) [static]

Parameters:
name the name for the cache (must be a valid directory name)
mbMaxSize the maximum size for the cache in mega bytes
deleteOnExit try to delete the cache on exit; false otherwise

static int intValue ( Object  o  )  [static]

String's that don't start with a numeric sequence always return zero

Parameters:
o the object
Returns:
the integer representing the object

static boolean isJava6OrAbove (  )  [static]

Returns:
true if the application is running on JDK 6 and above, false otherwise.

static boolean isJava6Update10OrAbove (  )  [static]

Returns:
true if the application is running on JDK 6 and above, false otherwise.

static boolean isJava7OrAbove (  )  [static]

Returns:
true if the application is running on JDK 1.7 and above, false otherwise.

static boolean isLinux (  )  [static]

Returns:
true if the desktop OS is a version of Linux; false otherwise

static boolean isMac (  )  [static]

Returns:
true if the desktop OS is a Mac OS; false otherwise

static boolean isOptimizationEnabled (  )  [static]

Returns:
true if enabled; false otherwise

static boolean isPrintableChar ( char  c  )  [static]

Parameters:
c the character to test
Returns:
true if the character is printable ;false otherwise

static boolean isRunningInBackground (  )  [static]

Returns:
true if the current thread is running in the background; false otherwise

static boolean isStrictScriptingMode (  )  [static]

Returns:
true for strict mode; false otherwise

static boolean isUnix (  )  [static]

Returns:
true if the desktop OS is a version of UNIX; false otherwise

static boolean isWindows (  )  [static]

Returns:
true if the desktop OS is a version of windows; false otherwise

static boolean isWindows7OrAbove (  )  [static]

Returns:
true if the desktop OS is a version of windows or greater; false otherwise

static String join ( Object[]  array,
String  sep 
) [static]

Parameters:
array the object array
sep the item separator
Returns:
the string

static String join ( List  list,
String  sep 
) [static]

Parameters:
list the object array
sep the item separator
Returns:
the string

static String length ( String  val,
String  tok 
) [static]

Parameters:
val the string
tok the token
Returns:
the length of the specified string (e.g. length("a^b","^") will return 2 length("ab","^") will return 1)

static String length ( String  val  )  [static]

Parameters:
val the string
Returns:
the length of the specified string

static String linefeedToHTMLBreak ( String  s,
boolean  html 
) [static]

Parameters:
s the string containing linefeeds
html true to enclose the string between <html></html> ; false otherwise
Returns:
the converted string

static String linefeedToHTMLBreak ( String  s  )  [static]

Parameters:
s the string containing linefeeds
Returns:
the converted string

static Map<String, ActionEx> loadActions ( iWidget  context,
ActionLink  link 
) throws Exception [static]

Parameters:
context the context
link the link to the configuration file
Returns:
a map containing the loaded actions
Exceptions:
Exception 

static Map<String, ImageIconEx> loadResourceIcons ( iWidget  context,
ActionLink  link 
) throws IOException [static]

Parameters:
context the context
link the link to the properties file
Returns:
a map containing the loaded icons
Exceptions:
IOException 

static Map<String, String> loadResourceStrings ( iWidget  context,
ActionLink  link 
) throws IOException [static]

Parameters:
context the context
link the link to the properties file
Returns:
a map containing the loaded strings
Exceptions:
IOException 

static void loadTemplate ( iWidget  context,
ActionLink  link,
String  name 
) throws IOException [static]

Parameters:
context the context
link the link to the template file
name the name of the template. If specified it will override the name specified within the template itself
Exceptions:
IOException 

static long longValue ( Object  o  )  [static]

String that don't start with a numeric sequence always return zero

Parameters:
o the object
Returns:
the long integer representing the object

static String lowerCase ( String  val  )  [static]

Parameters:
val the string
Returns:
the lowercase representation of the specified string

static String mac ( String  val,
String  key,
String  algorithm,
boolean  hexout 
) [static]

Parameters:
val the value
key the key
algorithm the mac algorithm
hexout true to return the value as a hex string; false otherwise
Returns:
the Message Authentication Code for the specified value

static String makeHyperlinks ( String  s,
boolean  escape,
String  tag 
) [static]

Parameters:
s the string to hyperlinks
escape true to escape the special html characters; false otherwise
tag optional html tag to surround the text with (e.g. 'html' or 'div')
Returns:
the processed string

static Component makeResizable ( iWidget  w,
boolean  createCorner,
Icon  cornerIcon 
) [static]

Parameters:
w the widget
createCorner true to create a corner resizing component; false otherwise
cornerIcon the optional icon (min 16x16) for the corner
Returns:
the corner component

static Component makeResizable ( Component  comp,
boolean  createCorner,
Icon  cornerIcon 
) [static]

Parameters:
comp the component
createCorner true to create a corner resizing component; false otherwise
cornerIcon the optional icon (min 16x16) for the corner
Returns:
the corner component

static String md5 ( String  val,
boolean  hexout 
) [static]

Parameters:
val the value
hexout true to return the value as a hex string; false otherwise
Returns:
the MD5 hash of the specified value

static String md5 ( String  val  )  [static]

Parameters:
val the value
Returns:
the MD5 hash of the specified value

static long nanoTime (  )  [static]

Returns:
a string representing the number nanoseconds of elapsed time

static void notifyWaiter ( Object  object,
boolean  all 
) [static]

Parameters:
object the object being waited on
all true to notify all waiters; false to only notify one waiter

static Date parseDateString ( iWidget  context,
String  date,
String  inputFormat 
) throws ParseException [static]

Parameters:
context the context
date the date string
inputFormat the input format
Returns:
the date string in the output format
Exceptions:
java.text.ParseException 

static Date parseDateString ( iWidget  context,
String  date 
) throws ParseException [static]

Parameters:
context the context
date the date string or object in the default item format
Returns:
the date string in the default display format
Exceptions:
java.text.ParseException 

static Date parseDateTimeString ( iWidget  context,
String  date 
) throws ParseException [static]

Parameters:
context the context
date the date string or object in the default item format
Returns:
the date string in the default display format
Exceptions:
java.text.ParseException 

static Map<String, String> parseOptionsString ( String  options,
char  delimiter,
boolean  unquote 
) [static]

The options are name/value pairs separated by an equal sign

Parameters:
options the string of options
delimiter the delimiter that separates options
unquote true to unquote and decode strings
Returns:
a map containing the name/value pairs

static Map<String, String> parseOptionsString ( String  options  )  [static]

The options are name/value pairs separated by an equal sign. Individual options are assumed to be separated by an ampersand

Parameters:
options the string of options
Returns:
a map containing the name/value pairs

static String piece ( String  val,
String  tok,
int  start,
int  end 
) [static]

Parameters:
val the string
tok the token
start the position if the starting token to retrieve
end the position if the ending token to retrieve
Returns:
a string representing the result

static String piece ( String  val,
String  tok,
int  start 
) [static]

Parameters:
val the string
tok the token
start the position if the starting token to retrieve
Returns:
a string representing the result

static String piece ( String  val,
String  tok 
) [static]

Parameters:
val the string
tok the token
Returns:
a string representing the result

static void populateViewerWdgetValues ( iWidget  context,
Viewer  viewer,
Map  values 
) [static]

Parameters:
context a context to use tor resolve values
viewer the configuration to populate
values a map of name/value pairs (name paths are supported). Values must be strings

static void populateViewerWdgetValues ( iFormViewer  fv,
Map  values 
) [static]

Parameters:
fv the form viewer
values a map of name/value pairs (name paths are supported). Values must be strings

static void print ( Object...  o  )  [static]

Parameters:
o the object to print

static void printDocument ( iWidget  context,
String  url 
) throws IOException, PrintException [static]

Parameters:
context the context
url the document to print
Exceptions:
IOException 
PrintException 

static void println ( Object...  o  )  [static]

Parameters:
o the object to print

static String property ( iWidget  context,
String  name,
String  def 
) [static]

Parameters:
context the widget context
name the name of the variable
def the default value if the property is undefined
Returns:
the system property with the specified name

static String property ( String  name,
String  def 
) [static]

Parameters:
name the name of the variable
def the default value if the property is undefined
Returns:
the system property with the specified name

static String quote ( String  str  )  [static]

Parameters:
str the String
Returns:
A String correctly formatted for insertion in a JSON text.

static String random ( String  val  )  [static]

Parameters:
val a number representing an upper bound for the random number
Returns:
a string representing the random number

static String random (  )  [static]

Returns:
a string representing the random number

static long randomLong ( long  max  )  [static]

Parameters:
max a number representing an upper bound for the random number
Returns:
the random number

static long randomLong (  )  [static]

Returns:
the random number

static String read ( iWidget  context,
Object  entity 
) throws IOException [static]

Parameters:
context the widget context
entity the URL, File, or string representing a URL from which to read
Returns:
the contents of the specified entity
Exceptions:
IOException 

static MouseKeyStrokeTimeoutHandler registerMouseKeyStrokeTimeoutHandler ( AppContext  app,
int  seconds,
String  code 
) [static]

Note: Does not work when running in a sandbox

Parameters:
app the application context
seconds the number of seconds
code the code to execute
Returns:
a handle to the handler that was added
See also:
removeMouseKeyStrokeTimeoutHandler

static Map removeAll ( Map  main,
Map  remove 
) [static]

Parameters:
main the main map
remove the map containing the shared elements
Returns:
the main map

static void removeCachedData ( String  name  )  [static]

Parameters:
name the name to cache the item under (must be a valid file name)

static String removeHTMLMarkup ( String  text  )  [static]

Parameters:
text the text to remove the markup from
Returns:
the text with the markup removed

static void removeMouseKeyStrokeTimeoutHandler ( MouseKeyStrokeTimeoutHandler  handler  )  [static]

Parameters:
handler a handle to the handler
See also:
registerMouseKeyStrokeTimeoutHandler

static void removeRange ( List  list,
int  fromIndex,
int  toIndex 
) [static]

Shifts any succeeding elements to the left (reduces their index). This call shortens the ArrayList by (toIndex - fromIndex) elements. (If toIndex==fromIndex, this operation has no effect.)

Parameters:
list the list
fromIndex index of first element to be removed
toIndex index after last element to be removed

static String replacePiece ( String  val,
String  tok,
int  tlen,
int  pos,
int  pos2,
String  rval 
) [static]

Parameters:
val the string
tok the token
tlen the token length
pos the starting token position to replace from
pos2 the ending token position to replace to
rval the value to replace with
Returns:
a string representing the result

static String resolve ( iWidget  context,
String  str 
) [static]

Parameters:
context the context
str the string to resolve
Returns:
the resolved string

static String resolve ( String  str  )  [static]

Parameters:
str the string to resolve
Returns:
the resolved string

static Object resolveUIProperty ( iWidget  context,
String  value 
) [static]

Parameters:
context the context
value 
Returns:
the resolved object

static void restoreAntialiasHint ( Graphics2D  g,
Object  oldHint 
) [static]

Parameters:
g the graphics
oldHint the old anti-alias hint
See also:
setupAntialiasPainting(java.awt.Graphics2D)

static void retargetKeyEvent ( KeyEvent  e,
Component  target 
) [static]

Parameters:
e the event
target the target

static void retargetMouseEvent ( MouseEvent  e,
Component  target 
) [static]

Parameters:
e the event
target the target

static String rformat ( iWidget  context,
String  resource_string,
Object...  args 
) [static]

Parameters:
context the context
resource_string the resource string representing a the printf-style pattern
args the arguments
Returns:
the formatted string

static Image scaleImage ( BufferedImage  img,
int  width,
int  height,
ScalingType  type,
boolean  proportional 
) [static]

Parameters:
img the image to scale
width the scale width
height the scale height
type the type of scaling to do
proportional true to maintain proportions; false to force to the specified size
Returns:
he scaled image

static String script ( iWidget  context,
String  code 
) [static]

Parameters:
context the widget context
code the code to execute
Returns:
the result of the execution

static String script ( String  code  )  [static]

Parameters:
code the code to execute
Returns:
the result of the execution

static String scriptVar ( iWidget  context,
String  name 
) [static]

Parameters:
context the widget context
name the name of the variable
Returns:
the string representation of the specified script variable

static String scriptVar ( String  name  )  [static]

Parameters:
name the name of the variable
Returns:
the string representation of the specified script variable

static String serverBase ( iWidget  context  )  [static]

This is the url to the server (http://server:port/)

Parameters:
context the widget context
Returns:
a string representing the base server URL

static String serverBase (  )  [static]

This is the url to the server (http://server:port/)

Returns:
a string representing the base server URL

static void setAnimatedSpinner ( ImageIconEx  icon  )  [static]

Parameters:
icon the default animated spinner

static void setAnimatedSpinnerSmall ( ImageIconEx  icon  )  [static]

Parameters:
icon the default small animated spinner

static void setBackgroundOverlayPainter ( JComponent  c,
iPainter  p 
) [static]

Parameters:
c the component
p the painter

static void setBackgroundPainter ( JComponent  c,
iBackgroundPainter  bp 
) [static]

Parameters:
c the component
bp the painter

static void setBrowserSessionCookie ( String  url,
String  value 
) [static]

Parameters:
url the url for the cookie
value the value of the cookie

static void setBrowserSessionCookies ( List< Cookie >  cookies  )  [static]

Parameters:
cookies the list of cookies

static void setOptimizationEnabled ( boolean  enabled  )  [static]

Parameters:
enabled true to enable; false otherwise

static void setOverlayPainter ( JComponent  c,
iPainter  p 
) [static]

Parameters:
c the component
p the overlay painter

static void setRelativeFontSize ( float  size  )  [static]

Parameters:
size the relative size (1.0 = normal size)

static void setSelectionState ( iWidget  w,
boolean  hasSelection 
) [static]

This method does not actually affect the state of the widget. What is does is fire a selection change property that actions like copy and delete listen for. Use it to toggle these actions when you are managing selections and copy and delete for a widget

Parameters:
w the widget
hasSelection true if the widget has a selection; false otherwise

static void setStrictScriptingMode ( boolean  strict  )  [static]

Parameters:
strict true for strict mode; false otherwise

static Object setupAntialiasPainting ( Graphics2D  g  )  [static]

Parameters:
g the graphics
Returns:
the old ant-alias hint
See also:
restoreAntialiasHint(java.awt.Graphics2D, java.lang.Object)

static String sha1 ( String  val,
boolean  hexout 
) [static]

Parameters:
val the value
hexout true to return the value as a hex string; false otherwise
Returns:
the SHA hash of the specified value

static String sha1 ( byte[]  val,
boolean  hexout 
) [static]

Parameters:
val the value
hexout true to return the value as a hex string; false otherwise
Returns:
the SHA hash of the specified value

static String sha1 ( String  val  )  [static]

Parameters:
val the value
Returns:
the SHA hash of the specified value as a hex string

static String sound ( iWidget  context,
String  sound 
) [static]

Parameters:
context the widget context
sound the sound. Current valid values are "beep", "error", "success"
Returns:
null always

static String sound ( String  sound  )  [static]

Parameters:
sound the sound. Current valid values are "beep", "error", "success"
Returns:
null always

static String stringValue ( Object  obj  )  [static]

Parameters:
obj the object
Returns:
the string representation

static String stringValue ( long  number  )  [static]

Parameters:
number the integer
Returns:
the string representation

static String stringValue ( int  number  )  [static]

Parameters:
number the integer
Returns:
the string representation

static String stripMnemonic ( String  text  )  [static]

Parameters:
text the text
Returns:
the cleaned text

static String substring ( String  val,
int  start,
int  end 
) [static]

The substring begins at the specified start and extends to the character at index end - 1. Thus the length of the substring is end-start.

Parameters:
val the string
start the beginning index, inclusive.
end the ending index, exclusive.
Returns:
the specified substring.

static void systemPrintDocument ( iWidget  context,
String  url 
) throws IOException [static]

Parameters:
context the context
url the document to print
Exceptions:
IOException 

static String timeExecution ( String  code,
int  iteration 
) throws ScriptException [static]

Parameters:
code the code to execute
iteration the number of times to execute the code (defaults is one)
Returns:
the amount of time the specified code took to execute
Exceptions:
ScriptException 

static String titleCase ( String  val,
String  wordSeparators 
) [static]

Parameters:
val the string
wordSeparators a string containing word separator characters
Returns:
the titlecase representation of the specified string

static String titleCase ( String  val  )  [static]

Parameters:
val the string
Returns:
the title case representation of the specified string

static String toExternalForm ( URL  url  )  [static]

Parameters:
url the URL
Returns:
the string representation of the specified url

static String tokenReplacement ( String  s,
String  what,
String  with,
boolean  html,
String  prefix,
String  suffix,
int  maxLineCount 
) [static]

Parameters:
s the string containing linefeeds
what the token to replace
with what to replace the token with
html true to enclose the string between <html></html> ; false otherwise
prefix optional prefix
suffix optional suffix
maxLineCount then maximum number of lines to return. If specified and there is more than maxLineCount then the string is truncated to maxLineCount and '...' is appended to the end of the string
Returns:
the converted string

static String tokenToHTMLBreak ( String  s,
String  tok,
boolean  html,
String  prefix,
String  suffix,
int  maxLineCount 
) [static]

Parameters:
s the string containing linefeeds
tok the token to replace
html true to enclose the string between <html></html> ; false otherwise
prefix optional prefix
suffix optional suffix
maxLineCount then maximum number of lines to return. If specified and there is more than maxLineCount then the string is truncated to maxLineCount and '...' is appended to the end of the string
Returns:
the converted string

static String tokenToHTMLBreak ( String  s,
String  tok,
boolean  html 
) [static]

Parameters:
s the string containing linefeeds
tok the token to replace
html true to enclose the string between <html></html> ; false otherwise then the string is truncated to maxLineCount and '...' is appended to the end of the string
Returns:
the converted string

static String trim ( String  val  )  [static]

Parameters:
val the string
Returns:
the trimmed string

static String unescape ( String  val  )  [static]

Parameters:
val the value to be cleaned
Returns:
the cleaned value

static String unescapeQuotedString ( String  val  )  [static]

Parameters:
val the value to be cleaned
Returns:
the cleaned value

static List<RenderableDataItem> ungroup ( List< RenderableDataItem list,
int  groupings,
List< RenderableDataItem out 
) [static]

Parameters:
list the grouped list
groupings the number of column groupings
out the list to use to store the results (can be null)
Returns:
the un-grouped list

static void updateUIColor ( iWidget  context,
String  name,
Object  value 
) [static]

Parameters:
context the context
name the name of the color
value the new value

static String upperCase ( String  val  )  [static]

Parameters:
val the string
Returns:
the lowercase representation of the specified string

static String utf8String ( String  value  )  [static]

Parameters:
value the value to convert
Returns:
the converted value

static void waitFor ( Object  object,
long  timeout 
) throws InterruptedException [static]

Parameters:
object the object to wait on
timeout the maximum time to wait (use -1 to wait until notified
Exceptions:
InterruptedException