JIDE 3.5.15

com.jidesoft.utils
Class SecurityUtils

java.lang.Object
  extended by com.jidesoft.utils.SecurityUtils

public class SecurityUtils
extends Object

A class that keeps all the security stuff so that an application can safely run in applet or webstart environment. Please refer to JIDE_Developer_Guide_for_Webstart_Applet.pdf in doc folder for more information.


Field Summary
static String BOLD
           
static String BOLD_ITALIC
           
static String ITALIC
           
 
Constructor Summary
SecurityUtils()
           
 
Method Summary
static Font createFont(String name, int style, int size)
          Creates font.
static FontUIResource createFontUIResource(String name, int style, int size)
           
static String getProperty(String key, String defaultValue)
          Gets the system property.
static boolean isAWTEventListenerDisabled()
          Checks if AWTEventListener is disabled.
static boolean isTranslucentWindowFeatureDisabled()
          Checks if the translucent window feature is disabled.
static void setAWTEventListenerDisabled(boolean AWTEventListenerDisabled)
          Enables or disables the usage of AWTEventListener.
static void setTranslucentWindowFeatureDisabled(boolean translucentWindowFeatureDisabled)
          Disables or enables the usage of the translucent window feature available since JDK6u10.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOLD

public static final String BOLD
See Also:
Constant Field Values

ITALIC

public static final String ITALIC
See Also:
Constant Field Values

BOLD_ITALIC

public static final String BOLD_ITALIC
See Also:
Constant Field Values
Constructor Detail

SecurityUtils

public SecurityUtils()
Method Detail

createFontUIResource

public static FontUIResource createFontUIResource(String name,
                                                  int style,
                                                  int size)

createFont

public static Font createFont(String name,
                              int style,
                              int size)
Creates font. If there is no permission to access font file, it will try to create the font directly from font file that is bundled as part of jar.

Parameters:
name - the font name.
style - the font style.
size - the font size.
Returns:
the font.

getProperty

public static String getProperty(String key,
                                 String defaultValue)
Gets the system property.

Parameters:
key - the property key
defaultValue - the default value for the property.
Returns:
the system property.

isAWTEventListenerDisabled

public static boolean isAWTEventListenerDisabled()
Checks if AWTEventListener is disabled. This flag can be set by user. If false, JIDE code will read the value and not use AWTEventListener. The reason we need this flag is because AWTEventListener needs a special security permission. If applet, it will throw security if the user policy doesn't have the correct permission.

Returns:
true if AWTEventListener is disabled.

setAWTEventListenerDisabled

public static void setAWTEventListenerDisabled(boolean AWTEventListenerDisabled)
Enables or disables the usage of AWTEventListener. If you want to change it, you should change the value at the beginning of your main method.

Parameters:
AWTEventListenerDisabled - true or false.

isTranslucentWindowFeatureDisabled

public static boolean isTranslucentWindowFeatureDisabled()
Checks if the translucent window feature is disabled. It is disabled by default if the JDK version is less than JDK6 u10 or theOS is not Windows.

Returns:
true or false.

setTranslucentWindowFeatureDisabled

public static void setTranslucentWindowFeatureDisabled(boolean translucentWindowFeatureDisabled)
Disables or enables the usage of the translucent window feature available since JDK6u10. This feature is used in Alert for fading animation.

Parameters:
translucentWindowFeatureDisabled - true or false.

JIDE 3.5.15