Package com.jidesoft.utils
Class SecurityUtils
java.lang.Object
com.jidesoft.utils.SecurityUtils
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
Checks if AWTEventListener is disabled.static boolean
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.
-
Field Details
-
BOLD
- See Also:
-
ITALIC
- See Also:
-
BOLD_ITALIC
- See Also:
-
-
Constructor Details
-
SecurityUtils
public SecurityUtils()
-
-
Method Details
-
createFontUIResource
-
createFont
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
Gets the system property.- Parameters:
key
- the property keydefaultValue
- 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.
-