Together Workflow Editor 3.0-1 API

org.enhydra.jawe
Class Utils

java.lang.Object
  extended byorg.enhydra.jawe.Utils

public class Utils
extends java.lang.Object

Various utilities.

Author:
Sasa Bojanic

Field Summary
protected static java.util.List actImgResourceNames
           
protected static org.enhydra.shark.utilities.SequencedHashMap actImgResources
           
static java.lang.String LANG_PROP_PREFIX
           
 
Constructor Summary
Utils()
           
 
Method Summary
static void adjustProperties(java.util.Properties original, java.util.Properties external)
           
static void center(java.awt.Window w, int minXDiffFromMax, int minYDiffFromMax)
           
static boolean checkFileExistence(java.lang.String path)
           
static boolean checkResourceExistence(java.lang.String path, java.lang.String name)
           
static void copyFile(java.lang.String src, java.lang.String dest)
           
static boolean copyPropertyFile(java.lang.String path, java.lang.String name, boolean overwrite)
           
static int countErrors(java.util.List verrs)
           
static java.util.List findErrorList(java.util.List allErrs, java.lang.Class objClass)
           
static java.util.List findErrorList(java.util.List allErrs, java.lang.Class objClass, java.lang.String validationType)
           
static java.util.List findErrorList(java.util.List allErrs, java.lang.Object obj)
           
static java.util.List findErrorList(java.util.List allErrs, java.lang.Object obj, java.lang.String validationType)
           
static java.util.List findErrorListParent(java.util.List allErrs, java.lang.Object parentObj)
           
static java.util.List findPropertyFiles()
           
static void flipCoordinates(java.awt.Point p)
           
static java.util.List getActivityIconNamesList()
           
static org.enhydra.shark.utilities.SequencedHashMap getActivityIconsMap()
           
static java.lang.String getActivityStringType(int activityType)
           
static java.awt.Color getColor(java.lang.String col)
          Returns the color parsed from the given string.
static java.lang.String getCurrentDateAndTime()
          Gets the current date and time string in ISO-8601 format.
static org.enhydra.shark.xpdl.XMLElement getLocation(org.enhydra.shark.xpdl.XMLElement el)
           
static java.lang.String getLocString(org.enhydra.shark.xpdl.XMLElement location, org.enhydra.shark.xpdl.XMLElement el)
           
static org.enhydra.shark.utilities.SequencedHashMap getOriginalActivityIconsMap()
           
static java.util.Map getProperties(java.util.Properties properties, java.lang.String startsWith)
           
static java.util.Properties getProperties(java.lang.String path, java.util.Properties defaultProperties)
           
static java.util.Map getResourcesForPath(java.lang.String classPath, java.lang.String prefix)
          Returns a Map of images from located on given path.
static java.lang.String getUnqualifiedClassName(java.lang.Class cls)
          Returns the class name without package.
static java.util.Map loadActions(java.util.Properties properties, JaWEComponent comp)
           
static java.util.Map loadActions(java.util.Properties properties, JaWEComponent comp, java.util.Map defaultActions)
           
static java.util.Map loadAllMenusAndToolbars(java.util.Properties properties)
           
static java.util.Map loadPopups(java.util.Properties properties)
           
static java.util.Map loadSubMenus(java.util.Properties properties)
           
static java.util.Map loadToolbars(java.util.Properties properties)
           
static java.util.List makeSearchResultList(java.util.List results)
           
static void manageProperties(java.util.Properties properties, java.lang.String path, java.lang.String name)
           
static void printStrings(java.lang.String[] s)
          Used for debug only
static boolean reconfigure(java.lang.String newConfig)
           
static void showEA(org.enhydra.shark.xpdl.elements.ExtendedAttribute el)
           
static void showEAS(org.enhydra.shark.xpdl.elements.ExtendedAttributes el)
           
static boolean showExternalDocument(java.lang.String document)
          Java doesn't support direct opening of arbitrary documents, but this hack should do it.
static java.util.List sortValidationErrorList(java.util.List verrs)
           
static java.util.List sortValidationErrorList(java.util.List verrs, org.enhydra.shark.xpdl.elements.Package p)
           
static java.lang.String[] tokenize(java.lang.String input, java.lang.String boundary)
          Take the given string and chop it up into a series of strings on given boundries.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LANG_PROP_PREFIX

public static final java.lang.String LANG_PROP_PREFIX
See Also:
Constant Field Values

actImgResources

protected static org.enhydra.shark.utilities.SequencedHashMap actImgResources

actImgResourceNames

protected static java.util.List actImgResourceNames
Constructor Detail

Utils

public Utils()
Method Detail

getProperties

public static java.util.Properties getProperties(java.lang.String path,
                                                 java.util.Properties defaultProperties)
                                          throws java.lang.Exception
Throws:
java.lang.Exception

checkFileExistence

public static boolean checkFileExistence(java.lang.String path)

checkResourceExistence

