com.ibm.tivoli.maximo.skd.common.util

Class SKDUtility

  • java.lang.Object
    • com.ibm.tivoli.maximo.skd.common.util.SKDUtility


  • public class SKDUtility
    extends java.lang.Object
    Singleton class for servicing utility methods
    Since:
    Scheduler 7.1.0.0
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String LRE 
      static java.lang.String LRM 
      static java.lang.String NONE 
      static java.lang.String PDF 
      static java.lang.String RLE 
      static java.lang.String RLM 
      protected java.util.TimeZone servertimezone 
      protected static SKDUtility skdu 
      protected java.util.Locale userlocale
      Locale is used to interpet date and time queries
      protected java.util.Properties userOverrideProperties 
      protected java.util.TimeZone usertimezone
      TimeZone is used to interpet date and time queries
    • Constructor Summary

      Constructors 
      Constructor and Description
      SKDUtility() 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean areServerAndUserTZDifferent()
      Returns true of server and user timezones are different.
      java.awt.Color decodeColor(java.lang.String hexValue)
      Decodes color based ona hex value
      void enforceOrientation(javax.swing.JComponent comp) 
      java.awt.Color getColorProperty(java.lang.String propName, java.awt.Color defaultColor)
      Gets a skdviewer.properties color value and decodes it to a Color.
      boolean getDailyView()
      Gets dailyview value
      java.util.Date getDate(java.util.Locale l, java.util.TimeZone tz, java.util.Date date)
      Get the data with locale and timezone specified in fparameter.
      boolean getDefaultscenario()
      Gets snapshot value
      java.lang.String getResourceString(java.lang.String key)
      Returns a given string from the resources strings loaded
      java.util.Hashtable getResourceStrings()
      Returns all the resource strings
      java.util.Date getServerDate(java.util.Date oldDate)
      Returns server date but based on users timezone;
      java.util.Date getServerDateForUser(java.util.Date serverDate)
      Returns server date but based on users timezone;
      java.util.TimeZone getServerTimeZone()
      Returns server timezone
      SKDFormat getSKDFormat()
      Returns handle of SKDformat
      static SKDUtility getSKDUtility()
      Returns the static instance of this class.
      boolean getSnapshot()
      Gets snapshot value
      int getSnapToGridIntervalMins(UISerializationHelper helper)
      Returns the configured Snap To Interval for moving and resizing activities on the gantt view.
      java.util.Locale getUserLocale()
      Returns user's locale
      java.util.TimeZone getUserTimeZone()
      Returns user's time zone
      boolean isBIDIEnabled()
      Returns true if BIDI is enabled
      static boolean isBiDiString(java.lang.String str)
      Returns of a given string is BIDI
      boolean isComplianceEnabled()
      Is the Scheduler Compliance enabled?
      boolean isDebugMode()
      Returns if debug mode is on
      static boolean isEmpty(java.lang.String text)
      Simple String isEmpty test
      boolean isGUIMirrored()
      Returns true if GUI is mirrored R
      boolean needSendModelChange()
      need send model change to server ?
      static java.lang.String removeMarkers(java.lang.String str) 
      static java.lang.String removeMarkersForApplink(java.lang.String str) 
      static java.lang.String replaceString(java.lang.String str, java.lang.String pattern, java.lang.String replacement)
      Replace all occurrences of a pattern string with a replacement string.
      static void reset()
      Reset/Clear the utility to enable it to be cleared up
      boolean sendToBeSaved()
      need send model change to server ?
      void setBIDIEnabled(java.lang.String value)
      Returns true if BIDI is enabled
      void setComplianceEnabled(boolean complianceEnabled)
      Sets a flag to enable/disable Scheduler Compliance.
      void setDailyView(boolean dailyview)
      Sets dailyview value
      void setDebugMode(boolean debugMode)
      Sets debug mode
      void setDefaultscenario(boolean defaultscenario)
      Sets default scenario value
      void setGUIMirrored(java.lang.String langcode)
      Sets GUI mirrored
      void setSendModelchange(boolean sendModelchange)
      Sets a flag to enable/disable Scheduler Compliance.
      void setSnapshot(boolean snapshot)
      Sets snapshot value
      void setToBeSaved(boolean sendtobesaved)
      Sets a flag to enable/disable Scheduler Compliance.
      java.util.Date todaysDate()
      Returns todays date;
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • userlocale

        protected java.util.Locale userlocale
        Locale is used to interpet date and time queries
      • usertimezone

        protected java.util.TimeZone usertimezone
        TimeZone is used to interpet date and time queries
      • servertimezone

        protected java.util.TimeZone servertimezone
      • userOverrideProperties

        protected java.util.Properties userOverrideProperties
    • Constructor Detail

      • SKDUtility

        public SKDUtility()
    • Method Detail

      • setDefaultscenario

        public void setDefaultscenario(boolean defaultscenario)
        Sets default scenario value
        Parameters:
        defaultscenario - boolean value
      • getDefaultscenario

        public boolean getDefaultscenario()
        Gets snapshot value
        Returns:
        default scenario boolean value
      • setSnapshot

        public void setSnapshot(boolean snapshot)
        Sets snapshot value
        Parameters:
        snapshot - boolean value
      • getSnapshot

        public boolean getSnapshot()
        Gets snapshot value
        Returns:
        snapshot boolean value
      • setDailyView

        public void setDailyView(boolean dailyview)
        Sets dailyview value
        Parameters:
        dailyview - boolean value
      • getDailyView

        public boolean getDailyView()
        Gets dailyview value
        Returns:
        dailyview boolean value
      • getSKDFormat

        public SKDFormat getSKDFormat()
        Returns handle of SKDformat
        Returns:
      • getUserLocale

        public java.util.Locale getUserLocale()
        Returns user's locale
        Returns:
        Locale
      • getUserTimeZone

        public java.util.TimeZone getUserTimeZone()
        Returns user's time zone
        Returns:
        TimeZone
      • getServerTimeZone

        public java.util.TimeZone getServerTimeZone()
        Returns server timezone
        Returns:
      • getSKDUtility

        public static SKDUtility getSKDUtility()
        Returns the static instance of this class. No need to create new instances.
        Returns:
        SKDUtility
      • reset

        public static void reset()
        Reset/Clear the utility to enable it to be cleared up
      • isDebugMode

        public boolean isDebugMode()
        Returns if debug mode is on
        Returns:
      • setDebugMode

        public void setDebugMode(boolean debugMode)
        Sets debug mode
        Parameters:
        debugMode -
      • getResourceString

        public java.lang.String getResourceString(java.lang.String key)
        Returns a given string from the resources strings loaded
        Parameters:
        key -
        Returns:
        String
      • getResourceStrings

        public java.util.Hashtable getResourceStrings()
        Returns all the resource strings
        Returns:
        Hashtable
      • decodeColor

        public java.awt.Color decodeColor(java.lang.String hexValue)
        Decodes color based ona hex value
        Parameters:
        hexValue - String
        Returns:
        bColor as Color
      • enforceOrientation

        public void enforceOrientation(javax.swing.JComponent comp)
      • isGUIMirrored

        public boolean isGUIMirrored()
        Returns true if GUI is mirrored R
      • removeMarkersForApplink

        public static java.lang.String removeMarkersForApplink(java.lang.String str)
      • setGUIMirrored

        public void setGUIMirrored(java.lang.String langcode)
        Sets GUI mirrored
        Parameters:
        langcode -
      • isBIDIEnabled

        public boolean isBIDIEnabled()
        Returns true if BIDI is enabled
      • setBIDIEnabled

        public void setBIDIEnabled(java.lang.String value)
        Returns true if BIDI is enabled
      • replaceString

        public static java.lang.String replaceString(java.lang.String str,
                                                     java.lang.String pattern,
                                                     java.lang.String replacement)
        Replace all occurrences of a pattern string with a replacement string.
        Parameters:
        String - str - String to search
        String - pattern - string to replace
        String - replacement - string to replace patter with
        Returns:
        String
      • removeMarkers

        public static java.lang.String removeMarkers(java.lang.String str)
      • isBiDiString

        public static boolean isBiDiString(java.lang.String str)
        Returns of a given string is BIDI
        Parameters:
        str -
        Returns:
      • todaysDate

        public java.util.Date todaysDate()
        Returns todays date;
        Returns:
      • getServerDate

        public java.util.Date getServerDate(java.util.Date oldDate)
        Returns server date but based on users timezone;
        Returns:
      • getServerDateForUser

        public java.util.Date getServerDateForUser(java.util.Date serverDate)
        Returns server date but based on users timezone;
        Returns:
      • getDate

        public java.util.Date getDate(java.util.Locale l,
                                      java.util.TimeZone tz,
                                      java.util.Date date)
        Get the data with locale and timezone specified in fparameter.
        Parameters:
        l -
        tz -
        date -
        Returns:
        converted date
      • areServerAndUserTZDifferent

        public boolean areServerAndUserTZDifferent()
        Returns true of server and user timezones are different.
        Returns:
        boolean
      • isComplianceEnabled

        public boolean isComplianceEnabled()
        Is the Scheduler Compliance enabled?
        Returns:
        true to indicate scheduler compliance is enabled, false otherwise
      • setComplianceEnabled

        public void setComplianceEnabled(boolean complianceEnabled)
        Sets a flag to enable/disable Scheduler Compliance.
        Parameters:
        complianceEnabled - true to enable compliance, false otherwise.
      • needSendModelChange

        public boolean needSendModelChange()
        need send model change to server ?
        Returns:
        true to indicate scheduler compliance is enabled, false otherwise
      • setSendModelchange

        public void setSendModelchange(boolean sendModelchange)
        Sets a flag to enable/disable Scheduler Compliance.
        Parameters:
        complianceEnabled - true to enable compliance, false otherwise.
      • sendToBeSaved

        public boolean sendToBeSaved()
        need send model change to server ?
        Returns:
        true to indicate scheduler compliance is enabled, false otherwise
      • setToBeSaved

        public void setToBeSaved(boolean sendtobesaved)
        Sets a flag to enable/disable Scheduler Compliance.
        Parameters:
        complianceEnabled - true to enable compliance, false otherwise.
      • isEmpty

        public static boolean isEmpty(java.lang.String text)
        Simple String isEmpty test
      • getColorProperty

        public java.awt.Color getColorProperty(java.lang.String propName,
                                               java.awt.Color defaultColor)
        Gets a skdviewer.properties color value and decodes it to a Color. The format of the color can be
         aaRRGGBB
         #aaRRGGBB
         RRGGBB
         #RRGGBB
         
        Parameters:
        propName - property name
        defaultColor - default color or null
        Returns:
        decoded color from properties or defaultColor is no color defined
      • getSnapToGridIntervalMins

        public int getSnapToGridIntervalMins(UISerializationHelper helper)
        Returns the configured Snap To Interval for moving and resizing activities on the gantt view. The value should be a multiple of 5 and be a number that be evenly divided into 60, such as 5, 10, 15, 20, 30, or 60
        Returns:
        snap interval in minutes