public static boolean checkResourceExistence(java.lang.String path,
                                             java.lang.String name)

getProperties

public static java.util.Map getProperties(java.util.Properties properties,
                                          java.lang.String startsWith)

copyPropertyFile

public static boolean copyPropertyFile(java.lang.String path,
                                       java.lang.String name,
                                       boolean overwrite)
                                throws java.lang.Exception
Throws:
java.lang.Exception

manageProperties

public static void manageProperties(java.util.Properties properties,
                                    java.lang.String path,
                                    java.lang.String name)
                             throws java.lang.Exception
Throws:
java.lang.Exception

adjustProperties

public static void adjustProperties(java.util.Properties original,
                                    java.util.Properties external)

tokenize

public static java.lang.String[] tokenize(java.lang.String input,
                                          java.lang.String boundary)
Take the given string and chop it up into a series of strings on given boundries. This is useful for trying to get an array of strings out of the resource file.


getUnqualifiedClassName

public static java.lang.String getUnqualifiedClassName(java.lang.Class cls)
Returns the class name without package.


getColor

public static java.awt.Color getColor(java.lang.String col)
Returns the color parsed from the given string. The color can be given in three different string form:

Parameters:
col - The string representation of wanted color.
Returns:
The color based on given string or null if incorrect

flipCoordinates

public static void flipCoordinates(java.awt.Point p)

printStrings

public static void printStrings(java.lang.String[] s)
Used for debug only


center

public static void center(java.awt.Window w,
                          int minXDiffFromMax,
                          int minYDiffFromMax)

findPropertyFiles

public static java.util.List findPropertyFiles()

copyFile

public static void copyFile(java.lang.String src,
                            java.lang.String dest)

showEAS

public static void showEAS(org.enhydra.shark.xpdl.elements.ExtendedAttributes el)

showEA

public static void showEA(org.enhydra.shark.xpdl.elements.ExtendedAttribute el)

getCurrentDateAndTime

public static java.lang.String getCurrentDateAndTime()
Gets the current date and time string in ISO-8601 format.


getActivityStringType

public static java.lang.String getActivityStringType(int activityType)

sortValidationErrorList

public static java.util.List sortValidationErrorList(java.util.List verrs)

sortValidationErrorList

public static java.util.List sortValidationErrorList(java.util.List verrs,
                                                     org.enhydra.shark.xpdl.elements.Package p)

findErrorList

public static java.util.List findErrorList(java.util.List allErrs,
                                           java.lang.Object obj,
                                           java.lang.String validationType)

findErrorList

public static java.util.List findErrorList(java.util.List allErrs,
                                           java.lang.Object obj)

findErrorList

public static java.util.List findErrorList(java.util.List allErrs,
                                           java.lang.Class objClass)

findErrorList

public static java.util.List findErrorList(java.util.List allErrs,
                                           java.lang.Class objClass,
                                           java.lang.String validationType)

findErrorListParent

public static java.util.List findErrorListParent(java.util.List allErrs,
                                                 java.lang.Object parentObj)

countErrors

public static int countErrors(java.util.List verrs)

showExternalDocument

public static boolean showExternalDocument(java.lang.String document)
Java doesn't support direct opening of arbitrary documents, but this hack should do it. For Windows executing "start", and for KDE "kfmclient exec" will open document with associated application. Associations are of course system dependant, and we cannot do anything about them.


getLocation

public static org.enhydra.shark.xpdl.XMLElement getLocation(org.enhydra.shark.xpdl.XMLElement el)

getLocString

public static java.lang.String getLocString(org.enhydra.shark.xpdl.XMLElement location,
                                            org.enhydra.shark.xpdl.XMLElement el)

makeSearchResultList

public static java.util.List makeSearchResultList(java.util.List results)

loadActions

public static java.util.Map loadActions(java.util.Properties properties,
                                        JaWEComponent comp)

loadActions

public static java.util.Map loadActions(java.util.Properties properties,
                                        JaWEComponent comp,
                                        java.util.Map defaultActions)

loadAllMenusAndToolbars

public static java.util.Map loadAllMenusAndToolbars(java.util.Properties properties)

loadSubMenus

public static java.util.Map loadSubMenus(java.util.Properties properties)

loadToolbars

public static java.util.Map loadToolbars(java.util.Properties properties)

loadPopups

public static java.util.Map loadPopups(java.util.Properties properties)

getActivityIconNamesList

public static java.util.List getActivityIconNamesList()

getOriginalActivityIconsMap

public static org.enhydra.shark.utilities.SequencedHashMap getOriginalActivityIconsMap()

getActivityIconsMap

public static org.enhydra.shark.utilities.SequencedHashMap getActivityIconsMap()

getResourcesForPath

public static java.util.Map getResourcesForPath(java.lang.String classPath,
                                                java.lang.String prefix)
Returns a Map of images from located on given path.


reconfigure

public static boolean reconfigure(java.lang.String newConfig)

Together Workflow Editor 3.0-1 API